#multiplayer

1 messages ยท Page 43 of 1

fresh cloud
#

yeah, TryGetPawnOwner -> IsLocallyControlled

fathom aspen
#

Dude, use that method I mentioned above to get the pawn to then check IsLocallyControlled

fresh cloud
#

chain one into the other

fathom aspen
#

Red squiggles were never a real error

summer tide
fathom aspen
#

And if you get an error in the output log saying that function doesn't exist then you are probably not in a subclass to UAnimInstance

#

You are just sending uncomplete info to your issue hoping we guess what's happening

summer tide
#

thanks

fathom aspen
#

YW

thin stratus
#

What?

fathom aspen
#

Guess what I said

sinful tree
#

If there are clients, there must be a server, otherwise they wouldn't be clients.

summer tide
#

Can you have server RPC in anim instance using GetLifetimeReplicatedProps? I think it's for actor class only right

quasi tide
#

The anim stuff gets derived from the actor it is attached too

#

You don't do networking inside of animations

summer tide
quasi tide
#

Nope. Whatever information your animation needs, you get it from the anim instance owner.

dry pebble
#

Does anyone know how to have a custom movement mode also work with the FLAG_JumpPressed. I use this in GetCompressedFlags()

if (Saved_bPressedJumpForClimb) Result |= FLAG_JumpPressed;    ```
But it makes the character jump when the server runs UpdateFromCompressedFlags() and sets 
```cpp
CharacterOwner->bPressedJump = ((Flags & FSavedMove_Character::FLAG_JumpPressed) != 0);```
Then it goes into my climbing state. All this causing a net correction as the server starts making us jump as the client didn't.
prisma coral
#

is there a way to replicate variables and trigger their repnotify functions on clients whenever they are set even if the value stays the same instead of only when they change?

quasi tide
#

Last argument you pass in is REPNOTIFY_Always

prisma coral
#

im not exactly sure what I should put in for the condition as in the second last parameter as i still want it to be 'normal' i guess
maybe COND_Custom and do nothing with it?

quasi tide
#

I think COND_None is as if there is no special condition

fresh cloud
#

i would assume that if you decoupled anything related to your climb state away from that flag/the jump in ACharacter and relied on a custom flag in that free zone it would help?

near granite
#

in the client, ARPin are not loaded but in the editor I checked anchor has been loaded,

boreal bison
#

So I'm calling a multicast on my enemy actor when it dies to play the death animation so all the clients see it, but when the client is the one who kills the enemy, it only plays for the client and not the server

#

how do I have the client shoot the enemy and have that call a multicast that runs the code for everyone?

#

so the documentation says multicasts called by the client will only run on the client, so if the client is the one initiating the enemy death, how do I get the server to run the multicast?

woven basin
# boreal bison so the documentation says multicasts called by the client will only run on the c...

Very basic example:

  1. Client sends server an RPC to do attack action (shoot, swing sword, whatever)
  2. Server processes the RPC and does the attack
  3. Server determines enemy dies
  4. Server sets enemy status as dead, turns off their AI etc.
  5. Server does multicast of enemy dying montage
  6. Server sleeps for a few seconds, then "destroys" enemy (to despawn them).

The client does nothing except telling the server it wanted to attack.

boreal bison
woven basin
#

"then calls an event EnemyDeath" - is that the client or the server calling that event? Needs to be the server.

boreal bison
#

and Server_LineTrace is ofc set to Run on Server

woven basin
#

Is this c++ or BP?

boreal bison
#

BP

woven basin
#

are you sure the server is running that code? maybe post some screenshots. But add some 'Print String' debugs and confirm its doing what you expect.

boreal bison
#

I'm not sure, but the event is set to Run on Server and I've messed around with basically setting everything to that to no avail

woven basin
#

so when you do "print string" there, does the printed string say "Server: XXX" or "Client: XXX"

boreal bison
woven basin
#

and then follow it from there

boreal bison
#

yeah so I just put a print string right after the line trace call and it said Client: Hello

#

even though it's set to Run on Server???

woven basin
#

"if enemy not dead, substract health by damamge" - what is BEFORe that screenshot?

#

i.e. where is that Exec pin coming from?

boreal bison
woven basin
#

and before that?

boreal bison
woven basin
#

I dont think you can do "get player character" in that command, because that would get the server's character. You need to pass in a ref to the character doing the shooting when you call it.

boreal bison
#

I can do that, but is that what's causing everything else?

#

because line trace is still supposed to run on the server but the print string says client

woven basin
#

(you already have a ref to the char, so just use that from the input)

boreal bison
#

okay, did that

woven basin
#

I'm not super strong in BP. Maybe someone else can jump in. I'm just wondering if you own the Pistol or not? or does the server own the pistol, so it wont fire your rpc?

boreal bison
#

I don't think anything owns the pistol right now, I couldn't figure out how to set the owner to the right players

#

I was using set owner on the player character but it was run locally and I guess set every pistol to be owned by the server player

woven basin
#

so the way I would do it personally is; the Player says "I want to fire", and gives a ref to the pistol it wants to fire.

Then the rest from there.

#

not "hey pistol fire" via the char

#

you def own the player/pawn - but you might not own the pistol depending how its set?

boreal bison
#

yeah I didn't set the pistol owner anywhere

#

so whatever the default is when it gets spawned in

#

Then 1 is unrelated

woven basin
#

right - so because thats in BeginPlay - every client is spawning their own pistol locally that is not replicated

#

you need to do a switch Has Authority, and have only the Server spawn the pistol for each person, and then replicate it across

#

so your problem is here, not in the fire stuff

boreal bison
#

:O

#

hold on let me process that

#

so how do I have the server spawn the pistol? do I have BeginPlay call an event set to run on the server?

woven basin
#

lots of different ways - depends what you want. One option is BeginPlay -> Server_RequestPistol, and the client can tell the server it would like a pistol given to it. Then server actions that.

or you could do some stuff around when a player joins, hook into that event, and the server just assigns it. Or at start of match, the server just gives everyone a gun

#

Or your bp_player_character could start with a pistol already attached

boreal bison
#

and for Server_RequestPistol, I would pass in the mesh that has the socket, attach the pistol to the socket, and then go from there?

woven basin
#

basically as one option - yep

#

i'm sure there are other (better) ways - thats just one way

boreal bison
woven basin
#

because the client is spawning it. Only the server can spawn something that you want to exist everywhere

boreal bison
#

ohhh

woven basin
#

the client needs to ASK the server to spawn it for them

#

not spawn it themselves

boreal bison
#

that makes sense

boreal bison
#

also, thank you so much for help! I appreciate it :D

latent heart
#

RestartPlayer is probably the better method

boreal bison
#

ah, never used that before

livid solar
#

Hi all, I have a question regarding saving the player state. For example, if the player picked up an item to inventory so should we use socket to save data to server database or how can we do that?

latent heart
#

Google RPCs.

livid solar
#

Thanks, @latent heart.

iron crest
#

Hello, Im trying to spawn a weapon through the UI so that the player can pick it up and use the weapon, the problem is, the sword bein g spawned is not replicated, is there something wrong with my code? Or doI need to handle spawning this another way, any help is appreciated!

woven basin
#

You would need to calculate the Actor location on the Server without using the client code. i.e. you cant have the lines joined like that AFAIK.

iron crest
woven basin
#

Because when the server runs its part of the code, the previous calculation was never done on the server

#

you are probably spawning the gun at 0,0,0 at the moment

iron crest
#

its weird because the actor spawns, but my interact code wont work with it vs when I spawn it in before I hit play, then my interaction code works, sorry for the confusion

topaz storm
#

hello everyone, do you know of any service that is not EOS which is supporting p2p matchmaking + NAT handling and has good unreal integration? best case: no user accounts (like steam or epic) / most awesome would be anonymous login without any need for the user to input. best alternative would be custm username and password

#

I add one more criteria: no need for a user account or custom accounts with password and username

#

thanks. should have made my question a little more detailed (edited)

near granite
#

is there any way to join to dedicated server in the editor by using cmd?

latent heart
#

open ip

#

If you have a PIE session running.

#

Might need standalone!

near granite
latent heart
#

Yes

near granite
#

Oh

latent heart
#

You can't join a "dedicated editor session"

#

But you can join a dedicated game server.

near granite
#

I'm very begginer I can show you this

#

ohh

#

I have problem in the client ARPin are not loaded in the way to this

#

so I'm thinking another way

#

without using that exe file to join to server, is there any way to join in the editor by using cmd?

latent heart
#

You'd have to start a PIE instance first.

peak sentinel
#

Are anim montages net adressable?

real ridge
#

Guys I have a problem I had a game with planes my planes was did with Pawn I could fight each other fly etc, then I made multiplayer game where main character was normaln third person character yea I did session,dedicated server etc everything was working I could see other players playerd with them etc, but then I tried to combine these two games and use planes in my multiplayer game but there comes problem I dont see planes / joined players in session like Pawn was not replicated, any tips what I can do ?

fathom aspen
peak sentinel
#

So any data-asset like thing and TSubclassOf/UClass* are net adressable?

#

I guess basically every CDO is net adressable then?

fathom aspen
#

Correct

#

They are picked from editor, so they are loaded for both ends

#

They can be referred to by their path so it's all good

#

In packaged builds they have to be packaged ofc

peak sentinel
#

Alright, thanks

near granite
fathom aspen
#

Play In Editor

latent heart
#

If you run one on a Mac, it's apple flavoured.

real ridge
#

anyone have idea of solution to my problem ? :/

fathom aspen
#

Your problem is that plane actors are not replicating

#

Make them so

latent heart
#

Missed opportunity for a Picard reference.

real ridge
#

?

#

but Actor is replicating and I did nothing

#

it was replicating from start

#

this is plane and this my person

#

character

#

second is working fine first is not

fathom aspen
#

Working could mean a lot of things

#

If you mean character is replicating but plane is not then check the replication settings for the plane

#

And how you spawn the plane

real ridge
#

I am not sure if its true but I red somewhere that Pawn classes are not replicated by default in ue 5 just Actors are and idk what is true,working means I started game joined session and was inside with 2 players and I saw each other, when I tried it with "plane" I was on map joined session but I was alone on map even we joined with 2 accounts. I spawn them like this just change this to PlanePawn/ ThirdPErsonCharacter and on map is player start

fathom aspen
#

Then just make sure that PlanePawn BP replicates

real ridge
#

I am gonna check settings

#

so sentence that Pawns are non replicated by default is false?

#

here I have these settings but on but here is not ticked

#

maybe this?

#

but in my character is not ticked

#

so I am confused ๐Ÿ˜„

fathom aspen
fathom aspen
fathom aspen
#

For the actor

#

Not the component

real ridge
#

also there is 1 interesting thing what happened when I try run map as client and choose 2 windows with server behind / from editor I am on map with both pawn and see each other

#

but in case I am trying it in my session I see only actor but not pawns

#

in this mode

#

i see pawns in game normally

fathom aspen
#

Then you are not joining the other pawn session

real ridge
#

example

real ridge
fathom aspen
#

That or anything to make sure they are in the same session

#

Nothing fancy about it

real ridge
#

bcs is there logic that it work in simulated server by editor but not on my dedicated server in session?

#

I dont think

#

both should be same or?

fathom aspen
#

Replication is not your issue as long as that pawn is replicating and you are letting vanilla UE code to spawn them

wicked nimbus
#

Quick question, I'm using seamlesstravel in UE5 and for some weird reason it can happen that one player travels to the new level but the host doesn't call AGameModeBase::SwapPlayerControllers & APlayerState::CopyProperties for it, all other players work as expected? This somehow breaks replication for that specific character later?
Has anyone encountered something similar or can point me in a direction to solve this? (Would be awesome if you can tag me directly so I get the ping <3)
The PlayerControllerClass is the same in both levels.

real ridge
#

but that log means I propably didnt join right session

#

however I see /errors on my dedicated server which means someone connected, I am confused

fathom aspen
real ridge
#

ugh where, when

#

ah sorry

#

missreading

#

........ ๐Ÿ˜„

#

I understand now

fathom aspen
#

Also if you are seamless traveling in editor under one process (the new ue5 feature thingy) then I would try not to do that as that could be not stable

#

For example SwapPlayerControllers doesn't get called if the new GameMode's class is a subcalss of AGameMode and that the old and new PlayerController's classes are the same

fleet viper
#

Im trying to replicate my proning mechanic. Im changing capsule half size and i am lifting the mesh up when proning to avoid this clipping trough the ground. First i do that on the client and then i pass those values over to my server or multicast function which also set the new relative location and the capsule half size. As you can see the capsule half size is replicated perfectly. But the relative location of the mesh isnt. Can anybody give me a hint?

#

so basically it isnt replicating the location at all.

mortal mica
#

I'm trying to connect 2 clients through EOS, need to use packaged builds for that, and I'm now getting this error:

[2022.12.18-05.52.28:388][201]LogNet: UNetConnection::SendCloseReason:
[2022.12.18-05.52.28:388][201]LogNet:  - Result=MissingLevelPackage, ErrorContext="/Memory/MainGrid_L8_X0_Y0_DL0,/Memory/MainGrid_L8_X0_Y0_DL0"```
#

