#multiplayer
1 messages ยท Page 133 of 1
Is there a good way to test steam sessions without having to package the project and run on a second computer each time?
Can't you just launch it on a 2nd computer?
each computer has engine installed and project (just like you had 2 dev machines)
just launch the uproject
Always thought these were warnings , but with structs you should initialise values. FVector and FRotator do not initialise to 0 in their constructors either
You can declare a constructor or specify a default inline
Won't everyone need the detach call too? I would also recommend that your weapon just has a Drop function instead of if being the character's responsibility to set that up
detach for everyone doesn't change anything unfortunately
It is normal to have two actors on the client when the actor that has bReplicates=true is spawned on the fly (dynammically with code) on the client without if(HasAuthority()) check.
However, for us as developers, calling if(HasAuthority()) check is not possible for the actor placed on the level at design time. I assume the engine does this check. Please clarify whether my assumption is correct or wrong. Thanks!
Yes?
If a client spawns the actor, then it'll only be on their version of the game
Because you get the server actor that's replicated and the client actor just exists on the client
Replication is only server -> client. Never client -> server
In other words, how the engine spawns actors that come with bReplicates=true and are placed on the level at design time? Are the running game instances filtered with if(HasAuthority()) such that there is exactly one actor on the client instead of two?
Or maybe actors placed on the level at design time and with bReplicates=true are spawned from GameMode class so if(HasAuthority()) is no longer needed as GameMode only exists on the server?
I know how to send start dedicated server with map via console comand. But ho wth send parameters and read them inside started map and dedicated server?
I have already considered this convention. That is why the server gets only one actor but each client gets two actors. Assuming the actor has bReplicates=true and the spawning is done at runtime without if(HasAuthority()) check.
When actors are part of a map package and have bReplicates=true they are considered NetStartupActors. When the Client and Server load the map file, those actors get created based on the data in the package. There should be no need to handle explicit checks for them, the spawning of them happens as part of the load of the level, the Server and Client will each end up with one instance of that actor
@serene kestrel Thank you.
I have a related question several days ago.
Assume that we have a non-replicated actor (with bReplicates=false).
I did the following:
- Place one actor on the level
- Spawn another actor dynamically with code (for example from level script's
BeginPlay())
Result on client for the actor placed on the level:
Network Mode: Client
Local Role : ROLE_None
Remote Role : ROLE_Authority
Replicates: False
Result on client for the dynamically spawned actor:
Network Mode: Client
Local Role : ROLE_Authority
Remote Role : ROLE_None
Replicates: False
The roles are just swapped.
I am interested in the result for the actor placed on the level.
Because it has not been explained yet by others before, how the engine does this? why does engine need to differentiate the results by swapping the roles?
If the Actor is not replicated, you can basically ignore RemoteRole and treat the Actor has having local Authority. I'm not sure why the loaded map Actor has a Remote Role but not a local one.
It seems that in ULevel::InitializeNetworkActors() if the Actor is bNetLoadOnClient=true, it sets bIsNetStartup=true and then if it is the Client, it calls Actor->ExchangeNetRoles(true). The reason for this is that it's possible that the actor gets set to be Replicated=true later in the game. If that happens, then the roles will be correct and the Server owns this Actor with authority.
If you're spawning on Begin Play then you're spawning it on the client in which case the client would have authority of the actor.
A placed actor is a bit different. There is a "Net Load on Client" option which if you uncheck means the actor would only exist on the server. If it is checked, then the actor is spawned by the server but it doesn't replicate, therefore the server has Authority.
So if you plan on making this Actor replicate later, then you likely don't want to mess with the roles. If you are not going to replicate it, there's probably nothing wrong with swapping the roles locally if you want the HasAuthority to work in all cases.
Hello! I have a small question about multiplayer that I don't understand, I created a projectile object, which prints the name of the object that it overlaps with. But I don't understand why the projectile is printing the correct name of the character it collided with on the server, but in the client it prints the opposite character
bReplicates of an actor can be dynamically changed from true to false or from false to true as many times as we want?
hopefully quick question. In a listen server setup how can I check if a function is being run on the server?
I have recently learned this is not what HasAuthority is actually doing
Shouldn't it be the same name on both of them?
Yup, take a look at AActor::SetReplicates(bool)
Not necessarily. The display name of the object isn't the best way to reference actors as actors are normally named automatically locally which may not necessarily be synchronized on client and server. There is a net ID that is shared between client and server when referencing actors across the network that ensures you're actually referencing the correct actors.
Ohhh ok, thank you!
can multiplayer sessions be tested using steam with app id 480? Because I got game invites to work but can't get players to join other sessions
If an actor with bReplicates=true and bNetLoadOnClient=false is placed on the level, the actor still exists on the client. Is it supposed to behave like this?
Yes
Yes because the actor is replicated, the server would replicate it to the client, but it's not loaded by the map.
Because it is still replicating
I typically turn it off for triggers.
So the triggers only exist on the server
Saves me having to do HasAuth checks ๐
That's actually a pretty good idea. I'm using my mesh component for overlap events and the mesh needs to be replicated so I have to use auth checks :'( I'm too lazy to add in another component just for overlaps because then I have to resize it for each item and that's a pain
Anyone have any experience using PaperZD with multiplayer
when playing as listen server and client it appears to be playing the correct flipbooks on both
I was handling it using this bit of code but it seems that it is replicating fine even without it so im slightly confused.
this is with code disconnected and playing as listen server everything appears to be fine.
A variable set to replicate needs to be changed by/from the server for it to automatically replicate to other clients, is this correct?
(and that variable won't replicate to other clients if it's set from the client) ?
Client changing the variable will only change the value for it self
Replication goes from Server to Client
got it thank you
If client needs to change a variable, run a server RPC
the server will then set the variable
and will update the other clients of the new value when
well it goes back to the client that calling RPC too if you set the replication condition to None
thank you for the graph ๐
hi all, after closing the .exe while in server map resulting in this warning msg .. what could be reason for this ?
so i have a first person project and added a world model for my character however when i pick up the weapon, its not parented correctly. is there a good way to fix this? like do i parent it to a different bone for the owner vs other clients?
Generally, youd have FP and TP mesh, with OwnerOnlySee/OwnerNoSee
ye thats how it is but im not sure how to handle the gun to it appears correctly in both
ive ended up opting for a true first person camera for now
this probably isnt a "fix" but.... it will do
FP gun for FP mesh, TP gun for TP mesh
Fake it till you make it ๐ฏ
you don't display FP gun in TP and TP gun in FP
there is even a checkbox for it in primitive mesh iirc so you don't have to handle that yourself
Guys, How can I disable AI's chase when the character dies?
The Unregistered Perception or Unregistered from sense did not work.
hello, i have a dedicated server hosted at some ip somewhere. Is there a way i can get this ip from inside the server's gamemode using a built in function etc? I cant hardcode the ip as a variable for reasons.
?
the game is multiplayer?
I need to disable it for both server and client.
Run On Server or OwningClient, even these are a separate problem. Unregistered may not be working for this reason.
guys what happened to spatial os? they created this amazing server meshing system for us and then just disappeared
any one knows ? thanks for answers
I have been using the generic 3rd person template for my mp game and as I understand it, this works for good feeling client side representation and accurate server side control. Without considering netcode quality control, does that suffice for most projects? Is there a place where it fails?
What methods have you employed to make a smooth experience in multiplayer? Have you tested the game with substantial ammount of lag?
I just build off of the third person character example. I am writing custom projectiles which I expect to address custom smoothness clientside, but am not there yet. I am asking purely for the charaction motion, running, turning, jumping etc.
You will need to go deep into CMC to make it multiplayer ready. Even for simple thing as sprinting, you will need to toggle flags in FSavedMove
For jumping, if you are using CMC jumping, that should be fine out of the box.
More Info : https://www.youtube.com/watch?v=urkLwpnAjO0&list=PLXJlkahwiwPmeABEhjwIALvxRSZkzoQpk&ab_channel=delgoodie
https://discord.gg/uQjhcJSsRG
In this video I am introducing a series I will be making which explores the character movement component and how you can extend it in depth.
0:00 Intro
1:00 What is the CMC?
2:00 Do you need a custom CMC?
5:35 What does the CMC provide?
7:10 Outro
Great! That is exactly what I was looking for.
Is there a reason TopDown project out of the box doesn't work in Play-As-Client mode on ue5.1?
"Allow Client Side Navigation" is off by default in TopDown 5.1. needs to be turned on to use Play-As-Client
oh and enhanced input doesn't work with it, had to use legacy
Discord: https://discord.gg/CHm7RZJ
Project Files: https://www.patreon.com/forsakenreality
UE5 How To Set Up Top Down Template Multiplayer Replication
In this video we will learn how to Replicate the top down template for multiplayer in unreal engine 5. We will go over multiplayer replication for Click to Move and in future videos we will se...
Just hasn't really been updated to do so I'd imagine
Does anyone know if the client side events for FFastArraySerializer are guaranteed to be received in the order they were executed in on the server?
I.E: If I remove something and then added something new, will the client always receive them in said order, the remove before the addition? I need to process the adds/removed in the order that they occurred in and since PreReplicatedRemove happen before replication, I cannot update the timestamp I added.
I also just tried changing the values, marking as dirty then removing but it seems FFastArraySerializer is smart enough to not bother running PostReplicatedChanged if something is removed.
it's not gauranteed
You should setup some sort of ID system to compare the entrys
Well balls, I am using an id system for the entries already, just incrementing an integer every time an item has been added to the list, however, the issue I have is a little complex.
I'm using a plugin to generate a mesh (RealtimeMeshComponent) and I'm using the FFastArraySerializer to add/remove collision bodies to the mesh when "parts" are added/removed, the problem is, this mesh is generated each time a client leaves and then re-enters net cull distance and the FFastArraySerializer updates client side before the mesh has finished generating.
I've added a form of queueing client side but of course, if the bodies are removed or added out of order, then the client may or may not have a collision body where there is supposed to or not supposed to be, hence the need for a timestamp.
So far everything has been in order, both in the editor and on a real dedicated server but I'm certainly not wanting to rely on it since it's gameplay critical
*The downside is that you will need to have game code mark items in the array as dirty, and well as the *order* of the list is not guaranteed to be identical between client and server in all cases.
that comment is on line 43 Inside of FastArraySerializer.h
but I'm not sure why you can't just loop through the entire array each time to get the information you need?
The list order itself does not matter in my scenario, it's the order the add/remove events are received.
They will come in, in the order they were sent out if that's what you mean
the only thing that won't be reliable is how it's listed
the order you add/remove items on the server will not match the order the callbacks are called on the client.
Full stop.
First, all remove callbacks are fired before add callbacks are, which are fired before change callbacks are.
Second, even within a single type of operation the order is not going to necessarily be the order the items were added/removed/changed in.
what I'm referring to is if you added ID: 1, and then added ID 2, and then replicated it, the order isn't gauranteed. If you replicated it one at a time then you could potentially order it yourself
There's no mechanism in the engine to do that with fast arrays.
That explains why I have yet run into a problem, leading me to a false sense of security ๐คฃ
I was using reliable multicasts which poses its own problems (they were getting dropped as unreliable), but I guess I'm going to have to do some hard thinking
I guess I'm gonna have to maybe look at misusing PostReplicatedChanged for removes and then ack back to the server when I have received the message to actually remove it from the fast array, or rather than an ack RPC, a server side timer to clean them up.
Then again, I think I might just be overthinking this ๐
I think you are too, with an ID system I really can't understand how you're having a problem. Maybe it'll help to explain more clearly what you're trying to do
I wrote a whole bunch to explain what I'm doing and whilst I was reading it, I have confirmed that yes, I am definitely overthinking this, add/remove happens as it should, each time, every time, the ids never get out of sync and collision is always updated correctly, the only time there is a problem is during actor re-creation after re-entering net cull distance, which is where all local client state is lost anyway.
Sort of a "premature optimization being the root of all evil" moment, except this is a premature "trying to accounting for things to go badly even though they likely never will" moment.
Anyone know why from the server viewpoint(listen server host), the client animations look fine in the editor, but when played on Steam the animations are like half-speed and not responsive looking?
Something to do with how AnimationTick I think
there's a fix for that but I can't get it to work and the page is lost
kinda the reason why I download source code and trying dedicated server
The Server see things Raw, so Client will see other client fine. Client will also see server fine. But server will see other client jittering,~~ I think it updates the animation as fast as the netUpdate but I could be wrong~~
Net update in the character bp?
It's just weird because I've simulated 500 ping and the characters animation looked fine
Maybe it's related to maxclientinternet speed or whatever in the .ini
@hushed rain #multiplayer message
Found my convo with the legend
you can read his response
scroll down from there
Hmmm I really don't want to build source haha. Do you know if the General Movement Component plugin from the market has this issue?
I don't know, don't wish to spend $350
Haha yeah ๐ญ
Is this not of any use? Pretty sure this was something I needed to set when I was working on a freelance project, just add this to the constructor of your character class.
GetMesh()->VisibilityBasedAnimTickOption = EVisibilityBasedAnimTickOption::AlwaysTickPoseAndRefreshBones;
This had to be set for my project/s since servers don't tick the bones/poses meaning socket locations were not correct for stuff like weapons, etc, I'm not sure if it fixes the same problem you're describing but I have never seen weird issues with anims playing at half speed on both listen servers and dedicated servers.
That;'s already the default option isn;'t it
in my case that wasn't it but the CMC tick causing the jitter on server side
This problem only apparent when you play in network environment outside Editor
I don't believe so, at least it wasn't when I originally started using it, however, I can be sure that I've never seen jittery animations except when I don't have X specific window/client/host selected/in the foreground.
have you tested in Steam for example? because you can't see it in Editor
Yes, I have like 3 games I've worked on that're on steam and none of them exhibit the problem
just to clarify, client to client see each other fine
And before that I've always tested in a real networked environment
it's only the server seeing other client actor jittering
Once again, I have not seen that problem with my listen servers
k
I have, in several projects. And Epic even confirms it.
I was thinking it might be related to my client net speed settings in the ini since it's only happening on steam
Character Pose on ListenServer, for Clients, is ticked via the Move RPC
At least it was for quite some time.
5.4 brings a movement refactor, so maybe you are lucky and it gets fixed/changed with that
๐
That would be glorious
The tick option that was just posted simply means that by default poses aren't ticked at all if the mesh isn't rendered
Are you aware if General Movement Component has this fixed?
Which can be problematic if you have ADS and a Dedi Server, since that never updates the bones then
No, never touched it
Ok
Yeah, that's what we've used it for, was also enabled for one of our games that only supported listen severs to fix the same problem
The original "fix" was to subclass the CMC, override the function with the TickPose call, commenting that out, then subclassing ACharater, overriding Possessed iirc and skipping the ACharater Super Call by calling APawn directly
But the CMC changed since then
And I never had to implement it again
Basically the issue is if your client has low fps or generally a lower update rate, the anims of that client will look jittery
Ping doesn't even matter
Is there a way to increase the update rate
Changing the update rate will scale the anim rate too I think =(, last time I did it run twice as fast (not in velocity but visually)
Weird, was this pre 4.27? I've only ever worked on games that've shipped on steam on that or up, most in UE5.x though, everything before was using just dedicated servers.
Still happend in 5, I can confirm that
Damn well this problem is annoying I hope it gets fixed in 5.4 but I doubt it lol ๐
did some test and decide to go with dedicated server route because it's still exhibit the same issue
Okay, then I have no idea since it's not something I've been able to observe :/
Hmmm I think I started my project in 4.27... would the CMC be old even though I'm in 5.3 now?
What way round is it? The client cannot see the listen server host at the correct rate or the host doesn't see the client at the correct rate?
I kinda wanna check it just for the funsies
The host doesn't see client animations correctly
I have same problem in 4.24 and 5.1. Nothing has changed
Is that over LAN using two PCs or with someone outside your network?
Steam
Yeah, Steam works in the same network though, is this with two separate people in different houses testing or on two PCs that are on the same network
Yeah 2 different houses
Are we sure 5.4 is going to have mover 2.0?
I really hope if there's no good solution ๐
It was a thing since ever
Based on road map yes
Otherwise, no
Welp, you're certainly more experienced than myself, so maybe I'm just mistaken, strange how I've never noticed it ๐
Dedi Servers don't have that issue and you would need to have a low rate client to see it
Isn't that part of the roadmap just a, "Hey - we're workin' on this, no promises!"
I know I've heard rumors of it comin' in 5.4, as well as the UnrealFest possibly hinting at it as well. But still
My first game tested via steam was a listen server based game ๐ I have definitely done much more that is strictly dedicated servers so I genuinely could be doing a big dumb and not recalling correctly, it was a long time ago.
Either way, I'm super excited for Mover 2.0
You might be right
I have a feeling it will be coming because of the new FN season as well. They did advertise a whole new movement thing to the playerbase
If it intends on supporting physics based actors I am SUPER stoked, we've been using SmoothSync for a while and it works great for our use case right now, but doesn't support prediction or rollback, just client interpolation, plus it'd just be nice to not rely on 3rd party stuff ๐คฃ
how would I set the team of one player in my PlayerState when starting from my BaseCharacter? for context, the Character has interacted with something and now he should be set a specific team, that later also needs to stay for a seamless travel, so im guessing it needs to be in playerstate
Hi, if a single property of a structure in a fast array change, does it replicate all the structure ? And can we know which property changed ?
hey gang, any way I can mitigate packet loss when it comes to replicated variables?
I understand that reliable RPCs are always pushed through, but I'm noticing that replicated variables aren't. Thats a problem cause I'm trying to do a buffer prediction system (where I track the histories of client/server value changes and checking if they match, so if a value change isn't replicated then there's a mismatch)
I'd prefer if I didn't have to do an RPC every time my variable is set, but is that the only sure-fire way?
No, they only replicate the single add/remove/change (it's part of the reason fast arrays exist) and secondly, yes, there's client side events you can implement, PreReplicatedRemove, PostReplicatedAdd and PostReplicatedChange, these exist both on the FFastArraySerializer itself and the FFastArraySerializerItem, check FastArraySerializer.h for a full description (the Lyra game sample also has several examples of this being used)
I believe the PlayerState has a CopyProperties function that you can probably override for this, alternatively, there's also the GameInstance which you can use to store temporary data that can be used in spawn character requests to the server (you will have to implement that yourself.
My game has a flow something like this.
DefaultPawnClass set to none in GameMode class.
GameMode::PostLogin: Get player controller, call ClientPostLogin RPC.
PlayerController::ClientPostLogin: Get stored client side data from game instance then call server RPC ServerRequestPlayerSpawn with the previously gathered data as a parameter.
PlayerController::ServerRequestPlayerSpawn: Get game mode, call SpawnPlayer with any data that is needed to determine what to spawn.
Hi, i'm talking about struct properties in the fast array, not the fast array itself
Oh, right, uhh, I believe it will resend the whole struct, what you could always do is just copy the data from the struct into the fast array item, then re-create the struct client side.
Ok so for big structs it could be better to split data into multiple arrays
hello, can anyone help me? i faced with the problems of animation blueprint is being slower on server, but on clients it works fine. i tried to play with input values of animations but that not helped and they were still half time slower. so as I think the problem is that animgraph is playing slower by some reason on server and i haven't found how to fix it yet.
Multiple fast arrays or multiple regular TArrays? Regular will re-send the whole array, a fast array will only send the single property that has changed AFAIK, so it will still be faster to use the fast array, but you will want to split the data back out into separate properties within the fast array then marking as dirty and recreate the struct client side, @chrome bay (sorry for the ping) knows this far better than me so I'm sure he can point you in the right direction.
TArray will only send delta changes
TArray identifies elements by index, so if you shuffle elements around, that might create large deltas. Fast Array identifies elements with a unique ID, so deltas will be the same size - but base delta size might be larger.
TArray replication still has a lot of good use cases over Fast Array
Fast Array is poorly named IMO
Which one you should use really depends on the use-case
Can we get the changes of a TArray ?
If you pass the old value into the ONRep function then you can iterate and compare yourself
How efficient that is depends on the data
How do you pass teh old value as a parameter?
UFUNCTION() void OnRep_Whatever(const TArray<FWhat>& PreviousValue)
In the OnRep function
Oh and it supplies it for you?
Yeah
Ah. Neat.
Just note that PreviousValue is the shadow data, NOT the member data - so if you changed the member locally, that wouldn't be passed in
Not an issue unless you're doing client prediction or smethigo
FastArray + TArray can both do delta replication of the internal struct btw
But that's annoying to iterate on the TArray to get those changes
To be fair, you don't get the discrete change in Fast Array either - you just get told WHICH element changed, but not what about it changed. There's also no previous value to compare to unless you cache it yourself.
Depends whether you care about bandwidth, efficiency or convenience I guess
As with all things, it's a trade off ๐
Yeh i see, thanks !
It's a shame you can't get per item callbacks for TArray tbh, would be quite convenient
Can anyone tell me what these debugger messages mean
My component is set to be replicated, the method in which this is called is a Server RPC called by a player controlled inventory component
hey, what is the best way to replicate an event to all the players, to me I use that, but sometimes it doesn't work in all the events needed?
so the client calls ROS_Shoot, which calls MC_Shoot on ALL clients, which all clients will call ROS_shoot again.. i think you may have some sort of RPC loop going on which is causing wayyy too many RPC's to get fired off and some get dropped
no no , the final shooting event is in the weapon class, not this one
the first shooting in's the final one called
Not sure what the fix is, but I'm trying to increase the maxclientnetrates in the ini and update frequencies in the character. I doubt it'll work but I'll let you know
Is there a way to have RPCs on an actor when using beacon connections ? I can only use them on the beacon client actor, even when i set the beacon client as net owner of the actor
thanks! i will try it!
are you also using the FPS multiplayertemplate
no, i made all myself on c++
Ah okay, good, then its not just me lol
Also this only seems to happen over the net for me, and also only if the clients PC is trash
as i already said only problem is in animation speed on server, cause it's half time slower than on clients
Yeah im getting the same thing, but if the client's PC is good then it looks fine on server for me
and velocity length and other inputs are the same
well i have this will all pcs
hmmm interesting
yeah it makes no sense to me D:
So now the effect is reversed
with higher netmax speeds and a 25 update rate minimum in the character BP, if the server has a good PC it sees everything fine, but if the server is bad it sees the slowmotion animations
I'll take it as it makes sense I guess. Don't have a bad PC or your animations look bad ๐
well i haven't even tested it yet
where can i find the .ini file to high up the maxclientnetrate?
i've set all up and nothing fixed
and also i fixed it by putting a float in all animations states, that speeds them up if it is a server and model isn't local
@twin juniper @hushed rain This is basically by design
The Server ticks the Pose of the Mesh via the Server Move RPC
The only "fix" there was, which I don't know how to do anymore cause the CMC changed, was to override the method where it calls TickPose, more or less copy pasting the parent method, commenting out the TickPose call.
And then also overriding PossessedBy or whatever it is called in the Character, calling APawn::PossessedBy directly instead of Super, cause ACharacter::PossessedBy sets that boolean that the TickPose isn't called on tick
well i fixed it my way, and it works)
Sure, if you think that works for you
I doubt your fix is the proper way, given the TickPose calls vary based on ClientPCs, so speeding them up is probably not the best call, but I leave that up to you
well it's going to speed up only on server's view not on the clients
Yeah, but I don't quite get how speeding them up is a solution.
TickPose doesn't rely on speed. It will move based on the time since the last call.
If you set it to 2x the speed for the Server, it will still not tick more often
Hmm yeah seems mine doesnt work in shipping but it worked in development O_o
well i don't need to make it tick more
i just need to speed up the animation twice
Welp guess i gotta wait until epic does something >? lol
If whatever you are doing works for you, I won't argue. ยฏ_(ใ)_/ยฏ
Yeah hes just saying its a hacky fix
ye but i think speeding up animation is also cheaper for cpu
Not even a fix, it applies to all animation
I tried increasing the rate, it's either too fast or too slow or just not sync enough
i want server sees everyone all the same
Anyway gave up on it, just gonna use dedicated server
I don't even mean "hacky fix". I simply don't geth ow it's a solution
It's two different things
my brain not big enough to dive into cmc
But it doesn't matter talking about it if it fixes it for them
Yeah i guess my only hope is epic fixes it (oh god) or maybe GMC fixed it
or dedicated servers which are out of the question
should a rts/moba with top-down pathfinding manage units as autonomous proxies with saved move buffering/replaying?
or is that overkill and they should just be treated as simulated proxies with reliable channel target setting
You can't really make them autonomous anyway afaik, cause you can't posses more than one.
Even if you manually change the role, there are, iirc, a bunch of checks for if the Char is properly possessed
i'm not using character/cmc. when i say autonomous proxy assume i'm referring specifically to saved move buffering/replaying
Ah
Yeah if you do that manually the world is open to you :D
But I would not I think. If it's "slow" movement, and the Player wouldn't notice it that much due to not directly controlling them, I wouldn't bother
i'm just wondering if its worth it. honestly my simulated proxies look better than my ap units when i do a "Bad" network emulation
even in out of the box top-down project, with "bad" network emulation the saved move replaying doesn't work well
Depends
The CMC works fine with high latency
Properly implemented additional movement should work fine up to 200ms+
"Bad" Network Emulation probably has Package Loss active, if you just use the preset, which is irrelevant for that kind of test
Package Loss will always f*ck things up. Package Loss testing is mainly to ensure that if things get lost, the Player doesn't get soft locked
Otherwise, Package Loss can be ignored
If you test the CMC with 1% package loss, it will already start having corrections
Which is normal
The point is that it only gets corrected, not locked
hmm this was not my experience, at least with the top down map
eg. the character teleporting around everytime it replays the buffer
ill have to check my settings
The camera has 0 affect on that
It doesn't matter if Top Down or not
Idk what the default tempate from epic does
But I have worked on and shipped Top Down titles
I know that the CMC works fine with high latency
yeah i know, i'm just referring to the standard template i was using
i started with my player owned units managing their saved move buffers, but leaning towards keeping them as simulated proxies after more testing
and sending the user target in reliable transport
then the next question is, should clients bother having a navmesh, or should it just exist on server.... currently i have it on both
If your Clients don't need the NavMesh, then it doesn't matter
But you might find other usecases for the NavMesh that Clients could in fact use
We used the NavMesh in the past for e.g. a "Route Ping", to guide the Player
Stuff like that
Depends on your Game though
true
i haven't checked the size of a FSavedMove, i know it has around a dozen vectors/rotators though
did you ever have memory concerns, i.e. 100 units, each with ~32 SavedMoves at any given point? @thin stratus
(assuming you could possess more than one)
Hm, never had that many with saved moves. That's battle royal Level of possessed characters
But that's more a bandwidth issue than memory
Memory is usually plenty available
Unless you plan on supporting old gen Xbox :D
yeah nvm its only 1088 bytes. thats tiny, even if you had 100x32 of them
Hello, what's the correct way of checking whether a player state is controlled by a local user? Is it possible to do without using the associated player controller?
On animation blueprint if I want to use root motion on a blendspace I need to turn on this setting but it says
Not suitable for network multiplayer setupsDoes it say that just because the values can't change in the blendspace every frame in multiplayer which would make the root motion inaccurate?
I want to use it for directional hit reaction animations so I just have 1D blendspace and I set the direction of it only when the hit happens and it is not a looping blendspace
Pretty sure it needs to go through the player controller to determine that
Maybe there will be a hacky way to do it but why
You should be able to get to the player controller from the player state
Alright, thank you
The standard way to do it is to compute a Cardinal based on the direction (left, right, forward, back, maybe diagonals too) and play the closest match. I've never wanted blendspaces to have root motion so not sure about that
Also, feeding it an exact direction vector over multiplayer is asking for desync, because a tiny difference in a direction results in a huge difference in position
That's 99% of the reason prediction is so hard with vehicles, because they collide and deflect
But if the server handles the direction set up and then it changes the animation blueprint to use the hit reaction movement
The direction set up only happens 1 time
Not every frame
I have it set up with front back left right animations using montages but it too inaccurate
That won't mitigate the issue unless the normal is 100% exact
Use 8 way instead of 4 way then
That would require 8 animations instead of 4
Yep
Cant do that
You can blend the animations together just like a blendspace does to generate them. Heck you can even do it using a blendspace and the record animation feature
Create a new anim graph, make it play the blendspace without loop, and record it playing
Ok that is something I could do
I've used this technique to generate anims many times, especially turn in place, blend a 90 turn with a 180 turn to get a 135 turn
Have you ever tried recording root motions? Or do I have to apply it manually later by editing the recorded anim?
It works with root motion for me
why does a network correction happen when player character bumps into corners?
I have no custom logic running, all default unreal engine movement code
Collisions are the #1 cause of network corrections in sane environments
They're expected and normal
Prediction is actually built with the assumption and intention that corrections will occur
Simulate some latency and walk around (into objects), there should be a few corrections that you can't feel and don't repeat or cause anything the player will notice, that's normal
If it's intrusive, then its not normal and something is wrong
Make sure your latency simulation doesn't have packet loss for this test
Thank you I see, I think these corrections are normal and not intrusive
i have a 4x4km world partitioned map with a bunch of generated partitioned foliage, when packaged the client build loads the level fine, but when running the dedicated server the process hangs after the first frame, no explainations just FUBAR, anyone else have similar issue with a "large" partitioned map on their dedi builds? (windows and linux are borked)
it loads all other non partitioned maps fine, can connect and alls well
Hello, did anyone get any issues with making a blueprint array RepNotified? Anytime I add a new element to it it doesn't call the OnRep server-side, but it does client-side. Is there anything I can do about it?
C++ or BP?
BPs
Your BP Array is not calling OnRep for the Server when adding an element?
Yeah, pretty much
How are you adding the element?
Through the add node
In BP, OnReps should be called automatically for both Server and Client.
Yeah, that's why I'm confused
Yeah, but I'm working in BPs now. I'll show you the example I'm running to get that result
This is my code to add the elements, and that's what I do OnRep
It's the player controller, and it's being created
It's likely because you're doing this on Begin Play which fires on both the client and the server. Put a "Has Authority" node immediately after begin play and then hook up your add to the Authority path and see if that changes anything.
I don't use any clients in this test. The onrep should be fired regardless
I appear to get similar behavior in such a set up. The OnRep doesn't get called on the server when adding to the array. I guess it's an oddity as it's not like you're setting the array. Doing this appears to get the OnRep to fire on the server.
If that's true it's absolutely a bug. If the array changes in any way it should replicate the change
It will replicate the change and call the on rep on a client because the change would come through on the client. On the server, it isn't replicating to itself.
Hey, Mike, long time no see! I assume you mean 4x4km landscape? If so, no, I haven't ran into that issue with any project/s some using 8x8km, 16x16km landscapes and my main project has about 20 2x2km landscapes over a total 100km space all with world partition enabled.
What engine version are you using?
After a quick search on google, it appears that this has been happening since at least UE 4.7 (~2015) if not earlier, so I'm sure it's been reported several times.
I'm with you - it would make sense for it to do so, but I can only suppose that it's due to a technical limitation of how they need to be able to expose the "Add" functionality of arrays to blueprints (it's a template C++ function) and that doesn't necessarily translate into being able to call the OnRep on the server when the change occurs, much like how you don't get OnReps called on the server in C++ to begin with.
https://issues.unrealengine.com/issue/UE-39186
It's marked as won't fix, because it's not a bug really, but by design. A desginer won't really know that adding an element array will call the RepNotify function locally, and hence you can never know what would be the side effects of such an action. Only SET w/ Notify will guarantee that. Not even Set by ref will do.
narrowed it down to probably something with pcg...
5.3
5 has been nothing but issues, was a big mistake upgrading ๐
Ahh, I have yet to mess with PCG so I can't comment there, but handy to know there might be something crop up ๐ gahh, UE5 has been a blessing and a curse, async physics, LWC, delicious exectaly what I needed and it came at the right time, by contrast, World Partition and the confusing information surrounding landscape HLODs, ehhh, not so much, they should have kept that in the oven a bit longer ๐คฃ
The annoying thing is that clients do receive the onrep. There's this little inconsistency
They should
To know whether replicated actor's code is running on a server (either dedicated or listen server), I often see most people use if(HasAuthority()) check. Assuming the replicated actors are always spawned on the servers.
Why don't we use if(GetNetMode()==NM_DedicatedServer || GetNetMode() == NM_ListenServer) check?
I'm trying to figure out some moderation tools for my players, I've been looking online for something to give me a template or something but I cannot find anything at all. I would of thought this is something that would be a prime example for a plugin or something, but apparently not. How would I get started with this very necessary part of a multiplayer project?
In my experience, HasAuthority is more consistent and easier to write. A lot of my code I want it to work equally as well in standalone single player as well as the listen server and dedicated server architecture, which if using Net Mode would require three checks like you wrote above or GetNetMode < NM_Client
It's also more clear in what you mean and that is very important when you have other programmers coming to work with you on it, or when you come back to it months later
I see. However, if(GetNetMode()<NM_Client) still works as expected when we accidentally spawn replicated actors on the clients. But it is out of topic as I already mentioned that the replicated actors are always spawned on the servers.
HasAuthority is indeed context depending and should be avoided if the code should not run on clients even if the actor is locally spawned. However in reality this basically never really happens and HasAuthority does the job just fine then
If HasAuthority should be avoided, then what should be used instead?
You mentioned if it should not run on clients, but is there a limitation to HasAuthority running on clients other than it should be a redundant check?
Well, Clients have authority over locally spawned Actors
So the check returns true for them
In that scenario only of course
NetMode would be better then
Or role rather I guess
having some trouble with getting a projectile to home towards other players. so backstory my projectile is more or less a carbon copy of unreal docs and at first it was replicating correctly, both players can see the projectile and can get hit by it, now I gave it some code to home towards the other player and this is where the replication stops tracking where the projectile is on the player who joined side. that is problem 1.
the other problem is the projectile only homes toward the player who hosted the lan this happens when either of the players shoot it will only aim for the host. the way homing works is it targets playercontroller. I want to user tags from project settings and I tried assigning the tags whenever the players choose to either host or join but the tags dont seem to stick.
I'm using anim montages to enable and disable melee weapon collision to deal damage. It works perfectly with listen server and client but when I set it to only client it seems to get a lot more misses
Hello ๐
I need to get a unique Network ID on an actor, and this ID need to be the same for client and server, I tried using GetWorld()->GetNetDriver()->GuidCache->GetOrCreateNetGUID(actor); but it gives me different ID on each clients/server, do you have any hidea how to achieve this ?
Does it need to be the actual NetGUID?
Otherwise maybe just since your own GUID as a member property?
I just need it to be the same on clients and server
Maybe I missunderstood what NetGUID is used too
Yes I can replicate a GUID property but I feel like it's dirtier than getting it through the Unreal network system
You are supposed to use the job board for this. Please remove this post and properly use the bot (explained in #instructions ).
So the server can see all clients control rotations but I need to replicate the listen server's control rotation to clients?
The Roll theoretically if you care about it
Yaw comes from the Character itself.
Pitch is replicated already and can be accessed via "GetBaseAimRotation" iirc.
Oh thank you, I was using GetControlRotation, so the value was 0,0,0 for clients because I assumed it was already replicated
GetBaseAimRotation works
helllo i looking for a developer that can help me with making a injection for coins like GM to gift player coins via chat maybe parse,, or ,,,,can be also if know cmds line for ,, AdminCommand" that takes in a command string as a parameter.- -
Bruv
read what the admin tell you
and bro that was not a job post it just says a payment but for store my gosh
What store? I don't know the context but if you want someone to do work for you, you can do it via #instructions
If you are not willing to pay there is #volunteer-projects
anyway just saying
not here to attack you
That is correct. The channel here is not to ask for someone to do something for you. Payment or not.
That's what the Job Board is for, which does have a "no payment" category.
If that's not your goal, then that's fine, but your message reads very much like just that
who asking to do >i asking little help , i only speak with high developers excuse le mua
I'm learning replication, is this a good way to correct movement? I'm assuming the projectile and rotation movement would be correct on all instances of the game unless it bounces off something so each time I send an rpc from server to clients
I don't think so, they should be tied to Time
what you have looks like a guarantee de-sync but I don't know enough
High developers?
Right now you aren't speaking with anyone, cause your request is as vague as it can get
Which is why probably everyone here will ignore that anyway, so good luck.
The ProjectileMovementComponent has a lot of Syncing already build in
In theory you only need to ensure that you have a Root Component that is your collision, and a Mesh Component as a Child that is your Visuals.
Then you can set the "Interpolated Component" on BeginPlay or via ConstructionScript on the Movement Comp to the Mesh
The Bounce will in theory happen on everyone
So you don't really have to do any RPCs here
I did this because I realized movement is slightly different on client and server sometimes when the object bounces. This is how I have it set up
Would enabling sub-step imrpove the experience?
So, you would in theory want the StaticMesh to not be the Root
but rather have a collision sphere for example be that
And the Mesh be a child of that
Despite that, you should also ensure that the Component and the Actor are replicated and set Replicate Movement to true.
There was sadly some stuff in C++ that I previously had to do to get this nicely working, but in theory you don't need to RPC
I don't understand why that's causing a problem, it's using a simple collision
Last time I used this was to simulate a Ball
It's not, but the ProjectileMovementComponent has logic to smoothing interpolate the Mesh when Root Collision will teleport
@thin stratus Question please, would it be viable to do Vaulting in Multiplayer using CMC without working with bits flag?
tutorial I followed in CMC does flags for everything, even for checking if montage is being played
I guess? Vaulting is usually instigated by jumping or not?
So you have the flag already
Oh I see, thank you
Last time I did vaulting I think I simply checked in the function that handles jumping (not the jump itself, but start and stop jumping), if I can vault via traces
Just want to know if I can make it a skill instead using GAS
And if so I vaulted, otherwise I jumped
w/o touching the CMC
Since that is already synced, it works quite well
anything that i can be fine finally someone that knows anything that can work o r i can work with thanks
What a wild chat
I'm probably not high enough to see the link between Admin Commands to grant coins and a QR Code Generator Plugin.
Ah, that's probably an easy one
Had to scroll a bit past the random shite
Please check the Mesh Component of your Character
There is a drop down for when to tick Bones and Pose iirc
That is usually set to only tick when rendered
Your "only Client" means a DedicatedServer is used and that doesn't actively render
So the Server basically doesn't properly tick the bones from your Montage
At least that's my best guess
So for dedi server, better use that setting for every component with collisions?
Not with Collision, mainly if it's animated
Like if you have a ADS for a your Weapon Holding
The missing hits from Dylan are probably cause the bones aren't at the same location on the server
Yeah if needed at least
Can't really say "Yeah always use it." As always "it depends"
Hmm I probably won't go that route. Client and server don't necessarily gonna be in the same place especially with ping
So, you shouldn't home to PlayerControllers
They only exist on the owning Client and the Server
You might also be using "GetPlayerController0" or jokes like that
Since that would explain that it always goes to the same
In our screen shooting another player head and running the trace on server gonan give different hit result
I don't think the Homing Target is actively replicated
So if you have some sort of replication here, you'd need to have a RepNotify variable with the Homing Target, and in teh OnRep function set that on Movement Component
Yeah that's normal ping stuff
You can decide to either punish the shooter or the victim
Or an inbetween fwiw
yup
But if you stand still, and you have an ADS Montage/Anim that lifts the arms
And you trace from the muzzle
You need that drop down changed
Even on ListenServer
So I made a sphere collision the root, set the actor and the collision to replicate and replicate movement, set it to interpolate, and I set the replicated component to be the visual mesh. The movement in client and server matches but the it looks very stuttery on client side
Cause if that ListenServer isn't there or doesn't look at you, you still have that issue
Are you setting the Velocity on both?
Or only on the Server?
I set the replicated component to be the visual mesh
The "Interpolated Component"
Also I'm not 100% sure if that alone is enough. I remember someone once saying there is a TickInterpolatedComponent or so, that is needed. But not sure that is exposed to BPs
I would need to open the engine
Sorry I meant interpolated
Are you setting the Velocity on Server and Client?
The main thign you need to keep in mind with the ProjectileMovementComponent is that it doesn't replicate anything internally
I'm calling this event from server to multicast, passing the actor that is calling it, then I'm casting that actor to a pawn and calculating the velocity from that pawns velocity
So you are sure this is called on both?
This is how I call it
I think one of the main issues is that this is not properly exposed to BPs... Epic please
/**
* Moves the UpdatedComponent, which is also the interpolation target for the interpolated component. If there is not interpolated component, this simply moves UpdatedComponent.
* Use this typically from PostNetReceiveLocationAndRotation() or similar from an Actor.
*/
UFUNCTION(BlueprintCallable, Category="Game|Components|ProjectileMovement|Interpolation")
ENGINE_API virtual void MoveInterpolationTarget(const FVector& NewLocation, const FRotator& NewRotation);
You are usually supposed to implement a bunch of functions on the Actor itself
And feed the MoveComp with stuff
/**
* Assigns the component that will be used for network interpolation/smoothing. It is expected that this is a component attached somewhere below the UpdatedComponent.
* When network updates use MoveInterpolationTarget() to move the UpdatedComponent, the interpolated component's relative offset will be maintained and smoothed over
* the course of future component ticks. The current relative location and rotation of the component is saved as the target offset for future interpolation.
* @see MoveInterpolationTarget(), bInterpMovement, bInterpRotation
*/
UFUNCTION(BlueprintCallable, Category="Game|Components|ProjectileMovement|Interpolation")
ENGINE_API virtual void SetInterpolatedComponent(USceneComponent* Component);
Posting mainly for comments
E.g. I usually override
/** Update velocity - typically from ReplicatedMovement, not called for simulated physics! */
ENGINE_API virtual void PostNetReceiveVelocity(const FVector& NewVelocity);
And push that into the ProjectileMoveComp
For BP only, all you can really do is ensure that the Velocity is the same and that's mostly all. The "ReplicateMovement" bool might cause some teleporting since the Mesh isn't interpolated apparently in BP only...
Sorry, I don't think I can actually help much with BP only. BP only is and forever will be a limitation in Multiplayer.
Also, the function you posted, does that result in the same velocity for both?
I would suggest you rather have a Replicated Velocity that you set from the Server
And apply in the OnRep to the ProjMoveComp
To ensure they both have the same
If the Velocity of the Pawn is different on Server and Client due to Ping, you'll get different results
And the Control Rotation you are using is also not a good idea, rather use GetBaseAimRotation
ControlRotation doesn't exist on Simulated Clients
I realized after I sent the picture and changed it :D
I'm going to check if the velocity is the same and if not, I will try to match launch velocities
If that doesn't work I will move this class to cpp
Thank you for all the help I really appreciate it
No worries, hope you can solve it
And hopefully that Mover stuff that epic makes will also replace this Move Comp
Hi, i have a beacon client that takes 3/4 seconds to connect (locally) it seems long, is it normal ?
Is there anything special about that Client or is it just empty?
I would say it's not normal
Maybe it's normal
You could use Unreal Insights and check I guess what it's doing
For the connection there is nothing special, but that's a minimalist beacon usage
Will try Insights to see what happen
I would say it's not normal
Maybe it's normal
โค๏ธ :p
Heyo
is it normal for the display name of the same Pawn to be different on Server in comaprision to Client?
When Actor overlaps it will print it's display name.
This print happens on both server and client , but they have 2 different names even though its the same actor.
Yes. The display names of actors appear to be generated locally. The reference to the actor over the network is based on a network ID that is shared between the server and clients.
sweet , thanks for confirming! ๐ค
Are steam lobbies natively supported or do I have to have an intermediate level for the lobby?
Im assigning a variable called "PlayerNumber" within the playerstate BP called "BP_PS_BaseSetup" .
When I simply cast to that PS and print the PlayerNumber variable it prints correctly. (Key Input 7)
But when I attempt to loop through the Player Array from the game state, It just prints the PlayerNumber variable assigned to the owner twice. (Key Input 6)
Any ideas on what im missing here and why its not printing all the player numbers from the player array?
Below is a video example
How are you assigning the player numbers?
(I mean, can you show your code for it?)
yes ! 1 sec
A very simple way lol , i know this is not ideal but just doing this for testing . But maybe thats the issue?
Begin Play fires on both client and the server.
So client ends up overriding the value.
And because the server is always authority, it would set the same value for both (1) and the client would end up setting the same value for both as well (2)
A table based on my experiments. ๐ This is for actors that are not possessed by controller.
ohhhhhhh i think i get it.
The host has authority , its going to run that begin play on all player states . Therefore all player states Player Number's assigned a value of 1
vice versa for client
Correct.
If a game has 3 players , in reality is there not 3 player States. there is 9 unique player states total?
is this somewhat correct? or am i trailing off lol
because each client has there version of the 3 player states
yooooo ,ty!
There are 3 unique player states, but it exists in 3 different places, giving you 9 player states, but really, there is only 3
hey guys is something wrong with unreal networking like... just now?
i got this message when i try to join my own server
can someone help me? I can't seem to replicate the
"Get Hit Result Under Cursor by Channel"
The damn thing just wouldn't send to the server for some reason ; - ;
Can you show your code?
sec
tried changing the code in various ways but still nada
server event works just fine when I tested it out for sending a custom set variable, but using the cursor hit just wouldn't sent over
The problem is because event tick runs on the server and you're setting the cursor variable on tick but the cursor location is not something the server knows about clients.
Don't set the value on tick unless you want it set on the remote client, this way your RPC will send it to the server so the server then has the value and it can set its own copy of the value.
; - ;
thank you kind sir, you relieved me of my 2 days' worth of suffering
I updated the my project with advanced session plugin and added the config and added the 480 appid. My steam invite is not working. So host creates the session and starts the game. Client goes to join session screen. Host invites client via Steam, and client accepts te invitation. Nothing happens. What else do I need to add or config?
any idea to why my character not spawning with custom skeletal meshes ? when a client connects my server, player controller creates a widget that uses game instance to save custom skeletal meshes to their own game ฤฑnstances. then get this values from their own game instances to apply values with ''updategrromassets'' to my character bp.
for now my clients now whats their face,body meshes i can print that out but server can see clients character but not in right skeletal meshes. clients cant see server or their character. in my character bp everyting(grooms and skeleteal meshes) has ticked with replicated to.
any tips ?
The host needs to load the map with ?listen
Hello ๐
Does anyone knows how FNetworkGUID is working ?
I got this simple script
void UMyActorComponent::BeginPlay()
{
Super::BeginPlay();
AActor* actor = GetOwner();
if (actor->GetIsReplicated())
{
FNetworkGUID net_id = GetWorld()->GetNetDriver()->GuidCache->GetOrAssignNetGUID(actor);
FString actorName = actor->GetName();
if (net_id.IsValid())
UE_LOG(LogFlecs, Error, TEXT("[%s] - New net ID = {%d}, is Server {%d}"), *actorName, net_id, IsServer());
}
}
But this output me the screen below, I don't understand why all my actors got different id on server and client, they should be the same right ?
here is where the netId is more useful when identifying entities in a networked enviroment
this is because Player_0 in server =/= Player_0 in clients
they are initialized based on FCFS basis, on clients, they will initialize the local player first before recieving replicated players from the server
I got it, thanks !
But what about the 3 movable cubes ?
im guessing the call is too early
hey guys anyone know any other way to make a api or payment communicate with unreal , either SQl , or by calling player name over parse , ofc the infidel that said the QR code wont work or relate sounds like a troll that not know anything of what the topic is , don't know anything of this topic don't opinion silly man keep smokeing crack ,A QR can call website and that can be the payout but that's not what i was looking for i looking for something more efficient and automatized
Would it be better to put a score manager on the game mode or state? If I wanted it to replicate, then the game state would be best but for server authorative validation it'd be best on the game mode. I've currently got the validation component on the game mode and the game state has a component that listens for this component and replicates it
I know my logic might be a bit flawed here, so that's why I'm asking for a second opinion ๐
guys a friend of mine would like to create a portal that leads to another world. Both players if walk through the portal get teleported individually. How would you go about this in blueprints?
Define another world
Another level?
yap
Only one map can be opened in multiplayer
Unreal don't support multi world out of the box
Think of the engine like counter strike or any round based video game
Clients just follow the server
So something like a mmo is not possible in blueprints?
Yup
Those MMO don't even use unreal replication system
They write their own
Unreal replication system is not made for MMO
Thanks man
is possible but you will need lots of work .come see me i may have a solution
you might want check open level by steam also wink wink ๐ , but will talk and i will show my skills since its been question
Hi, I have a question, I implemented a weapon switching with UChildActorComponent, where I create it in the constructor and attach it to "GripPoint" socket, in begin play I set it's class etc.
GunComponent->SetChildActorClass(WeaponClass);
if (AWeaponBase* Weapon = Cast<AWeaponBase>(GunComponent->GetChildActor()))
{ // do things }
but the issue is when I run as a server everything works fine, weapon is at his socket, but if started as a client, the weapon has a large offset, as on the image. Is there any solution for this or what Im doing wrong? I also tried to GunComponent->SetupAttachment(Mesh1P, "GripPoint"); in the BeginPlay but getting same thing :/
Hello. What are steps to create AutonomousProxy Actor on Client?
(Custom Autonomous Proxy Actor)
Did anyone else here run into the issue of a Server RPC being called later than when signaled in the code? I assume this has to do with some kind of lag or other stuff
In the picture above, OnItemDropped is a Server RPC
Instead of executing the function, the 2nd breakpoint is hit before the first function even starts executing
Then only at the end of this function does the server function get executed
Anyone know why this is?
I'm currently working on a FFastArraySerializer. Do I need to MarkItemDirty() if I'm modifying a non-replicated variable ?
nice way i also try this , but it lacks on something have u tired this method yet? this is not the method i was suggesting but a nice beginner a way to try obtain a simulation of a mmo BP only ๐
That's why you redefine the common perception of what an "MMO" is. IE - these games that have like 20-30 players in a session and call themselves an MMO ๐ง
What about the million unit RTS?
The solo-MMO. Comes out in 2050.
(was started in 1986)
Looking over some example code
Session->ClearOnDestroySessionCompleteDelegate_Handle(DestroySessionDelegateHandle);
DestroySessionDelegateHandle.Reset();
In previous session examples, I've never seen this .Reset(); step once after clearing the handle, anyone know if there is a benefit to doing it?
I'm trying to setup lobbies in steam using OnlineBeacons. Do you typically close out the beacon after traveling to the game or leave it running? Having a hard time finding any useful information. I have the clients connecting to the host and I'm ready to move them to the actual play world.
Have a look at the Steam Party plugin / documentation, should have some info there regarding that kind of stuff
Link?
Kinda hard to take a look without buying ๐
by going over their discord history / training videos you can glean a lot of info. It's a very niche topic that mostly relies on tribal knowledge to set up
I think from past experience (in response to your original question) that yes you can close out the beacon after traveling
But then there is the question of returning back to the beacon after a match is finished, you'd ideally want to stay in your party but not necessarily in a world together
So maybe in that case the beacon should persist
Well my situation is not a party but just a lobby, imagine Fortnite pre-game lobby but just in the main menu rather than in another level
The problem I'm running into is when I travel on the server, the beacons are destroyed since they're actors in the current level
so they lose connection, which makes sense
so there has to be some sort of transition that I'm missing. I'll see what I can find on their discord
I cannot damage my client :/ they wont take damage.
so far the damage test is this:
inputs are done locally only
Apply Damage is only called on Server
you can hover over the computer icon it will tell you
if you are On Client you need to call Server RPC in this case
did you say you cannot damage the client tho?
Server should be able to damage client, try to check your on Take damage event
Create custom event
Click on custom event and set it to "Run on server"
Attach the Apply Damage function to the custom event
Call the custom event
Quick question for anyone who knows: I'm having an issue with spawning a replicated actor on the server and attaching it to a hand socket. It obviously works fine on the listen server, but clients don't seem to respect the attachment location, so it ends up off screen in random positions. Is there anything specific I should be watching out for to ensure it attaches properly? Or should I possibly be doing attachment on the client side as well after it replicates?
It is sensible to handle attachement on both sides.
I was able to get a separate actor connected on the server so it appears to be the specific actor that wasn't working. Commenting/debugging to see if I can find the issue now. Thanks!
You need to make sure that whatever your attaching to will exist on both the Server and Client as well.
i need to assign different roles to both players. I wrote something like this but it doesn't work. What am i doing wrong ?
If you need to assign different roles then why are you randomizing it?
If they both roll a 1 then they will likely end up the same
Depending on the value of whatever that bool is
becuase it's a tagging game. Tagger must be random at the start
if there is a tagger, i need to assign a runner too
i created that bool to check if there is a tagger already
make array, shuffle it, first one is tagger, the rest are not
what you're doing right now is going to run that rng for every player
so you might end up with 2 taggers, or 0
how am i going to assing if i shuffle them, variable default is tagger and the other index is runner.
Shuffle the array of players or whatever, then assign the first one the tagger and the rest the other one
You have to do this from somewhere else besides the character unless you want to use a race condition lol
controller sounds better
That wouldn't be much better as it'd still roll different random numbers. I'd do it in GameMode probably
but i want to change roles when someone tag them, doesn't that means i need to work on controller ? or i need to cast to controller in some point i guess
multiplayer is so complicated for me
Multiplayer is very complicated
Tagging is different from choosing the first tagger
honestly just let the first character be the first tagger
beginplay -> has authority? -> if player pawn 0 = self -> true -> I'm the tagger
So i don't know how am i supposed to take player pawns with begin play and did it like this. Seems like it's working but i can't get any print strings for remote ๐
How do you treat save from a dedicated server ? Really different from classic host-client save ?
Maybe Iโm missing something
Save files are always local to the machine that you're currently running on. If you save while executing on the server, the save will be saved on the server, regardless if it is listen or dedicated. Same with loading.
Thatโs what I guessed so code can be the same if it can be hosted by anybody or on a server
Thatโs was my assumption, asked to know if there was something tricky.
Loading through game Mode ?
How you do it will depend on your game
Is it basically a singleplayer game where players have little consequence towards each other, but you want them to be able to play in the same world? You can probably let them save/load locally and then send the loaded data to the server
Is it a competitive game? Obviously you'll need a different solution, such as a database with account support etc.
It can be as simple as a save file per player
like Minecraft
Minecraft makes a save file per world and one per player on the server
Where is the code that tells all connected clients to travel when you call ServerTravel?
AGameModeBase::ProcessServerTravel
Which is called by UWorld::ServerTravel
That ultimately calls AGameModeBase::ProcessClientTravel
That calls the Client RPC APlayerController::ClientTravelInternal
Which does a Seamless Travel for that Client.
But doesn't ServerTravel travel ALL connected clients?
If you read the code that I linked you would see that it calls it for all Clients yes.
ah ok. the way it was worded made me think just the client calling ServerTravel
Thanks
Clients dont call ServerTravel, only the Server would
Which would make it not a Client
ok
APlayerController* AGameModeBase::ProcessClientTravel(FString& FURL, FGuid NextMapGuid, bool bSeamless, bool bAbsolute)
{
// We call PreClientTravel directly on any local PlayerPawns (ie listen server)
APlayerController* LocalPlayerController = nullptr;
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
if (APlayerController* PlayerController = Iterator->Get())
{
if (Cast<UNetConnection>(PlayerController->Player) != nullptr)
{
// Remote player
PRAGMA_DISABLE_DEPRECATION_WARNINGS
PlayerController->ClientTravel(FURL, TRAVEL_Relative, bSeamless, NextMapGuid);
PRAGMA_ENABLE_DEPRECATION_WARNINGS
}
else
{
// Local player
LocalPlayerController = PlayerController;
PlayerController->PreClientTravel(FURL, bAbsolute ? TRAVEL_Absolute : TRAVEL_Relative, bSeamless);
}
}
}
return LocalPlayerController;
}
Loops through all Players and calls that RPC
So how would this work if you have a lobby in the main menu using OnlineBeacons since they don't create player controllers for the clients connecting
In that case they arent Clients either, because they arent connected to a Server.
A Beacon is just a Window into another instance of Unreal essentially.
You can pass data through the Beacon.
Thats it.
Its a "soft" connection
Where as being literally connected to a server would be a "hard" connection
So the rules are different then
If you are using Beacons, you need to literally tell the users on the other end what they need to be doing.
If you have a Host and Party Members (that might use Beacons as part of a Lobby so they can chat etc).
The Host would find a Session to join.
Once its found one, it would communicate the Session info the the Party Members
So they can also find it and connect to it.
so in my situation, the lobby host is also the session host
So then you would just tell the Party Members to search for the Hosts session?
well there is no host session yet
because it's still in the main menu
well the session exists, but the map hasn't been loaded yet
so when you load the map, the beacons fall apart because the world where the beacon actors live is being destroyed
I tried putting the beacon actors into the SeamlessTravelList and that didn't work either
Thats your problem, you need to manage your Beacons better.
Do you have any suggestions of how I might do that?
Not sure what I did wrong then. I created an array in the game mode and had the related beacon actors add themselves to the array when they're created. Then in the GetSeamlessActorList or whatever the method name is in the game mode, I appended that array
๐คท Maybe you need to debug it a bit further
The only thing I can think is that they're getting GC'd after the travel since it's a new gamemode type so I'll probably try storing them elsewhere
i just realized i can start the same quest twice while im already doing that quest and im trying to solve this. im thinking a boolean like "on quest" but the issue with this is that they can do multiple different quests at once and choose to track whichever they want so the "on quest" would stop them from starting a second quest until they completed tht quest (this is multiplayer, where each player has their own quests)
would anyone know a way to store this variable maybe in a different place? im just trying to figure out how i can make sure they can't do start a quest while they are already on that same quest, but they can start other quests etc
What is it that you are using to identify a quest uniquely in the first place?
yea i thought about this, but then the issue is if another player is interacting w it. i have quest givers that are childs of a quest interactable master
So in the quest system that I was building, each quest is a data asset, and that data asset is given a unique ID (just an int32).
If the quest is active, a "Quest State" is created which replicates only to the owning player of that quest. An array is managed locally on the client and the server of all active quest states for that particular player. The QuestState contains the quest ID and other details about the quest, like the objective progress etc.
Any logic I need to validate if a player is on a particular quest, I just have to get the local array of active quest states, loop through it and check for that particular ID. If there is a QuestState with the associated ID active, then the player can't request to start that quest again.
Hi everyone. Is there character movement error correction in character movement component? Character movement replication looks fine at first, but when player slightly touches an object or corner, he can stay in that place on his client, and run further on the server or other clients. What can be the problem?
Hey there quick question:
I want a client to travel to a solo map for some time (open level or client_travel...), how to make that client come back to main server map?
well ok I can also do that but how the client can come back another travel ?
Client 1 is connected to main map .
Client 1 enter private quarters > open a local map...
Client 1 goes back to main map.
is it something that people do?
make a VM with another steam ๐
i get this warnings. Anyone knows how to fix it? I use first person preset and didn't change anything related to movement
I am creating a session with my UMG here!, which seems to be working as I get the correct print message, and then once in the level Im trying to find the session in the server browser here, But its not displaying but keeps giving me a server detected message,.
If Im making an online RTS
is it better to just simulate inputs each tick, send inputs each tick to each player and let each client calculate everything manually?
Eg this guy pressed LMB at 24:35, calculate all the movements on his client side instead of sending each units position
no fog of war btw
Help Im trying to find sessions In VR but it never finds any?
even this finds nothing , What Am I doing wrong?
Hi,
I'm trying to teleport my users to a point on the map but I didn't find how to do it in multiplayer
It seems that I'm wrong with the server part of the teleport
Do you have any clue?
I had the same problem with sprinting but I found the solution
I try to do the same with teleport but nothing work
I'm sorry, I found my problem
I feel like I just learned something about multiplayer but not entirely sure, if someone can shed some light a bit if Im right:
-
inside PC (blueprints), I do a getActorsFromClass, set a variable with the actor placed on the level, then I call a RPC with some info regarding that actor (position), and it fails.
-
same thing as above, this time I spawn the actor inside the PC instead of fetching it from the level, it works just fine.
Is this somehow related to ownership?.
Hello does anyone have any idea why my character shrinked after i putted idle-walk-run anim to it?
Hey quick question :
I'm watching a tutorial where the person is doing the counter of players for a battle royal at the top (so the counter before the match showing how many players are in the game) and created 2 variables in the gamestate being CurrentAmountOfPlayers and MinimumRequiredPlayers and what confuses me is that he made both variables replicated, and it confuses me because I though the GameState was both on server and client, isn't that the case ? Or it's the case but variables there have 1 version for the client and 1 version for the server which needs to be replicated to be synchronized ?
Please ping me if any answer ๐
The object is replicated. You still need to tell Unreal which variables need to be replicated
If there is never ever going to be a way to change the minimum required players, then it probably doesn't need to be replicated and could just be read locally. As you'd most likely set the default value.
But what if instead of replicating CurrentAmountOfPlayers, you get the GameState each time and get its value, wouldn't it give the right value when that variable changes ?
No. Because the value is not replicated
Oh interesting, thank you ๐
Also he's checking if CurrentAmountOfPlayers is bigger than the MinimumRequiredPlayers to start the game in the GameState, aren't we supposed to do that in the gamemode rather ? ๐ค
Honestly it doesn't matter too much.
You typically put stuff like this in the gamemode, sure (because it only exists on the server itself, so safer)
probably due to it being a video tutorial and trying not to make it too hard to follow
But you can certainly check the starting condition inside of the gamestate and then have the gamestate tell the gamemode to start the game as well.
lots of youtube tutorials i find hard to watch cause it seems like they take shortcuts to make the video easier to follow
I don't think it's the case here because it's a full battleroyal so not easy to follow if you don't have the basics
The documentation makes it sounds like an unreliable RPC will never be called if there's a problem with the network. Is this true or will the call eventually execute?
By default, RPCs are unreliable. To ensure that an RPC call is executed on the remote machine, you can specify the Reliable keyword
yes if its dropped it wont be resent
@fossil spoke Ok, I got the beacon stuff persisting through world changes.
The issue now is that when the Host moves levels and tries to send an RPC through to the clients, the error is that the RPC can't be sent because the BeaconNetDriver doesn't have a valid world. Note, during this step, the BeaconNetDriverpoints to the current World but the World does not point at the BeaconNetDriver.
I added logic so that when the BeaconHost moves worlds, it updates the BeaconNetDriver's world. I no longer get the above error but now the error is that the RPC cannot be sent because the client isn't in the same world as the host.
To fix that, I added a delay after the client receives the Connect RPC. This seems to work correctly but then the client tries to connect after a few seconds and it's successful but then the server immediately crashes because the current World has no NetDriver.
To fix that, I would assume I call UGameInstance::EnableListenServer(true) like I was prior to setting up this lobby stuff. The problem there is the new NetDriver interferes with the BeaconNetDriver and sends this error.
LogSteamSocketsAPI: Error: SteamSockets API: Error Cannot create listen socket. Already have a listen socket on P2P vport 7777
Which makes sense because the BeaconNetDriver is listening...
Ah because they're listening on the same port...duh
i want to thank @grim saddle for helping set up a my mmo Store and administer table and even a mini tool to track player connected Truly genius guy
Unreliable is for RPCs that you are spamming all the time and are time sensitive (inputs, directions, etc), or for stuff you don't really care about.
Aim Direction should be unreliable because by the time you notice that it got dropped, it's out of date anyway
Opening a door in a level should be reliable then because it's not spammed and if it gets dropped the door will stay in its current state until another rpc successfully gets called?
Yes, that should look like TryInteractWithObject(TheDoor)
You would be passing the door ref to the server in the rpc, or you could just pass the fact that you pressed the interact button and let the server do the interact targetting for you but that could feel goofy
need some help with a homing projectile method talked about this a few days ago and was given good advice. it now homes towards player pawn but I dont know how to get the homing projectile to home toward other players. if a client joins they can shoot and it will home towards the host but when the host shoots it also aims towards itself. how do I differentiate between the 2 to make homing work properly?
Show your code for how you set the homing target
it is based off of a low of experimentation with my original tyring to get player controller but here is what was created so far:
AActor* AAdrian_Projectile::FindTarget()
{
UE_LOG(LogTemp, Warning, TEXT("Hosting"));
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(this, 0);
if (PlayerPawn)
{
ACharacter* PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 0);
if (PlayerCharacter)
{
return PlayerPawn;
}
}
else
{
ACharacter* PlayerCharacter = UGameplayStatics::GetPlayerCharacter(this, 1);
if (PlayerCharacter)
{
return PlayerPawn;
}
}
return nullptr;
}
That smells like Get Player Character 0 shenanigans
What's the most simple and general rule for what the projectile should choose as target?
other player. the game is a 1 v 1 type of shooter. it only needs to home towards whoever is the other player
So it needs to home to whichever pawn is not its owner or instigator
yes
Are you setting instigator?
no
remember the client doesn't have both playercontrollers on their machine, just the playerstates and pawns
ok. so I just need to figure out how to set instigator. and use this to correctly home the projectile
The point is you need to figure out which pawn is yours and home to the other one
yours can be the one set as instigator
or the local one
if I have an actor that spawns another actor, should both be replicated or its enough for only the initial actor (the spawned by action originated from the player) to be replicated?
whats the correct approach when thinking about this
Replication only happens from server to client. If you spawn an actor on a client, it will not be spawned on the server and replicated to clients even if it is marked as replicated. If you spawn an actor on the server that is marked as not replicated, then it will not replicate to clients.
If you want an actor to exist on the server, and have clients be able to access that actor and read values from it, then it needs to be spawned by the server and marked as replicated.
Right, Im calling an RPC that's marked as "run on server" in the blueprints, that part works just fine
what Im curious about is what happens if those actors want to spawn something on their own, example, a barracks that spawns units.
they dont need your user interaction, so that means they shouldnt be replicated?
If you want other clients to see the actor, it needs to be spawned by the server and marked as replicated.
however currently the actors being spawned are not marked as replicated (the ones spawned "second") and it works
I can guarantee you it doesn't. You are likely spawning the actors locally, and not a replicated copy.
right, in the event that the game is deterministic
it should in theory work
right?
Sure. This then means that the server would not have any authority of those actors.
right
This also means you can't reference that actor across the network at all.
so.. if one of these secondly spawned actors would cause damage to another actor on the enemy team, this logic would probably get more difficult or different
or the damage will be "invisible" to some client
so maybe I should also run the RPC whenever the actors spawn a second actor
to make sure I dont run into problems
Hi, if i change a replicated value then destroy the object, will the value be replicated before the destroy event ?
not necessarily
mhh
So if i have to send/update a value before destroying i have to use a rpc i guess
That's not guaranteed either
just don't destroy it right away
A reliable RPC might be guaranteed but I'm not sure
Yes but if the destroy message makes it to the client before the RPC message does then what
for a transmog / shapeshifting system where the original skeletal mesh of a character is changed would it be better to use a repnotify over lets say a replicated variable with a multicast to convey the visual change to all clients including those that arrive on the scene later?
@elder sable @dark edge Just call TearOff() first. Then you can destroy it. The Client will have to destroy itself when it receives the last state.
Seems a good solution thanks !
Lyra replicates float ServerFPS;
But from what I see, its only ever used by performance stats
Is there a reason why this wouldn't be incredibly wasteful other than dev purposes?
It also is the lone reason why they need their gamestate to tick from what I can see
Is your DM a red van that says free candy or something
Well that's a super weird thing to come here and say
How to make advanced online?
Hey guys!
I was hoping someone could help me. When I use either of these nodes, the result seems to be the same. What exactly is the difference between these two? If you are the server, you must have authority right? Therefore if you have authority, you must be the server?
Server is often authority
But not always
I see that the newly arrived alien is learning to blend in with the humans
A long road ahead
Nothing
The trolls get stranger each year
Interesting ๐ค Do you have an example where Server does not have authority?
If the client calls SpawnActor they will have authority, and no one else will be able to see it
Ah I see. Quite a specific case (perhaps less common case), but noted! Thank you
<@&213101288538374145> there is a low effort troll here
Go to #lounge , this isn't the place for it
Hi I have a question, I'm making weapon swap with this implementation ```cpp
PrimaryWeapon.Ammo = WeaponInHands->GetAmmo();
PrimaryWeapon.ClipSize = WeaponInHands->GetClipSize();
GunComponent->SetChildActorClass(SecondaryWeapon.WeaponClass);
if (AWeaponBase* weapon = Cast<AWeaponBase>(GunComponent->GetChildActor()))
{
WeaponInHands = weapon;
WeaponInHands->SetAmmo(SecondaryWeapon.Ammo);
WeaponInHands->SetClipSize(SecondaryWeapon.ClipSize);
WeaponInHands->OnAttachWeapon(this);
UE_LOG(LogAlphaCharacter, Warning, TEXT("Ammo: %d"), WeaponInHands->GetAmmo());
}
SecondaryWeapon = PrimaryWeapon;
PrimaryWeapon.WeaponClass = GunComponent->GetChildActorClass();
PrimaryWeapon.Ammo = WeaponInHands->GetAmmo();
PrimaryWeapon.ClipSize = WeaponInHands->GetClipSize();
WeaponInHands->Multi_CopyPropertiesToMesh(WeaponInHandsTps);```
Where those primary and secondary weapon are replicated structure with only class and 2 ints (also WeaponInHands is replicated as well) and it's a server rpc. The problem Im getting is when I switch weapons on client the ammo is always full till you fire one bullet and then it's correct, but that log there, is printing correct bullet number. Is there any way of force update a variable on the client? P.S gunComponentis a UChildActorComponent
People be nice to each otherโs. Thanks!

Its not a matter of being nice, that person is just trolling the chat
I have a replicated array implemented with FFastArraySerializer. The array itself gets filled up only at begin play and then only elements properties change so no adds and no removes. But after profiling with unreal insights it seems that for some reason sometimes the array replicates entirely (according to the size of the packet) and it happens kinda frequently in between individual items replication. What could cause it? ๐ค
Relevancy perhaps?
hmm, i don't think so. I tested with only listen server and client and there wasn't a situation where either client or server was close to the replicated actor and the server/client wasnt
at least from how I understand relevancy - it shouldn't be the case here
And the actor doesn't go dormant or anything?
unless it does it automatically for some reason - it shouldn't
besides, even if it went dormant, how could it cause the whole replicated array to be sent over again and again?
Dormancy closes the actor channel, it just doesn't destroy the actor on the client. When the channel is closed all replication state is lost so it'll be sent again when the channel opens.
and I must add, that sometimes i can see in insights that there are packets of adequate size, like I can tell "ok at this moment one element has changed it's ok"
hmm, can it happen automatically/initiated by the engine or should I look somewhere in the code base (i'm working on an existing project) if somebody has done it before?
Nah dormancy is opt-in so you should be fine. Relevancy would be my bet usually. Also just to check, the fast array is a member property? It's not embedded in another struct or anything?
Fast Arrays can only be members of UObjects to work correctly
yeah fast array is a UPROPERTY(ReplicatedUsing) in an actor
Yeah ok, should be fine then. And how large are the packets?
Fast Array does have some base overhead
~10k bits, and the array itself is 80 elements of 48 bytes per element
yeah kk. I would double check to make sure it's not just relevancy first. If not, check you aren't accidentally marking every item in the array dirty or something
Also, you definitely defined the TStructTypeTraits and NetDeltaSerialize functions?
yeah, I double checked with the NetSerialization.h and a manual I found on the internet
So long as it's showing up in insights as fast array serializer you should be fine
All I can think of really
hm, how do I check that?
I mean how do I verify in insights that the array is replicated as/with a fast array serializer?
I haven't got a screenshot to hand but you should see things like 'ChangedElement' etc.
hmm, i'll look for that
Just make sure you have this defined too:
struct TStructOpsTypeTraits< FExampleArray > : public TStructOpsTypeTraitsBase2< FExampleArray >
{
enum
{
WithNetDeltaSerializer = true,
};
};
it's all here
To be absolutely sure, you can breakpoint NetDeltaSerialize to ensure it's being called
yeah kk, in that case the only reason I can think of would be relevancy
can you elaborate how exactly relevancy can be of issue here? The replicated actor is an AI character, AFAIR they have very far net clipping distance and high priority, and since the levels are not that big I don't really see how client and listen server being close to each other can end up in a situation where the replicated AI character will drop out of relevancy for the client ๐ค
Well ultimately if the character is not relevant for the client, it's actor channel will close destroying the replication data. When it opens again, everything will get resent
You'll likely see other properties replicating as well though, I think insights shows when the channel is being opened
yeah, I just thought that for an actor to become irrelevant, i'd have to be very far away from the client
There are other conditions too but yeah that's the main one
The default distance is only 150M, so not that far
hmm, is it possible to somehow preserve/update only changed replicated properties in case of losing/gaining relevancy and hence closing/opening actor channel?
there won't be more that 1 instance of this actor so maybe I could get away with that
but then again, can in be the relevancy issue, if, judging by the packets size, there is a 10k bits packet at 11m 26s, then 3 small packets in the following 3 seconds (~200-400 bits), and then 3s later at 11m 29s boom - another 10k bits packet ๐ค
also another question. before profiling I noticed that my OnRep_ReplicatedArray triggers very often, I didn't pay much attention to that, but is it ok for a FFastArraySerializer to trigger OnRep of the array itself if I don't add/remove any elements?
Hmm well it should only trigger if data is actually changing
And also requires that you mark either an item or the array dirty server-side.
well properties in individual elements do change frequently, but should it trigger the OnRep function?
Well that sort of explains it then, if each element is changing often, that could potentially trigger large updates
For Arrays which have fixed sizes and do not shuffle their elements, normal TArray replication usually works better tbh.
And yeah any change to the array or it's elements will trigger the OnRep
well, the problem is that I need to react to individual elements changes, so I use the PostReplicatedChange of the FFastArraySerializerItem
The main benefit of fast array is that you get per-item callbacks about changes, and it's more optimal for large arrays where elements are removed from the middle of the array, since it doesn't preserve order.
But those benefits come with some overhead
You can still react to individual changes to a TArray, you just have to do the comparisons yourself.
I still wouldn't expect to see a 10K update though either way
Unless the element is enormous and has lots of changed data
but if I removed FFastArraySerializer, wouldn't it mean that every change of an element inside array is a replication of the whole array and hence every time I'll get a 10k bits packet?
No, I don't know where that myth started but TArray doesn't replicate entirely everytime an element changes, it also does delta replication.
huh
TArray also only replicates changes. The difference is that TArray identifies items by Index, so if you remove something from the middle of the array, it's hihgly likely all elements after that one will trigger a 'change'
so I could just have OnRep_MyArray(const TArray<FMyElement>& OldArray) and manually (since there are only 80 elements) find the changed ones?
You can yeah
huh, ok, I'll check a couple of things with the fast array, and if that doesn't help, I'll try to switch to regular array, thanks for the help
You'll probably find the updates will be much smaller anyway. TArray deltas are generally smaller so long as you aren't changing the order of elements.
The latter is what Fast Array is meant for typically
yeah yeah, in my case, array's amount and order of elements is changed only at begin play
yeah in which case I'd probably go with TArray myself
Or even make it a static array, to save a tiny bit extra
static arrays will be "unfolded" into individual members so no index is needed to identify the item. Don't think that works with OnRep though.
oh, i'm a dumbass, it seems I do mark all elements dirty on the server in one case where I forgot to add a check if element actually needs to change. well, thanks for sharing the knowledge anyway
Make an editor module that create replicated variables :p
Or mark a selection of variables as replicated
Or improve your apm as Laura said :p
ha
when i played sc2 alot i had 270 apm
crazy
hey another issue
this is a common one im always having for some reson
this is a "freshly" made project
the right screen is "listen server"
the left client
se how "clitchy" or laggy or something it is when im running
stutters*
ideas ?
Client seems to get corrected 24.7 by the server.
You shouldn't replicate w.e causing the lag (eg. The rotation) for the local client.
Local client will rotate as it please , send the value to server via rpc. Have rpc replicate the values to everyone except the client that send it. To avoid snapping on other clients, make the rotation interpolate to the incoming value
hmm
Hi, i tried this solution but when i destroy my object server side, the destroy event is still called client side, even when i call TearOff first
Those actors use a beacon connection, maybe that's a problem ?
@dark parcel
so yeah this is how im chaning the rotationm
your saying not do it locally to
Think about this if you are just replicating a variable to rotate and have it replicate to all client.
Your client rotate over an axis over some time.
Time 0, player rotate by 5 degree. Send the value to server, server hasn't got anything yet in time 0.
Then time 0.1 server gets the value. 5 degree to one of the axis and going to replicate this to all client.
Still at time 0.1 the player that send the rpc already rotate by 10 segrees.
Now time 0.2 player rotated by 15 degrees at this point. Server now comeback with the replicated value which is 5. Now wat happend is tour client get rubber banded back to 5 degree rotation.
yeye that makes sense
thats what i figured was the problem
im not sure how to solve it
I would pay some money to get Stephen tutorial. It really helped me to understand the challenges in multiplayer game.
Not saying that I can do MP atm, infact haven't done a single MP yet. But when I'm stuck I will fall back to his explanation.
yeah but i mean is this what r talking about basicly ?
but this is wrong
instead of locally controlled i have to chek is self or something
Again im not in a stage to make multiplayer yet. But I would have 2 variables. One for the client, the other for proxies. The one for proxies, send server rpc and have clients interpolate to the incoming value
Mp is hard , I am happy to spend some money to get some insight which would take me very long time to understand
hm but what your saying makes sense your ready for mp :z)
yeah but this seems like such a basic thing to solve and should have a simpler way
You probably don't want to set the actor rotation of the local machine. It will get rubber banded. Also don't think you need rpc at all for rotation. Perhaps a replicated rotation and interpolate on ticks for proxies
Just pure speculation tho, hopefully someone experienced have answer
hm
i mean this makes it better but not 100%, and yeah hopefully someone with experience could help out
but what ur saying makes 100% sense tho
its just the "how" thats interesteing
Why are you doing that anyway?
If you are using Characters and the CMC; you already have Rotation Replication via the ControlRotation
yeah but this is for a custom movement system basicly,
or u mean i dont need to rpc if i replicate the CMC
and if i just set/add actor rotation it would replicate
The Client sends its own ControlRotation to the Server already via the CMC
That's why doing AddControlYaw or whatever the node is called, locally from Input, simply works
Custom CMC movement cannot and will never work with just BPs (at least in its current form)
You can't just start RPCing around
You will always get corrections
Either use the stuff that exists already or use C++ to extend the CMC
hm
i get what your saying i think, but if i modify the CMC teh nit should replicate right ? then why is it not working for me what am i doing wrong ?
or do i have to use the Inputs function to make it replicate?
ok so i guessing you did not try it or not understood also that beginner +giving wild advice don't go together either .
Have I misunderstood what BlueprintAuthority means? In my build, it seems to be be skipped over when in standalone net mode
Does TearOff works for beacon connections ?
He's been trolling for the past few days
Imagine not shipping a no code MMO lol
Hi, i tried your solution but i'm not sure TearOff is working with beacon connection. I could maybe bypass the destruction client side but do i have the guarantee that the state will be replicated to all clients before the actor is destroyed server side ?
seconding this, some of the stuff people ask in here involve stuff that is too long to explain and the people asking would be betting off taking a course that explains how it works at a fundamental level.
Hello, I'm working with the FFastArraySerializer and I have a question.
Any reasons that could explain why the PostReplicateChange is not called if the array is marked dirty twice pretty fast
I tried to call AddItem() twice in a row and I found that PostReplicatedAdd() was called for the first item and PostReplicatedChange() was not called for the second item (this function over the first one due to stacking rules changing the stack count). This scenario only happens if I add 2 same items
Otherwise, PostReplicatedAdd() is called for both items
Maybe it just needs time for updates which explains why little delay (even 1 tick) works
Hello, all. I am struggling to get Seamless Travel to work again. I have created an empty Transition Map, set ALL of my GameModes to have Seamless Travel as TRUE, and call GetWorld()->ServerTravel(...), but a Standalone game instance still hard travels to all maps. Why? What am I missing here? Thanks
Ah. So because the game is running as a Listen Server, the seamless travel doesn't work as I am expecting (for the Listen Server/Host)?
Multicast what?
What? That's not how Seamless Travel is supposed to be done.... at least according to https://wizardcell.com/unreal/persistent-data/
Are u guessing or that's what actually should be done?
I don't do multiplayer but reading from the document only server have to execute server travel
Client will follow automatically
Yes exactly
HOWEVER, my seamless travel is not working as the documentation describes
Is it because of a Listen Server issue? Because the docs don't really talk about that
Is this a ChatGPT bot?
because that makes no sense
EXACTLY WHAT A BOT WOULD SAY
Joking, of course
But yeah, I have some things set up for replication, but that shouldn't matter for a Standalone Listen Server.
Just gonna leave it here
I see nothing about replication or w.e
It says just make the server call the function
What I am expecting is that Standalone Listen Server will Seamless Travel to the Transition Map for a moment, then Seamless Travel to the new map and run the overridden methods on the Destniation GameMode
Yes. Notably, it says nothing about a Listen Server
I'm still stuck with single player part on my end so I have no clue
In fact, ALL of the Epic-written documentation I have seen completely ignores Listen Servers. They are written exclusively from the perspective of a Dedicated Server with many remote Clients
Docs r fine, just not the generated one for nodes
I wouldn't think it matters whether listen or dedicated it should function the same. I wish I could help more with it myself, but I haven't really done anything with travelling and that doc is probably the best resource for trying to get it working.