#multiplayer
1 messages · Page 27 of 1
confusion. Mine returns remote regardless
Confusion. I have no idea without seeing code and proofs
nvm. I'm dumb. Dedicated server means they're all clients when running it. Sorry for wasting your time
No worries, you're welcome™️
I'm fairly new to Unreal and multiplayer in Unreal. Through some experimentation, I've discovered that PlayerStates are replicated after login rather than at/before login like PlayerControllers.
I'm wondering what the reasoning is behind this, and if there's a way to force a client's own PlayerState to be sent to it at login?
Or does this have to do with the Net Load on Client option?
Found an answer to this one, in the engine code PlayerState.cpp L24 there's this comment:
// Note: this is very important to set to false. Though all replication infos are spawned at run time, during seamless travel
// they are held on to and brought over into the new world. In ULevel::InitializeActors, these PlayerStates may be treated as map/startup actors
// and given static NetGUIDs. This also causes their deletions to be recorded and sent to new clients, which if unlucky due to name conflicts,
// may end up deleting the new PlayerStates they had just spaned.
Hi, I created a custom dedicated server which works fine on desktop. Next, I wanted clients to connect from their android mobiles and iPhones too, is there a way to achieve this?
Hello all. I am trying to replicate a mapvariable type, but dont work, y read somewhere that if you put your map inside a struct you can repicate the struct. I did but it seems that the map is still not reeplicated. I aded a control variable inside the struct, and that one is replicated inside the struct, but no the map. Any suggestions? there is a posibility to do it or a workaround to fix the problem?, i am working in 4.27.2, Thanks in advance.
Hey guys I followed unreal documentation for enabling steam in my game, it works fine when packing the project in development config or package config, but when i package in shipping config steam doesnt work. Any ideas?
Hey guys. Does anyone have a definitive answer for when properties are guaranteed to be assigned on the client if I replicate them using COND_InitialOnly. Are there any guarantees they are assigned before BeginPlay or is there some other method I can override to run initialisation based on initial props?
Oh and also at what point does the server compute the 'Initial' value to send to the client? IS this after begin play?
Maps are not replicable. Putting them in a struct won't change that (nothing will). Those suggestions would be telling you to use a struct containing a key and using operator overloads to find it in a tarray of that struct
Usually POD types are assigned before BeginPlay, and they are read in PostNetInit. Unmapped references should be wrapped with OnReps.
The point is somewhere after the actor is spawned and before replicated props are gathered (could be same frame the actor is spawned). That's why you can set values exposed on spawn and they will be read properly.
@grand kestrelThanks a lot, thats i did
Hi
I managed to create a session and join with another computer via IPv4 address of the host with (open 192.168.147.x) command, however that only works inside a local network (or when using hamachi) I wonder if you can use a more specific IP address to connect to a session that is not inside if a local session !?
You can yes, but that requires the other person to port forward (or indeed use something like hamachi). Considering this is something most people won't be able to do and really isn't a standard that's likely not a good option for a game though. Normally you would use some kind of solution that takes care of all this stuff for you in one way or another. Steam provides a relay network / session service to do this. EOS does the same as another example. Photon provides this as well but paid (although I have no idea if this even works properly with Unreal honestly). Look around and see what you like I guess, they unfortunately all have theirs ups and downs.
Is the steam Network usable for free ?
If you have a game on their platform it's free to use yeah. (There's also a development app ID you can use for testing purposes if you don't have a store page etc. yet). The downside is however that this only works for Steam users.
Is there a free option ?
A free option for what?
For connecting players to a hosts session
Outside if a local network
Without the additional use of hamachi
are you using dedicated servers or is it p2p and small sessions
If you're only on Steam and don't care about being limited to just Steam you can use their services for free. If you want cross-play for free the only option is EOS (Epic Online Services). But that does require people to login with an Epic account I believe and is still relatively new.
WELL, free is a strong word here
@paper trellis listen server model
100€ initial fee and then 30% onwards
Yeah but compared with EOS which is actually free
EOS is just as much "free" as Steam is lol.
EOS does not take a cut
Nothing is ever truly free 😛
But EOS it self indeed doesn't take a direct cut.
EOS also has no initial fee
That only comes up if you release on the EGS
Which is a different story
ah rip yeah was gonna say if its dedis you can just tell people to stop being lazy and portforward
or hire from a server provider that will do it for them
Well sure. But by those means no one forces you to launch on Steam either.
Would absolutely kill your game though, but you know xD
You can't use Steam's Systems without though
You need a custom AppID
But if you don't launch on Steam you also don't need it. But again that would just be weird.
Only because you let people download the game from your own website doesn't mean it's not running over steam
And if you don't launch on steam then you won't get keys
I doubt you can get away from this
You need User Accounts with the Key added
I want to make it co op , hamachi appears to be the best option
The 480 one doesn't count for testing/development purposes?
There are not many games that create their own website these days lets be fair.
Yeah but we are talking about release
I wonder if there are any games that still use the 480 app id with their games xD
Yeah but what I mean is: If you want to use the Steam Subsystems, like MasterServer for Sessions, you need your players to have the game on their account.
And to have the game on the account you will need to release it on steam.
Spacewars game
Yeah fair enough.
Unlike EOS where you can use EOS with your own Account System
Hosting that is obviously not free, but that's besides the point
The thing that still worries me about EOS is that Epic loses a lot of money with it with no way of ever getting that back, I would be surprised if they do it like this forever tbh.
Especially if it gets more popular it will just take more and more money.
Idk, but I don't picture Epic like a company that goes back on their word for the free part
But in the end people still need an Epic account right?
No
It's a bit confusing for me too, but EGS counts as just another Auth Provider here.
Same as Steam, Sony, Microsoft etc.
And for Auth you can also use other things, like plain Email + Password iirc
Or even DeviceID if that fits your product
Surely with steam as an auth provider, it uses your steam account?
🫠
Yes, that is an example of course
The idea of EOS is crossplatform
Huh. I just saw a message as well in #epic-online-services from an Epic employee saying the same. My brain can't comprehend that x)
Which means you wouldn't use Steam for anything else but auth
It's the same idea as using your Google Account to Auth on Random Websites
Just that it's not only Google, but multiple different ones ,that are all connected to the same EOS account
So you can share progress
So EOS can use any auth provider (even your own) and is completely separate from EGS?
Or even play with PS vs Xbox
As they share the same EOS MasterServer for lobbies
And the same Unique NetID
But in theory you can just go with your own account system, Epic Accounts or whatever, use that as a login provider and boom you have true cross-platform everything. That's weird to say lol.
Yes
Nice to know!
Just without the price
And still existing
Playfab still exists I believe.
I'm still shocked that it doesn't require an Epic account 🤣
Yeah I think Epic Account is EAS
What would you choose to display UI stuffs depending on network data ?
- Wait all data then notify the UI
- Construct the UI with bindings, and notify on each event ?
I'm not sure that the 2nd solution is safe if data can be replicated before the UI is constructed
UI itself binds to Callbacks
Do not set it up to notify the UI by getting a direct reference to it
That's the worse setup that really doesn't scale well
But is it possible to have a data replicated before the UI is constructed ? The bind would be too late in this case
- Create UI
- OnConstruct
2.1. Get Object and bind to Update Callback
2.2. Ask Object for newest Data
Ok thanks !
or you can use gameplay message router from lyra if you on unreal 5
With the gameplay tags ?
yes
Mhh i will check again how it works
What's the benefit using gameplaytag version ? Is it just to have a generic interface ?
Are actors guaranteed to be successfully replicated (ie. received by the client) before any of its variables, or components?
I'm guessing Unreal would send network updates of the parent first, however they could be received by the clients out-of-order, so the answer to my question would be no - is that correct? thanks
and as a followup, if the client does receive a child variable first, will a ReplicatedUsing/RepNotify fire immediately, even if its parent hasn't yet been received? eg. say I have a PlayerState with a field int32 Level. is it possible for a RepNotify on Level to be fired, before the RepNotity for the PlayerState?
Is it poossible to keep player state when travelling between servers?
The repnotifies you are referring to are of different actors (they are not in the same transition unit) so the answer is no. However, there is no such a thing that a property replicates before its actor replicates. A property replicates through its owner actor channel, so the owner actor must replicate first.
For order there is no such guarantee even if they were in the same transition unit (in reality there are for POD types but you shouldn't comply to it)
Article written by Alex K. From the documentation for Property Replication: “Actor property replication is reliable. This means that the property of the client version of the Actor will eventually reflect the value on the server, but the client will not necessarily receive notification of every individual change that happens to a property on t...
It's kept by default when seamless traveling but not when hard traveling. Check last pinned message. It is possible but you shouldn't do it
Probably
Is it possible to get notified when object variables are fully replicated without checking all onRep for each variables ?
PostNetInit
Should be this i guess
PostRepNotifies
Perfect ! Ty :p
hey all...
how does OnRep work for an array of actors
for example, i want each client and server to have an array of the units they have spawned
would the system send the entire array over network anytime a new actor is added?
No. Only what changed. TArrays replicate deltas
[OnlineSubsystemNull] I have a dedicated server which creates a session through a custom Game Session class's RegisterServer() method (as in ShooterGame). However, players join the server using the open command and not through FindSessions(). How can I get them to join the session created by the server so they can share voice chat?
Override HandleOpenCommand and call FindSessions in there?
Well, I can call FindSessions() at the same time as I execute the open command, but looking at the FindSessions() implementations I'm not sure how I'd identify the specific server.
Looking at FOnlineSessionSearch and FOnlineSearchSettings I don't see a way to specify the IP address and port, for instance.
oh really? brilliant
/** The ip & port that the host is listening on (valid for LAN/GameServer) */
TSharedPtr<class FInternetAddr> HostAddr;
From FOnlineSessionInfoNull
Not sure if this is what you're looking for, and whether this is valid for dedicated
Thanks, saw that but it's in a private header and I was wondering if there was a less hacky way of doing things than making it public. 😄
Oh well, guess I'll go the hacky route.
There is no Getter? 
Just a getter but no setter.
So I can't set the IP address I want for my search filter.
Ah you want the latter
I mean there is SetIp and GetIp
But I can't seem to find how you can retrieve the HostAddr pointer
Well they have it all in FOnlineSessionInfoNull::Init
This is what they do: HostAddr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->GetLocalHostAddr(*GLog, bCanBindAll);
Oh wait, I think I see how to do it.
I don't think I need to hack this.
It's just that I need to call FindSessions() not via the client's online subsystem pointer but through the custom Game Session.
Heck, I could just have the Game Session return its session directly, no? 🤔
I've never done multiplayer stuff so I'm not sure.
Yes, because you already connected to that server
So you do it using the server's GameSession
Thanks! I'll try that.
I've never done #online-subsystems that deeply but it makes sense 😛
Just to check, on a dedicated server does AGameMode::BeginPlay() run on the client when they join the map?
No. There is no GameMode instance on the client's instance of the game
Thank you. 🙂
only TArrays right? aka not a std::vector
Right. The STL containers can't be serialized, so ofc not.
Hm, I am quite confused about FindSessions() and JoinSession(). Are they supposed to be executed on the server or the client? In ShooterGame all those calls are routed through GetWorld()->GetAuthGameMode()->GameSession, which in my understanding only exists on the server.
Client. Clients are going to be finding and joining sessions. They get routed through the GameMode because at the given time, the client does have a GameMode because they're not actually connected to anyone else yet.
Though in ShooterGame they seem to be called from the server as they seem to connect to the server first and then find/join sessions. So I guess it depends.
Thank you both!
Guys it is possible to load my player later ? for example I start game I am in menu but in background my player is already loaded and his variables too
I want load it after I will hit for example Lobby map
he is created immediately after game start
I dont need it
You can use a specific Game Mode for the main menu map that doesn't use the default pawn.
so 2 game modes? and own pawn
ahh
and its normal every game is loading player immediately?
or they doing it later
i have problem with widget there
i create player with widget but its propably too early and then when I package it my client crash
but in editor its working
this widget I have it binded to nick which has static text value TEXT but its falling
Trying to call a server function but litterly nothing is happening. I've been trying to figure out what the problem might be for hours. Am I missing something? I think this is the relevant code.
Worth to note, I have set up some boilerplate for GAS, but I would hope that wouldn't effect things.
For starts. Don't do this. Unreal already handles this for you. If it's called on a server, it'll just run the server function, which should do the same thing for a listenserver and a client. This should be nothing but ServerRequestBuild.
Second, I assume that the ServerRequestBuild is UFUNCTION(Server, Reliable) ?
And what is ServerRequestBuild doing to test if it's working or not?
There is a good reason to use that pattern - if you want to predict the action on the client and do a server call.
That's not what's happening here though.
Yes, that's correct UPROPERTY(Server, Reliable)
So, I'm actually testing the ToggleBuildMode, but the function look the same. It's just a regular UE_LOG at the moment.
I need to stop writing UPROPERTY when I mean UFUNCTION. 😂
Printscreened the wrong function.
ToggleBuildMode isn't an RPC though?
At least not in what you sent. You don't have an Implementation function.
UFUNCTION(Server, Reliable)
void ServerToggleBuildMode();
void ABuilderCharacter::ServerToggleBuildMode_Implementation()
{
UE_LOG(LogTemp, Warning, TEXT("Server Toggle BuildMode"))
if (IsValid(BuildSystemComponent))
{
BuildSystemComponent->ToggleBuildMode();
}
}
There you have it
Does it work when called on a listenserver?
Yes, everything works on server
How are you calling it? Cause that'll definitely work on an owned character. Will not work if client tries calling it on another character.
Hmm, by input
void ABuilderCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ThisClass::Jump);
PlayerInputComponent->BindAction("Build", IE_Pressed, this, &ThisClass::RequestBuild);
PlayerInputComponent->BindAction("BuildMode", IE_Pressed, this, &ThisClass::ToggleBuildMode);
PlayerInputComponent->BindAction("SelectWall", IE_Pressed, this, &ThisClass::SelectWall);
PlayerInputComponent->BindAction("SelectCeiling", IE_Pressed, this, &ThisClass::SelectCeiling);
PlayerInputComponent->BindAction("SelectRoof", IE_Pressed, this, &ThisClass::SelectRoof);
PlayerInputComponent->BindAxis("MoveRight", this, &ThisClass::MoveRight);
PlayerInputComponent->BindAxis("MoveForward", this, &ThisClass::MoveForward);
PlayerInputComponent->BindAxis("TurnY", this, &ThisClass::TurnY);
PlayerInputComponent->BindAxis("TurnX", this, &ThisClass::TurnX);
if (AbilitySystemComponent && InputComponent)
{
const FGameplayAbilityInputBinds Binds(
"Confirm", "Cancel", "EGASAbilityInputID", static_cast<int32>(EGASAbilityInputID::Confirm), static_cast<int32>(EGASAbilityInputID::Cancel));
AbilitySystemComponent->BindAbilityActivationToInputComponent(InputComponent, Binds);
}
}
Would think it would work then. 😦
Input function is running fine on client as well?
What's in ToggleBuildMode, just the server call?
So, I have a thought.. The only Bind I've actually set up for GAS but not yet using for a GA is BuildMode. Might it be that GAS is blocking that for client somehow?
I'm new to gamedev if that was not obvious already.
ToggleBuildMode is just flipping a bool on a BuildSystemComponent
What actually calls the server function though if not that?
Don't think I understand your question, but I do not think anything is calling the serverfunction?
Might be missunderstanding you.
You said you're getting the log on the server, but not on a client. So I assume something somewhere is calling your ServerToggleBuildMode.
Oh, no, I do not get the log on the server.
I took that as when client uses it, no log.
I guess since I check for Auth and just call the function on component directly
Which I will change since that was not how it was supposed to be done.
I'm more confused because if nothing is calling it, then where is the expectation for the log to run?
I guess, since I had en else, and call it if not auth it would be called if you're a client?
Oh, I think I've done something wrong here.
void ABuilderCharacter::ToggleBuildMode()
{
if (IsValid(BuildSystemComponent))
{
BuildSystemComponent->ToggleBuildMode();
}
else
{
ServerToggleBuildMode();
}
}
Just noticed that I do not check for Auth, BuildSystemComponent is always Valid so the server function will never be called.
Sorry for taking up your time, appreciate the effort though.
You don't need any of that except for ServerToggleBuildMode(); Prediction for doing it quicker on the client can come later if you want client authority on it, but for starts, you should just let the server set it and let it replicate as a state back to the client.
Thank you!
How can I ping the IP, so I can see latency between host and remote?
There is compressed latency value in the PlayerState for each person.
I don't need a latency between client connected to the server, but client and any other computer
As in another client?
e.g. I have client and 2 servers, and I need to know with which one I have faster connection, and then connect it to this one
Seems like the session search result carries this in PingInMs
When I change my AppId in DefaultEngine.ini from 480 to my own AppId, the steam overlay stops working/it no longer uses steam to sign me in and show my profile. Is there something I need to do in Steamworks?
you only need to add those definitions on the server Target.cs right? or is that wrong
if that's right, i have them there. but I wasnt sure what to put for GameDir and GameDesc so I just put the product name in both spots
No idea tbh. I vaguely remembered that it was asked few days ago so I linked (it's also in pins). Might be a good question for @pallid mesa
also i'm using UE5 which I believe the keys are slightly different for (UE_PROJECT_STEAMSHIPPINGID)
ah ok. thanks for flagging
Yeah would be a good idea if he could elaborate on that and add/edit if there's any changes to UE5 🦆
How is AActor::HasAuthority() different from AActor::GetNetMode() < NM_Client?
Ah wait, is the only difference that for client-spawned/client-only actors, the client has authority over them?
Do you have any ideas why do I get crash?
It happens after connecting 2nd player to session ;c
Its seems blatant but i want to see if anyone knows how i can make this replicated. ive been searching stuff for 2 days and i cant seem to find anything online. i really dont understand how you can replicate an overlay change that removes a Actor from a socket
please @ me if you have any input on this
You must “own” the game on Steam if not using 480. So make sure your Steam playing account has been given a developer key on your SteamWorks account
Secondly, if packaging the game in Shipping Build, but the game is not released, you need to include a text file with your App ID in the base folder.
Hi, is it possible to bypass initial replication ? For example, gamestate variables will be replicated before i can initialize some values, so i have to create invalid values to handle that, that's not really clean
dang what the hek is iris
A new replication system
Wait for GameState::PostRepNotifies to get called and then do your initialization?
But onrep functions will still be called (i meant server side initialization so it's require replication)
Right, the former could return true for client-spawned actors.
I'm not sure what you mean
When the gamestate is spawned, the replicated variables will replicate with default values, so onrep functions will be called with invalid values
Because they are not initialized server side yet
How ? The only way i found is to spawn the gamestate manually with deferred spawn
Either that or override AGameModeBase::PreInitializeComponents and set what you want after GameState is spawned
After is too late, no ?
No, it's same frame
Mhh, i will try thanks !
Don't cross the streams man. Break stuff into functions and use OnRep when you can.
Is it possible yet to feasibly (as a solo dev) make multiplayer flying games in Unreal? I know of the 21km^2 map size limit. I see there is a "Large World Coordinates" beta feature. And I'm not sure if UE5 makes this any easier.
updated! 👍
How many players and does it need prediction or not?
The game target also needs it
When I launch separate server as it's own process in the editor, do the logs go to any temp file?
The process is crashing and disappears too quickly for me to grab them from the console
I doubt flying would be a good case for prediction.
It's more physics based, is UE physics engine even deterministic?
Plus you don't turn on a dime like an FPS/MOBA, so you can get away with <100 ms delay and it wont feel that bad
no, but you can look at NPP movement examples to investigate how to do a floating moving pawn the unreal way
the plugin by itself is pretty great, but you'll have to spend some time reading their examples and comments
i feel like this is really poor documentation for how to do this. where is that button supposed to be, and if i dont have access (meaning its not there) how do i get it?
also, with 480, do you need to write something like spacewar as the UE_PROJECT_STEAMPRODUCTNAME or can you write the name of your own game?
Pretty sure you can't generate Keys for the Test App
If at all for your own App
And I would say if you use 480 you need to provide that IDs product name
But at that point I would just suggest getting your own app id
Yeah sorry the context is getting lost — I’m trying to generate them for my own app but asking a separate question about the test app
I do have my own app id I’m just not able to get it to work yet so I’m also exploring the test app id for now as well
Do you know where the button to do it for my own app is? I can’t find it and the documentation just says it’s in the portal
You should be fine. Start by getting a cube to move around with server authoritative physics (if you're using the actual physics engine)
I use it for my vehicle game and it works just fine.
Thanks buddy!
I’m sure it’s a fine approach to use prediction also but you will have to bump the correction tolerance
hi all, lets say I want to move a character with apply force on tick, for a jetpack maybe. Would I run that on tick force on owner, host, and all clients? Or just client and host? Or some other combo? thanks
There is another section in SteamWorks, where you invite/add people/developers to your account. It’s different to public keys, I don’t remember the exact name.
But the idea is you add them to your account, which means they also “own” the game, and this Steam lets them connect to your app.
This is part of the Steam piracy process: if you don’t own the game, you can’t use Steam to connect to its network.
Hey people !
I'm quite new to all of the replication and multiplayer code, so I'm running into an issue that might seems really basic to most people ahah.
I want to replicate my Pitch on the server, for now, only the left and right are replicated not up and down, so I came up with this code :
So it's grabbing rotators of actor and control, doing some math to set the pitch and yaw.
It's using an anim notify that is firing the onRep_pitch and Onrep_Yaw, that are calling the interface to make the replicated values goes to anim blueprint.
It's then setting "aim rotation" that is applying to a transform on the spine 1 - 2 - 3, to make the char lean forward and backward.
Thing is it's super fluent on the server, and super clunky on the clients ( showing that the server is correcting the rotation on the client, most likely thats probably why it's super clunky)
could any of you explain to me why it's super clucky like this on clients ? (Multy casting dont work at all 😄 )
I also tryed an aim offset, that is giving me the same results 😄
As this stands, you wouldn't need to use a server RPC for this.
Event Tick fires on both the client and the server. So your "Set Pitch" event is being called by both client and server which they both then call the S Set Pitch And Yaw.
Therefore, if this is mostly working for you, you only really need to be running the sets that you have there directly on event tick rather than having the client tell the server to do it (and the server doing it itself).
Ideally you'd probably use a HasAuthority (Authority) > switch to ensure that the event tick is only running on the server side.
so basically my problem is using the "event tick node" ? x) I could call it on "input axis" and fix it all, right ?
Again if it looks like it's mostly working fine apart from being a bit clunky, then you could probably just separate tick by using a Has Authority (Authority) > node and from there do your sets. There's no need for the client to RPC to the server on tick just to do that.
is that where you wanted the "has authority" ? It's still clunky, I dont really understand this ^^'
Replication is sopposed to send the info to the server that the client is moving his controller, right ? And then display it on all clients screen
I removed the "event tick" and putted the values to "replicated" directly, then grabbed them into the anim BP with a cast directly, but no changes on the client, still clunky
From Event Tick > Has Authority (Authority) (there's a node that splits it between authority / remote) > Set your floats
I fired it there directly
xD the input axis are replicated directly as well, right ? since we can nativly see the left right turn, right ?
No they aren't.
What you may be seeing is the "Add Control Inputs" being replicated.
But the axis events themselves are not.
okay, thanks good to know ^^
I will make it back to first screenshot and use the proper node this time ^^
well I removed the event and stuff, just used the "envent tick" with rep notify still clunky
Also tested this one, it's super clunky on client this time and not working to make a client lean, but the server shows the client leaning forward... I'm so confused right now
yeah I was thinking it might be my issue gimme a set
I'm triggering twice the same code basically xDD
So both notifys are triggering this... I'm starting to see the logic and now I think that this is calling twice the values and might cause clunky things on clients, right ?
You likely need to gate your OnReps so they only set values if islocallycontrolled == false so it only forces the rotations on clients other than the player who is in control of the character. This should allow your client to properly maneuver themselves freely and then their rotations should be replicated to everyone else.
Might I ask why you don't use GetBaseAimRotation?
It already has the pitch and the other dudes replicated
well from what I saw, we need both Actor rotation and control rotation to make the delta and get difference between both, I'm kinda blindly following tutorial, trying to acquire the logic and the basics about this, so I can make my own replicated code ^^
Well I'm not well-versed with the movement code stuff myself, but that function should be what you're looking for
well I dont know a thing about those, will give it a go, once I figured this out to try to optimise and variate the technics
@sinful tree is that what you ment ? This is Right now only moving for the other clients, and the server but the actual client that is controlling the pawn, is not moving on his own screen.
So I'm guessing when you said "you need to gate", I need a proper gate to open only when the locally controlled is "False" and then set the values and close the gate again ?? 🤔
That's what I meant, yep
well at this point, the client dont control the pitch and the server dont replicate it either ><
Trying to replicate the movement of a spawned actor and is getting some wierd crashes and behaviour. I'm new to game development I should add. Anyone who has any pointers? This is in an ActorComponent.
You should download debug symbols
From launcher, go to your binary version. And click that down arrow somewhere
Searching on google on how to fix debug symbols now.
Thank you! Downloading.
@fathom aspen turns out you were right this node was already replicated and is completely working if I use it directly from the anim blueprint with a cast, it might not be optimised at all tho...
Also @sinful tree I tryed many combinations with the gate and thing, try to use no rep notify and still had the same issue, looks like doing things directly into my anim BP was my only way to get ride of the issue ? 🤔
Thanks to you, i'm still open to any futher opti, explanation and solutions tho 😄
Explain "not optimized" pls
Do you mean the code Epic uses at Fornite is not optimized?
Because that is a very bold statement that uncle Tim won't like
well it's casting to the pawn every single frame into the anim blueprint to get the pawn and its "aim rotation" right ? might be better to pass the data trough an interface ?
- That has nothing to do with the function.
- Casting is not expensive.
- Tick is not bad.
I will save the link and give it a proper look, thanks, it will probably help me know what is great to use and what is not ^^
Amazing, and at this point I would suggest typing a comment of the solution you found in that YT tutorial, so other peeps get the knowledge too
And a tip to not blindly follow tutorials
well the guy just does a "replicate" on his float value into his video, run the game on only one Server and one client, doesnt even try on the client the render, and have no way to test the code between 2 clients, he probably didnt even noticed it's not working xD
And then the second video was into a not replicated project, that I though I could get to work with the anim notify thing I had, none of them actually did what I had, I use them has a "base" and when I dont manage to do it on my own I follow it blindly,
Last tutorial I was watching really helped understanding the logic, what a rep notify does, when to use multicasts etc... so a really decent base
I asked this question in this channel a few weeks ago:
I've got a replicating Actor with two replicated variables on it. If I synchronously change the values of both of these variables on the server, are clients guaranteed to receive the updated values of both of the variables in the same network update?
and was told that I can't rely on clients to receive both replicated variables simultaneously/in the same frame. However, I've since come across this article:
https://forums.unrealengine.com/t/replication-ordering-guarantees/264974
which says:
Another guarantee is that, on a frame when an actor is replicated, all of it’s changed properties will be sent at once, and the client should receive and apply these changes within a single frame (with the exception of unmapped properties). However, there is no guarantee made regarding the order in which properties will be received or the order in which OnReps will be called.
have things changed since Dec 2021?
Also, what are "unmapped properties"?
It might be that the original answer meant that you won't have e.g. OnRep calling at a time where both values are changed. And that each OnRep of those two variables can call in either order.
The second OnRep call would then have both values changed
But again: order
It's usually best to just put them in a struct as already mentioned
Wasn’t there a post the other day by Zlo that said the order is partially defined by the order it is listed in GetLifetimeRepsProp function (for replicated values)
how to check if actor is dedicated server in BP ?
I dont have access to ENetMode i guess
Is Dedicated Server
Right, though I would make my best not to rely on that.
I guesss these kind of functions are not fit for PIE maybe 🤔
They work in PIE just like they work in non PIE environment
Do I automatically own my own game or do I need to generate a CD for me to own my game? I don't see my game in my steam library. Does that mean I don't own it?
I still don't really get how to generate a CD whether its for myself or for a tester
haha i've actually been posting that link and screenshots from that link for the past 2 days
I'm simply not able to find the button that this documentation is referencing
And yes, I am the admin of the project so I have Generate Steam Keys
So you paid the fee, got an application and also created an application from that available slot?
I think so. And what if you navigate to the actual landing page of that?
The other thing you can try is to go to Packages in the top UI. It's in one of the dropdown menus
it's possible that my landing page is bugged
is this what it's supposed to look like?
or is that not the landing page?
the buttons that say "See checklist below" don't actually do anything
What if you click on View Packages under Apps and Packages
oh it actually loaded
those aren't buttons tho
they're literally header elements
Yeah it would list the available packages there usually
oh i see
(i removed some of the images because they were technically doxxing my real name, but lmk if you want to see them again)
Been a while since I saw a fully setup project page. I haven't setup our project yet, only the company
So I can't give you any screenshots of key creation as I don't have any
Also on this. You can still see where your last project call was. Your MulticastSetCurrentBuildLocationAndRotation quite likely accessed a nullptr somehow, resulting in a couple of calls into engine code until it tried to access a property on the null class.
bummer. i think my UI is literally bugged, so I'll just submit a tech request to steam i guess
thanks for lookin at this with me
questions still out there if anybody knows how to generate a CD key, or knows if I even need one to use steam with my own app id (I didnt need one for app id 480 to work)
Yeah you do need to add the game to your library
480 is invisible in your library
All accounts own that iirc
i see. is there a way to get myself to own it in my library without a CD or without actually fully deploying the game to steam
that's what i want i think
at least for yourself, yes
i'm just trying to make it work for myself
DEV Keys will also grant rights on the steamworks page iirc
how do i get a dev key
On the page that doesn't work for you
oh you know that it's not supposed to look like what I sent?
I have a vague image in memory of how it looks like
This video walks you through how to request Steam keys and details the three types of Steam keys.
Lots of more information about Steam keys can be found in our Steamworks Documentation here: https://partner.steamgames.com/doc/features/keys
Questions? Contact our biz and tech team directly: partner.steamgames.com/contact
That video is linked on the steamworks page
Not sure if you watched that before
They def updated the process a bit
Alright, I've been at this for hours, thought I had networking in UE figured out but I guess not. Do a multicast there make sense to you? Right now I changed it so that it does not do any RPC there at all but just the regular logic. It does not crash but it's not replicating properly either.
Is this for letting other people see something that someone is placing down?
Yes, that's correct
Also the movement of a preview being moved before actually placed.
according to this video, my landing page is bugged because it doesnt have any of that stuff on it, just the headers
Yeah could be that the setup process of your app actually has to be finished first or so. At this point it's probably best to ask Steam directly.
@still arch For placement the placer would do this locally so it looks nice for them and they would serverRPC it to server the intended place in a non reliable Server RPC. And then server would set a replicated property that is SkipOwner. All other people would get this property replicated to them, and all non owning clients could just do some interpolation to smoothen out the net updates.
This all leads to the placer having a nice, snappy easy to use look for themselves, and a relatively okay, decent look for everyone else.
The final placement would be just a single ServerRPC to tell the server they want to place it. The new actor can replicate itself back to every client even the placer.
i thought about this, but if you hit View Checklist, it just takes you to that page lol.
I sent a request to steam so I hope I hear back soon!
Not by the computer now but will try to implement this when I get home. Thank you.
@still arch I'm not sure if I have all the context, but doing a multicast for moving a physics object would not be ideal because that process would have to re-execute separately on every single machine connected to the game. multicast is good for personal things like footstep sounds and HUD indicators, but bad for things like making physics objects move on everyones screen (unless you dont care if everyone sees the exact same thing)
Yeah, trying the multicast was my last resorts, just wanted to see if I could get this replicated properly in anyway to understand it better. Thank you for the info. Much to learn.
CheatManager exists only on server, but can exist on owning client if the latter calls APlayerController::EnableCheats()
Do note that it isn't accessible to BP unless you call it as a console command.
Yes, that's what I'm saying xD
But directly calling the method doesn't work from BP.
Fair enough xD
That's pretty much how server travel is done in BP xD
Poor BP peeps have no travel nodes
Though soon enough they will be able to pass seamless/hard travel as options when doing a travel
Which is amazing
How about Epic actually fixes their kick system instead 😄
We don't talk about that here Thom
😔

I want to try and see if I can easily fix it, but I think they will reject it honestly because there's only one proper way to fix it and that might break compatibility in some cases.
Never hurt to try. I would love if they fixed this instead: https://forums.unrealengine.com/t/ue5-seamless-travel-bug-found-we-found-the-cause-and-also-have-a-workaround/583652
There is a bug that occurs in UE5 when seamless traveling that occurs if a client beats the server in loading the next level. There’s a race condition that causes the server to never see that client as having loaded the new level, therefore never transitions it’s player controller over to the new level, and the server and all the clients hang. ...
They fixed the bug that entails listen server not carrying clients with them after a hard travel
But this one 😔
Does that have an issue on the issue tracker? Would love to upvote it.
Exactly, that was the question I asked myself and the answer seems to be no
Which is mind-cracking
What xD
"Lets make an entire issue about this on the forums with a workaround but not post it to the issue tracker.."
😛
I mean it's literally just a few lines of code to ServerNotifyLoadedWorld and to PostSeamlessTravel and hurray
Sure, but if you don't know about this issue then you've a dumb bug that might seem impossible to fix..
They had to add an additional RPC because ServerNotifyLoadedWorld isn't virtual xD
Epic and their non-virtual methods are going to drive me crazy at some point 🤣
At least from my experience there has been a few dudes that came here to realize afterwards that they faced this bug
Epic: Just hard travel, duh
Sure, but you never know how many do have this issue and don't know how to fix it.
It should simply get fixed, there's no reason for it to not get fixed.
To be honest I've never faced it and if I was to bug report it I won't be able to reproduce it, as it seems to be seasonal
How would I make the client load faster than the server
Thread.Sleep(10000) ❤️
But just stating that should be enough I guess
And linking that thread
Well let me ask the OP if they reported it so I don't recreate bug reports
Epic hates you 😔
😦
https://forums.unrealengine.com/t/tech-note-network-vulnerability-in-netconnectionidhandler/631303
I love how they don't disclose this to anyone in a proper way and instead make a forum post only 218 people read.
Tech Note: Network Vulnerability in NetConnectionIdHandler Article written by Alex K. Description: A vulnerability was found during the connection process where a client could overflow the connection IDs, causing a checkf assertion. By default, this won’t affect shipping builds, but if asserts/checks are enabled for servers in shipping configur...
If I have two a FRotator and an FVector that I would like to have replicated, but I would want one repnotify for them since I cant update an actors position before they both have been set. Is there a way to do this?
Make it a struct and replicate that.
As an example I'm doing this in one of my own projects.
USTRUCT()
struct SPACESHIPGAME_API FShipData
{
GENERATED_BODY()
public:
FShipData()
: ShipYaw(0.0f)
, ShipLocation(FVector::ZeroVector)
, bShooting(false)
, HitEnemy(nullptr)
{
}
FShipData(float Yaw, const FVector& Location, bool bShoot, ABasicEnemy* Enemy)
{
ShipYaw = Yaw;
ShipLocation = Location;
bShooting = bShoot;
HitEnemy = Enemy;
}
public:
UPROPERTY()
float ShipYaw = 0.0f;
UPROPERTY()
FVector ShipLocation = FVector::ZeroVector;
UPROPERTY()
bool bShooting = false;
UPROPERTY()
ABasicEnemy* HitEnemy = nullptr;
};
```With the following OnRep
```cpp
public:
UPROPERTY(ReplicatedUsing = OnRep_ShipMovementData)
FShipData ShipData;
You are a saviour, will try this out. Thank you!
Assuming you use C++ that is 😛
You forgot the part where you say "and implement a NetSerialize function for them"
No u
I mean POD types would still replicate the same frame they were changed, but what if they didn't 
Also this way they won't get to a state client-side that never existed server side
A great example is FRepMovement
I have an actor pointer in there, it doesn't care as long as it can be serialized.
Structs by default delta replicate
NetSerializers are great if you have a use case for it, but by default you don't need it. A use case for a custom net serializer is if you need to optimise stuff as you can optionally replicate certain fields at the cost of 1 bit instead of the entire value.
Right, but there are other use cases, including atomic replication which is exactly what they asked for
Why would that matter in this case?
Another question, wouldn't the repnotify for that struct fire once I set the first value, lets say the FVector, and then fire again once I set the FRotator?
I believe it does not detect changes within the struct it self.
But maybe I'm wrong. Not 100% sure.
Because you want to guarantee they are received at the same frame as they are replicated together
Ok, so I would have to instantiate a new struct for every new location update?
Which I guess is fine, doing it in tick though. Expensive?
That's by default. If you implement a NetSerialize for them then they will be received in the same OnRep guaranteed
You could probably just reassign the same struct if it doesn't update.
So I was planning on passing the struct as reference to a SetNextLocationAndRotation() with the hope that the rep notify woud fire once they both had been set.
Again you're looking for this. See how FRepMovement does it
Yes, I will see if I can digest that and look into implementing a NetSerializer.
Moving an actor over the network got me thrown in the deep end.
Also ideally you will NetQuantize your location and rotation which is a win win
Just set bReplicatesMovement=true , duh 😛
For real? Isn't that set when I set the actor itself to replicated?
Thought that was part of the package.
No.
That is set to true by default for pawns
But if that's a generic AActor then no
But still you won't get a CMC-like movement
Oh, so I would basically just have to do Server RPC for spawning the actor and then not do anyhing for the movement letting it be called by clients and the movement will be replicated?
I have to try this out.
It's just a bulding piece. Making a Base building system of sorts.
GetBaseAimRotation ftw
Where is this mentioned? I can't find anything about it and that would absolutely make zero sense honestly.
The whole point of Delta Encoding ("compression") is not that it doesn't bundle together but that it's compressed. That should have nothing to do with how it gets replicated.
It's either tribal knowledge or was mentioned at a knowledge base (or udn?) post
Ah well it is in NetSerialization.h
NetSerialization.h doesn't mention anything about it for me. Unless I'm really blind 🤣
Nevermind I'm indeed just blind lol.
I mean it's me now that is not able to find it lol
Ah ok found it
It's not in the UE5 thingy
But UE4
Literally all the documentation just vanished in UE5. Epic, hello?
I'm not sure what you mean tbh.
Wizard I don't think it's right what you're saying: https://github.com/EpicGames/UnrealEngine/blob/46544fa5e0aa9e6740c19b44b0628b72e7bbd5ce/Engine/Source/Runtime/Engine/Private/DataReplication.cpp#L1603-L1622
return true if the serialization was fully mapped. If false, the property will be considered 'dirty' and will replicate again on the next update.
Note that UPackageMap::SerializeObject returns false if an object is unmapped.
It also just sounds really weird to send half of the properties when it can't fully write.
That lines up with what I said. You force them to be replicated together by net serializing them.
That what happens by default
Just pack two properties (ideally if they are pointers to actors) in a struct and change them on the same frame, you won't receive them in the same packet
But the exact same comment is above non-delta serializers too.
Oooh wait I think I see what you mean now.
But wtf.
Or not? I'm so confused.
A struct should be one entire "property", it skips/continues it in the first link whenever it can't fully serialize. So you would say it just skips the entire struct then right?
* NetSerialize & NetDeltaSerialize
* Properties that fit into the flat Recent buffer can be serialized entirely with NetSerialize. NetSerialize just reads or writes to an FArchive.
* Since the replication can just look at the Recent[] buffer and do a direct comparison, it can tell what properties are dirty. NetSerialize just
* reads or writes.
*
* Dynamic properties can only be serialized with NetDeltaSerialize. NetDeltaSerialize is serialization from a given base state, and produces
* both a 'delta' state (which gets sent to the client) and a 'full' state (which is saved to be used as the base state in future delta serializes).
* NetDeltaSerialize essentially does the diffing as well as the serialization. It must do the diffing so it can know what parts of the property it must send.
They have their own use cases.
Right. That was at least my standing from reading that file lately
I haven't tested these stuff quite much tho, and it's hard to test them too
With dynamic properties they mean TArrays
That's why you see NetDeltaSerialize used heavily in FTRs (Fast TArray Replication)
Also NetSerialize.h actually explains something I thought Unreal protected it self against but doesn't with custom serializers.
Which is?
- ===================== Safe TArray Serialization =====================
- These are helper methods intended to make serializing TArrays safer in custom
- ::NetSerialize functions. These enforce max limits on array size, so that a malformed
- packet is not able to allocate an arbitrary amount of memory (E.g., a hacker serilizes
- a packet where a TArray size is of size MAX_int32, causing gigs of memory to be allocated for
- the TArray).
As an example:
bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess){// Don't do this:Ar << MyFloats;Ar << MyVectors;// Do this instead:SafeNetSerializeTArray_Default<31>(Ar, MyFloats);SafeNetSerializeTArray_WithNetSerialize<31>(Ar, MyVectors, Map);}
So never directly serialize TArrays in a custom NetSerializer without those methods.
Ah I haven't read that one yet (it comes at the end of the page right)
Yes.
I will bet you right now that the Engine or a lot of projects have this mistake btw 😅
Oh alright, so it seems that in UE5 they were moved FastArraySerializer.h
Yeah they moved that documentation.
Goes and writes a blog post
Lol
is there way to spawn actor on server, but only replicate it to selected clients ?
I mean replicate it's creation not properties (;
If you're using C++ you can override AActor::IsNetRelevantFor with whatever custom conditions you want: https://github.com/EpicGames/UnrealEngine/blob/46544fa5e0aa9e6740c19b44b0628b72e7bbd5ce/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h#L2632
If you're using BP, I have absolutely no idea.
oh thanks, wasn't aware of that function
I've been trying to figure out what this error actually means. Anyone who has any pointers?
It's saying that the actor has no NetOwningConnection thus you can't server RPC from it
There are at least two ways to cure this issue:
- Make a client-owned actor own that actor.
- Route the RPC through a client-owned actor.
Your preference should be the latter most of the times as the former will end up in a bad design if you have too much instances of that actor
I just thought that the owner would be the character, its just an actorcomponent attached to the character.
For example you don't want to hold hard references for the owner in too many actors
Hmm, okey. Need to rethink the whole architecture.
Cool. Though that Character doesn't seem to be owned by a net conneciton
Where are you calling that function from?
I just have a character that has a buildingsystem which spawns ABuildable, so it's not that much to refactor. Only thing is I really don't know any other way to do it.
Relative to owner character
I call it in tick of the component itself
That explains the behavior then
Tick of the component fires after Super::BeginPlay of the owner actor fires IIRC
Or at least they are registered around that time
At that time the character could be not possessed
To guarantee the character has been possessed you want to listen to APawn::Restart
Also another note, Tick fires on both server and client, pretty much like BeginPlay
You are firing that server RPC on both server and client
And you want to ask yourself if that should be the case
To split the two execution paths you do a HasAuthority in actor, and for components you do it via the owner's actor HasAuthority method
I would suggest looking over the starter pack if you haven't done so
In this channel pins, look for multiplayer compendium pinned by eXi
Thing is I have looked at alot of stuff, read the multiplayer compendium. It just has not registered fully yet.
Yeah takes time to digest
Indeed it does, well, back to the drawing board, just gotta research this some more. Thank you.
Wizard.. Epic lied D:
// For net archives, limit serialization to 16MB, to protect against excessive allocation
constexpr SizeType MaxNetArraySerialize = (16 * 1024 * 1024) / sizeof(ElementType);
Also yes this is totally hard coded into their code LOL. But I guess they weren't going to deal with having to protect TArrays in NetSerializers them selves 🤣
It’s a good thing, it was way too easy to mess up honestly.
The thing I'm sure about is that I'm having severe trust issues with the docs at this point
Except that it is a hardcoded value
guys I have problem when I set names for players in multiplayer game and I try it like in editor with play as client and 2 windows everything is alright I see names of all players but when I run my game as standalone and join my EOS session I dont see any names even I set them why ? do you have idea its same princip both are multiplayer
The OSS should have zero effect on seeing other players names
So whether it's NULL SS or EOS it should function the same
They may handle names differently though. I would suggest asking in #epic-online-services to see if they know more about it there.
Correct. I just vaguely recalled that PlayerState.SomethingName is affected by OSS
Otherwise everything would be your default PC/device name, that's not the case 😛
By the way recently I discovered a hack to seamless travel in PIE 👀
Pre UE5.1
Can you guess it @twilit radish ?
Considering I have barely ever looked at how it works probably not.
Turn off "Run Under One Process" 😛
I know that sounds dumb, but I swear I thought even that won't let you seamless travel in PIE lol
Also the warning says it all, " ... can't seamless travel in one process PIE"
Was there all the time without me noticing it 😔
Rip
How would I pass an option to the game mode on a dedicated server when loading the level via IP address?
Assuming you mean from client -> server. You can pass arguments to the URL you use to connect to the server. Those can be retrieved by the server again 🙂
For example 192.168.2.8:7777?argument=test
Or you can just send a RPC through the player controller. Also a possibility.
Unlike webservers, you don't use &blah=moo for subsequent arguments, you just use ? again.
Lyring be like 😄
Lyring?
Lyra, Lyring
😛
Compiling a dedicated server unfortunately takes a bit the first time 🥲
Anyone has some extra RAM and a thread ripper for me?
Have you downloaded rider?
No x)
Hey there! Is it correct to say that "this->HasAuthority()" is always true for a GameMode (given GM are server-only)?
I'm reviewing code and I'm seeing checks for it which I find weird.
Correct. GameMode doesn't exist on remote clients
Is there any way to find when any single property in an actor is being replicated to an instance without overrides?
OnRep.. ?
I'm trying to find a way to fix GAS on clients without having to override OnRep_Owner in every class I have an ability system in where clients might need to use the ability.
TLDR GAS component needs owner to correctly set up ActorInfo stuff. Which requires that the Owner property be valid on the actor owning the AbilityComponent. Right now I just handled it in OnRep_Owner. And I really don't want to have to do that on everything.
show me how you handled that
i'll try to compare with my stuff as i'm also using GAS
{
Super::OnRep_Owner();
AbilitySystem->RefreshAbilityActorInfo();
}```
yeah so
i'm only calling that in OnRep_Controller on the pawn
and PossessedBy/UnPossessed for server
i think Lyra also do that
GAS compendium goes over that, though APawn::Restart ftw (called on both ends :P)
Couldn't you technically have a shared parent where you override and do that in there instead?
More. Fucking. Boilerplate. I love this plugin, but I also really hate this plugin. :/
don't use it
i recommend nobody to uses that tbh
If you know c++ at least
that's stuff you can do yourself
are we talking about gas companion ? 😄 (i'm confused)
GameplayAbilitySystem.
How dare you
my bad then, i though we was talking about the gas assisted bp plugin
but yeah again that is how you should do that
that's not "dirty" that's just the way you should
what is gas compendium ? i'm interested
Or, since the people who wrote it have easy engine access. They can just like.. Stick a fucking delegate in the OnRep and use it and not make us use boilerplate crap. More than we already are.
Here's where I got
ah gas documentation
yeah again not the best practices inside but it's nice to learn GAS 😄
Compendium > Documentation
yeah that's true 
cough cough
shush
When is 5.1 dropping by the way? Can I still PR and hope that my PR will be accepted into 5.1?
I might be wrong but i would say at the same time as the FN next season following what i heard
so late november/early december
Season 5 will likely begin on Sunday, December 4, 2022.
Good to know, thanks!
But yeah they might release 5.1 earlier than that and just release Verse plugin aka Creative 2.0 with the next season 🤷♂️
Oh yeah I forgot about Verse too. Wow too many things coming our way soon. One has to be ready for when the stuff start to kick in 🤓
Verse should be only Fortnite relative stuff so except you're playing Fortnite you might not be interested to it
The new thing i want to look for personally is Iris new replication system
Will be happy if they've fixed Vector2D math nodes in 5.1 😄
what's wrong with them
Try to multiply a Vector2D with a float.
oh yeah
it does not work
i'm pretty sure it's not the only math node that is broken
i got this issue with a few other nodes :/
Not working 5.0.3 🤷♂️
i feel like im starting to understand replication concepts but theres something im stuck on.. I have a pickup, I am feeding it a data asset for it to initialize itself. I initialize it on the server, and set its mesh there. But since that event is a server event not a multicast event, no clients see it. So I think to make the "StaticMesh" property a RepNotify function, to set the mesh there. Thats working great... But now when i play the game standalone, there seems to be no rep_notify event called. So my code works well in multiplayer but not single player anymore lol. Do I manually call OnRep for that variable after I set it? And is that going to introduce redundant calls to update the static mesh in a multiplayer game?
Right OnReps don't get called automatically for you server-side
Just call it manually yourself after you set the value
Nothing exceptional beyond that
Nothing is redundant there. You are just making sure your game works the same on the different net modes
so, run the function on the server.... the function changes the servers version of Mesh.. Repnotify takes care of clients receiving that value, and then i call repnotify while still on the server so the server remains in sync in terms of state
and i guess thats only one call per "client/server"
Correct that too, in terms of state you are also in sync which is a double win
Correct.
im just double checking, in the interest of keeping things in sync... if i want to do something like update a base actor variable, in this case i want to "SimulatePhysics" on a component. Do I need to make an additional replicated variable inside the actor like MyCustomActorSimulatePhysics which calls OnRepNotify which sets the components SimulatePhysics to true or false?
I guess thats just a long winded way of asking can i replicate already existing actor properties in C++ easily
Yes. You want to replicate the property that drives that other property that you wish to replicate
So pretty much what you said
It doesn't have to go by the same name, as it goes by the the event that happend
Say bDied
ok cool! thank you. I used to really rely on multicast events when i was trying this in BP.. before i understood their purpose. And i was doing a lot of state synchronization by calling events multicast (like actor set hidden in game) or something. But I know now that i would run into major issues with actors going in and out of relevancy. Was just checking that my thoughts were correct on how to replicate state.
But they run on all connected clients
oh yea? whats the alternative for things you want to be one offs like playing a sound or a particle event?
Find all pawns in relevance radius and client RPC?
I think they meant to use it, but to avoid for state
haha dont confuse me! 😄 Is that pawns in relevance radius a good method?
Ofc not lol
But that YT tutorial told me it's fine to mark it reliable and call it on tick
I cannot for the life of me get the OptionsString to work in my game... I'm trying to connect to a server via OpenLevel via ip address, and tried passing the options 2 ways
then in cpp in my GameMode:
void AArenaGameGameMode::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage) {
Super::PreLogin(Options, Address, UniqueId, ErrorMessage);
UE_LOG(LogTemp, Warning, TEXT("ArenaGameGameMode::PreLogin() Options: %s"), *Options);
UE_LOG(LogTemp, Warning, TEXT("ArenaGameGameMode::PreLogin() OptionsString: %s"), *OptionsString);
}
OptionsString only has ?Name=Player in it
Yeah I can't think of a situation where I would mark it reliable tbf
I'm not sure if you're allowed to have options in LevelName (even if you did, they are designated to be in Options param)
But anyways I would start by debugging this whole thing since the start, so you know where they are getting lost if any
OpenLevel should call UEngine::Browse and UEngine::LoadMap (so you can breakpoint those)
This isn't really true. There is next to nothing actually known about Verse other than the short snippet of stuff we saw 2 years ago. And in that exact same stream, Tim said that it was going to be coming to UE as a whole. Not just for Fortnite.
Yes it’s coming to UE for Fortnite…
Again - no.
You’re supposed to create mods, maps etc on UE and it’s synced to Fortnite
That’s literally what they showed up in their livestream 2 years ago
They was modifying map, placing actors inside UE and you was able to see the changes in real time on Fortnite
Yes - they obviously showcased it for Fortnite because Fortnite is their metaverse
But yeah I guess as everything Fortnite uses it will be coming for everyone later
Like a new generic plugin for modding games in general
He has said that he wants verse to be the standard programming language for the metaverse as a whole
So you could take it and put it in a different engine altogether
Mmh
Do you have a link to the livestream ?
He wants to open source it
Yeah not surprising 🤷♂️
We’re not on Unity Slackers
But just waiting for Star Citizen to actually release first I guess 🤣
A few fair things leaked and hinting for December
Does the push model not work with modular components?
Or mid next FN season
It does
void URaevinExperienceComponent::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
FDoRepLifetimeParams SharedParams;
SharedParams.bIsPushBased = true;
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, CurrentLevel, SharedParams);
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, MyExperience, SharedParams);
}
Not sure what I am doing wrong
UPROPERTY(ReplicatedUsing = OnRep_CurrentLevel)
int32 CurrentLevel = 1;
The OnRep_ is not firing
yeah'
It's the 2020 UE in review in the Q&A section that he mentions it coming to Fortnite first and then coming to UE as a whole later.
void URaevinExperienceComponent::SetCurrentLevel(const int32 NewCurrentLevel)
{
if (!HasAuthority()) return;
if (NewCurrentLevel < 1) return;
MARK_PROPERTY_DIRTY_FROM_NAME(ThisClass, CurrentLevel, this);
CurrentLevel = NewCurrentLevel;
}
It's in some tweets of his that the other tidbits have been picked up on
So it’s not in the video showcasing « Verse » on FN ?
yep
URaevinExperienceComponent::URaevinExperienceComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
SetIsReplicatedByDefault(true);
}
It depends on what you're asking. Verse coming to UE as a whole - is in that video.
Your OnRep is a UFUNCTION ?
That video is the only official information at all about Verse. Other than like 1 or 2 tweets that could've easily been missed.
Yep
LogRaevinExperience: Display: URaevinExperienceComponent::ProcessCurrentExperience() - Current Level: 1 ExpToLevel: 2.000000 ExpToNextLevel: 4.000000
LogRaevinExperience: Display: URaevinExperienceComponent::ProcessCurrentExperience() - setting current level to 2
I see that the method is actually getting called
Yeah and I can see Epic using that in their lyra project for the player state
void ALyraPlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
FDoRepLifetimeParams SharedParams;
SharedParams.bIsPushBased = true;
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, PawnData, SharedParams);
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, MyPlayerConnectionType, SharedParams)
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, MyTeamID, SharedParams);
DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, MySquadID, SharedParams);
DOREPLIFETIME(ThisClass, StatTags);
}
Pretty much like Super ... another fancy typedef
Ok at this point it could be something weird going on with Unreal. Not long ago Authaer had a similar issue: #multiplayer message
They added a replicated property and OnReps started to fire
Pretty sure that crap again
That's... really strange. I've never seen that before.
I have two replicated properties though
That doesn't legitimate things in unreal terms tho
Though I guess let me add a regular non-push replicated property and see if that fixes it
If you saw that issue you should expect everything at this point
Well I have added a regular (non-onrep) replicated float prop and recompiled both debug and dev editors... we'll see what happens
Anyone know why I might be unable to connect to a dedicated server running on my PC from a client also running on my PC, using open with localhost or 127.0.0.1 and with or without the port number?
You are not getting logs whatsoever?
Yes.
No.
I've been uploading my builds to GameLift, the iteration times are killing me.
Adding a regular property unfortunately did not make a difference
wait they actually accept those? I thought they had hundreds thousands of PRs still open on the github
They used to. Didn't for a long time. Hopefully once UE5 is truly on the correct path they'll pick it back up again. They probably see little point in it with redesigning so much of the engine
depends on the team
and depends on if it will benefit fortnite ofc
but fwiw Mieszko told if you do a PR related with #gameplay-ai or #mass you can ping him in the server and they'll review
I ended up just moving the plugin to the project level to modify it, and calling RefreshAbilityActorInfo() at the end of UAbilitySystemComponent::OnRep_OwningActor, and setting OwningActor and AvatarActor to REPNOTIFY_Always. No more useless project boilerplate.
what is the command line syntax to select a map when starting a dedicated server?
i.e. ./TestServer -log -map ?? doesn't work for me
Hello! In a multiplayer game, accessing the save game from the player controller as client = accessing my client save game?
Is it wrong to set a Playerstate variable straight from a w widget blueprint? trying to set an ability class and wonderig if it should go through the player controller in anyway?
Not sure I would set it locally like this. Calling the RPC through a locally owned Playerstate in the widget is fine. But that Set should probably just be taken out and it can be replicated back from Server.
@kindred widget I should note its turnbased
so im setting it in the PS to be read by the server on turn activation (queing it essentially)
if that changes anything
Yes
what's a good way to sync in weapon ammo between client and server when client is firing a high rate of fire weapon?
if the client is firing 1000 rounds per minute , is it wise to choke the network with 1000 RPCs per minute telling the server that you fired a shot?
I can probably batch it each tick 😛
but then sudden disconnect would cause deyncs
Not that I did it before, but I imagine you would want to predict and correct. So the client server RPCs telling the server I started shooting and then they should predict how much ammo are being spent till they send another server RPC telling the server they are not shooting anymore. Along the way you can correct the client, so things stay in sync.
That was an answer from a peaceful guy, that doesn't work with weapons, so take it with a big grain of salt
I've tried that approach once , it was disasterous due to ping
this is inverse relationship for correction , because client is the one who decides how many shots are actually fired
Right, that's at least how it sounds, but you could make the server the one who decides and has authority, till that second RPC get to the server, telling them it's enough, or if the mag got empty
Probably some combination of a StartFire/StopFire RPC with Timestamps
Together with a synced clock and some RTT/Ping data, you can figure out if the Client is telling the truth about the Timestamps
might be too much work compared to just telling server the amount of ammo consumed at the end of each tick to the server?
only while the weapon is firing
every time i tried to join my own server it crashed like this
any idea why?
1,000 rounds-per-minute is 16-per-second, so not unfeasible to do an RPC per shot. We do this in HLL for up to 20 shots per second.
And if those shots are hitting, it's two RPC's for every shot - so GLHF.
why not batch it?
Now if all 100 clients did this, obviously we'd be screwed.
We do now, but we never used to
It's very rare that firing and hit occurs on same frame because all shots are projectiles
So we don't benefit from batching all that much
not the hit , but the shots
if the client fires say 5 shots in a single tick , why not just tell the server 5 shots at the end of the tick instead of telling 1 shot 5 times?
They are never going to fire 5 shots in one tick though
They might fire 5 in a second, but we can't batch those together
Clients are never running at sub-20 FPS
Idkm , sending 1 rpc per shot feels like abusing the RPCs
You don't really have a choice
what do you do in case of 100 clients?
Server crashes and dies most likely
But that's not a problem we ever expect to have
The Start/Stop approach with timer sync rarely actually ever works - because the divergence in aiming is too great between client and server
I mean for 100 client all to be shooting at once thats not a very likely scenario in most cases though, is it?
So you have to send each shot with the exact aim the client had
Exactly
UT uses a start/stop approach - but it only works because they force the character movement to send a movement RPC for each shot-fired frame, and process weapon state machine updates in lockstep with character movement updates
The other option is to give the designers a reality check
in the past I've also done research on this exact subject and it's my understanding that most if not all multiplayer shooters out there do an RPC per shot
the other approach has more complications, or so I hear
yeah it absolutely does
If you're using hitscan weapons, you can at least batch the shot and the hit into one RPC 🙂
If you're using projectiles, welcome to my pain
You'd be surprised how much you can get away with though 😄
Even if it feels horrible
MFW we added shotguns
yea I mostly use hitscan myself, not a fan of projectiles unless its for some RPGs and such
oh yea my shotguns have a max of 5 pellets per shot, no more than that
I know that Insurgency uses hitscan for the first 50 meters or so, as that's the majority of their engagements - but we're projectile from the get go
It's a clever trick though
interesting approach
Fortunately we can group the "shoot" pellets into one RPC.. but not the hits sadly
But shotguns in a game where most people are 200-500M away are thankfully largely useless
We do batch hits together if they are in the same frame though
Rare as it is.. we tried
If you think though, Fortnite weapons are all individual ability activates for each shot - and those activations have quite a chunky payload
I mean when you have the money to spend on good servers, alot of these problems are just not that much of a big deal I think
not only good servers, but many of them, in every region
It's still a lot of work, but the game is mostly about shooting so.. it's fair to dedicate most of our budget to that
yeah, I think that's more oriented towards better server performance which is the bottleneck for most people I think, at scale anyway
any thoughts?
how do I know actor is in listen server based on their local and remote role ?
I have a Muticast RPC and I want it to be called only for simulated proxyies. it works in dedicated server. but not well in the listen server
Actors on listen-server have no RemoteRole, and their LocalRole is always authority
IsNetMode(NM_ListenServer) is probably easier way
RIP
😁
IsServer && !IsDedicatedServer
I guess they dont work well in PIE huum ?
They do
🤔
Answered yesterday, you're welcome
Probably something to do with WorldPartition
Could also be that you forgot to set up a starter/default map
explain pls
also how come this server doesn't have any players
did i miss something?
I don't work with WP myself so I have no idea what's that. You will want to debug why that assertion is failing, pretty much like I would do.
You missed #online-subsystems
@fathom aspen instead of that IsServer && !IsDedicated server , this one worked
bool bSimulatefire = actor->GetLocalRole() == ROLE_SimulatedProxy && actor->GetRemoteRole() == ROLE_Authority
|| actor->GetLocalRole() == ROLE_Authority && actor->GetRemoteRole() == ROLE_AutonomousProxy;
You said you're doing it full BP, no? (or that is a sketch of your BP?)
would give true for simulated proxy if game is ded server, and true for simulated proxy in listen server (except the listen server himself)
yea but I wrote it here
cause I cant upload image lol
Ehh not the most readable piece of code, but if it works, then it works 
holly s***
in PIE listen server, character who is owned by listen server has RemoteRole:Simulated but in standalone lunch RemoteRole is Autonomous
🤔
Hello, could you please help me?
I'm only starting to learn about the Replication system.
I couldn't discover anything about some player modifying some actor properties to only be seen by this player (for example, UStaticMeshComponent Visibility)
Replication appears to be for all clients to see the same thing that the server "sees", but what if I require different models to appear above npcs for different players based on their quest progress? Is it necessary to spawn new separate actors above each npc for each player?..
Use SetHiddenInGame, you're welcome
a muticast called from listen server, how do I exclude _Implmentation for listen server ?
!IsLocallyControlled()
Hey there. I put this in my GameMode, yet when playing in Listen Server mode, ALL player screens print "I AM SERVER". I expected only one (the listen server) to actually print this. How the hell? GameMode should only exist on the server, no?
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, FString::Printf(TEXT("I AM SERVER")));
}```
Try using UE_LOG instead. I have a hunch that function does some networking stuff
In PIE it's hectic
You want to either use Kismet's Print
@fathom aspen no no not that, its was my previus bug
Or turn off "Run Under One process"
Why the hell there is no Is ListenSerever
bool UKismetSystemLibrary::IsServer(const UObject* WorldContextObject)
{
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
return World ? (World->GetNetMode() != NM_Client) : false;
}
bool UKismetSystemLibrary::IsDedicatedServer(const UObject* WorldContextObject)
{
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
if (World)
{
return (World->GetNetMode() == NM_DedicatedServer);
}
return IsRunningDedicatedServer();
}
bool UKismetSystemLibrary::IsStandalone(const UObject* WorldContextObject)
{
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
return World ? (World->GetNetMode() == NM_Standalone) : false;
}
This was the answer to your last question
Ask Epic
There is:
NM_ListenServer
They mean a function that explicitly checks IsListenServer that is exposed to BP
How the why is that thing working like it does? That's just madness.
There is IsServer
Because all worlds are being run under one process, so it makes sense to behave that way
Which, given the existence of IsDedicatedServer, implies enough separation to be able to use IsServer synonymously with IsDedicatedServer
That was already suggetsed to them, with checking !IsDedicatedServer
You expect me to read???
No, but you replied to me and I replied back
/s
@fathom aspen man thans you so much !IsLocallyControlled() fixed my problem
BP makes me confused
UKismetSystemLibrary::PrintString seems to suffer from the same behavior.
UE_LOG is your friend
They won't be able to see it on screen though
Not that there is log for each window that opens
on screen debug is overrated
Unfortunately, unticking Run As One process seems to prevent me from running multiple windows.
My root need is to debug by finding where (server, client) stuff is executed. Maybe there is a better way instead?
Iteration times will be slower with that option being off, but at the end of tha day your game isn't going to be played in a PIE environment
So there is nothing you can do about it
I don't care about the time, but if I'm completely unable to run multiple windows with it then I won't be able to debug ANY multiplayer stuff, which is a problem.
apprantly if you put a ufunction to be "Unrealiable" it'll starts dropping very quickly even when there's plenty bandwidth left
its like it needs 99% of the bandwidth to be free to be replicated
I'm totally confused at this point. What do you mean by you can't run multiple windowe with it. It's running a process per world, which is exactly how your game is going to function.
PIE allows you to select a number of players and opens multiple additional windows when clicking Play, one for each player.
If I untick Run as One Process, clicking on Play will not open any additional window.
Nevermind, I was just too impatient. Thank you for your assistance. Sorry for my dumbness.
lmao that was anti climatic
thanks of course, but I asked about how the client could change the visibility of an actor he doesn't own only for himself to see and not what function to use to change the visibility. Do you mean that normal methods can do that? Its not working for me, I thought it was because only the server can change replicated actor's components
{
uint32 index = GetUniqueID();
#if WITH_EDITOR
ACB_LegacyGameState* gameState = GetWorld()->GetGameState<ACB_LegacyGameState>();
index = gameState->PlayerArray.Find(this);
#endif
return index;
}```
For testing save games in a multiplayer game in the editor, would this be an okay way to do it? Since GetUniqueID() returns a new random number for each time I play in editor, I can't use GetUniqueID() to test save games in editor. (And I was using GetUniqueID() as an identifier to save player information). I was hoping to create a solution that would work both in testing and through steam.
I mean if it works why not. I think it's just fine, might use it my self honestly as I exactly know your problem 🤣
Although what I don't understand is why GetUniqueID() returns an index if this is inside the PlayerState?
That should be a FUniqueNetIdRepl 🤔
I think there is GetUniqueID() and GetUniqueId(), the latter returns FUniqueNetIdRepl
Oh the last letter... I see lol.
There is a difference between changing the visibility of actor vs. component.
You asked: How can I change the visibility of a component for specific clients (not all of them but specific ones)
My answer was: Use SetHiddenInGame locally for the clients in question, and you're good to go.
For a game mode with capturable bases between two teams, should the status of the base's affilitation be in the game mode or a replicated property in the game state?
I'd say a replicated prop of game state - after all, it is the state of the game
Thank you. Do you think it would be too heavy to have the replicated array be pointers to the Base actors themselves? The Base actor has the info regarding team affiliation
First thought is to have the array just be an int array of the base's team affilitation, but that leaves open the possibility to have the index of the values be out of sync with the client. I just need to make sure theyre in sync
idk - depends on the context. The bases themselves - I'd have a replicated prop, after all, they're server owned anyway. It'd be their team designation. Then in the game state I'd probably just have a count for how many bases a team has or w/e
great suggestion, thank you
First test of this results in the PlayerArray order not being consistent between new games and loaded games (I'm not saving it and reloading it or anything, just on generation it is different between saved and new games, and I'm not sure why). In new games, the Host is at index 0 and new players as index 1. In loaded games, for some reason, the host is at index 1 and the client is at index 0. For testing purposes it doesn't really matter to me which player is which, so I think I can actually use PlayerArray.Num()-1 instead of PlayerArray.Find(this). Because after I get this "ID", I am checking to see if I have any saved players with that index, and if so, load that player, and if not, initialize the player as new.
Is IOnlineEvents::TriggerEvent the equivalent of sending a JSON request in web dev land?
(obviously its not json)
looks like that function is implemented via the online subsystem. I can find the implementation for EOS but not for Steam. Is that available somewhere?
Even when disconnecting the PlayerArray Indices could be flipped, thus what you did is absolutely inconsistent. What I would do instead is either use PlayerState.PlayerId (can't speak of it, but seems promising for basic editor testing stuff), or either embrace what the engine does when UniqueIds are not in the equation, which uses SavedNetworkAddress. See AGameMode::FindInactivePlayer for reference
Might want to ask #online-subsystems
thank you!
Is there a good resource anywhere for what happens to player controllers when seamless travelling?
I currently have a bug happening where I just don't get a player controller after a ServerTravel call 🤔
Luckily there is, it's found in this channel pins (latest pin)
Oh hell yea, thanks for the write up!
Out of curiosity
Are there any known major gotchas for why a player controller might not exist?
By default, there should always be one, by either the previous persisting or a new one getting created.
Breakpoint those and see what's going on
Oh! Yea sorry I misunderstood what was happening in my logs
Turns out it's just one client
Not getting it
A player controller should try and replicate over and over again though right so it should eventually replicate?
Yeah it's always relevant only to owner
Wait let me check that I have all the player controllers on the server because maybe that one doesn't exist even though the others do
Out of curiosity, is the travel seamless/hard?
GetWorld()->ServerTravel(transitionToMapString);
I don't know what this is
But it's that
So basically I have a game lobby where everyone picks a character, and everyone is able to do so, so clearly everyone has connected and has a player controller at that point
And then we call that server travel and after that one of the player controllers doesn't seem to be created on the server
But before now someone else handled that code so I'm just familiarising with this sort of stuff now
So I guess it's supposed to be seamless and I should be looking in HandleSeamlessTravelPlayer
Though I don't know the difference between hard and seamless so I should look that up first
This doesn't help me figure out what travel that is, because it could be any of them.
Oh, how would I tell what type we use then?
But if this function is getting called then it's seamless
haha it must not be seamless, I just searched and we don't use this
The correct way to look that up is if you look at the departing GameMode and see if bUseSeamlessTravel is checked
Ohh I just read your guide info about it
Yea we would want a hard travel in this case
Well you don't need to override it for the travel to be seamless
Seamless is for like loading level ahead of someone in an RPG right?
oh
haha
OK I'll go look for bUseSeamlessTravel
Turns out it is
Oh wait I read more of your description and jumped the gun a bit
Not really. Seamless should always be preferred over non-seamless, because it results in a much smoother experience, and reason being that the destination level is loaded async.
Remaining connected to server is better for sure
Was expected.
Yea ok that makes sense
What criteria does the Engine use to match mesh components between clients and server? Is just having a common name enough?
Sometimes a hard travel is inevitable though, but that is a long story that the compendium goes over
Based on this then, how do we create a different type player controller and not override that method?
Well I guess maybe that's a tangent because clearly it works most of the time already
Stably naming them
Creating them via Simple user construction script
Loading them from package
Creating them on server and replicating
If you want a new PC to get created (not the old one persisting) then you want to make sure the new GameMode's PC class is different the old one's
Thank you.
It is a different class I just thought based on your description it seemed like we needed that override but that's OK I'm not too worried about that now as that exact part does seem to be working correctly
OK so to debug a player controller not being created on the server after a seamless travel
I want to breakpoint in login?
No, based on this you want to breakpoint HandleSeamlessTravelPlayer
Login is for hard travel
Ah OK, then I should override this and see what happens there first
Hmm
I can't repro this in the editor
It only happens sporadically in live
So I've only been tracking it with logs so far
If I had a 100% repro I could attach a debugger but atm it would just be a waste trying to catch it