The map is packaged.. and I see it on the connecting client for a few frames, yet there seems to be an error of some "portion" of it missing from world partition?

fleet viper
#

So i made this little custom testing code. Server to client replication works, but Client to server does not. (client to client works too) The setLocMulti does even get triggered on the server side for that character. But still it doesnt set the new relative location. What do i overlook? or is this even a bug?

#

No matter what i try the relative lcoation of a client character cant be changed on the server

#

if someone would be able to tell me whats wrong, that would be awesome cuz i have done things like this since ever and it always worked except now.

wicked nimbus
neon mango
#

Sorry for the delayed response, here is a clip to illustrate the issue.
Every 2 seconds the server updates a "score", you can see it blink the print as it updates the "score".
Once the score gets updated it tells the Game State to update an int, score is a float so its casting to an int.
The Weapon/Gun here is reading from the game state on tick to fetch the latest "score" as an int for display.
You can see when the score hits 1 on the top left from print and when the client sees the score update. There is an initial delay then as the score changes a few decimal points it seems to be updating ok?
https://gyazo.com/b7421cf96d6d6efa1a7328f70fae0030

#

The yellow text is Score : 60 seconds countdown.

#

And the Score Displayed on gun is made to be 2x the actual score, so hence the number is higher once displayed on gun

#

Took about 40 seconds to read a value change on game state, then it seems to update ok afterwards?

dry pebble
fresh cloud
#

ah nice!

ember vine
#

are you allowed to struct NetSerialize pointers ?

#

is there any examples i can look at ? i tried googling and couldnt find anything

#

by ID you mean GetUniqueID() or that network guid thing

#

nvm, i can just call MyActor->Serialize(Ar)

split wind
#

Still having trouble with this. i should clarify that i'm a newb, and am trying to get 2 characters in one server together. My client can connect to server, and players can see eachother, but the connecting player always spawns with 2 players in one spot, and then starts floating up. if i use movement, it will just add to the players movement, but still continuously goes up and up. while this is happening, the server host can see the joined player floating away. 3 days now, i've been trying to get this right. i have no clue what to do.

split wind
#

I should probably add, that all my code is bluprint ( if that matters).

prisma snow
#

The units for the Stat Net command are bytes per second, right?
I was doing some tests that seem about correct according to my calculations. Sending an int16 consumes double bandwidth than int8, no matter that the represented number is the same or not ( I had the doubt whether it got optimized or not, answer is no)

solar stirrup
#

It can't know that it doesn't need as much so yeah, it has to send all the bytes

#

If you really need the bandwidth you can do the (de)serialization manually for structs

prisma snow
sinful tree
split wind
#

Throw me a ping if this sounds okay. And let me know what the proper channel is to show in.

#

Not sure if this is what you mean by manually spawning, but is th eone you're asking about? @sinful tree

sonic python
#

Heyyyyy My Client Player Cannot Move properly , and jitters while jumping only in mobile preview

ember needle
split wind
#

the first pic is inside gamemode BP start player node. This second pic is also from inside gamemode BP and is the find player random player start node.

#

this is what the second player/ new joined player is seeing. For some reason, it is spawning 2 in one.

#

another odd thing, is that it is still taking the controller movement from the first player/host. so if i am host, the joined players controller is still moveing in coalition with host controllers. meaning, whatever way i move my motion controllers on host, the joined client's are controlled still by the host.

fathom aspen
#

Also in case of PC it's a bit different if say you want PCM to persist, then you want PC to persist

#

You could edit the vanilla code to not get the PCM get destroyed when PC gets destroyed though that could cause trouble down the line

#

It's not just PCM, also HUD and any other PC dependent actor you might want to persist

dry pebble
#

I want to log a variable with the server and client's same timestamp so I can check for a difference because of a net correction. Does anyone know how to get the time stamp and print it for the same one time with client/server?

ember needle
candid shuttle
fathom aspen
#

For PCs one could argue, and a good practice is to start fresh

dry pebble
ember needle
fathom aspen
#

The easy way is just to have a new PC class inheriting from one shared PC parent

#

That way you don't override anything

ember needle
candid shuttle
#

or more specific?

#

Oh no, I see your question, you want to log different variable values over time, right?

peak notch
#

Hey fellow devs i need some assistance,

So I am creating Goals inside GameMode Blueprint Class as shown which spawns the goals on the Server & Clients As The Actor is set to Replicate

However on the server the Goal ID is set upon creating the Goal but when I execute the code show in the 3rd picture it doesn't update the text for the client upon Event BeginPlay but it work if i set it inside Event Tick inside PlayerCharacter BP or Character Pawn

candid shuttle
#

can you send images of the client code

#

I think the goals are being spawned right when your character asks for their ID

peak notch
#

That's The ClientSide

candid shuttle
#

So event tick will later grab the corrected ID which wasn't there when spawned

#

maybe add a delay of 2 secs just for testing

#

after BeginPlay

peak notch
#

gotca will try that

peak notch
#

but doesn't Gamemode initialize before any other class?

candid shuttle
peak notch
candid shuttle
#

Ok I can't see the pics above, can you send them again?

peak notch
#

sure

candid shuttle
#

Yeah ok so, what is prob happening is, the goal and the char initiate at around the same time and can only change values after the GM is initialized

peak notch
#

but the GM is initialized before any other class i thought

#

im guessing Event BeginPlay is initialized at the same time for all classes

candid shuttle
candid shuttle
peak notch
candid shuttle
peak notch
#

yeah true

candid shuttle
candid shuttle
peak notch
#

yeah could find that out by debugging or something but oh well, appreciate the help

candid shuttle
#

Ok I just looked into it, it has to be some sort of setting I turned on/off , because when I ALT + F4 my one client standalone window the server gets disconnected too

#

So no BP errors, yaay ... ๐Ÿ˜

candid shuttle
neon obsidian
#

How do I replicate a leader pose to other clients for montages? ๐Ÿค”

I'm using a character made a multiple pieces and I use a set leader pose to the mesh on begin play. This seems to work fine for both clients and works fine for blend tree animations but when I play a montage on viewing clients it will play the montage only on the base mesh and the rest of the pieces don't move.

dry pebble
#

Anyone ever had issues with SweepMultiByChannel using a capsule getting different results on a client vs server when calculating on tick component? Got some net corrections and pretty sure I've narrowed it down to this.

candid shuttle
#

It was. And that was it

mortal mica
#

I'm having a hard time getting a client to connect to a session, and I boiled it down to a problem with World Partition, getting this in the logs:

