#multiplayer
1 messages ยท Page 625 of 1
I didn't say it would
Which is what matters
Yeah, he asked about something that doesn't exist
the column Update Hz doesn't exist?
https://youtu.be/hiHP0N-jMx8?t=524
Here is what i meaning update frequency. If ill leave as 100 as default this will bite my butt.
In this video you will learn about basic computer networking, update rates, tick rates and a lot more which affects your online experience. I also tell you the reason behind "super bullets"!.
This video is an extended version of the "networking basics" that I used to include in my Netcode Analysis videos. Due to popular demand, I will no longer...
Bye
@bronze arch https://softwareengineering.stackexchange.com/questions/80084/is-premature-optimization-really-the-root-of-all-evil
better to make everything work first and then fix stuff later when there's a problem
Game is ready, just one job left for test spamming instances. I wouldnt mind if its 1 hz or smth but 34 this may bit my butt while 100 instances. You will still check the variables 34 times if its changed or not to sent over clients, That how updatefreq works
you'll know it bites your butt when it shows up in the CPU profile
But i cant see on cpu profile ๐ฉ
There still have 0.8ms "self" network, no more info
2ms isn't even one whole feature of a commercial 60fps game
there's nothing to optimize at this point
You've heard valorant?
My goal was at least reach 500 fps
But i cant forget on server side too
what about valorant?
imo 500fps is kind of an unrealistic and senseless goal but that's your business
Well i've already reached 450 fps while 100+35 AI character minion actors in one map while replicated.
35 minions spawning 60 second per, Statistic may change depends minions alive or dead
I was posted same image some ago
At this scene you will not see other actors but theyre still ticks, character movement, skeletal mesh, codes etc
Even animation blueprints
I thought if i changed a replicated variable on the server, The client would be updated but that isnt happening. Do i have to use a multicast function to set the variable? I was trying to do a run on server where i pass through camera rotation and only server would see it unless i set it in a multicast function.
Stranger is correct here, pretty sure engine processes replication every frame
Net update frequency sets how often that actor should be considered for replication but in this code example it is entirely pointless, if it has nothing to replicate it won't replicate, if it replicated it clearly had something to replicate
what is the Update Hz column in his network profile counting? it's not equal to the framerate
it makes sense that it checks updates every frame but
Loop over each actor that is actively replicating (AActor::SetReplicates( true ))
Determine if this actor is initially dormant (DORM_Initial), and if so, skip immediately.
Determine if the actor needs to update by checking the NetUpdateFrequency value, if not skip
the only thing that short circuits replication sooner than netupdatefrequency is not replicating
then why does it run at 34HZ tick? Isn't it unnecessary? if it doesn't work at all, turning it off or setting it to a value less than 1, it'll not check is there replicates or not at least when there is nothing to replicate.
But this works every frame, not skip or shutdown replicating.
No clue what Update Hz column is, haven't used that tool
There is replication Hz which is what I'm pretty sure your network update rate (how often something is sent over)
Update Hz is something else, not quite sure what
But judging by the bytes sent that's definitely not the network update rate
well like you said if there's nothing to replicate then it won't
If there is no replication, then this list wouldnt show on network profiler. but it shows. so there is have kind of replications
"so there is have kind of replications" no definitely not
it shows you how much data was sent
every frame i selected it shows mate
which makes sense with the Rep rate of 0.02, basically doesn't replicate
not once
at there actors has max 5 update frequency except character. dunno why it does shows up 49.99
I just tried it; the data you screenshotted is cumulative and not per frame
Just confused now
look at the count column, there's no way you updated WorldSettings 355 times in one frame
when I go through my profile frame by frame the counts are sensible like 1 and 2
if I select the whole time range then that column shows the total number of updates and the bytes column sums the real data sent
its total
e.g. for my playercontroller it updated 762 times and sent 0 bytes
update hz is 107 and rep hz is 0
waste is 100%
your worldsettings updated 355 times, but like @bitter oriole and @signal lance said it only sent 5 bytes total because there's no change
the UE4 doc says
The less an actor updates, the less time it takes to update. It's best to make this number as low as possible. This number represents how often per second this actor will replicate to clients.```
Some tips for optimizing the performance and bandwidth usage of Actor replication.
but like I said before, you literally can't find that update time on your CPU profile because it's utterly inconsequential
what's absolutely wasted is all the time spent considering this issue
now that you know what's going on you should evaluate what's important to work on next
Well then im done, there is nothing to work anymore since those two things was left.
i had some times to research this
that's fantastic!
Thank you for conversation
my pleasure, thanks for introducing me to the network profiler
When you use the gamemode to restart game, do the variables return to default as well? Or does it restart under the current conditions.
Does AIMoveto "On Success" Work for multiplayer?
Server seems to tick "On Success" but clients won't
AIController doesn't replicate to clients so you won't get events there
@shy kelp they should return to default as it is basically a travel to the current level
in the level blue print i have added custom event for commands to change walk speed, how do i make it so it changed on both server and clients, so far i only got it to change on server but not the clients
How costly is Data Table Row Handle over the network?
I look it up in here https://docs.unrealengine.com/en-US/API/Runtime/Engine/Engine/FDataTableRowHandle/index.html
Handle to a particular row in a table
but I can't find the variable size
I know it holds a Name variable and a Reference to DataTable variable
(Not me or my video) For those of you, who don't want to read through 100+ pages of information, but just watch some nice slides and listen to some calming voice to learn the basics of multiplayer:
https://www.youtube.com/watch?v=JOJP0CvpB8w
An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.
Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe
00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...
Would be neat if he also covered the replication graph
Is it possible to open my dedicated server and clients on different maps on PIE?
no
Okay, thanks
Yeah, though that's less basic and not sure that thing even works out of the box
and not sure that thing even works out of the box
How so?
I had hoped it was something I could just add on to my existing logic, but haven't looked into it properly
Last time I read TheJamsh tackle it for Hell Let Loose and there were lots of crashes that needed engine changes and what not
I don't think a lot of people actively use it
Very specific for the 100 player genre
@chrome bay, hope you don't mind the ping. Is this something you could comment on?
Curious about your experience
Didn't notice the rename ha
It's certainly not basic but it's pretty stable now (4.25/4.26)
It only really makes sense if you're dealing with high volumes of actors or connections, especially if they're mostly the same thing
Yeah, I think I'll fall into that category
Does it require much modification of your existing replication logic to work well?
It's more of a different way of thinking
you lose per-actor relevancy and settings
Instead you tend to group them together based on gameplay concepts or classes
No it's more class/rule based
I see, I thought it divided the world into a grid and replicated based on that
There should still be some "up-to-date" concept talks about this
No - it does have a grid node to make the range-based relevancy queries faster though, but the actual concept is more about replicating actors based on their class rather than individual properties
Iirc it was more like a grouping system, where you can say how many actors can be in that group at a time per platform
it does have a grid node to make the range-based relevancy queries faster though,
Ah yes, this was what I had in my head
At least that'S how they originally explained it
For e.g, you might have the concept of "teams" in your game - and you may have actors that should always be replicated to a given team so you can add them to the "team" node etc etc.
But yeah it's helpful if you have lots of actors that tend to replicate the same way. In HLL all of our map icons are individual actors themselves (100's of them), so grouping them into a shared "policy" saves a fair bit of CPU time
We do a few other things too like limiting the # of player states that can rep at once etc etc.
But it's mostly about saving CPU time
ShooterGame has a pretty good initial setup for it that gives a general overview
It does have some wierd stuff though
Pitfalls?
Like not replicating "destroy" info for actors outside relevancy range etc, some weird gotchas
So they end up staying alive, client-side?
yeah it can be strange like that
:yikea:
I was mixing dormancy with it so I think that had some wierd stuff as well which probably helped there
tbh unless you know you're bottlenecked by CPU time or have ~40 or more players, it's probably not worth it early on
But it's definitely good for games that scale up
I'll profile before I commit to it, but it sounds like it might be worth it
Appreciate the insight ๐
Hi @chrome bay, is TheJamsh your UE answerhub name?
I think I might have similar problem that you already faced there
You are giving him the option to say no :D
Basically I have replicated component attached to PlayerController which is spawned dynamically. Inside of that component I am calling client-side ServerRPC in BeginPlay which works fine, but sometimes my clients are getting disconnected, because probably when the RPC arrives to the server the component is already destroyed server-side.
I can see logs on the server which are related to this DC, like: ReadContentBlockHeader: Client attempted to create sub-object. and UPackageMapClient::InternalLoadObject: Unable to resolve default guid from client
Totally not me ๐ ๐
What's the issue link?
Need some context as I can't remember now
why would you go and destroy the component?
I think it is destroyed automatically when starting server travel
I can't honestly remember anymore, I think generally the issue is don't call a reliable RPC on a component after you've destroyed it ๐
I used to do my weapons as components, which was a mistake
But can you reliable detect client-side that the component was already destroyed server-side? I will try to not execute this RPC when bIsBeingDestroyed is set to true. We will see if that helps
hello guys real noob here, how would i go about connecting two match together, one as listen server and the other as client
using for example the 3rd person example scene
You can't no
Realistically I feel like the engine should handle it gracefully, but if you're sending a "reliable" RPC it kind of implies that the game can't recover properly if it doesn't make it through
Does the client own his playerstate? ๐ค
So unreliable RPC won't make such problems?
My playercontroller is trying to call an RPC inside the playerstate and its not working 
I'm not sure, worth a try!
Yeah they do own their Player State
pawn, player state and controller are the primary types you can call server RPC's on without issues
So probably on every actor it should be safe, but not on components
Wrong PlayerState in my GameMode settings
@empty axle it might even be the same with actors I've never tried it to be honest
@sly remnant print the value of the reference, can you confirm that it's being set correctly?
Input is only handled on the client, you need to replicate that reference
Or set it in such a way that the client has a valid reference as well. the reason why jump is working is because you are not calling jump on a specific character reference, you're just calling it and the controller knows what character to make jump
You really should just be handling input on the character though, there's really no reason to handle it in the controller
when playing splitscreen multiplayer in PIE, how come when i go into fullscreen, my second game controller stops sending input? exiting fullscreen enables the seconds controller again - what could be causing this?
immersive mode: F11, seems to disable input from the second player controller, anyone else come across this?
Are you sure you aren't consuming the input axis events in the controller? Get rid of them in the controller.
Out of curiosity while I'm waiting for Unreal to compile on my notebook (
), why do we need to do a source build for dedicated servers in the first place? Is there a technical reason or is it just a barrier of entry thing?
It's simply to keep the size of the prebuilt engine down for most users.
Oh, but in that case, why isn't there an optional "Server SDK" download like there is for "Editor Debug Symbols"
You'd have to ask Epic that ๐
Sounds epic (haha)
I agree it is a bit annoying
I guess relatively speaking most users do not need to built dedicated server
Yeah, that's understandable, unfortunately for my notebook, it'll be busy for a while, thanks for the info
@sly remnant you aren't using the input axis events?
@sly remnant and do those events exist in the controller graph?
I know you have them in the pawn now, but are they still in the controller?
Well all your notes there are referencing a pawn, so I'm guessing you're back to square one, where you don't have a good Pawn reference to call them on.
Because you aren't setting it there and don't have it replicated. You need to do either one. But you really should just put the character input in the character.
can I "flush" a replicated variable? ๐ค
say, force the server to make sure everybody has the replicated value
(a variable of my playerstate is set by the server and when the user logs in, the server sets the value but the local playerstate doesn't replicate until after a few seconds. I am testing locally and it is not just latency)
I'm pretty certain there's a force replication function somewhere
@sly remnant I've told you what to do like six times. If you're not getting it, you need to really go back and start from the basics.
I wouldn't even mess around with multiplayer until you are comfortable with the engine and know what you are doing a little bit
I am on phone, send him the link to the EXi Bible
Heck, even if you don't plan on doing network, that guide is amazing for understanding the gamemode, gamestate, playerstate, controller, etc
Is it generating errors all the time or just for the little bit of time when it hasn't replicated yet? Are you sure you are setting it on the server?
You might need to proxy
Show where you are setting the reference. Everything from whatever event triggers the execution to setting the reference
If your variable isn't from an unreal code (example, the position of a character controller) the time from when you set the value on server until it replicates might make your game jittery.
You need to set the value locally. You predict what the server would set and set it yourself. If you predicted wrong the server rubberbands you. If you guessed correctly, you are silky smooth
@sly remnant show where you are calling initialize player.
Are you switching on has authority?
You should gate that by HasAuthority but anyway, you're doing all this unnecessarily. You can just put the input in the character and it'll work.
It actually does if you set it up right. Just look at any of the template projects.
not that kind of delay
You are probably consuming the input in the controller in that case. Unless you have some input the requires being handled in the controller like a pause or switch character button, you can do whatever you're doing with a completely empty controller
movement input is replicated automagically.
If you are calling the movement input of a pawn you own, it will move ๐คทโโ๏ธ
Just look at the third person or first person template and see where yours is different.
Lmao
"standalone" is single player
"as client" is connected to a local dedicated server
"as listen server" player 1 is the server, everybody else connects to him
that is listenserver
unless you are manually connecting afterwards, you want listenserver
ok, so the client opens the game with listen
and then the other game connects to it?
ooooook, we are getting close
standalone is correct if you manually do the connection
are you sure your inputs are reaching the "add movement" node?
put a print string there to see that
I see the same print in client and server ๐ค
where you alternating? or pressing on clients makes the server go hello? ๐ค
(is your controller routed to the two windows? that's my setup)
is the controller possessing the pawn you are trying to move? ๐ค
oh 
then let's analyze how jumping is different from running ๐คทโโ๏ธ
what does your jump code do?
the server wouldn't listen to your custom variable of movement locked ๐คทโโ๏ธ
once the server gets the "add movement input" call, he goes
player input code is 100% local. your branch if player is locked is also local
it is really odd that the add movement input is not replicating ๐ค
the server won't see the event of a key being pressed
the server will only listen when the clients call the add movement input
Hey guys, is there a way to set a map to Listen without Open Level?
maybe something arround the "create session" node? ๐ค
not really sure tho
Well well... I tried that, I guess? I mean...
I called the CreateSession node but nothing. It seems I really have to ?listen at OpenLevel
huh... it should work...
You CreateSession and when that is done then you Find Session + Join Session on your client window and the client will reload the map into the server. The server doesn't have to reload the map ๐ค
is the "on Success" flow being run in your server Create Session? ๐ค
is the "on Success" flow being run in your client Find Session?
nope, the Create Session is for gui
for you... I kinda ran out of options 
Character Movement is replicating the jump but refuses to replicate the movement
never happened to me 
Wait...
So, should I createSession on the connecting client as well?
I thought that'd be exclusive to the server...
no, no, clients use Find Session and then (assuming you are running only one server) you Join Session on the first element of the array
gotcha, sounds good.. lemme give a few tries here
@gloomy tiger
This are the code for my 2 buttons, the create server and the join game.
I happen to chain an openLevel but because it makes sense for me. You could remove it and it should work the same.
Also, I use lan because I don't have any onlineservice in place ๐
Loved your Open Level (by object reference)
This is quite off-topic, but would you mind sharing its contents with me? lol
oh.. if it's not standard then it is from the LowEffort blueprint library. It's free and on the marketplace ๐
ohhhhhhhhhh, wait wait i get it
@gloomy tiger
you are opening a level without listen. I thought you wanted to not open a level at all ๐ฌ
"open level" usually means "fuck everything and create something new". with "listen" you keep the session open (but drop any player already connected)
you might want to "servertravel"
that will change the map, keep the server open and notify all currently connected players to follow the leader
("servertravel" wont work in PIE mode, you must set "standalone game")
@sly remnant please tell me you are not just setting speed clientside?
That could be the problem...
Only server can write references. If a client writes a reference that the server didn't the server will overwrite what the client wrote
for example: the client can't set its own speed, or they could set it to 99999 and speedhack ๐
any replicated variable MUST be set by the server
so yeah, any speed, acceleration, etc
if you are locally changing that, that is a problem. The server is the only one that can touch variables
server knows the absolute truth and will never trust any client. If a client says that a variable has a value different than what the server thinks, the client gets stomped by what the server thinks ๐
that is saying "character reference is null" ๐
where are you setting character reference?
is Character reference replicated?
so you are setting it locally... and then replicating it... so the server never set it and it's deleting it 
yeah, you shouldn't replicate it
also, it should be the "get pawn" of your character controller
if it's not, then that is your problem ๐
You really ought to back up and start from the basics. it sounds to me like you followed some tutorial a lot further than you should have and now you are lost in the weeds
it is SUPER weird. Character Controller replicates on it's own
there is something SUPER wrong, we just don't know where ๐คฃ
sanity checks: p.netshowcorrections 1 on the console and try moving. You get a mess of red and green boxes right?
great, that is the server telling your local player "no-no-no you are not where you say you are".
Reasons for that:
Movement isn't replicating: Super odd since we are using the add movement input and that is replicated.
You don't own the pawn: Check if your player controller possesed pawn is what you are actually trying to move.
Your speed doesn't match: Check that you are not setting any variable of the player movement component on the clientside.
Your physics world got desync: The server thinks there are walls all arround you and the client doesn't think the same.
can't think of anything else that could be the problem ๐ฆ
This is a sort've UI and sort've multiplayer issue..
This was working until recently, I don't know why or how it broke.
But basically the 'Get Owning Player Pawn' is returning null every frame on clients - but works fine on the server. The reference to the widget blueprint returns valid both on server and client.
The heck...
@sly remnant try not using the reference, just getting possessed pawn and casting to character
Have you checked that the server and client agree on the reference? Print it on tick.
if the variable is replicated, the server will always overwrite it.
that's his job ๐คฃ
how is pressing a key firing on server 
or are you pressing that key on the listenserver?
oh, ok, that is possible
The Is Valid failure prints out server side, not client - so it looks like client side everything is hunky dorey?
still, you might not own the reference ๐ค
yes, but "own" it as in "network own" it
Simplify things, get rid of the listen server and just run with dedicated server for now. Have both print that reference on tick.
I might have a reference to your character, but I shouldn't be able to move YOU arround ๐
Also try it without using the reference, just getting possessed pawn, casting to character, and adding movement input.
you can also try getting the owner of that reference. The server should always find the owner, but client only finds himself
remember the graph, playercontroller is not replicated to other players
server has everybody, but clients only have themselves
is that.... two wires going to a data wire? 
that's illegal 
my UE automatically unplugs the other wire 
Major what the f*** with that, how does it get controlled Pawn return nothing?
you never possesed a pawn 
your gamemode probably has the actor pawn set to none
and you never did the posess node
you might have killed that pawn? 
and spawned a new one?
and never possessed the new one?
yep, and that pawn should be automagically possessed
that is the spookiest of shits.
that's why I think you have a missmatch in speeds or collisions
but I am really confounded
On the server it shows that the client is invalid, on the client it shows it's valid (this is 1 player, dedicated server).
What's confusing is that I have identical logic in another actor that works fine server/client
adding to spooky stuff.
you are saying that the server has a reference to a WIDGET... like.... screen widget? 
you are challenging all I know here @odd sundial
server CANT have widgets 
A user widget object
๐
gravity is not affecting it?! 
I think I will deem your unreal project cursed ๐ป
sorry m8 ๐ป
Listen server mebbe
I've got a weird crash with dedicated servers and ServerTravel and could really use some help:
We are hosting dedicated servers, players join the lobby without any problem, however when the lobby does a ServerTravel / Seamless Travel to the next map, the clients crash with very little detail in the crash log
The clients have the map packaged, they can open it via command console. When I tested on a different map, the clients did not crash, so I suspect it is something specific to this map (named "District")
However, I have deleted all kinds of things from the map, and it still crashes. But only sometimes. Sometimes it doesn't crash. There is about a 70% chance the client of it crashing from what I can tell
What are things that I can look for? My guess is that it is related to the long load time for this map, "District" is a lot bigger than the other map I was testing on (basically an empty room for testing)
If it takes a long time to load the map, and some code started executing on the server or the client attempted to reference something that wasn't loaded yet, would that make sense?
funky code on the migration? Do you have something custom on the GameMode Oncontrollerchange or on the playerstate copyproperties? ๐ค
I haven't looked at either of those events / functions. I don't think there is anything going on but I'll check
This is what the end of my log file looks like @frank birch
No worries, thanks for the suggestions @frank birch
Attach visual studio to the client and when it crashes you can debug from there.
no. ask for more details in #blueprint - perfectly legal syntax
Would anyone have a great article about networking and architecture pattern with UE4.
It seems the videos or articles i've crossed just speak about how to simulate that you're running the different server setups.
Then how to check if you have authority over a specific entity.
My current goal is to have an actor which is basically the rule maker and tells everyone what to do when they can do it.
But currently it seems everyone has a copy of that actor.
I'd like to aim to have that actor just exist for the server, aiming for a Listen Server setup.
the network bible by eXi? http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
So how would u handle stuff like rounds, would u use the server's game instance or smthn?
Or handle it in a webserver, etc
can't you pass parameters in the servertravel? ๐ค
@woeful hound Did you ever figure out how to fix the client movement being jittery on steam?
@spark inlet Yeah, It turns out that the CapsuleComponent was set to replicate, Turning it to false fixed it. It still gets jitter when something gets picked up but that is more of a physics issue we think.
There is a way to simulate jitter within the editor in advanced play settings. It may help when testing in editor
I would go for a custom logic in game mode
Hey! does anyone know if it is possible to override a .ini depending on you are dedicated server or not?
Well you can ship different config files with the server I guess
Probably not a very resilient design though, what's the use-case?
speaking of server config, is there any downside to pulling config from a master server via http requests?
@lavish cypress actually this is the best approach to have configuration remotely.
And for that you could use firebase remote config instead of maintaining a inhouse master server for configs. It's completely free .
Well, i want to override "[/Script/OnlineSubsystemUtils.OnlineEngineInterfaceImpl]
VoiceSubsystemNameOverride", this is specified at "WindowsEngine.ini", but I would like that to be different at WindowServer builds
and I think "DedicatedServerEngine.ini" doesn't override platform specific settings
Yeah you can't do that, only option really is to package the server with different configs if you wanted to do something like that. Why would the server have a different Voice system anyway though?
Ideally the voice system itself should behave differently depending on whether it's operating on client/server (if it needs to)
because server is not going to use it.
Just don't initialize it on a server
Could be as simple as:
if (IsRunningDedicatedServer()) { return; }
Thx mang I'll check that out
Hey guys, i need some help, i'm trying to replicate movement on a game i'm making with a listen server, the problem is i'm getting some jittering on the client side, it's not really lags, more like everything is a little shaky, i was able to reduce it by playing with the replication settings of the character but can't get it to go away completely, any ideas?
Sounds like you are describing the GameMode
Asking again: How can I force the server to replicate a variable?
My GameMode set an array of the GameState but clients aren't seeing it. (They see it after they do ANY rpc after. Which tells me that the server is changing the value of the array but the array isn't considered dirty enough to be replicated or something ๐ฆ )
Server will send it when it considers that actor for replication, and it thinks the client has an outdated value
You can't force it as such
You can call ForceNetUpdate() on the GameState, which will cause the engine to evaluate that actor on the next network frame and ignore the throttling
(usually end of the frame)
Wheres the code that changes it?
hey, I'm experiencing something weird: I have a primitive that detects nearby objects when overlaping, triggering OnComponentBeginOverlap on those objects and some logic there. I added a call to UPrimitiveComponent::GetOverlappingComponents on BeginPlay so it generates overlap events with objects the primitive is already overlapping when spawned. The issue is: it works perfectly on clients, but not on ListenServer. It's consistent and I don't understand why
the overlap events work fine on both cases, but the call on GetOverlappingComponents is the one that fails on ListenServer
UPrimitiveComponent::GetOverlappingComponents won't trigger the overlap event
That's only triggered when a component "moves" or spawns
Doesn't it also trigger when something moves into it?
then I don't understand why it's working with dedicated server
@dark edge yeah
@lean fossil Get Overlapping Components shouldn't have anything to do with the overlap event. One is an event that is called when a new overlap happens, the other is just querying for what is currently overlapping.
It's also going to be out-of-order. On a server everything might exist initially, but on a client things will be arriving at different times, begin play might be called before/after spawn etc.
You can't rely on BeginPlay ordering anyway, but that may not be an issue in this case
yeah, I just verified that that it's not the cause for the initial overlap to work. Somehow that started happening when I added that line and I assumed it was triggering the overlaps
is there a way to manually trigger overlap events?
although this might be no longer a multiplayer question ๐
Well you can just call the function it's bound to, or broadcast the event yourself - but you'll need to pass some parameters in
But I'm not sure why you'd need to do that anyway
The event will be called as soon as something is spawned and overlaps it
So you shouldn't need to call it manually
currently, the event is not called on overlapped objects, but it's only happening on listenserver
yeah that doesn't make sense to me, something else must be going on
maybe some missing configuration?
what network domain you're operating on doesn't really have any effect on whether collision events etc. are generated
yeah, but it's the only thing I'm changing. It should be something related to component replication. I'll take another look with this new information, thanks
gamemode after controller migration/on post login
but now I fear that the gamestate doesn't exist yet at that point and that's why it is failing me ๐ฆ
It should exist by then, gamestate is spawned very early
May not exist on the client yet, but that doesn't matter - the values will still replicate to them
Hey there
I'm getting into Multiplayer programming
and I have an example that I've added to my project
OnPostLogin, I call an interface event ShowTeamSelection on the player controller
The PlayerController implementation calls an ExecuteOnOwningClient function, which handles actually creating the widget etc.
My question is: Why?
Is it because the Server copy of the PlayerController shouldn't deal with widgets?
Widgets should only exist on the local machine and the server shouldn't even care about them at all
Alright
I would use a state-based team selection method but its all the same
I'd repnotify an enum to State_TeamSelection which would handle the UI
Is there a general set of rules for what I should and shouldn't do on the server?
so if your PC can be in states TeamSelection and CharacterSelection and SpawnPointSelection and Playing (like the Battlefield games) you could leverage Repnotify on Enum ESelectionState or whatever you call it
I get you - I just use this example bc I'm following a course.
Sorta but not really. No input events or UI are relevent to the server (or rather, they are only relevent to a local player). A listen server is a local player AND a server.
How do you decide what to run on the server then?
Like - do you have an example of something that is server only?
Say you were summoning a pet, that actor would be spawned on server and replicated out
if you were spawning an actor that is NOT relevent to gameplay (a targetting visualization mesh or whatever) then you would spawn it local only
You need to read the compendium
So if something is wholly relevant to other players, it should be on the server
(like the pet)
oh hell yeah
Thanks man
purely out of interest
if I did run the widget creation on the server, what would happen?
Is it just wasted processing/memory?
might not do anything, idk
Fair enough
a listen server will have access to the widgets of the local player
since they are a server and client at the same time
Yep
but for dedicated i have no idea
Guess it's a question that shouldn't really need an answer other than 'irrelevant'
That makes sense, thank you
I'll start reading the compendium, it seems really useful
I guess Play as Client + Standalone isn't enough to test servertravel? or am I doing something extra wrong?
just to make sure, my test is set to standalone but I think the server isn't understanding the standaloneness
That doesn't matter, if you want to test your real flow, you maybe should start as NetMode Standalone, spawn your sever, conntect to it etc
how can I set standalone and have my game open in headless server mode? ๐ค
I can use that but to create a listenserver
๐ฆ
Just do it without PIE
@frank birch These are old but you'll get the picture.
Should fire up a standalone instance and headless server instance
You can probably connect to the headless server with PIE Standalone but don't quote me
The simplest way would be to Run on server then multicast it out
that would have local delay but it'd work
the tough part is running it locally instantly before the ping round trip
the hardcoding of UE4Editor.exe is strong in this one... but it worked! Thanks!
@dark edge Still happens when launching via the .bat file 
You don't need to repeat it. Just have the run on server call the multicast
Yeah, multicast runs on server and then on all clients
how do you guys typically handle initializing replicated UObjects? I run into the race condition of the pointer to the object often being replicated before the object itself, so I am constantly checking in the pointer's OnRep if it's null, then if not null if its been initialized, and if not initializing it, and only then actually accessing it to do stuff
this is especially annoynig when replicating arrays of UObjects, as any time i want to iterate over them on the client I have to check for null/uninitialized before doing stuff
Is it normal that a replicated variable is nullptr inside of OnRep on a client?
While its not nullptr on other functions, server rpcs etc.
its just in the case of spawning a UObject on the server, then setting a pointer to it as a replicated variable, sometimes that OnRep is called on the client before the object is replicated, unless there's something else i've done to cause that
you're getting is not valid from that node?
or you get none somewhere else when checking it on the client
post where you are trying to access it on client
post the blueprint where you are accessing it
is what i meant
it looks like you have a different variable there than the one you replicated
oh
from your gif it just looks like your movement isn't replicating
there is a checkbox somewhere for Replicate Movement
yeah i think Character Movement Component might handle that
you should just have none of that checked
and just make sure the actor is set to replicate
weird that you can jump tho
im at work, but last thing, post the blueprint where you jump?
why is character reference a replicated variable in this screenshot but not the movement ones? these are in the same blueprint right
dont think this'll fix it, but instead of breaking and making a rotator and getting vector from that, try using GetActorForwardVector from your character instead just to rule out any math issue?
other than that, i'm not sure. likely suspect would be one of the "component replicates" checkboxes that shouldn't be checked, not sure what else to look for
yeah you are correct
with that error log
i'd guess you invented your own way to spawn and possess a character
and did it wrong
your character reference in controller is none
if youre using it to add movement input
yes you wouldnt be able to move
Yep that should work
I think there is something super f***** about your project because you've been having replication issues for like 2 days now. To debug, put a print string at each event in that chain.
Is Playerstate::CopyPropertiescalled on server only or on Server AND Clients when doing a seamless travel?
Does DECLARE_MULTICAST_DELEGATE has something to do with NetMulticast or is it just naming?
I'm trying to solve how ShooterGame shoots animations
No, it is a delegate type.
๐ Thanks
NetMulticast is an RPC sent to all Clients at the same time
Hey we're having this issue with Steam onlinesubsystem, it seems to be working really inconsistently!! One morning, our packaged project has no issue finding another player and playing with them, but in the afternoon, it stops working in that same package
Could anyone assist us in a call maybe?
you using steam sockets or connecting via ip:port?
that is odd, ip:port connection doesn't have most reliable NAT punchthrough
but steam sockets never had a problem with it
We initially used that type of connection to test at first before using steam since we didn't know if we were allowed to or not
that worked perfectly, but since we introduced steam, everything stopped working (well at least for half of the day lol..)
should still verify if its NAT causing you problems, setup port forwarding on host/server
or you can't even find a session?
I can find some sessions, but not my colleague's session
ID 480? ๐ฆ
i have no clue, but might be
we have 3 different IDs for one game, haven't used 480 ever
from what I understood, the difference is that we can't implement steam features like achievements and stuff like that, and restricting lobbies to our games. which is why i see random lobbies
i think we're about to start again from scratch.. it's frustrating because the setup seems so simple :/ is there any recent tutorial you recommend that's foolproof?
we don't even use sessions, we use steam lobbies
host creates a lobby, sets the lobby data
is that like matchmaking?
its in matchmaking interface, yes
i see, thanks for your input 
anyways, we're offering uber eats if anyone can help us read those logs ๐ฆ
@hasty yoke you can totally use 480 but you wanna filter out anything not your game. If you're willing to use c++ you can do this easier, I think, but at the very least you can have a custom attribute and validate that the value is what you expect
the standard session stuff won't filter this at all for you, and only gives you so many sessions
and advanced sessions might have the same issue.
Not aware of a tutorial and I've long since deleted any projects I did this with
okok i think you're def helping me there
because we tried to test it with 3 diff people
and every time one of us hosted, one or two of us (or 0) could find the session, it was insane, there was no real pattern
ok so we'll look into filtering our stuff them. thanks!!!
Does anyone know a neat way to replicate ragdolls on a dedicated server? Meaning that the ragdolls end up in the same places for all clients
If you are not going to replicate every bones transform only thing you can do is trying to make them close enough
I'm not concerned about the specific pose, or as you said, where each bone is.
I just need to make sure that when a character stands back up, there won't be any clients surprised that the character is standing up somewhere else from where they could see the ragdoll.
You made any prototypes yet? Or just thinking the architecture at the moment? I have some ideas but not sure if they are going to work with your system
But anyway all I can say is you should enable physics on server only and disable it on clients, but enable ragdoll on clients so transform of server will be replicated to each client but they will update ragdoll state locally
I have made a prototype. It's a project I'm returning to because I faced this problem before.
The project is very new, so I'm totally fine with fundamental changes ๐
That sounds interesting. I will try that.
I thought about CMC first to update the location but since CMC also receive inputs from AutonomousProxies, you might think about disabling input or you can create a new component and send buffers of transform by yourself
I have a very simple and stupid example for physics replication (physics replication does not work at all in UE, so it only tries to) in my github, you can take a look if you want
Thank you! I really appreciate this. I will look into soon and get back to you ๐
How do you enable ragdoll on clients without enabling physics? The only way I know how to make a ragdoll is by using Enable Physics.
Uuuuh nice I didn't know about this one.
It's progress ๐
he is not exactly a ragdoll but at least he's lying down (this is tested through client)
This is the blueprint I used
You want your mesh to follow the origin (0,0,0 on relative location) while clients simulating ragdoll on their local, from this point it could be a R&D for you
When you enable ragdoll, afaik mesh detaches from origin and starts physics, you want
1- Only server to update transform
2- Simulate ragdoll locally on everyone while clients' meshes are snapped to origin
Right, so the server controls the actual location at all times. I'm still having trouble making the clients see the mesh as an actual ragdoll.
It sort of works, but the mesh keeps a solid animation. It's not a ragdoll by looks. But I can tell it falls around as if it's a ragdoll mechanically (as seen in the picture I posted before).
When I try to call Set Collision Profile Name, the mesh disappear for other clients when I try to multicast it. But I think that is my wrong approach.
I think that should be done locally
currently im still dealing with the problem of not having a proper ragdoll for the client
I dont know the exact solution about it, but at least we know what is missing. That requires a research, how mesh detaches from origin, how can we prevent it or how can we attach it back etc.
you may try to multicast the server rpc
rpc?
I must make a c++ script for that? I can't use raw blueprints?
You can use BPs, just create a new event and set it to multicast
and call it on server one
Cant say anything further, sorry :\ But what you are asking should be entirely possible in UE, if I am not wrong. You just need to fix the missing parts
That works yes, but that gives us other problems that are explained above ๐
yes
Maybe an ideal way is to do what sswires and try to somehow attach to mesh back to origin
instead of trying to find a workaround for simulating physics
There was something interesting that I discovered when I first tried this 6 months ago. Back then I was still making multiplayer games using peer to peer. I found out later that dedicated servers were a lot easier to code in.
What I found out in my last experience, was that the clients actually had the same ragdolls physics. It was only the server who had different.
So I was wondering, with some testing, if the clients actually follow the same physics... Then I just need to get my location from the clients to the server.
Ofc this is easily hackable when you have vital info from the clients but I'm not really worried about that ๐
the mesh shouldn't be replicated
Agreed. Right now it actually looks good. Running phsyics on multicast and mesh is not replicated.
They seem to land in the same place and pose when i throw them around and look at them with 2 clients.
though it seems that this shouldn't be done in a multicast if there's a potential case with late joiners
variable with onrep does seem a little more appropriate
I take it back. They are not really similar... When I tested it 6 months ago I was using Apply Force... Maybe that is somehow more reliable in the outcome.
The game is going to be american football style game where the players can run into each other and see their bodies fly around.
I suppose a tmp fix would be to have a "soul" that is the correct indicator for where they get back up... And then have the bodies fly around at their own accord for each client.
I have tried to attach a ragdoll to a game object, but I did not succeed. That would fix the problem though. You could have an invisible projectile flying and bouncing around with the ragdoll attached to it.
Could do something like replicate just a central position like the chest. It sounds like it doesn't matter that much if the ragdolls themselves are the same, just their general positions.
Yes, as long as the ragdolls end up in the same position, it's all good. They don't need to have the exact same pose.
For that you probably just need to add a vector property that's replicated, copy the position to it on the server.
The problem with "naively" replicating that position is that you'll have lots of rubber-banding. You'll need to do some sort of resolution on clients, possibly only correcting the position if it's too far away and lerping it over a short period. Also would have to account for lag. Honestly not a simple task but doable.
and a hell of a lot easier than trying to replicate a full ragdoll
It's not too hard, but getting it right isn't the simplest thing if you haven't written latency compensation stuff before. And then make sure to test it with the built-in network simulation.
It would be an amazing thing to make work. I'm gonna try Ulntax plugin now..
How can I stop the Steam from creating a default gamepad configuration?
I'm using the OnlineSubsystemSteam for session finding and voice chat, but when I launch the .exe of the game rather than running on the editor, the controller does not work anymore, only the keyboard / mouse do
I've found this solution which works, but is not ideal as it requires a lot of work on the user side: https://answers.unrealengine.com/questions/892853/view.html
You would not be using appid 480 if you were going to publish for real - the only reason that's happening is that you do not have your own appid to define your own steam input config.
but how I can try my game with a controller in multiplayer if I do not have the appid 480?
Either do what it says to disable steam input, disable steam for the game, or get an actual appid
appid 480 does not exist for you to develop your game against - the available things you can work with are limited when you use it since you do not have full control over that appid. You are intended only to do small tests with it until you have a real appid.
Sounds good, I'll look into getting an actual appid, thank you!
Hey guys, I have a question, How should i handle people connection to the same server from different regions ?
We are having a problem where people from very far away are not able to connect to the server, we are using Gamelift for this.
or is it possible to create server on different regions but share, game sessions and Game Data ?
you can't really defeat the laws of physics, but if they can't even connect then there might be other factors there like an ISP blocking certain IP regions
or if they can see the server and they time out connecting, there might be some INI tweaks you can make to the timeout settings
By this point I sound like a broken record, sorry ๐ฆ
How can I make servertravel work on dedicated server?
I know it is supposed to fail on the editor, but how can I launch my game into server standalone without building it?
I tried "D:\UnrealEditor\UE_4.26\Engine\Binaries\Win64\UE4Editor.exe" "%CD%\Mayhem.uproject" Lobby -server -log but it still tells me that Command not recognized: servertravel Game (Game is my map name)
@lost inlet it only happens on quest though.
From windows I can always connect to server but not from quest.
I am not even sure what is the problem about
Even sometimes they get connected.
Then they will drop off for some reason.
@tranquil yoke check your dedicated server logs. You will see the reason for a disconnect or you won't see the attempt to connect at all which would suggest it is some kind of different issue.
@frank birch is the server booting up for you? I am not sure if the servertravel command is an issue or server launching
the server is launching, the servertravel command fails
Now I tried to build my project and is crashing and burning saying there is no ue4game.target so I am slightly panicking. ๐ฌ
You have to be working with an engine source build to package a dedicated server unfortunately
What do you say Jambax? That I should stick to listenserver until the dreaded day that I actually need a dedicated server to work? Sounds good to me

Pretty much, I mean if you want to test travel properly you have to do it outside the editor
What do you mean? anything which needs to be the same on client and server needs to be replicated or generated determenistically, anything where it doesn't matter ... doesn't need to be deterministically generated
you could try having a deterministic random per client so the client can "proxy" the random... but at the same time the client could hit the random like crazy to predict what their next randoms would be
so I wouldn't give the client the seed to its random
and in that point, pretty silly to have a seed at all ๐ค
unless you want all the players to get the same random ๐ค ๐ค (fairness or smth)
Hi guys. Where I can save personal players data when using "servertravel"?
Define save
Thought about SaveGame. Just thinking if there is a better way ๐
Is the saving on client or server ?
Both for now. Its listen server btw
Like, I have player names in lobby and I want to be able to get them in the next level
If your need is to only persist player names.. then you don't need to make any save system...
Engine already has a feature for this.
When client does travel.. they can pass their name as a query and it gets parsed in Login() function of GameMode
So the final URL should be something like this.
http://ip:port?name=PlayerName
I m not sure about the query name.. but if it's not name then it should be playername
http://ip:port?playername=PlayerName
And this name gets automatically set in PlayerState
@steady musk PlayerState has an event of CopyProperties or something like that where you can copy from the current playerstate into the future new one
also GameState has a "Controller Swap" event or something like that that happens when an old player arrives again to the server. I personally find this event quite useless and my logic is all in the playerstate copyproperties ๐
I use the Copy Properties to "save" my player number, selected character, team, score, lives and more ๐
Oh, for CopyProperties to work it has to be a seamless travel โ
Are there any resources on making Linux dedicated server executable? I am using Windows 10 PC and have installed the Linux toolchain as mentioned in UE4 documentation.
They answered me this like an hour ago. Not really your answer but might help
I already have the source build
Hmm small question, earlier I was trying to replicate my characters rotation (which I solved with some help from you guys by using controller yaw input). But now I want to replicate the rotation of my turret (the character is a tank) and therefore I cannot use the controller yaw input, since that replicates the whole pawn :/. So I want to replicate the child mesh of the hull.
What i've got is working on the client, but neither the server or other clients can see it ๐ฆ
It will work if clients are connected.. what he is asking that he wants to persist something for the first travel.
if players are in a lobby, they already connected to the server tho ๐ค
Hi, Can anyone give a tutorial pdf link for multiplayer?. I am just starting multiplayer game for the first time. I have read the official documentation but not properly understand that. Please help me out.
Thankyou
by our lord and saviour eXi
pretty good other than the obvious pet peeve of mine
I just have to reassing units to all players and Im using names to decide it (like IDs). So I want to drag names from lobby to main map, so I will be able to assign units properly ๐
Will check this copyProperties
Might be the one I want to use
UE5 confirmed ๐ฝ
@steady musk seamless travel can persist controllers/playerstates and/or their data between levels
server only, but then you just replicate that over to players
Sounds good. Also is it bad that Im using Controllers to store data and not playerstates?
it is
Controller is significantly more unwieldy
PlayerState can use COND_OwnerOnly or COND_SkipOwner for replication
depending whom you want to replicate the data to
@empty axle I am using gamelift, so the response i get when i try to search for game sessions is connection time out.
Hi everyone, quick question. I have a struct which I use to replicate death information for a character (type of damage used to kill them, direction they were hit from etc) which I replicate so that clients can play appropriate death animations when another client is killed
Within the struct I have a FVector_NetQuantize10 for the hit direction
At the start of a match, I sometimes get a massive warning spam like this:
Native NetSerialize StructProperty /Script/WaT.DeathInfo:HitDirection (ScriptStruct /Script/Engine.Vector_NetQuantize10) failed.
In the death info struct I initialise the hitdirection like this:
FVector_NetQuantize10 HitDirection = FVector();
Is this not the correct way to initialise it?
Just want to cut out warning spam, it doesn't seem to actually impact gameplay
Wtf, I Disabled "one process" in advanced settings and still have this
Welcome to my hell
servertravel will work on standalone and only on listenserver
like that
dedicated server servertravel won't work unless you make a special build for dedicated server
@steady musk ๐
Damn, already noticed that "standalone" version works as expected but its not that heavier. At least listenserver is what I need ๐
Is there a way I can be notified when a character pawn spawns when a player logs in? I need to subscribe to an event in a character in another structure, and for that, I need to find a way to be dynamically aware of characters being added into my game over networking.
I know there is the "PostLogin" method that happens when someone logs in, and I get a controller out of it, but I've heard that the controller isn't bound to a pawn at that time, which gets problematic if the property I need to access is in the character pawn itself.
That is uninitialised - try FVector(EForceInit::ForceInitToZero) instead
or = FVector::ForwardVector or whatever
What about using "OnPossess"?
Restart gets called on pawn and controller iirc in default gamemode
but don't hold me to that, ours is heavily modified
I could look into it. I would basically have to keep a list of controllers somewhere, and override their "OnPossess" method to then let the UI know it's okay to get their pawn, but that sounds very tedious for something that should be simpler. It's a good idea to explore from, perhaps!
Hmm, I could look into that. My biggest problem is really just to find a reference to a character when they're spawned after a network connection.
Hey guys!
Question - I have a given Actor without Owner, and for organisational/architectural purposes, I'd love to have RPCs exchanging data between Server/Client inside of it. I know that's quite forbidden by the engine but well, just would like to touch base with you on this subject. In my specific situation, having PCs acting as bridges is dirty as hell.
I read this thread by eXi from 2015: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/44230-rpc-client-server-not-working-owner-problem and he mentioned using PC as the bridge, but then the user ClarkJ raised the point of being a bad coding practice, forced on us by the engine. (the very last comment)
For gameplay programmers writing C++ code.
Anyways, to the question. Is there a way to handle this - having RPCs in an Actor without an Owner? I mean, it's been 6 years since that was posted and I believe Epic has made some progress here?
no
When I create a linux dedicated server build (shipping config), it creates a .debug file too. This file is almost 80% of the total build size. Is this file required for the server build? Should shipping build even create a .debug file?
When i RPC a actor Reference from client to server, Can some one tell me, what is the actual data that being sent, what is going to be the size of the reference that i am sending?
I love the simplicity in this answer. Thanks.
can't say anymore ๐
no but it's handy to have around when your server crashes
since it'll show you the stack trace in the log
Can't seem to get this replicated destroy actor to work
There is a print string just to the left of this that fires fine, so I know it's getting as far as the first Switch Has Authority
got it thanks!
As far as I can tell the SRV_ custom event just isn't running and I can't work out why
Actor is replicating
Have to go for the night, but if someone knows the answer please just @ me here otherwise I'll miss it. Thanks ๐
Hello guys. Im new in this whoe UE4 developing and i'm working on my project. Problem i've got i can't replicate crouch animation. With jump i had no problem but i have no idea why i can't replicate crouch. Any ideas?
why you setting bools for?
Unreal does it by default
just call Crouch and Uncrouch on client AND server
then check IsCrouching bp function the engine provides
dunno man i just started ;d im trying everything now
Anyone has a good source for faking/simulating the projectile spawning for weapons in client rather than UT source code?
UTs version is pretty straight forward.
What differences in another example were you looking to see?
Could make your own system that fits your game of ut4 one is not good enough ?
I am not implementing anything at the moment just wondered different approaches to learn better before diving into development
Do you add prefixes to your RPC, multicast, server only, etc; methods and/or events? 
I usually add RPC_ but I want to know if there is a consensus/ what each of you does
The most common thing you'll see is ServerDoSomething/ClientDoSomething/MulticastDoSomething
adding a further prefix is just redundant beyond that
@regal storm most likely you don't have an owning connection for that actor. Are your client the owner of that actor?
I'm trying to visualize the net cull relevancy. Isn't this the right math?
depends on the spheres initial size^^
Can someone point me in the right direction how to replicate material changes? A lot of posts regarding this topic mention RepNotify, but I did not have any luck with that
hey, what do you mean by UE5 confirmed? There are more news since the announcement?
there are rumours saying some companies trying UE5 are getting back to 4.26 because Nanite and Lumen don't work. Any info about it?
I am adding mesh components to a replicated actor. The clients should be able to change the material which should be replicated to everyone.
Yes, you should add these components with a repnotify
Replicate the materials with a repnotify, and in the repnotify set the new material to the mesh
Then just change the material on the server and you're done
I mean, I haven't heard of third-party getting UE5 access but if companies are trying UE5 right now, they're close partners of Epic that understand it'll be a while until it's ready for production. Fortnite isn't on it yet, and Fortnite is usually the first to use any new tech
So I wouldn't worry too much
(And I would also expect any announced but unreleased tech to not be as good as it looks in the announcement, because that's life)
does multicast only execute on client, if player (client) near/rendered the object?
becoz in my case, it only trigger the multicast on client if i render the object (near the object)
yeah I see, thanks. they announced it for first quarter of 2021 in preview. Not sure they will make it as there is 1 week remaining. Anyway it's better they take more time and polish their stuff
however it always triggered on server
void AMinionC::Multi_SpawnEffect_Implementation(FGameplayTag _LaneTag, UCharacterDA* _MinionData)
{
if (GetLocalRole() == ROLE_Authority)
{
UE_LOG(LogTemp, Warning, TEXT("SERVER"))
}
else
{
UE_LOG(LogTemp, Warning, TEXT("CLIENT"))
}
it wont triggered on client if the actor no rendered by the client
Multicast should execute on all clients if called from the server, as long as the actor is relevant for the client
what it mean relevant?
Information about Actor relevancy and priority
becoz in my case, it called on the client if i get near the actor
Try making it always relevant to confirm that's the issue
They probably won't make it til the end of the year, I'd expect more news about it if it was close. And it's not like Epic is known for releasing large engine features on time - what Lumen does was very literally promised for UE4 at launch.
Dynamic indirect lighting was shown in demos in 2012
And then it didn't make the cut
what am i doing wrogng
i spawn actor (replicated) from server
and client see it but listen server not
the location is correct
with print string i check that is spawning only on server
and client see it
but server not
@woeful ferry @bitter oriole thx - this basically what I want to do - i tried putting parts of this into a rep notify but the set material still only happens on the server. the rest happens on all clients too...
Can't read the graph on that image, it's too small. But basically
- make a "current material" actor property
- make it repnotify, have the event set the material property to the mesh
- make the actor replicated
- change the material property on the server
@bitter oriole em how do I create an actor property? ๐
oh ok i thought it was something different
i put this into the OnRep Function...
and i am seeting the "current material" on the server. but I get this error:
Did you assigned something to that Main Mesh property?
Overall OnRep looks fine though
what do you by "assign"? just the graph above, but i think it does not like the loop
The actor was just in the scene when the game started, not sure who owns the actor in that case
should i let the server spawn the actor instead of having it in the scene at game start?
Sorry Fele, my comment wasn't directed at you :)
haha oh right
If u set in network emulation incoming ping and outgoing ping to 50ms, does it mean it emulates ping as overall 100ms? Also should i set it for both server and client, im not sure what exactly it means, because ping always between server and client?
You would have to call your server RPC in actor that your local client owns like Character or PlayerController. Just route it through either of them
Jetbrains have got UE5 access.
And they added UE5 support in rider.
where did you get that from? never heard of any rumour like that
Hello. Does anyone knows why I can't get CheatManager in standalone game as listen server. If I try to play as offline, then it works in standalone. Also it works if I play as listen server in PIE.
Could someone clarify if my solution stated in this topic is the best solution for handling Multicast from a client: https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1872208-replication-of-a-child-static-mesh-hull-turret-on-a-tank ?
I've got some issues with replicating movement / rotation of the turret of my tank. Everything is working on the client, but it's not getting replicated to the server / to other clients.
For the hull I use methods which call the charactermovement, but I don't see a viable option do do that for the Turret rotation since it's
Definitely not
- Client is sending a reliable RPC on every input tick.
- Server is sending a reliable multicast on every received RPC (worst-case, every tick).
- It looks like RelativeRotation is replicated already, so you should just use a RepNotify to set the rotation (and throttle the server RPC)
If RepNotify for RelativeRotation isn't feasible, then replicate a float of your own - and set up a RepNotify for that.
It's also definitely not going to stay in sync
yea i was looking into that, but couldnt really figure out how to do that. (never really wordked with repNotify)
What you should replicate is the rotation of the object rather than the input or the rotation rate
So the way it's handled now would create unneccesary stress on the network I assume
yeah, but also it won't work outside of the editor
Because as soon as you introduce any packet lag or loss, or if the server/clients are running at different framerates, it will go out of sync
Do it like this:
2) Client applies the input, then calls *unreliable* Server RPC with the current yaw of the turret (not input), Throttle the RPC so it's only called at a fixed low rate (like 30 FPS)
3) Server receives that RPC, sets a replicated "CurrentRotation" float and sets the turret to that rotation.
4) "CurrentRotation" should be set to the "SkipOwner" replication condition. In the RepNotify, set the turret to that rotation.```
That's a decent enough starting point
Ok thanks!
If you want to smooth out the updates to rotation, you just interpolate the turrets rotation to the value of "CurrentRotation" locally on each instance.
Got no time right now, but i'll try this out in the weekend.
really appreciate it
This is my first multiplayer project in UE so it's all kind of new and overwhelming sometimes ๐
Sorry for this dumb questions, the multiplayer start is kinda hard for me >_<
But does this make any sense what i've done ?
UFUNCTION(Client, Reliable)
void Client_SprintStart();
void Client_SprintStart_Implementation()
{
if(M_StaminaCurrent >= M_StaminaRegRate && !bM_IsSprinting)
{
bM_IsSprinting = true;
GetCharacterMovement()->MaxWalkSpeed = M_MoveSpeedSprint;
Server_SprintStart();
}
}
UFUNCTION(Server, Reliable)
void Server_SprintStart();
void Server_SprintStart_Implementation()
{
if(M_StaminaCurrent >= M_StaminaRegRate && !bM_IsSprinting)
{
bM_IsSprinting = true;
GetCharacterMovement()->MaxWalkSpeed = M_MoveSpeedSprint;
GetWorldTimerManager().SetTimer(M_SprintHandle, this, &APlayerCharacter::Sprint, .1f, true); //start timer only on server
}
}
I'm not even sure if i should have some kind of authority guard in here cuz it seems to work just fine without them
Yeah tbh the tutorials Epic provides aren't exactly great either
@vague fractal it will break under adverse network conditions
@vague fractal tbh rather than setting MaxWalkSpeed directly, I prefer to override GetMaxSpeed() in the movement component and return a different value based on sprinting or not.
Then save + restore the "is sprinting" bool as part of movement
it is the extra bool IsSprinting that will get you
as with a little bit of variance and client spamming the sprint button
condition to start can pass on client and fail on server
I've tried to extend the movement component, but i didn't got it to work. Maybe i've made smth wrong or my tutorial was already outdated :s
you end up with different speeds, which means ungodly jitter
What would be the way to do it ?
ShooterGame has a pretty basic implementation for sprinting
extending CMC is a solid way to go about it
CMC ?
but you do need server to send a client RPC back if its if condition fails
to knock the client out of sprint mode
character movement component
and CMC tutorial wasn't outdated, the thing is as ugly as ever ๐
I failed due to this code here
void UMyCharacterMovement::UpdateFromCompressedFlags(uint8 Flags)
{
Super::UpdateFromCompressedFlags(Flags);
//The Flags parameter contains the compressed input flags that are stored in the saved move.
//UpdateFromCompressed flags simply copies the flags from the saved move into the movement component.
//It basically just resets the movement component to the state when the move was made so it can simulate from there.
bWantsToSprint = (Flags&FSavedMove_Character::FLAG_Custom_0) != 0;
}
I was able to see how i've set the bWantsToSprint to true with the setter method, but this line here has always setted it again to false
So i gave up on it >_<
I guess i should just try it again from scratch and hope it will work this time
Is there anyway for the player to Logout themselves from an online game? Players can 'exit' from the pause menu and I call UGameplayStatics::OpenLevel(). This ends up calling Client travel. I want to have the player leave the session and I am not sure where to look. Is it an Actor thing, a Game Instance thing or other?
it should be handled automatically
when player changes world via non server travel, the engine calls SessionInterface->LeaveSession
Thanks, I will be testing the online again later today so I'll be able to check if the code I have works as expected
I am working on a leap for a character that has to start and end at a specific place and finish in a specific duration. Is there a way with a single timeline to have a character move in an arc-like fashion (Basically start at position A, move to position B (middle in the air), then to position C (back on the ground).
I've tried character launch with suggested velocity but wasn't thrilled with the results
basically trying to pull off a nice and smooth leap in multiplayer where the player leaps from their position to their mouse cursor (topdown). The leap itself needs to be fast as this is a fast paced game.
use RootMotion sources, you could make an async task in c++ to do this
takes in destination location, duration, and a curve which adjusts the Z
works over multiplayer without corrections (unlike a timeline)
I would need an animation that moves the root bone though, correct?
If you don't mind cheaters just clamp movement input when not sprinting lol. Dirty but it'll work.
How can you throttle an RPC to a fixed rate in Blueprint?
You can't really
You can fire an RPC once every N frames
You can fire it at a timer (but it'll still fire during frames)
The RPC will be received at randomized times though
Because of this comment by @chrome bay about how to fix my replication on turret rotation
yeah I started working on the solution but can;t figure this part out ๐
Something like that
It would work in your case because "Something" was an input axis event which fires every frame anyway, but otherwise you'd have to tick it or something
Ok will continue my work in the evening i guess. Got some father daughter quality time now ;). Thanks again
@bitter oriole i got it working somehow, but i think its wrong... ๐
what exactly did you mean with "current material" property? i assigned the static mesh component to another repnotify variable...
but as far as i understood, the repnotify should be a material, correct?
Components cannot replicate, other than their basic existence
That is, making a component replicate does nothing out of the box
What you need here is to replicate the high-level information, which is which material you want
So make that a replicated variable and when that variable replicates (repnotify event) you can assign it to the component (not replicated)
Last time I checked, "reliable" only meant "Crash the client if this doesn't go through" ๐ค
That's not what it does at all
"Reliable" means "block all network traffic by resending this constantly until we get a packet from the remote end that confirms the reliable packet was 100% received"
returning false from _Validate function is what kicks the client
(It doesn't literally block all traffic - just the reliable calls, and it does generate a lot of additional traffic when packets are lost)
But if you send reliable RPCs on tick and do this too much client(s) can disconnect/kicked, right?
Because traffic will go crazy
I thought even unrealiable events have those crazy retry attepts, the only difference was that when the retries run out, unreliable events say "oh, well, we tried" and give up vs reliable events that crash and burn the client 
dumb question: Can I have a _Validate in blueprints?
Unreliable just tries to send once and doesn't require acknowledgment from remote end
I don't know about RPCs in blueprint - never used them
Unreliable does not retry ever
Anything that is not gameplay critical (hit fx and visuals) is usually Unreliable.
Anything critical (player killed, item picked up, etc) would be Reliable.
Aiming, moving is typically unreliable
Reliable is a high bar
It has to make or break the game
Moving is always unreliable because it's sent on tick and you do not want your 144hz player retrying lost packets when network goes down
Plus movement is extremely processed on servers, so missing one second of data is fine
unreliable movement won't have you dropping inputs tho? ๐ค
Sure
That's better than retrying
Consider this : retrying for movement is pointless
You have newer data available
newer WRONG data tho
No no
because you dropped that jump input
client thinks is on another platyform
everything is wrong
ohhh, good point ๐ค
But movement in multiplayer action games is different on all clients and the server, yes
It just has to be close enough
Hi, can someone tell me if I can make client side movement without replication on a multiplayer game? I want clientside movement, without opdating my player position severside.
I guess that you don't replicate the thingy? ๐ค
u can turn off replicated movement @golden nest
when i turn it off, the client start running at high speeds
Is it the correct way to have my _Validate and _Implementation functions in my .h? Otherwise the compiller panics ๐ฆ
@bitter oriole spent the whole day trying to understand this replication stuff... ๐
finally figured out what cause the error i got when using repnotify - it was the spawned component which was set to "should replicate"
but without this, later connecting clients dont get the actual state of the actor. is there way to "catch up" on connect?
You'd only need the declaration in your header, the definition can be still placed in your source file
yeah, definitions go to the .cpp I just wanted to know if the .h declarations should be there or I was breaking some macro stuff ๐
Ye, it should be in your header
Now, for my next trick... the Implementation will be virtual pure to be implemented in BP while the validation one stays behind 
Now there i'm totally out xD
you just PURE_VIRTUAL the sh*t out of it
Is it possible to set a password on a dedicate server instance?
With a custom code of course. AFAIK there is nothing built-in
You use replicated properties to reflect the state of the actor. Repnotifies will always be called for newly joined players so they can "catch up"
Blueprint-implementable events (native or otherwise) can't be pure virtual though
or virtual in general
It has to thunk into the BP VM, so if that is pure virtual (in a world where that is allowed) you'd have to copy that functionality around
is playerstate ping accurate enough for rewinding or verifying timestamps of client RPCs?
I've built a lobby screen for people to select their characters. This is it's own Map, GM, PC, etc. When people are ready, they load into the game (switching Map, GM, etc) with the selected character classes.
I can get this to work using ServerTravel - but that means running Standalone, and hence I lose access to debugging / working within the UE editor. Is there another way around this? My question is more around how do people manage development if they use ServerTravel as part of their gameflow? I feel like this is a massive impediment, but I might also be missing something fundamental in how this can be managed.
Listen server should work if you are using standalone. ๐ค
for dedicated you need a source build of unreal and to actually make a build of the dedicated server, standalone isn't enough ๐
Yep - no worries there.
Listenserver can servertravel if you run them standalone
and if you need to send data forward, you need seamless travel
and then, playerstate has the CopyProperties
and GameMode has "on controller switch" or something like that
I used the copyproperties so I don't remember the gamemode ๐
yep - I think it's something like onControllerSwap or somesuch
Also, for the regulars here... is this really that common of a question? I asked it and this is like 3rd or 4th time I see it asked ๐คฃ
heh so true ๐ So I can get ServerTravel to work, but my real query is if I run StandAlone I no longer can work with the editor (ie cannot debug my code)
You can cheat this I thiiiink ๐ค
Try loading 1 standalone (your listen server) and then 1 PIE and try to connect with the PIE to the standalone listenserver.
This just occured to me, maybe somebody more knowledgeable will tell me I am worng ๐
So 2 copies of the engine. Will try
๐ค
So they can see each - can confirm
now...
WILL
IT
TRAVEEEEEL? ๐
I'll have to fix the code up to see if that will work
(I've broken and rebuilt the system a dozen times trying to get open level working (so I can debug)).....
bbs
Seems to work!
You will only be able to debug client stuff tho ๐ค
remember, server is still riffing standalone
It's a bit painful though, b/c any changes 2 copies mean you need to shut one editor down to make changes...
Yeah that too
I just noticed if I start an editor as Play As Client it kicks off a dedicated server
You shouldn't have too many things to test in servertravel tho ๐ค
after servertravel is working you can just start directly on the map you want, listenserver and PIE
or heck, even dedicated + PIE
So really is the advice, find a way to avoid testing that involves servertravel until you really need to?
that's what I am doing ๐คฃ
I was going that way then thought "surely this isnt how it's supposed to be"
Cool - I think I know how I might approach this now. Thanks yet again (and for answering a very similar question of mine a week ago :))
I am at a loss... I have some UI stuff that i want to happen on the local client only. I have tried is local controller, I have tried Role Autonomous proxy, i have tried casting for player controller.... no matter what i do the ui is being effected by other pawns.
Have you tried creating an event and marking it owning client?
dunno if that will work cause its a tree that is triggering the UI and the UI gets bigger or smaller as you walk closer of further from the tree, so i dont thing owning client will work cause the tree is owned by the server
I put a UI Widget on the tree and have it hidden on all clients. When a client enters its detection sphere it casts to the player and immediately checks role before performing set visibility and the size.
UI only exists on the client that sees the UI ๐ค
It's not replicated at all ๐
checks role
how? ๐ค
try getting the controller, if you can either you are the client that owns that controller or you are the server ๐ค
if you got a controller, then check if its a local controller
get the owner of that character
it will be a controller
if it is valid, then you are the owner or the server. check if islocalcontroller to see if you are the client
(listenserver might be server AND the localcontroller, that's why you want that one and not just an authory one)
I think i know what i did wrong... its resizing on tick and that is missing its role check DERP
yea, i feel dumb... i was setting pawn variable and everything to check it in tick and i forgot the node lol
Hello everyone, I'm encountering a very weird situation. For context, this is my simple movement setup with replication (WASD top down, like a twin stick). But it's not about that...
I packaged the game and I've tested multiplayer with 3 different computers. PC1 is my main computer, where I'm working on the project, then I have PC2 and PC3, if specs are important I'll clarify, but PC1 > PC2 and PC3, even though PC2 and 3 have alright specs and somewhat recent. Now here's the problem:
When I host on PC1, and only on PC2, character movement on PC2 and PC3 is extremely slowed down, like dragging, like 5% of what's supposed to be. However, if I host the game on PC2 or PC3, every client movement works correctly.
I would hope someone could have some clue of what might be happening, I suspect it's not about the project but something external, and unfortunately, I'm clueless and confused ๐ Has anyone experience this?
Thank you
is it a firewall issue on PC1? Windows defender or something causing lost packets?
firewall, doubt it but I'll double check (maybe there's something more to it, but I have to allow it or I wouldn't even be able to connect), I forgot to mention it's an internal network
you are not proxying the movement ๐
make the client do the same thing the server does
otherwise you send the request to move, wait for the roundtrip and then move
feels supper laggy
asume the user isn't cheating and show him moving. If he was cheating, eventually the server will snap him where he should be
(unreal player character is proxied by default)
so i ran the online subsystem module over my local network that is port forwarded how would i connect to a different ip adress?
run command open <ip adress here>
@frank birch Thank you, I'll see to that, but would that explain why when PC2 or PC3 hosts the game, this issue doesn't manifest?
in unreal or cmd?
@hearty tulip with code as is, the only "smooth" movement should be from the player hosting the game
@drowsy arch this thingy
i use c++
UWorld::Exec(...)
GetWorld()->Exec(GetWorld(), TEXT("MyAwesomeConsoleCommand X Y Z"));
so getWorld->Exec(GetWorld(), TEXT("open 1.whatever"));
or
getWorld->Exec(GetWorld(), TEXT("open <1.whatever>"));
and do i do that before i join the session?
GetWorld()->Exec(GetWorld(), TEXT("open x.x.x.x")); or whatever the autocomplete says it's right ๐
that command is what joins the session ๐
what do you mean?
ok, let's see, do you have an online services or are you using the default empty one? ๐ค
ohhh, you have steam subsystems ๐ฌ
yeah, no, I have no idea
did you setup your steamworks files? (I am just reading the docs now ๐ฌ )
yes most likely?
i am not sure to be honest but i can run it from computer to computer
over my port
what is your problem again then? ๐ค
i wanna connect to someone else over the internet
and what do you mean by this? ๐ค
i can run it from computer to computer on my router