#
[2022.12.18-23.02.51:886][915]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: EOS:0002c10456fd470a9ddb1ae5220de9ff:GameNetDriver:26, Name: IpConnection_0, Driver: GameNetDriver NetDriverEOS_0, IsServer: YES, PC: BP_WastelandPlayerController_C_1, Owner: BP_WastelandPlayerController_C_1, UniqueId: EOS:d11612ba83814c1cad2fa2b31d38d002|0002c10456fd470a9ddb1ae5220de9ff
[2022.12.18-23.02.51:900][916]LogPlayerController: Warning: ServerUpdateLevelVisibility() ignored non-existant package. PackageName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X-1_Y0_DL0', FileName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X-1_Y0_DL0'
[2022.12.18-23.02.51:907][917]LogPlayerController: Warning: ServerUpdateLevelVisibility() ignored non-existant package. PackageName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y-1_DL0', FileName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y-1_DL0'
[2022.12.18-23.02.51:912][917]LogPlayerController: Warning: ServerUpdateLevelVisibility() ignored non-existant package. PackageName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y0_DL0', FileName='/Game/Maps/LandscapeCollection_DuneDesert/_Generated_/MainGrid_L8_X0_Y0_DL0'```
#

I saw a bug report on 5.0 with a similar report, but it says fixed in 5.1, and I'm on 5.1... maybe I missed something regarding world partition and packaging?

#

(although in the packaged build it works just fine for the host)

fleet viper
#

Is anyone able to change the relative location of the character mesh on servers and clients? I think i hit a bug, since some people made a forum post about it, but i cant believe it since they used 4.9 and im using 4.27

split wind
#

So its like the client joins, but not all the way... idk..

young spoke
#

hello slackers

#

i wanted to ask about the ue pathfinding system in multiplayer real quick

#

using Character, do autonomous proxies on a client run their own A* ? or does the server run it only and send necessary path/velocity nodes

young spoke
mortal mica
boreal bison
grave fog
#

Is there free matchmaking servece for listen server that supports any platform with no limits ?

sharp yarrow
#

Hi everyone! I'm building a building a game from Lyra and I want to set up a multiplayer system, something like a "Social Verification" system. It would be a way of gaining some stat or achievement based on feedback from another player. So for example, player A claims something happened and player B knows about it, the machine sends a request to player B to verify the event happened. Player B verifies that it did happen, and if so, Player A gets points. What would be the easiest or most efficient way to get this done? Some general guidance would be great to get started.

prisma pelican
#

event doesnt get called unless the player is "focused in window" so if the player alt tabs, the event wouldnt trigger, if the player doesnt alt tab then it works perfectly fine. curious if anyone had this happen before

#

its very similar to this thread's issue

#
Epic Developer Community Forums

Greetings, I have either run into a bug or some unfortunate piece of resource saving in the editor. First, Iโ€™ve made a partial ragdoll based on hit and ragdoll system that works flawlessly single player. However, in attempts to set proper replication Iโ€™ve had all kinds of trouble. Most I am happy to trouble shoot and fix myself, but my main is...

pure mango
#

Does anyone know how to increase ping in PIE? Just want to test things out for the scenarios where there's lag over the network

quasi tide
#

Go to Editor preferences > Level Editor section -> Play > Multiplayer options section, Enable Network Emulation

#

Can also get there pretty quickly by clicking here

pure mango
#

But this sucks, everything breaks down (on the Client) with "Average" latency preset, which is about 300ms ping

peak notch
#

Advance apologies if this question triggers you lol.

Q: GameState, PlayerState, Pawn Character Classes run on Server & on Clients. Does that mean the code in these classes will execute each time for all the clients upon every new client connecting or it will only run on the new client's instance of the game.

#

Pawn Character Class

prisma snow
#

I am getting some linker errors when using FFastArraySerializer, since I am using a blank project, I'm not sure if I need to add any modules to the .uproject or .build.cs files in order to use it. RPCs worked well

#

Probably it's me not writing the array serializer code well, but just in case

#

It seems that adding "NetCore" and "NetCommon" did the trick

#

@winged badger sorry for pinging! I tested the FFastArraySerializer and it works very nicely, actually it seems to use less bandwidth than RPCing the array deltas directly ๐ŸŽ‰

But I wanted to ask, have you ever had problems with the update timing arrival on clients?

When I send the RPCs (which are sent every 100ms) I do a check that the arrival timing of the update is more or less 100 ms appart from the last update, otherwise there is the possibility that the update was late, and applying a movement update that is guaranteed to be late (so it represents an old position) is worse than not applying an update at all

woven basin
#

(Iโ€™m following bits of this large replication fast array stuff. Any chance of a blog about it when you finish Max? Seems like thereโ€™s some good stuff coming together).

prisma snow
woven basin
#

Arh ok. Yeah Vori has some good stuff.

prisma snow
#

I will probs write something about the general replication for my RTS, but probs not very soon

winged badger
prisma snow
#

I don't have the same issue for health or other attributes, but for positions the timing is kind of crucial

#

maybe I need to test before making any assumptions though

hexed pewter
#

I just hit an issue where playerstate is not valid at beginplay. Is there any particular reason why that is the case? Also I assume adding delay node is not the smartest way to get around that, but polling for playerstate is only other thing that comes to mind and seems almost as bad as delay.

chrome bay
#

Use the virtual OnRep's

#

For the PS to be valid at Begin Play, both the PS and the actor referencing it must replicated before the game state does - of which there's no garauntee

#

Where are you accessing it from?

hexed pewter
#

I'm accessing it from in gamemode from GameState's PS array

prisma snow
#

From what I gather from testing the fast array serializer, the PostReplicatedChange function gets called in all the structs that have been marked dirty at the same time

chrome bay
#

Yeah, it's done in a loop during the replication update

chrome bay
hexed pewter
#

Essentially what happens is:
player enters a match,
his HUD constructs a widget
widget populates itself OnConstruct with data from PS array
Widget doesn't really populate itself because the PS doesn't contain valid information yet

I added a delay node between on construct and populating the widget with data to make it work
but it feels horribly wrong and is a subject to immediate refactoring

prisma snow
#

I think I'll be using RPCs instead of FFastArraySerializer nontheless, after a bit more testing I saw that the serializer has a ~25% package size increase to replicate the same data

chrome bay
#

my spidey sense is tinglin'

peak sentinel
#

I want to be able to add replicated properties from lua.. Is it possible to lazily register a property to replication framework instead of GetLifetimeReplicatedProps?

#

GetLifetimeReplicatedProps
is there any non lifetime method?

chrome bay
#

negativeismo

#

They're part of the class data

#

So unless you can serialize it into the class...

peak sentinel
peak sentinel
chrome bay
#

I don't honestly think it's feasible, you could try poking around FRepLayout::CreateFromClass

peak sentinel
#

roger, thanks

#

anything to avoid slow BP loops without converting every script to CPP at this point

prisma snow
# chrome bay my spidey sense is tinglin'

I know, stateful stuff should be replicated, not RPCd... but I don't plan to support late join (or not soon) and RPCs give me more control over the synchronization of positions

#

If it was not for the bandwidth increase I'd change it

thin stratus
#

Is there anything in UE5 regarding Movement Replication of Characters, that changed that could cause something that previously didn't have corrections, to now haev corrections?

#

I coded a simple "Upwards Boost while holding SHIFT" with the proper saved moves etc. and it works without corrections on high FPS and 100+ Ping without problems.
In UE5 it has random corrections

#

:<

winter marten
mortal mica
#

what's a good place to get the playercontroller while it still holds a Pawn when the player disconnects? I tried Logout() but at that point the controller has no pawn

#

ok that's strange, inspecting a bit the code there, it seems the PC has an "AcknolowdgedPawn" that seems to be correct, yet Pawn == nullptr

#

what's the deal with the AckPawn ?

#

ok I just found something that might help; APlayerController::PawnLeavingGame

thin stratus
#

Maybe the packageloss setting is on in UE5 but wasn't in UE4 >.>

mortal mica
limber gyro
#

i keep getting the following warning on my compiled server console:

#

[2022.12.19-17.38.54:737][525]LogScript: Warning: Script Msg: No world was found for object (/Game/FirstPerson/CoreObjects/CoreBlueprints/LobbyPlayerControllerBP.Default__LobbyPlayerControllerBP_C) passed in to UEngine::GetWorldFromContextObject().

#

the thing is the game mode is not even using that PC

#

why would it be even throw that warning im a bit confused

sharp yarrow
limber gyro
#

what is lyra? loobies and parties are usualy temporary things, depends on what you want to build u need to be more specific

sharp yarrow
# limber gyro what is lyra? loobies and parties are usualy temporary things, depends on what y...

Lyra is the sample game that was introduced with 5.0.. It implements the GAS and other features out of the box that I think would be useful for this. I want to build a system that allows one player (player A) to request verification for something from another player (player B). Then based on that verification points get awarded or not to player A. Example: Player A has wants to get points (in the game) for eating 10 hotdogs at the party last week (in real life). Player makes claim this happens in game but needs verification in game. To get this he sends request to Player B (also at said party) to verify.

pseudo merlin
#

hi all, im profiling sending procedural levels to clients via a listen server connection by replicating the actors, I dont quite have an intuition on how much bandwidth is too much, could anyone eyeball this graph and let me know how it looks?

#

thanks

#

also how do I check cpu cycle usage for replication? I'm not seeing anything obvious in the gamethread traces

prisma snow
pseudo merlin
prisma snow
#

What I found is that having many actor channels opened is really bad, if you need high numbers I'd consider using a manager actor

prisma snow
pseudo merlin
#

x axis is packet index, doesnt seem to be even time interval each packet ranges between .01 to .03 seconds from previous packet

prisma snow
#

if it is a one-time event I guess it's ok (at the end of the day, you just need to test your game in real conditions and see what happens and if it's acceptable)

pseudo merlin
#

true!

#

thanks for the ideas

graceful flame
limber gyro
thin stratus
graceful flame
#

Looking forward to it

dry pebble
#

Anyone ever had net corrections where you enter a custom movement mode (e.g climbing on wall) and then exit it and the client thinks it should jump, so as you see by the red capsule it starts jumping and then the server corrects it to say it shouldn't have jumped. Did not click spacebar to jump Only "E" + facing wall to enter climb and "E" to exit climb. Just running at a wall, clicking e to enter climb and e to exit and walking backwards. This is with 500 ping, but trying to understand it

amber falcon
#

Can I ask what networked vehicle physics you purchased off the marketplace?

sharp yarrow
dark edge
#

do you mean Is Locally COntrolled?

naive dome
#

Hello,

Got a question regarding issues I'm seeing since I upgraded my project to 5.1. Did not have these issues in 5.0.3.

Anyone else having issues with the Open Level By name (Or object ref) not working anymore?

And the basic Join Session node not opening the Sessions map anymore for the connecting client on initial connection? (Perhaps also due to behind the scenes issues with Opening Levels?)

If you experience something similar or know a fix please let me know

agile loom
# naive dome Hello, Got a question regarding issues I'm seeing since I upgraded my project ...

The current workaround for this is to build your project as Development, And do not use Steam Sockets if you are using Steam
https://forums.unrealengine.com/t/need-help-with-steam-sockets/604911/6?u=danialkama

Epic Developer Community Forums

Update: It doesnโ€™t work with shipping build ๐Ÿ˜• Development build was working. Do I need to change plugin or wait for next Engine update?

near granite
#

whenever modifying something in the editor, should i package the server again?

thin stratus
#

Not necessarily, but ultimately probably not a bad idea

#

There are some things that could be Client only, like UI, that wouldn't need the Server to be repackaged.
Not sure if the Build Version changes and breaks being able to join though.

daring gorge
#

when im casting a reference to self in a game state then what am i casting a reference to? the client that called an event or the server or each and every client in the level?

thin stratus
#

Casting a reference to self; what?

#

--
I dislike the CMC more and more. Noticed that when chaning MaxJumpCount and receiving a Correction, it can be that the local value is overridden back to the previous value.

Also the CMC just doesn't allow to patch up SavedMoves. A SavedMove doesn't need to be the truth...

#

Eg. 50 SavedMoves, all say "You aren't stunned.". Now you get a correction cause you were Stunned, already 25 of those SavedMoves you should have been Stunned.
When replaying the first 25 it's fine, when replaying the second 25 it acts as it's not Stunned (cause that was saved).

#

Overwatch patches the SavedMoves if something like this happens.

#

Still not quite sure how MaxJumpCount resets back.
All SavedMoves are played in the same frame, so either the MaxJumpCount got set to 2 (back from 0) before or after that.
If before, it will be saved, then Moves will replayed, then it will be restored, to not override the current value.
So 2 would still be correct after.
If after, there should be nothing overriding it.

#

LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Server: 2
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Client 1: 0
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Server: 2
LogTemp: Error: [UVRTCharacterMovementComponent::ClientHandleMoveResponse] Client Received Correction.
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Client 1: 2 // Set from RepNotify
LogBlueprintUserMessages: [BP_Character_Bay_MM_C_0] Client 1: 0 // ???

#

After that, Server is 2, Client stays 0. Lovely

#

Maybe I should just let it replicate and undo this from ACharacter DISABLE_REPLICATED_PROPERTY(ACharacter, JumpMaxCount);

daring gorge
thin stratus
#

That simply refers to the current instance that is calling the code

daring gorge
#

so the calling client?

thin stratus
#

No

#

It has no Multiplayer Concept

#

When you stand in a room with multiple people and you can command them to jump, then "self" would be you commanding yourself

#

That has nothing to do with multiplayer

#

Also the Target pin usually defaults to Self

#

At least for functions of that same class

daring gorge
#

that makes sense; although i still dont understand then;

#

if i say jump

#

and im supposed to jump

#

do i really jump?

#

that sounds so dumb

thin stratus
#

Don't apply network logic to it though

daring gorge
#

okay

thin stratus
#

Like the GameState exists on everyone

daring gorge
#

ah

thin stratus
#

Everyone has their own instance of it

daring gorge
#

seperately

thin stratus
#

Yes

daring gorge
#

makes more sense now

#

its like how widgets work

#

right?

thin stratus
#

so "self" when called on the Client 1, is the Instance of the GameState of Client 1

#

Same for Server, and Client 2 to 100000

#

Not sure how that is connected to Widgets, so I don't want to say yes or no if it further confuses you

daring gorge
#

more like

#

its the same concept for widgets right?

thin stratus
#

it's the same concept for any object

daring gorge
#

they exist on every client seperately

thin stratus
#

Eh, kinda

#

Widgets only exist on Clients, but that aside yes

daring gorge
#

i think i understand what you mean

#

so thanks

#

that helps it

thin stratus
#

Multiplayer is just having a Room, but it exists once per Player.

daring gorge
#

yee

thin stratus
#

If you draw it you'd draw one per player

#

And some Actors exist in every room, others only in some

#

GameMode would only be in the Server Room

#

Widgets only in the Client rooms

#

Some of those Actors are connected across the rooms

#

Being replicated

daring gorge
#

gotta back to reading the network compendium

#

thingy

thin stratus
#

Yus

daring gorge
#

it all makes more sense now though, thanks

#

i was confused as to why there was a "self" option and i could cast it as reference and what it meant so had to ask ๐Ÿ˜›

thin stratus
#

OH MY GOD

#

I hate that CMC has no proper function overrides for 90% of its sh*t. There is code duplicated to be able to inject stuff and it obviously changed durign Engine update

full tree
latent heart
#

Shame they never completed the other one.

full tree
#

NetworkPrediction one?

latent heart
#

Maybe?

full tree
#

Probably ๐Ÿ˜›

#

I was hoping for unreal 5 they will open or rework CMC a little bit

latent heart
#

They are more likely to make an entirely new class like NP.

#

Changing CMC behaviour would fuck over a lot of existing code.

full tree
#

that is true, damn thing remember Unreal Tournament better that anything else

twin juniper
#

When testing dedicated server / client in the editor is "Run under one process" always be unticked... I always have different behaviours :/

latent heart
#

Yeah. It's not a good idea to test it in a single process. It's just not a "production" environment.

#

Unless you're testing the absolute most basic of things.

twin juniper
#

To test Coop / player 1 host player 2 .... I should start 2 as listen server without run under one process ?

latent heart
#

Yeah.

twin juniper
#

ok thanks @latent heart

thin stratus
#

Not sure why though. Can't I just do Value -= DeltaTime; in PerformMovement and be fine?

chrome bay
#

Still baffles me that speedhack detection is disabled by default ๐Ÿ™ƒ

#

I have for years believed it was on. More fool me..

twilit radish
#

Sorry what

chrome bay
#

Oh yes

#

AGameNetworkManager:

    bMovementTimeDiscrepancyResolution = false;```
#

(And no it's not overridden in a config anywhere)

twilit radish
#

;-;

chrome bay
#

But it's okay just set the -deterministic flag and literally the entire game will speedhack anyway party_manny

#

Still reeling from this weeks discoveries

twilit radish
#

What does -deterministic do?

chrome bay
#

Forces the engine to run in fixed timestep mode, which as I discovered earlier this week is a shambles

twilit radish
#

Ah. Yeah that was a very heavy WIP last time I checked lol.

chrome bay
#

TL;DR, the engine might be running at say 60 FPS - but every value of delta time will be for 30FPS, so the entire game simulation runs faster

#

But ofc - that incredibly low-level decision is easily exposed to end users in the form of a command line flag ๐Ÿคท

#

gotta go fast

thin stratus
#

I would really love to know why a simple "reduce value over time" logic in PerformMovement breaks at higher FPS

chrome bay
#

IIRC the saved move buffer isn't large enough by default to handle high frame rates, especially if you have moves that can't be combined

thin stratus
#

But that's not even the issue

#

It looks like the Server is literally consuming the value slower or so

#

Or faster?

#

Is there like a min DeltaTime value that the Server calculates

#

I'm confused

chrome bay
#

I think there is a min time where it'll just skip a frame or something, but server calculates delta time IIRC as a rolling average across many packets

thin stratus
#

Also can't seem to reprouce this in the editor with the same fps

chrome bay
#

Delta on server is more like TimeSinceLastPacket

twin juniper
#

Hey there, so I have an interface "Get character infos" on my character...On this same character I have an actor component trying to add skills and calling get character infos from which I try to get a Struct Array from a DataAsset specifified in a variable on the character class..

Suprise, if I run in "separate server" + untick "run under one process" and run as client .. it will always be printing 0 event if the DataAsset is valid.

I might miss something easy somewhere ๐Ÿ™‚

chrome bay
#

But then fudged IIRC to sort of closely match the clients sent delta I think

#

Can't remember the specifics now..

thin stratus
#

But I can't really force Clients to have 60 fps

#

That's a little bit outdate with todays monitor refreshrates

#

Apparently, based on Client (work), 120 FPS were just fine, without any code changes since the update to 5.1

#

In UE5, packaged high FPS build starts behaving really weird in terms of movement

#

Which makes me believe the broke the CMC somewhere

#

Even more than it already is

chrome bay
#

Maybe it's related to the changes to world time?

thin stratus
#

If it wouldn't be a package only problem, I would be quicker in debugging -.-

chrome bay
#

Ah not sure in that case

thin stratus
#

At least I can't recreate it in Editor. Trying standalone atm

twilit radish
#

In some way it's kind of funny that the Character system has so much to it to cover a lot of use cases but at the same time is so complex that not many know how to properly adjust it and might as well not use half of the functionality ๐Ÿ˜…

livid holly
#

when I have a Client connecting to a Server, how do I override the Player Name that will be sent? I tried adding ?Name=MyName as a param to the URL for ClientTravel, but when the server spawns the local player, it uses the default ?Name= param (which is the computer's name at least during the editor)

thin stratus
#

What in the actual f

#

t.maxfps 60 or lower -> all fine
t.maxfps 61 or higher -> breaks

#

What is going on with UE5

#

I don't even know what breaks

#

Like, there is a float that gets reduced as long as you fall and hold SHIFT.
That is implemented like any other CMC extended movement.

#

The float value reduces visibly fine in the UI when on 60 or lower fps

#

Higher and the bar stutters and I get corrections

#

This is even on the same PC, so basically no ping or package loss

naive dome
naive dome
thin stratus
#

Not even sure if that's 5.1

naive dome
# agile loom The current workaround for this is to build your project as Development, And do ...

So the following is going on:

Steam Multiplayer is broken in 5.1, there is a workaround if you're using a source built version of the engine, see the details below:

There are console commands that disable SessionId/ClientId checking but they are broken since they implemented the console commands incorrectly, a pull request is created here:
https://github.com/EpicGames/UnrealEngine/pull/9857/commits/3623560408b7a98049c0e8c2a0bf438c777139c5

If you merge the pull request you can then use the console commands:
net.VerifyNetClientID 0
net.VerifyNetSessionID 0

To disable the Client/SessionId verification.

To make it permanent change these two variables to 0:
static int32 GVerifyNetSessionID = 0;
static int32 GVerifyNetClientID = 0;

in file:
StatelessConnectHandlerComponent.cpp

fresh cloud
#

OOF

#

i has issues with my server thinking a pawn was an autonomous proxy by my clients thinking it was simulated

#

turns out i forgot to call super dolifetimerep

#

this is hard

thin stratus
#

[2022.12.20-16.34.34:011][962]LogTemp: Warning: [UVRTCharacterMovementComponent::PerformMovement] 0.032776
[2022.12.20-16.34.34:028][963]LogTemp: Warning: [UVRTCharacterMovementComponent::PerformMovement] 0.016388
[2022.12.20-16.34.34:044][964]LogTemp: Warning: [UVRTCharacterMovementComponent::PerformMovement] 0.032776

#

As soon as I hold SHIFT on > 60 FPS, the Client prints different values for DeltaTime in PerformMovement

#

asdaskjdalsdjasld xD what is this

#

I'm not even performing the movement code. I just hold SHIFT on the floor (which fails to activate the boost I coded cause you can only do that in air)

#

<= 60 FPS it's fine. > 60 FPS it prints different values in log

fresh cloud
#

CMC does have some min tick variables and magic numbers potentially floating around, but 60fps is like .016 right? it shouldn't be triggering any of that...

thin stratus
#

Yeah but, it prints both

fresh cloud
#

oh duh true

thin stratus
#

Like, the Client prints DeltaTime correct and then like twice as high

#

And the ncorrect again

#

Which explains the lagging

#

Also it only happens if I hold shift

#

Have to research why

#

Shift is just "bWantsToBoost"

midnight steeple
#

Hello, I'm trying to make my first multiplayer game on unreal. However, when more than 2 players join my lobby and I start the game, all clients are disconnected. Do you have an idea?

short arrow
midnight steeple
#

I launch my games as standalone(Client i guess) and I host the session on one of them

#

Clients can connect to the lobby but when I run the game with more than 2 players, nothing works.

thin stratus
#

Is this using any Subsystem like Steam?

#

And are you (correctly) using SeamlessTravel for your ServerTravel of Lobby and Gameplay GameModes?

midnight steeple
#

I use the Null subsystem but I dont know if i use the serverTravel correctly. 3 players can join the lobby

#

but if i start the game, the game restart for my clients

#

ok i turned on seamless travel in the gamemode and its ok

agile loom
proven robin
#

Have any of you guys experimented with the Unity Multiplay for Unreal?

glad escarp
#

Hey smart people. So I'm trying to get my weapon swapping system to work in multiplayer and so far I'm getting really strange, mixed results. I spawn 4 weapons actors on begin play for my character. I attach 2 to my FPS arms mesh and 2 to my TPS mesh. I then set the visibility for each one on the server, then I run a client and a multicast on the server RPC which sets the appropriate visibilities. But still it's all screwed up. Can someone see from this pastebin what I'm doing wrong?

https://blueprintue.com/blueprint/d0nhwf56/

thin stratus
#

So I think my issue is:

            // Decide whether to hold off on move
            const float NetMoveDelta = FMath::Clamp(GetClientNetSendDeltaTime(PC, ClientData, NewMovePtr), 1.f/120.f, 1.f/5.f);

            if ((MyWorld->TimeSeconds - ClientData->ClientUpdateTime) * MyWorld->GetWorldSettings()->GetEffectiveTimeDilation() < NetMoveDelta)
            {
                // Delay sending this move.
                ClientData->PendingMove = NewMovePtr;
                return;
            }
#

I'm just confused why that isn't an issue in UE4

#

NetMoveDelta is exactly 1 / 60

#

So higher FPS mean we are sending too often and it tries to combine this move with the next one

#

Not sure how I'm supposed to handle that for a boost atm, but it's probably just part of combining the savedmove properly

#

Or increasing the value cause it's only 4 players

quasi tide
#

It's networking - it gets there when it gets there.

#

Could be in like 6ms or 600ms

#

It doesn't work different. Networking calls isn't 100% predictable.

graceful pumice
#

But the RPC can't be processed until the packet gets there

#

If client sends something to server, and it takes 6ms to send the packet to the server, then the server will process the RPC 6ms after the client sent it

#

To my knowledge, RPCs aren't processed in Tick. They are processed the moment they are received.

fresh cloud
thin stratus
#

Yeah

#

But I'm not sure what I'm supposed to do atm

fresh cloud
#

Uh exi there is a bForceNoCombine

thin stratus
#

Cause all I have in my Move is the saved boolean

#

Yeah I know, but why would I need to force

#

It already checks the flags

#

If the flags don't much it doesn't combine

#

And everything after starting my boost is just running on "tick"

#

I'm not sure why this would fail

fresh cloud
#

Oh I think cmc tends to lean towards combining moves if the delta between them (physically and time wise) are small enough, maybe 60fps was the threshold and was causing issues with the boost

thin stratus
#

What I don't get is why this matters for me

#

It won't combine the two moves when the Player starts pressing the key

#

There is no data in the Move despite that boolean

#

So nothing I have to combine

#

In theory, after pressign the button, all that happens is a float being reduced by delta time in PerformMovement

#

And a combined delta time should be fine

#

Not as smooth but that can be smoothed in the UI fwiw

#

PerformMovement(NewMove->DeltaTime);

#

This happens after combining

#

So that should be the correct, double DeltaTime for the local client

#

Now the Server has to do the same

fresh cloud
#

Mhmm, it grabs it via the saved move list, then does a combo, then perform movement then postupdate the savedmove

thin stratus
#

..

#

Did they go from the old ServerMove to the new ServerMovePacked between 4 and UE5?

#

Like as a default

#

Maybe there is a bug in there somewhere

fresh cloud
#

Yeah, there is a new boolean but the old server move is backwards compay

thin stratus
#

Let's for fun turn that off, shall we

fresh cloud
#

Itโ€™s use server packed rpcs, you can specify it and it will either use the new or old functions

thin stratus
#

Yeah I know

#

I'm asking if they moved to it by default

fresh cloud
#

I think so ye

thin stratus
#

Doesn't seem to help, so no bug there

ember sinew
#

I have an InventoryComponent that's attached to each player's Controller, but after rereading the compendium I thought it would be better on the PlayerState. Then I realized in both cases each client has authority on their own inventory, which opens the door to manipulation. Is that correct? I probably should put the inventories somewhere else that's owned by the server, right?

quasi tide
#

Doesn't matter. Just always verify stuff on the server before important stuff happens

#

They can say they have the BFG in their inventory all they want. If it doesn't exist on the server, then they're lying

ember sinew
#

Yeah.. each item is it's own UObject, so I could track what the authoritative "container" for that item is on the server, and add checks before equipping/using/consuming/etc. and item that the "container" is accessible to the player

quasi tide
#

When the client picks up an item - you should be asking the server to pick it up anyway. Which then gets replicated back to the client.

#

I don't even do those checks personally. I just check, on the client side, if I have the item. Then I ask the server to equip/use the item for me. The server then does the same process pretty much. If it doesn't exist on the server though, it is questionable behavior.

real ridge
#

Hello I have small problem in my game demo, I did eos login and eos sessions and joining to them buuut when I tried change my actors/ thirpersoncharacters with my PlanePawns /child of pawn from my second project I donยดt see each other in game like it was not replicated I will add also screens and logs if it can help thank you for any tips :)here are all screens

#

So main problem is that I dont see pawns in my map

#

like they are not joined on server

glad escarp
#

Hmmm... maybe I'm thinking about this in the wrong way. So what if I just spawn one actor for the player's currently equipped item. I attach it to the First Person mesh for the client but for everyone else, I attach it to the Third Person mesh. Is that something that would be simple to do? Like call an attachment RPC on server, pass the correct actor and mesh, then call a multicast RPC and run Attach Actor To Component in the multicast?

ember sinew
# quasi tide When the client picks up an item - you should be asking the server to pick it up...

I forgot to say thanks earlier, so thanks!

But also, follow up question - how do you handle firing the pickup from the server? Right now I have a PickupComponent on the Pawn that detects nearby items and fires the pickup... but isn't that also owned by the client? Should my Pawn's PickupComponent ask the Item (owned by the server) to add itself to the Inventory? That feels convoluted but also correct...

quasi tide
#

I just have a interaction box on my player. When it crosses something else that has it (only triggered by one thing, has its own custom channel), it becomes the TargetedInteractionObject.

#

When I press the interaction button, it checks that it is valid and then does a server RPC with the interaction object as the argument

#

At this point, someone can cheat. But it is a co-op game in my case, so I don't care.

#

The server then validates that this action is legal (simple distance and facing check honestly). Then picks it up and adds it to the inventory. Which then replicates back to the client that it was added.

#

Cheat away my friends. Cheat to your hearts content. I don't care.

#

I just do super basic validation, just for game balance reasons. The bad actors are going to figure out how to hack my stuff anyway.

#

I never really got on board with the whole interaction/pickup stuff being component based. Still interface based for me.

ember sinew
#

This is making sense. I guess I'll add the RPC on my PlayerController, something like "RequestAddToInventory(itemToAdd, thisControllersInventoryComponent)", which the PickupComponent calls

#

I'm a huge fan of composition over inheritance when I can, but the requirement that I need the RPC on an actor and can't do it from a component owned by a replicated actor adds bottlenecks like this...

quartz iris
#

Why does the widget only show up for the server and not the client?

#

This code is in the gamestatebase

quasi tide
#

It's not a client rpc

quartz iris
quasi tide
#

You're iterating through the player array and calling a function. That function is not a client rpc so the client is not told to do anything

#

You're just calling that function on the server

quartz iris
#

This needs to be a multi right?

graceful flame
quartz iris
rough jolt
#

So I've been dealing with this issue for a while and I can't find a way to fix it

I have a game about aircraft dogfights, they move really fast, so ping is a big issue. When they fire their guns, if i fire them from the server in order for them to be properly replicated, the time it takes for them to be spawned in the server seems to be enough for the location of the client to change, so clients will see their guns firing from the wrong place, with a delayed rotation

https://gfycat.com/livelyfearfulequestrian

As you can see, it's absolutely game breaking

What i've been doing is guessing the future position of the client based on their current velocity and angular velocity, but this solution, while better than nothing, is deeply flawed as when doing several quick and short turns the game will shoot in a future position that will never be reached, which will give the weapons an absurd "spread cone"

https://gfycat.com/tenderrichfinch

These movements just happen to be exactly the kind of movements a player will do when adjusting their aim so, while playable, it harms the client experience a lot, as in a game like this that spread can make it very frustrating to hit a target

So my question would be, is there a better way to do this? Can I somehow spawn the bullet from the client itself and then replicate it to the others, giving the client full authority? Hacking isn't a concern to me and this keeps harming the experience of most players

graceful flame
#

Are they projectiles?

#

Niagara particles?

#

Static meshes moving in world space?

rough jolt
#

they are their own actors with static meshes

#

I can send a picture of the blueprint if that doesn't answer the question, i'm a little unfamiliar with the terms to define these things

graceful flame
#

So each bullet is an actor being spawned server side, bug lag delay makes it feel broken. Is that right so far?

hollow eagle
#

You can use net startup actors to spawn something on the client and then link it to a server-controlled actor later (see https://vorixo.github.io/devtricks/procgen/ for an example, ignore that it's about procgen, concepts are the same).
Or you can manage things yourself - spawn an actor on the client, delete it once the server spawns its own actor and reconcile positions. Or hide the server actor entirely on the client that fired things.

rough jolt
#

Yes, the client tells the server to spawn it and gives it a location, then the ping makes it spawn a few milliseconds later, which is enough for the aim to be badly affected

graceful flame
#

I had a similar shooting system for one of my enemies with my game and I switched from projectiles to using line traces + niagara effects. This way the particle effects can be spawned client side and multicastsed for others to see (with lag delay) but since the line trace is what actually handles the hit and damage logic it happens on the server without any visuals.

thin stratus
#

I think what's mostly done to make this look and feel a bit better is to have the Client be the Auth on the Projectile.

#

As in, the Server is the one calculating where the Client's projectile should be

#

Not other way round

#

You still have to deal with general ping of shooting at RTT ghosts

#

Or RTT/2 fwiw

#

But that's the internet

#

UT does this iirc for their slower moving projectiles

#

Just read through their code a bit

rough jolt
thin stratus
#

I mean you can simulate a projectile with multiple traces over multiple frames

graceful flame
thin stratus
#

But that's just theory

rough jolt
hollow eagle
#

Right. You'd still need to extrapolate projectile travel time on the server.

thin stratus
# rough jolt Could you elaborate a little?

Well the idea is that the Client fire the projectile instantly, locally. The Server fires it after the RPC (however you do the firing) arrives. But the Server will spawn it "backwards" in time, basically.

graceful flame
#

But I'm still a novice so I'm not sure if my approach is gonna work or not...

thin stratus
#

Again, UT should be doing this for Rockets

rough jolt
#

Also, what is UT?

thin stratus
#

UTs source code, even if old, can be studied

#

Unreal Tournament

#

It's on GitHub along side UE's source code

#

You can just read through it

hollow eagle
# rough jolt I still don't underestand

Client spawns an actor that isn't "real" and is just for visuals. It also tells the server it wants to fire a projectile. Server spawns the projectile, but instead of spawning it at the gun's barrel or w/e, it spawns it a bit ahead based on the client's ping.

mild socket
hollow eagle
#

Also you'll want to limit the amount that ping can affect this so clients can't just shoot infinitely fast projectiles.

graceful flame
thin stratus
#

You need to trace the distance between Barrel and new spawnpoint

#

In case there was something really close

#

But despite that, it should work quite fine

#

On the Server that is

rough jolt
thin stratus
#

The Client projectile is only visuals

rough jolt
mild socket
hollow eagle
#

And it's generally how this sort of thing is solved

#

Most (if not all) server-authoritative shooters will do this

rough jolt
#

"What you don't know can't hurt you"? xD

graceful flame
# thin stratus Just test on both sides?

ahh okay so I do the ammo check locally for honest players to show vfx client side and only cheaters would see infinite rocket vfx as they cheat to skip the ammo check, but server side only max ammo of rockets was actually fired.

mild socket
thin stratus
#

Again:

  1. Spawn Projectile, non-replicated, on Client
  2. Spawn Projectile, replicated, on Server
    2.1. Take Ping into Account and calculate how far the Client's projectile already travelled until the "ServerRPC_FireWeapon" arrived.
    2.2. Spawn Projectile at the new Location (which is further away from the Barrel).
    2.3. Trace from Barrel to new Spawn Location to ensure nothing was in between.
  3. Once the Server projectile replicates to the Client you can delete the Client one.

They should theoretically match up. And if not you can still interp the fake one to it.

Locating the fake one is the only tricky part if you have no setup for it.
UT finds it based on distance comparison (ugly).
We, using GAS, just send a prediction key along.

mild socket
hollow eagle
# rough jolt "What you don't know can't hurt you"? xD

Great talk on techniques for prediction, if you haven't seen it. May give you some more ideas to handle projectiles and other things. Somewhat technical/advanced, but that's kind of inherent to networking.
https://youtu.be/h47zZrqjgLc

GDC

In this 2011 GDC session, Bungie's David Aldridge discusses the programming that drove Halo: Reach's online networking.

Register for GDC: http://ubm.io/2gk5KTU

Join the GDC mailing list: http://www.gdconf.com/subscribe

Follow GDC on Twitter: https://twitter.com/Official_GDC

GDC talks cover a range of developmental topics including game des...

โ–ถ Play video
#

They go over some of this stuff when talking about grenades.

rough jolt
thin stratus
#

Also keep in mind that if you are starting to need Multiplayer Improvements like these, you might hit the end of Blueprints really fast.

thin stratus
#

C++ is a must at some point.

#

--

On another note I'm still debugging my Movement Component with >= 61 FPS.
It causes the Client to try to combine most moves if not sending to reduce bandwidth.
It causes issues in my code though and I started printing in PerformMovement.
It seems like the Server gets all the combined move (double as high DeltaTime), which is good, but the Client prints once for the Combined and once for the normal Move, which seems wrong. It basically ticks a move 1.5 times?

mild socket
# rough jolt What kind of checks? I'd be interested in knowing how to do this

heavily depends on your game, and the thing is you will se past versions of your enemy, so if you register hits this way its possibly even more broken. i had it for movement in a racing game which was basically what i needed and the clients wont interact with each other. you are looking for a hybrid solution like the one @thin stratus is suggesting

thin stratus
#

LogTemp: Warning: [CLIENT] [73.982254] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [73.998650] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.015045] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.031441] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.047836] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.064232] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.080627] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.097023] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.113419] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.129814] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.146210] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.162605] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.179001] [::PerformMovement] 0.032791
LogTemp: Warning: [CLIENT] [74.195396] [::PerformMovement] 0.016396
LogTemp: Warning: [CLIENT] [74.211792] [::PerformMovement] 0.032791

LogTemp: Warning: [SERVER] [73.982254] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.015045] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.047836] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.080627] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.113419] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.146210] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.179001] [::PerformMovement] 0.032791
LogTemp: Warning: [SERVER] [74.211792] [::PerformMovement] 0.032791

#

I feel like something is really off with the CMC in UE5(.1?)

mild socket
#

not sure its impossible to pull a working solution only using blueprints, but knowing c++ will make it easier

rough jolt
mild socket
#

and then they die

#

the best way would be doing a hybrid solution when you display the bullets for the client as they should show, replicate other clients in a mediocrely predictive manner, and register hits based on logic that takes into account the player's ping and what happened first

#

unless you dont have any regards for a pvp scenario feeling right

rough jolt
#

I definitely do, it does sound like what i'd want is some kind of hybrid scenario like that, i just lack the skills to make it happen

If you don't mind explaining a bit, why would client bullets not hit the other clients on their screens?

mild socket
#

visually they wont. if you are sending over information purely from the clients game instance, it will take time for it to rach other clients, and they will see their current version of their pawn that they have full authority on against your pawn in the past (how fast back depends on ping)

#

shooting included

#

because these are slow and predictive aircrafts of sorts, you can get away with mild predictability of the movement, and then try and register hits based on clients local perspective, and patch the bullet paths up on the server for other clients

#

if a client hit a plane, then you just show on the server a bullet that hits the other plane so that it makes sense

#

you dont need to follow any ground truth cause you cant anyways

rough jolt
#

and on top of that it'd feel a lot better as the clients would see their own bullets so it wouldn't feel broken as it does now

#

Thanks to everyone for the help. Wish me luck ^^

mild socket
#

you know you can filter out the replication so it doesnt go back to the owning client right?

#

like you can have the clients live in their own bubble of sorts and have the server patch thigns up for everyone

#

either way much luck

real ridge
#

and actors yes?

thin stratus
# thin stratus > LogTemp: Warning: [CLIENT] [73.982254] [::PerformMovement] 0.032791 > LogTemp:...

So from what I can see, UE first checks if it can Combine the NewMove with a PendingMove.
If so it does and then Perfoms the move before sending it.
If it doesn't combine, it will check if it can hold off sending the NewMove and putting it into PendingMove.

But the result of that seems to be that UE Performs Move 1, then puts it into Pending Move. Then Checks if it can combine Move 1 and Move 2. And if so puts it into one Move and Performs Move 1 + 2, performing Move 1 twice.

#

What the...

#

Guess that's for tomorrow..

thin stratus
real ridge
# thin stratus Is your Pawn marked as Replicated? :P

I believe yes but I posted logs above maybe my mistake is in session but people in #epic-online-services sent me here and people here sent me there and noone was able to answer so I am little sad and also I tried run my map as 2x client + server on editor side and I saw my pawns but when I tried join my sessions with pawns I didnt see them and if I change pawns to actors(thirdpersoncharacter) I see them also in session and also in editor when I run it as 2x client

#

weird really werid

#

weird I dont know what to do

thin stratus
#

That's a strange combination

#

Are you sure you are on the same server when the pawns are not visible?

#

Or connected at all fwiw?

#

I didn't have the time to check the logs you posted, sorry

real ridge
#

it is this

#

both are for one of joined

#

on the top you can see they will find lobby and then join

#

(logs for characters are almost identical)

midnight steeple
#

Do you have an idea for an algorithm to transform a session id into an id that a player can use to join a session

glad escarp
#

Ok. guys I'm in over my head unfortunately. I've tried to change everything since posting earlier. I need to buckle down and internalize exactly how replication works. I thought I had but I am obviously wrong. What I'm trying to do is just a simple weapon swapping system for my multiplayer game.

When a player hits the 1 key it calls a server RPC which spawns a melee weapon. So good so far. Both the Server and all Clients see the spawn.

Then the server RPC calls a multicast RPC to attach the spawned weapon to the third person mesh, so that all clients see it in the hand of the visible mesh for them. Then I call a client RPC to attach the spawned weapon to the FPS mesh so that the player sees it attached to his/her player's FPS hand.

This works on the server but not on the clients so I am very lost as to what I'm doing wrong.

If someone can take a few minutes to look at this pastebin BP and tell me where my logic is flawed, I would greatly appreciate it.

https://blueprintue.com/blueprint/povq_8hp/

real ridge
#

u dont need transform anything

midnight steeple
real ridge
fossil spoke
midnight steeple
midnight steeple
real ridge
#

may help you

glad escarp
fossil spoke
#

What if you decide you want to support Listen Servers?

#

The Host is the Server but is also a Player, so not doing the attachment for the Authority would mean the Host doesnt see it.

#

Keep in mind that if you are using C++ the OnReps must be called manually for the Server

glad escarp
real ridge
#

just to know if issue is on my side or on side of ue

#

when I have problems with pawns in mp

#

thanks

fossil spoke
fossil spoke
#

A Pawn is an Actor

real ridge
# fossil spoke What do you mean exactly?

I mean when I join my session with 2 players both have parent class actor and its ThirdPersonCharacter I am there with friend and see each other, When I do same but I change actor to Pawn and put plane on it I join session and I dont see anyone

#

we are both alone there

#

I know Actor is child of Pawn thats why its weird to me

#

I am trying to solve this problem few days

fossil spoke
#

Not the other way around.

real ridge
#

so then it should have same result?

fossil spoke
#

The ThirdPersonCharacter is also a type of Pawn.

real ridge
#

Then I have no idea where is problem fak.

#

this was my planes

fossil spoke
#

Actor -> Pawn -> Character -> ThirdPersonCharacter

real ridge
#

Pawns

#

and they didnt see each other

glad escarp
# fossil spoke Well you can easily manage that sure.

ok. hmmm.. So instead of using Switch Has Authority, I could use IsServer with a branch and then assign the RepNotify Variable to the correct mesh. Then in the OnRepNotify function is where I do the attachment.

real ridge
#

here I changed to Actor and it was suddenly working. /sorry for big images.

#

ah I dont understand then what is the problem

#

with those planes

fossil spoke
#

@real ridge Are they set to Replicate?

glad escarp
real ridge
#

then for mesh it was unticked but when I ticked nothing changed

#

so I am lost tbh

fossil spoke
#

How are you spawning them?

real ridge
#

I cant use actor class for plane ... I cant make flying to work there.

real ridge
#

nothing more.

fossil spoke
#

So its set as the DefaultPawn in the GameMode?

real ridge
#

*player start

#

yes when I want thirdpersoncharacter I change DefaultPawn = ThirdPersonCharacter, when I want plane I change it to PlanePawn

#

and build server + client

#

and test

#

but its strange because when I test it like run 2 instances in editor for example and I use this setup

#

i see normaly both pawns in game

fossil spoke
#

What are the render settings for PoseableMesh?

real ridge
#

give me minute

#

(have slow ntb to load it) I used old screens before

real ridge
#

but it does not make sense that when I use editorยดs server and run 2 clients i can see pawns in game but when I join my dedicated server session i dont but for actor i do

#

its not logical

glad escarp
# fossil spoke Sure go for it.

Ok so I can get the spawn on server working just fine and OnRepNotify to attach the actor but I'm still not sure how to change which mesh to attach it to based on whether it is itself or other clients without using multicast/client rpc's

glossy kettle
quartz iris
#

Within the gamestatebase, how do I play a widget on all players in the lobby?

graceful flame
sinful tree
glad escarp
sinful tree
#

Then in the OnRep, you could do a "IsLocallyControlled" check. If it's locally controlled, then that's your owning client.

glad escarp
ember sinew
#

Any tips on how to handle the "no return values from RPCs"/"get callback when RPC is done"? E.g. client wants to call a server RPC, but wants a response (and can patiently wait for it asynchronously ๐Ÿ˜„.) I looked at the documentation for FPredictionKey from GAS and thought it was pretty smart, dunno if others have preferred approaches?

ember sinew
#

That wouldn't work for cases where the RPC isn't modifying a variable. E.g. client sends RPC to server "spawn me a thing, send a reference to it when you're done"

sinful tree
#

You'd set the reference to that thing in an OnRep variable.

#

The only other way I can think of is sending a client RPC back with the reference, but if I'm remembering right, there's no means to guarantee that if you spawn something on the server and then say, do an RPC back to the client with the reference to that object that the reference would be valid on the client simply because the actor may not yet exist yet on the client.

peak mirage
#

So in replication graph, how would you guys make the spatial grid 2D node calculation the distance from the pawn's location instead of view location? Tried modify the source of spatial 2D grid node with no luck ๐Ÿ˜ข

candid gale
#

Hey, so I have an issue with OuterPrivate for UObjects and it's causing me a lot of issues with replication
https://forums.unrealengine.com/t/problem-with-replication-of-sub-objects-when-changing-inventories/267037
Searching over internet this thread describes exactly my issue, I do exactly the same on server but the object seems to stay stuck with the older outerprivate on client, and once I remove that outerprivate actor weird stuff starts happening
How can I make it so the client OuterPrivate also changes to the one I tell him to on server?

thin stratus
#

Can anyone with decent knowledge of the CMC tell me why in ReplicateMoveToServer we process Combined Moves locally?
I have the issue that if it starts combining, that the Client performs the non-combined move, then saves it as pending, then next frame combines it with the next move and performs it again, actively performing it twice.
If I print in PerformMovement, I get DeltaTimes printed twice (once with 0.016 (~61fps) and once with 0.032 (combined moved)). Server only receives the Combined move.
This doesn't seem to be correct. But it's the same since 4.24 and probably earlier.

Do I not understand something here? It actively causes bugs.

#

I would have assumed that the Local Player only performs non-combined moves, and the combining is only relevant for sending it to the server.
So Client would print 0.016 all the time and the Server prints 0.032.

#

Also lovely that I've been reading, using, extending this thing for years and only noticed this now.
It might also be that I'm not supposed to use PerformMovement to lower a value each move, but I doubt, cause it's all fine when not combining moves.

#

The only thing I could imagine is that the second PerformMovement, the one with the Combined Move, actually somehow goes back in time, and reverts back to where we were when that move was not the pending one?
Seems unnecessary?

#

Actually it does

#

I wonder why that is the go to approach, instead of just not handling this move locally

#

So I need to store my float value and revert it back to the old move here. Let's try that I guess

void wyvern
#

Can anyone help me out with how to do snapping in multiplayer, like if there is a socket and a cable , the cable should snap in if brought near to the socket.
I am new to multiplayer and trying to find how to achieve this.

peak mirage
thin stratus
#

Please don't give false advice in terms of usage of RPCs though

#

I know no one means harm here, but a Cable being connected or not is a STATE.

#

And a STATE should be an OnRep/RepNotify variable, not an RPC

#

People who join late or come from further away closer to the cable won't have gotten that RPC.

#

@peak mirage

#

I would say for starters it's enough to just register the overlap of the Cable end with the Socket, and on the Server (SwitchHasAuthority) set some Variable or Struct with information that is OnRep/RepNotify.
And then actually attaching the Cable based on that Information in the OnRep function.

#

@void wyvern If any of that is unclear, specifically the terms, please read the Network Compendium that is pinned to this channel.

peak mirage
#

@thin stratus yeah you're right, I thought that is a beginner question so I give him a fast answer that could work right away to avoid complex solution. Not an expert so just try to help as much as I can ๐Ÿ˜„

thin stratus
# thin stratus Can anyone with decent knowledge of the CMC tell me why in `ReplicateMoveToServe...

I fixed it. I just didn't (remember?) know that CombineMove reverts some values on the CMC back to values of the OldMove. Doing that with my problematic value that I was reducing in PerformMovement seems to have fixed the issue.
Still not sure WHY they run the Combined Move on the local Client too, but someone somewhere had their reasons I guess.

I really need to write down all the steps involved on how to add those "simple" things to the CMC, such as a Flue-based Boost...

thin stratus
fresh cloud
#

mhmm, that happens around line 8346 in CMC cpp, it reverts to the beginning of old move, then adds the deltas together and performs the move as normal to combine the move i think?

thin stratus
#

Yes

#

The Part I forgot/wasn't aware of was the "reverts to the beginning of old move"

#

My float was of course not being reverted

#

It wasn't even part of the SavedMove, as I didn't need it for replaying

fresh cloud
#

ye ye, do you think you'll have to add something to revert the float back?

thin stratus
#

The server sends the correct version to the Client. Replaying would just reduce it, so I never tracked it

#

Yeah I had to add the Float to the SavedMove

#

In SetInitialPosition

#

And set the CMC back to the old move value

fresh cloud
#

yeahhhh that makes sense

thin stratus
#

It's fixed now

fresh cloud
#

nice exi!

thin stratus
#

Yeah it does, but why can't they just perform single moves locally

#

This seems so bug prone

fresh cloud
#

locally as in on the autonomous client?

thin stratus
#

Yeah,

#

So

Frame 1: Perform Move 1 -> Save as Pending
Frame 2: Perform Move 2 -> Combine and Send

#

Instead they do

Frame 1: Perform Move 1 -> Save as Pending
Frame 2: Combine Move 1 and Move 2 -> Revert CMC back to Move 1 (where needed) -> Perform Combined Move -> Send Combined Move

#

Like.. why

fresh cloud
#

hm... the only thing that i can think of is it might be something to do with the amount of correction happening with client adjustments after? but client adjustment is handled on tick BEFORE replicatemovetoserver even fires

thin stratus
#

๐Ÿถ wants to be walked. brb

thin stratus
#

so yeah, corrections could be a reason, but more for the future

#

I think that combined move also replaces the original Move 1 in the saved moves, or?

#

Would at least make sense

wicked stone
#

anyone know how to properly replicate anim notif? if I cancel a montage it happens on the owner side but not any other client side, montage just keeps playing

thin stratus
#

I would assume you need to cancel the Montage on everyone

#

AnimNotifies have nothing to do with replication

#

You just need to ensure the Montage start/stop is replicated by hand

wicked stone
#

this is kinda the hacky way Im trying to cancel it

#

I think ive tried a million different ways to cancel the montage on everyones end, its such a basic thing Im suprised I cant find anything on it

fresh cloud
#

if it needs to be immediate, you could call a multicast on the server (issues with setting it reliable and gunking up the reliable buffer), multicasts called on the server get sent to all clients

#

however, it's preferable to have this be driven by an onrep variable so as to not create a new RPC or put stuff in the reliable buffer, this has the potential to be delayed but is healthier networking wise

#

so client -> server i request you do the thing, server multicasts to all clients after the check is validated

wicked stone
#

do you know if any tutorial that properly addresses this? Im just trying to cancel an attack animation after a certain time of the player walks forward rather than waiting for the entire animation to finish

fresh cloud
#

hm, not off the bat, i'm not 100% sure but i would assume that the client calls an event that's set to replicated to the server, then that event leads to a call to an event that set to multicast, and in that multicast is the logic for stopping the animation?

#

i think, try that and see if it works, if not someone more experience can probably help better than i can LOL

wicked stone
#

okay will do thanks, atleast I know now its still a replication logic issue and not related to the notif

real ridge
#

I dont understand I added 2 pawns and when I join session I dont see each other but when I use Actor class I do

#

what can be problem?

meager fable
#

did anyone encounter a problem where after creating a dedicated server build it won't launch?

#

shouldn't this be in the package?

real ridge
real ridge
#

I have ticked all windows with replicate so I dont understand whatยดs going on

#

I should see pawn same as actor not?

#

but when I use thirdperson character with actor its functioning I am confused

woeful ferry
#

Are there any IDs that is the same on server/client I can use to identify an actor purely based on a name?

thin stratus
#

The Actor's NetId I guess?

woeful ferry
#

How do I get it?

real ridge
# thin stratus The Actor's NetId I guess?

hello exi do you remember our talk yesterday about non replicated pawn? what can be issue I tried almost evrything right after I change parent class of my blueprint and I join twice server I can see each other right after when I change parent class to Pawn

#

I dont

#

i am out of my mind

woeful ferry
#

How do you guys solve saving references to actors in a replicated array?

Because replicating soft refs is not safe due to the path being different on server/client.

Would you just save the softptr and then resolve that and add it back to the actor array on load?

thin stratus
#

Why do you use a SoftPtr when replicating an array of actors though

thin stratus
#

And then step by step reintroducing existing stuff and see if it fails/starts working

woeful ferry
#

How do I save a replicated array of actors?

real ridge
thin stratus
thin stratus
woeful ferry
#

Yes, so should I save the whole actor as a soft ref and just resolve them all back into the replicated array

thin stratus
#

I don't think you can save Actors as SoftRefs.

#

You usually serialize them

woeful ferry
#

You can

thin stratus
#

And later load the data back into a freshly spawned one

woeful ferry
#

Soft Object Ptr

#

You can save them as

kindred widget
#

It works if they're part of the level. The SoftPath resolves to the asset saved in the level.

woeful ferry
#

Yes

thin stratus
#

Yeah but not dynamically spawned ones, right?

#

I guess that info was in the question somewhere?

woeful ferry
#

Yes you can use them for that aswell

real ridge
woeful ferry
#

Our save system just looks for actors in the level with the same name, and loads the save data for that actor. If there are none, spawn them in

#

And load the data

thin stratus
thin stratus
#

Don't think we used SoftObjPtrs for this in The Ascent

kindred widget
#

Why do you need to replicate the array though? Doesn't the setting of state and spawning handle sending state to the client?

thin stratus
#

Would make sense if it's some sort of shared savegame I guess

real ridge
#

on current map

thin stratus
#

For example, yes.

#

Just don't mix up GameMode/GameModeBase and GameState/GameStateBase

#

You can only have GameMode with GameState and GameModeBase with GameStateBase.

real ridge
#

tried this now

thin stratus
#

That might not work if DefaultPawn is not replicated

#

So be careful

real ridge
#

but I need use now parent class for my pawn as defaultpawn to spawn it

#

why it is not replicated?

#

parent class is pawn isnt it

thin stratus
#

Mostly just saying it can be

#

I don't know what stuff is replicated by default

#

I barely use Pawns

woeful ferry
real ridge
#

i dont want to use actor like person

woeful ferry
#

So need a reference to the componet that is the respawn point

thin stratus
woeful ferry
#

Or would I? ๐Ÿ˜„ Maybe some other smart solutions

thin stratus
#

In terms of saving, we probably just grabbed the Actor based on an Interface. Let it provide us with some Bundle Struct with all Info that is needed, and serialized that.
And when it needs to be spawned we read it back in.

In terms of providing a list of owned respawn points, I would probably just place the Actor into some RespawnPoint array on its BeginPlay or so

#

Depends on the exact setup of course

#

If it needs to persist who owns it I would probably work with the UniqueNetId of the Player

kindred widget
#

I'm lazy. Client should be able to easily just actor iterate that if it has a base actor class for that. UWorld is already handling putting it in an array for you at that point. You'd just need them to be relevant on clients at all times. Otherwise you're looking at requesting some pod data array from server and using that to request the right respawn point without the client needing the respawn point loaded via relevancy.

real ridge
#

I need use default pawn here?

thin stratus
#

Just create your own GameMode that is empty despite the class selection

real ridge
#

and test pawn

#

where is only skeletal mesh and camera

thin stratus
#

If in doubt you should also try not using the Base versions of the GameMode and GameState at all

#

When you do Multiplayer it's best to just use the normal versions

#

The ones without the Base at the end

thin stratus
#

is this a GameMode?

real ridge
#

yep

thin stratus
#

You can't mix GameState with GameModeBase

#

Both have to be without the Base

real ridge
#

i am litlte bit confused now ๐Ÿ˜„

#

its like this

thin stratus
#

You need this to be a GameMode

#

You can't mix GameModeBase with GameState and other way round

#

Only GameMode + GameState and GameModeBase + GameStateBase

#

And for Multipalyer it's probably best to use GameMode + GameState

#

Idk what they all cut when they made that Base version a few years ago

#

It was originally only one class

real ridge
#

gonna change it

#

so like this

thin stratus
#

Yes

real ridge
thin stratus
#

Yop

real ridge
#

ah shiet

#

didnt help

#

i dont see anything in log

#

i am tired of it

thin stratus
#

That's still standalone with eos?

real ridge
#

2x standalone and server is runninng from packaged exe

#

then I am logging there via open 127.0.0.1

#

local ip to test it

#

this is log of second to server maybe is there mistake but I cant see it

#

i have no explanation why this is happening

woeful ferry
thin stratus
#

I'm still not sure why this would happen. A fresh project to test might be needed to rule out any problems with yours

#

With just a simple custom GameMode and Pawn. No EOS, just an basic Server + 2 Clients

real ridge
real ridge
thin stratus
#

I'm not surei f connecting from Editor (even if standalone) to a Packaged Server is a good idea

#

I would try to package the client too before you waste time on this

real ridge
#

okay will check but you know if it's working with third person character I don't see any logic why my own pawn is not working with it

#

it's program not woman

quasi tide
#

@peak sentinel Hey I saw an old plugin of yours, seemed like just making a replicated version of the floating movement component. Why'd you stop it?

peak sentinel
#

Epic migrated to hyperwallet and I couldnt get payment because its restricted in Turkey

#

then they froze my account since I wasnt able to update payment info

#

though I was not going to support it anymore

#

people were always coming with weird expectations like moving 1k characters with zero overhead etc

quasi tide
#

Wack

peak sentinel
#

yeah ๐Ÿ˜„

quasi tide
#

I just noticed it 'cause it looked exactly like something that I thought about doing. Pretty much a super simple replicated movement component more or less. Not every game needs all the fanciness of the CMC ๐Ÿ˜…

peak sentinel
#

Yeah, only problem is it was breaking the ACharacter inheritance chain because I wasnt able to act like CMC doesnt exist in ACharacter

#

then wasted one week to completely get rid of CMC side effects and implemented my own solutions etc but then I needed root motion movement

#

and couldnt implement back at the day with my limited knowledge

#

then switched back to CMC pensive

quasi tide
#

Well - Character is like the only thing that inherits from Pawn by default, right?

peak sentinel
#

we only do oop here

prisma snow
peak sentinel
#

but productive green_tick

#

most ECS-ish thing I do is tick aggregating and ST ๐Ÿ˜„