#multiplayer
1 messages · Page 6 of 1
So if an actor is not net relevant i cant get the distance between the actor and my character, right?
since their location is never updated
if you are on the server side, yes. because both exist.
If you are on your client, you may be able to get the location if the proxy actor already spawned before (in this case you will have an outdated location for that proxy actor)
if the proxy has never been spawned, the client doesn't know about it.
Is there a way to play with two player controllers on the same machine?
So that when I run any instance of the application it creates a new player controller for that instance?
I want to implement a system where ambient music plays once actorB is within x meters of my character. So im guessing i cant disable relevancy in this case and i need to find a workaround for making actorB invisible
More than that, they don't exist
yeah, so disabling relevancy is not the solution here
you can enable it by distance if you are worried about performance
im not worried about performance (yet). i just thought disabling relevancy was a good way of making an actor invisible to specific clients
Just hide the mesh
i don't know much about it, but this may be a good case of environmental ques maybe? not sure
problem is that i want to be visible to some clients and invisible to others.
you can specify more complex conditions for replication
What's the common thing between the clients. Team, what?
yeah, team would be a good way to put it
thematically its about entering a mirror world, which mechanically just hides your character from everyone outside of the mirror world and applies some post process effects
If you want to trust a client call me you can just have it locally not be visible if the team doesn't match the local team. If you don't want to trust a client, you can just replicate some variable on the character to play the sound floatCloseness
ideally i wouldnt trust clients, since in the end it's a pvp game, and those are very vulnerable to cheating
How would i go about setting up such a team system?
K so just use relevency and tell the client how close they are
and how do i tell the client only how close they are?
The same way you do anything. Either an RPC or a replicated variable.
You can easily have a variable on your Pawn, call it distance to nearest invisible thingy, and then have the server be set in that. The server tells a client how close they are. The client doesn't figure it out by checking their location and the things location, cuz then they know the things location and can cheat and just go there
So the distance variable is set by the server on the player character. That makes sense yeah.
Im guessing this would be done from the gamestate?
Some of the valorising devs actually made a blog on something very similar they did. It’s called fog of war and the aim is to minimise the effect of wallhacks
https://technology.riotgames.com/news/demolishing-wallhacks-valorants-fog-war
I mean this is mostly location based whether a player should be “visible to another” but you might find it interesting
This is a very interesting read, thanks 😄
X from the bp channel:
i'm running into an issue with client to server messages.
i want make an ingame terminal that can control a remote vehicle thats linked with it. should i make an ownership class that controls both from the top down? right now im trying to send messages between them via linked objects and it fails client side.
sorry if this is the wrong channel!
I'll keep it
Keep this one instead @fresh geode
High level question: How do you have clients pass custom "character data" to the server when joining? I'm thinking preferences data such as name, character hair color, etc.
Or more particularly, I need clients to indicate if they are VR or non-VR when they join so the correct character can be spawned for them
Do you mean data they had from previous level?
That too, but also on first connection
I've been looking at a few places on the connection flow, and I don't see where I can send custom data
I'm sure there has to be something I'm overlooking
EventOnPostLogin
There are many ways...
That's the good news
The bad news is that you're going to have a hard time picking what works best for you
Yeah I know with a dedicated server you'd want to have user accounts, etc. But for now I just want a simple and dirty LAN approach where I trust the client
Just building some quick PoC stuff to test viability of VR and non-vr playing together
One thing you can consider is the OptionsString. You pass it to the server when you travel
Even on first connection
So you'd string encode the data in the options string?
I've read about the options string before but I'm having trouble remembering where in the connection flow it is
You parse it when the player joins
See InitNewPlayer for reference
In GameModeBase
Oh looks like there is a good wiki article related to that https://michaeljcole.github.io/wiki.unrealengine.com/Passing_Arguments_To_Server_During_Connection/
Well the OptionsString you have in GameMode is saved only for first connection. So don't use it xD
See the login functions
PreLogin
Login
Oh good to know
The URL param there is what you're looking for
InitNewPlayer
For example parses the PlayerName
Yeah something like this. It's funny that I'm writing on it now, and had the whole day researching it and testing
It's a quite handy tool, really underrated
I was hoping there was a diagram / document about this flow that I missed somewhere. Cedric's guide is great, but I still feel a little fuzzy on some of the details
You can also have some sort of a database service linked and have something similar where you parse data on player login
Of course, this would be the production way I would want to do it. To provide a correct level of security and persistence
For now I'm building out a PoC as quickly as possible so I can try to win publisher funding on the project
Yeah that one is awesome, but lacks some juicy stuff :(
We should pay Cedric to write lol
🤔 Yeah that might work
Yeah that's how I would handle it at some point
I've spent the last 8 months building a custom Chaos Destruction alternative that is VR friendly and fully replicated. But I've done most my testing in PIE up to this point
You dare insult the networking bible? The unreal gods are disappointed
Now I want to scale up to a more direct LAN test with VR / non VR players
Pardon me my lords 🙏🏼🤣
Oh no. I had some PIE gotchas the other day. Never... never test in PIE, unless you're really lazy launching standalone
I set my connection speeds and packet loss percentages to ludicrous numbers and found the CMC replication falls apart long before my custom destruction system does
Because single process, or something else?
Yeah that's it. It really doesn't reflect how your game going to function in realtime
Yeah I have some concerns that single process muddles my results
Also some of the things just don't work or crash. Take for example a seamless travel
In theory I should be safe regardless of packet ordering. Holy hell was packet ordering difficult to consider when dealing with alternating break / repair events
This one scares me. I have not yet done any map travel
It should in theory be pretty simple, but I'm vague on the details
Correct. Every time I've seen some peep wanna go around this, it didn't end quite well
It's after you read my next post 
Apparently they're working on getting server travel to work in PIE
Fast array and event ids came in to save the day. I had to bundle a lot of data together and use a GAS like approach to keep the actual transmitted data to a minimum
Hopefully @quasi tide doesn't find a lot of bugs in there xD
Fast Array has some quirks. I NEVER "update" any of my elements, but sometimes I get a replicated update
That's something I was so happy about. Rapid testing is cool tbh
I went with a "read only" data approach where entries are only ever created or deleted, but never modified.
Yet I rarely get the update rep event on clients. I don't know if it's something to do with PIE, or just a quirk with Fast Array in general
Right now it's a small amount and I just ignore it
Sick, haven't faced that. Still it's one of the best, if not best tool in mp
Tell me about it I ❤️ FastArray
Made things so much easier for a neophyte like myself
Prediction Keys in GAS are pretty sick too
I made a simplified version for my own prediction. Really cool techinique.
In my case the prediction is visual only, so I didn't need to support roll back of any form.
Yeah GAS is inevitable too. Has to get into it asap!!!
It's like every system out there has some GAS in it
depends what you do™️
Yeah it's really a depends™️
Though when it comes to travels it's like never
Even hard travels
I mean I found that OpenLevel won't work if Absoulte was turned off in PIE. Though it works fine in standalone
Has to so with single process thingy prolly
Maybe after my post we can get them to do something about it ^^
btw sharing is caring 😁
hey guys, does any one have a code snipet on how to pass an int as an option to a server?
Define pass
i forgot to say it was in c++
my bad
Same thing. Use HandleOpenCommand
HandleServerTravelCommand
Whatever function works for you
And pass that URL like it's passed in the link I sent you
You have multiple options and they are separated with ? sign
You parse it when you login
ok my question might be a terribly articulated, what i meant was that i need to get the value in c++ after the server is open so that i can pass it onto a variable
My answer still stands
See InitNewPlayer
Inside GameModeBase
They parse the PlayerName in there
im getting those values in the initGameState
im looking for something like this
{
UE_LOG(LogTemp, Warning, TEXT("Restart match setted"));
restartMatch = true;
}
You can parse ints too
That seems too much low level. It's already there
Again go to the function I suggested
You'll get it once you look in there
^
u mean HandleOpenCommand?
That's the function that opens a level. Do you want to be able to pass the int on travel?
Or occasionally?
on travel
That's one of them
Just got back from lunch. Guess I should put together a blog to share this kind of stuff in
😄
Recommendations for a blog? I have a domain for my company. It's on my list to spin up a website soonish.
I find GitHub Pages amazing ^^
What do you think github.io boy?
don't bully Wiz
Only 129 lines in header and 44 in cpp, should I just post it here?
Funny part is most of it is usage notes
LOL
Feel free
Oh looks like discord thinks it is too long
I'll look into a blog in a few days
The key core idea is really simple though. You just need this in your structure: ```cpp
bool bIsOnServer = false;
/**
- On the Server, this uniquely identifies the network connection this was serialized on/from.
- On the Client, will always be zero.
*/
UPTRINT ConnectionKey = 0;```
And this in your net serialize: ```cpp
bool FSimplifiedPrectionKey::NetSerialize(FArchive& ar, class UPackageMap* map, bool& bOutSuccess)
{
// Only net serialized bit is if this is the connection for the client of interest. (most are not)
bool bIsSet = false;
if (ar.IsSaving())
{
// The ConnectionKey is only valid on the server if this serialize is going to or coming from the client it was created for.
// It is never valid on the client, but doesn't matter as client operates exclusively on bIsSet
bIsSet = ((UPTRINT)map == ConnectionKey);
}
ar.SerializeBits(&bIsSet, 1);
if (ar.IsLoading())
{
// Determine if this is on the server.
UPackageMapClient* mapClient = Cast<UPackageMapClient>(map);
if (mapClient)
{
bIsOnServer = mapClient->GetConnection()->Driver->IsServer();
}
if (bIsSet || bIsOnServer)
{
// Will get here if on a client and the server indicates the data around this serialize were predicted
// OR will get here if on the server receiving details from a client that the client predicted
ConnectionKey = (UPTRINT)map;
}
else
{
ConnectionKey = 0;
}
}
bOutSuccess = true;
return true;
}
Oh and you also need this in the header, but it's pretty simple: ```cpp
/**
* If true, we know the RPC or rep that sent this key was predicted by the client.
*/
bool WasPredictedByClient() const
{
return IsSet() && !IsOnServer();
}
/**
* On Server, if true and a proper ConnectionKey is set, the Server will notify the Client that replicated Cues were previously predicted and don't need to be played again.
* On the Client in Break and Repair calls, this tells the client it can avoid calling the Server RPCs because the server is already running the logic.
*/
bool IsSet() const { return ConnectionKey != 0; }
/**
* Returns true if this key was told it was created on the server.
*/
bool IsOnServer() const { return bIsOnServer; }```
The reference to "Break and Repair calls" comes from my destruction system. They are essentially calls made interchangeably on server / client that "magically" cause the logic to end up on the server because they utilize an internal Server RPC call that just calls back into the Break / Repair call.
IE: void Break(/stuff/, predictionKey); is called on both client and server, and inside is if (IsClient() && !predictionKey.IsSet()) { Server_Break(/stuff/, predictionKey); }
void Server_Break(/stuff/, predictionKey) { Break(/stuff/, predictionKey); }
There's additional validation details, but not related to the prediction key here.
@pallid mesa ^ Feel free to use. I can share additional details if needed.
Ultimately, this is just a regurgitation of the prediction key in GAS with a small amount of added documentation.
Is anyone else experiencing horrible performance when playing as several clients in PIE on UE5?
As in more so than UE4?
I've observed really odd issues with timing with clients with PIE in 4. As in timers have finished 6 or 7 frames too soon or too late
It feels like it's gotten worse
But yeah, in UE4 it was also bad, especially after upgrading to 4.27 if I recall correctly
Cries in 4.27
Are you using Wwise @obsidian cargo ?
I was using it at a smaller company where it was way overkill, but the short version is it was a PITA to get asset packs for DLC in Unity working.
Maybe the Wwise UE integration is better 🤷
Oh I can imagine, I asked because I thought it was having trouble handling different audio devices for each client, but perhaps that's not the case
I'm trying to equip a weapon to player characters using a c++ function called during BeginPlay, but for some reason the weapon class (assigned through blueprint) is null, but only for clients. It works when run standalone or as listen server, but not for connecting clients.
Should I be calling the function elsewhere, in case I need to wait for the value to initialize or something?
Guys a help here for me, I installed an unreal engine 5, I put the Sessions plugins for the guys to use with a steam and I'm stuck for 8 h trying to fix a package error by the plugins.
no joke
https://forums.unrealengine.com/t/engine-is-unable-to-access-appdata/624025
Unreal Engine v5.0.3 when I try to export something this error happens, I’ve already tried to reinstall drivers, reinstall requirements like .NET, Visual Studio, and others, even the engine. But nothing, I created a new project and exported it directly to an empty template, trying some things and I discovered that when I turn on the “Advanced ...
Hey, im playing on a listen server testing out my game. How do I get all the players in the listen server? I put the player count to 2 and im only getting 1 print back which is my computer. How can I get the actual pawns / players in game? I understand why its printing my pc because im the only pc in the game but I'm playing with the player count to 2 i need both players locally on this PC currently playing
Should I just get world , get all actors of class and point to the controllers its using?
Hey I got a dedicated server running on aws gamelift, whenever I try to connect to it (no gamelift features usage yet) with IP:PORT in the Open Level node, I get this error LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
I thought the dedicated server is supposed to create a session when it gets a connection?
How are you supposed to know which friend is tied to the presence structure?
[2022.08.08-23.33.27:532][ 85]LogRaevinParty: Warning: FOnlineUserPresence {Online: 1 Playing: 1 ThisGame: 1 Joinable: 0 VoiceSupport: 0 SessionId: NULL Status: FOnlineUserPresenceStatus {State: Online, Status: , Properties: }
What the hell am I supposed to do with that
That is the most worthless event ever, in the history of events
OSS: Hey! Hey now! There is someone that has updated their presence and is playing the same game you are playing!
Game code: Ok great! I am so glad to hear that. Who is it? so can you tell me who they are?
OSS: Oh it's... it's.... well I don't know. I can just tell you that someone is online playing the same game you are.
Game code: Oh... well I am so glad that someone on the planet is playing the same game I am playing. It sure would be great to know who so I can invite them into the game.
So, I've found a variety of projects you can purchase that enable multiplayer over lan, but none that are first person over epic services and/or steam; has anyone found a project like that available for purchase?
I don't want to code it myself, I want to code on top of it. Sorry in blueprints, all this.
qq: if a ballistics plugin needs me to run animations on the server is that going to cause performance problems? i dont think the animation itself would have to be synced, but just assuming that it runs if the same overlay state is active on the server
Inside GameState there's PlayerArray. It's an array of all PlayerStates. You can get its size. Also to get the Controller call GetOwner on PlayerState (array element)
this is also one of the very rare uses where GetPlayerCharacter[Index] is acceptable
GetGameMode->GetNumPlayers->For (0 to NumPlayers - 1) GetPlayerCharacter[Index]
Yeah I was amazed the other day that these functions works on server for indices bigger than 0
Or maybe GetPawn on that PlayerState array element
Sorry to necro this, though I didn't think of this at the time. How do you get a refernce to the deactivated PS inside OnDeactivated? Do you cache the one Duplicate creates?
It has a function thats called like that
So its this
That is actually a pretty good way to iterate all characters or controllers from bp
On server
Sorry I didn't follow-up. Are you referring to Duplicate (my question)? 
Correct. It has no reference to the inactive duplicated PS. It destroys the old one by default
void APlayerState::OnDeactivated()
{
// By default we duplicate the inactive player state and destroy the old one
Destroy();
}
I was asking how you get the reference to the inactive duplicate PS 😄
I'm afraid that overriding Duplicate and caching the one created there has side effects
The other option would be to traverse the InactivePlayerArray here and finding it based on UniqueId (before old PS is destroyed at that line) for example, but that seems an overkill 😦
ask me next week when i have more time to dig through code i only vaguely remember writing
this week DLC going out
we might had not duplicated and destroyed the PS, i don't remember now
Thank you and no worries. Also good luck on that too!
How do you name your multiplayer session for people searching.
Hello, I have a specific problem
Current floor in Character Movement Component doesn't return actor on Simulated proxies on Clients, but only on a spline mesh i've created. I guess there's something i should turn on in the collision, but i have no idea what.
@fathom aspen another question for you.
I am trying to print logs on client's screen from AIController.
Since you told AIController logic happens in the server so I tried to print the logs with client rpc, didn't work. Then I tried to call the server function and then call client rpc to print the logs
nothing worked tho
how should I approach this?
If you try that then you didn't understand Ownership
You can't run ClientRPC on something that isn't owned by a Client.
And that AIController, ontop, doesn't even exist on the Client.
Gotchya, but since AIController exist on the server then by calling client rpc on it's character would have printed the logs?
I tried to print it from the character too.
Is that Character owned by a Client?
Answer: No
So no, it won't work there either
AI is Server Auth
How should I approach this then?
What are you trying to do?
want to print the Bots' tasks on client's screen to know what they are trying to do
Is that for Debugging?
yes
If that's only for debugging and will be removed again, use GetAllActorsOfClass with the PlayerController as Class
And call the RPC on that.
I was actually printing the logs on specific events for specific duration. With this i guess it has to be printed on tick to track what's happening
Depending on what it is, you can also simply replicate in through the Character
And let Tick print it locally
Just not via Client RPCs
it will print if I call a delegate on the playercontroller when the event gets triggered?
player controller will have client auth I guess and calling a delegate from server to client might work?
uhm, I can replicate the task and it should print the values but along with it i wanted to print the name of the bot as well. Uhmmmmmmmmm
No delegates are local
Only way to go from server to client is either replication or RPCs
Attach a 3d widget to your AI pawn and print w/e you want to it
Since AI pawns replicate you should see what they are trying to do
Hi. My case is that I have 2 players, one is listen server, second one is player.
I use repnotify to close or open doors.
Repnotify is being called on the server, and the door mesh location is being updated, however, mesh collision isn't updated, until I get a little bit closer.
Any ideas why would it behave like that, any solution?
(So when I want to go trough the doors on client, i cannot do that because server thinks there's collision and blocks the player)
(I move doors using animations)
Is that a SkeletalMesh?
Yes
Go into the SkeletalMeshComponent of your Door
And check for the Bone Updates
It should always update, not only when rendered
Is that what you mean?
Are you actively Playing a Montage when opening the door or just setting the position?
Setting the variable which translates to anim percent
Does it work if the Server stands directly next to it?
yes
So if you are further away, you can still see the door opening on the Server, but hte Client isnt able to go through?
yes
I can see that the doors are open, both on the server and on the client
But I can't go through them with client until I get closer with the server
I even debugged it, and can see which specific skeletal mesh is blocking me, even thou on server it looks like it's open
What happens if you move the whole mesh component aside in your OnRep?
(trying to see if it's animation related)
sure, np. Thanks for trying! I'm a little bit closer now anyways
I'll let you know what it was when I fix that
3d widget is a good idea
Question about replication. Say I set a couple of replicated variables one after another serverside, are they guaranteed to arrive in any particular order?
Nope
It's not because late join and relevancy breaks it
Persistent properties should always be replicated vars
Yes this is what im having to deal with right now
It's irritating
I need some of the functionality of both
The way to deal with it is to mark the vars as replicated, everything else should work automatically. If you use RPC's then state will be lost
If you want properties to replicate together, put them in a struct and define a custom NetSerialize() method for it - but note that you lose the delta-replication that way
For example though, for firing a weapon I was queuing up weapon shots to deal with variable latency. If the client shoots an automatic weapon with a ping of 100ms, then the next shot the ping is 90ms, the server won't be ready to fire again because of the fire rate, so it needs to be queued up and fired as soon as it's allowed. But this meant the replicated ammo was being changed on the server and replicated late causing the client's ammo to jump sharply.
So I set it to replicate conditionally as InitialOnly and do the rest with rpcs
It won't work - and it won't make a difference anyway because the RPC will arrive just as late as the property
Wdym
the latency is the same regardless of whether you use a replicated property or an RPC
Oh I only update the ammo on a reload
An RPC can actually be worse, because when they are reliable they delay all other reliable RPC's to preserve execution order
I know the latency is the same
So the client ammo is independent outside of reloads
But it should always be the same outside of the client cheating, even so it wouldn't matter it's still validated on the server
The other approach ofc is a prediction system. The ability system has this built in as a general concept, but you can also roll your own
But the real problem is you will have trouble synchronising the true state of the weapon if network relevancy changes or when a client joins late, because the server will have no idea what properties changed for each client.
Queuing up the inputs seems to work pretty well
At least for my purposes
I have a question, since you seem pretty experienced. I'm having issues with the "first function" to be called when a pawn is created or restarted. Sometimes the beginplay function is called first, sometimes the restart function gets called first. It's annoying. Also the listen server host has its own set of issues with running all of that shit before the pawn gets possessed. Is there somewhere you can run code after the pawn is created AND after it has been possessed?
Something that is guaranteed to run before everything else
It sounds like it should be obvious
There isn't really, possession is determined by the controller - and since it's a different actor it replicates independently of the pawn, so it's fairly random whether or not the pawn will be fully possessed when BeginPlay() etc. is called.
But you can workaround it by overriding things like the OnRep callback functions
Similarly whether BeginPlay() is to be called is determined by the GameState, which is another independent replicated actor - so there are race conditions between three different actors for something like that. These are mainly why the OnRep functionality exists, to be able to handle initialization/changes etc. when properties are updated from replication.
I have a question, since you seem pretty experienced.
I'd hope Jambax is pretty experienced. Job title would be awkward otherwise 😅
@dark edge Hi! i was thinking on how to make this "packages" of similarity with the wave function collapse approach.
i'm thinking on use the normal weights that they already have for the chances of spawn and also add a new condition like "Multiplied chance of same cell type near" and a flag for it.
So if i want to, there's X more chance of a cell of the same type spawning around it.
What do you think? did you have something similar on your setup?
p.d.: posting it here and not dm because maybe it's usefull for someone
@worn wagon Generally you can get around race initialization issues doing something like this:
{
Super::BeginPlay();
TryInitiailize();
}
virtual void OnRep_Controller()
{
Super::OnRep_Controller();
TryInitialize();
}
virtual void OnPossessed()
{
Super::OnPossessed();
TryInitialize();
}
void TryInitialize()
{
if (HasBegunPlay() && GetController())
{
// Do init
}
}
Psuedo-code but you get the gist..
@thin stratus Hi, do you setup and manage UE5 servers?
Thank you very much 🙂
The initialisation issues have been annoying me for a while now
so OnRep_Controller is basically the clientside version of OnPossessed?
I wonder if it would be called at any other times
The OnRep's are just called whenever the replicated property is changed, so it could be valid, or it could be null
Hey, any good tutorials to make a UE5 game server
I have source access and did pull it off in UE4 but that was ages ago
hi, anyone has any good doc on "fog of war in RTS" - obviously I don't want to replicate any info if unit is in the fog... etc...
hey guys, this works on the editor but not when i package the game, any ideas?
it complains of invalid options
nvm i misspeled a letter
if i want to spawn UI only on the client what would be the ideal node for the "if" check?
UI is client side only anyways, not sure which if you're talking about, the screenshot is tiny.
so if i do like a "add to view port" it wont run on the server by default?
Are you using listen server?
or dedicated
actually doesn't matter, its client only yeah, mouse over the Add To ViewPort node and it tells you
my idea was to use a check for performance reasons but it seems that its not needed then
im acualy using both server types
the cast that i am doing will still run in the server i assume but a cast only shouldnt be an issue
I don't see any cast in your screenshot
that screen was referent to something else
this is was what i was refering to after
it had a "if" at the beggining
so since those nodes are client side only does that mean that the execution stops at the client side nodes in the server or the next nodes still run?
i dunno, just step through your code with breakpoints to find out
I'm not sure if anyone's done WFC on hexes but I'm sure it's doable. You could also consider a markov chain approach. What's your current map gen?
If the server reaches "Create Hud widget" it stops there because that's a client only node.
Those functions are cosmetic meaning they don't run on dedicated servers, or shouldn't be
They would get you errors in such case
Widgets in general are owned/assigned to local controllers
So they can still be server sided in case of a listen server player
- WFC
- Zones mark for biomes
- More fine specialization on each cell within those biomes
wtf on hexas is quite similar, i'm just trying to think of the better way to do those "clusters" of same type cells
This is a good if:
Frankly they execute (dedicated servers) what comes afterwards, though I recall that once errors start popping (error accessed none...)in a BP node they don't execute what comes afterwards, but that's incorrect 😦
Well it switches to whatever client stuff has to be processed next then back to server for the other player... etc right?
You can test this by setting a breakpoint and leaving the debugger set to default instead of a specific target and watch as the process happens.
Yeah it executes on whatever instance calls that flow, even if one of them fails it
On my character actor class, I have a property that I assigned in the character's blueprint, and for some reason it's just a null reference for characters running on client games.
It works properly for all characters on the server when playing as a listen server, and when playing standalone.
Any idea what might be the cause of that?
Is it a replicated property?
Yeah, but I probably messed something up setting it up
What type of reference is it?
Do you have the property defined in the GetLifetimeReplicatedProps function?
I have:
void AWeaponBase::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AWeaponBase, FPAnimInstance);
}
Is AWeaponBase marked to replicate?
in the derived blueprint class I made, yeah it is
Question: is setting the Velocity manually client prediction friendly?
I'm doing this on the client for prediction but also doing the same on the server, and I'm getting hitches whenever this happens 😐
Does anyone have a resource for setting up a team, round based single elimination game mode? Using Lyra so I have teams set up, but would like some guidance as to how to craft this alongside their toolset.
depends on the order
if predicted, and server modifies speed/velocity first, you get corrections
if autonomous proxy modifies it first and RPCs it to server, then corrections are minimal, if any
How would one go about persisting something like an array of playerstates through seamless travel?
Aside from using GameInstance.
Override CopyProperties in playerstate
It thought it was in gamestate too but I can't find it
Also, does anyone know if OnRep is called if the value hasn't actually changed? In the case where you update a variable on the client and server around the same time, then the server goes to replicate it. I'm sure I could figure out a test for this but would be easier if someone knew already xD
99.9% sure the answer is no. No OnRep called if the value doesn't change.
Ok great, that's what I was hoping for
Since I want variables to be replicated but I also need them to be update in a timely manner in some situations via reliable RPCs. If it called on rep after the rpc updated the value on the client it would run the functionality twice which is not what I want.
Seems like it should all work out then
Like you said earlier the GameInstance is the place to do it
That's the only thing that will persist across levels
Outside of caveats like the copyproperties function
Also
So in seamless travel the gamemode will be carried over, you can just store stuff there it seems
Hi, i'm trying to build multiplayer game for ios base on listen server, and i'm able to create and join session, but client failed to load shared map after joining. I use OnlineSubsysremNull and Unreal@4.27.2. Is there something i do it wrong. Please any help will be grateful.
1 vote and 0 comments so far on Reddit
See how it's done in AGameModeBase::GetSeamlessTravelActorList. PlayerArray persists, so you have a point in time where you have the old and new references of PS and you can use a function like CopyProperties
The functionality is already there
It doesn't persist to destination level but to transition. Epic must fix that
So I guess you're stuck using gameinstance?
there is also a funny part where the travel map game mode can fuck up the seamless travel list
Even if you use the GameInstance to persist PlayerStates that are linked to players you're still out of luck. The references are still destroyed
if not of the same class
Haha yeah
I mean try to override that function and make the GameMode persist to destination level

You would still have to reconnect your players, otherwise they're stuck
It seems like that function "truly persists" actors that are not part of the GameFramework. Otherwise you have to copy stuff over
i have a mission setup actor
it gets loaded with entire map and random generation config
travels to combat, records notable stuff there
travels back to lobby
in campaign mode that carries information like deployment result victory/retreat/defeat back
and then strategy layer awards are based on that result
and also, as a seamless travel actor
it and all its data is there and ready to be used when functions like InitGameState start to be called
so its great for initialization order too, its just there, no matter how early you try to find it
Wow, cool! The reference truly persists. Though GameMode is the one that spawned it right?
reference does not
i do need to actually find it from the GameMode
each time i transition a level
You TActorRange it?
what does this do?
for (AMyActor* MyActor : TActorRange<AMyActor>(GetWorld())
more elegant syntax for iterating actors of type
Ah i see very nice
The 2nd option is what's happening, but a hitch still happens. It's small/short, but still jarring because the player is going a bit fast 😅
if its a bit fast
you might want to configure CMC for greater tolerance before correction
Please, i spent three frustrated days to solve this problem, does anyone have some clue to solve this ??
Dedicated server stucks at this log . Dedicated server of Old version of this Project runs successfully last log (Engine Initialization) while dedicated server of updated version of project dont initialize properly and cant connect to clients. Help how can i fix it ? Anyone who has experienced this and solved it?
It seems that this checkbox was causing this problem.
After I changed to always refresh as you suggested and unchecked this checkbox it seems to be working now 🙂 Thank you very much
A nice, glad it helped
Incredibly rookie question, but do you need to spend money on servers if you want to make an online game with Unreal? Or does Unreal already have servers you can use?
I think there are some options as to servers, but i'm guessing they are not free. Check Epic online services, I haven't looked into it myself but I'm guessing it is exactly that - servers.
also unreal supports peer to peer
Unreal doesn't support a true p2p. The most close configuration to that is called listen-server, were stuff has still to go into the server.
With a listen server everything depends on the host right? So when the host disconnects does the server get shut down? Or is there a way to make another player the host to prevent this from happening?
Yes by default, everyone is disconnected. A while back, someone sent a plugin here were they workaround that. Not sure what they do
So can't you make another player the new host of the server?
This: #multiplayer message
Wow exactly what I was looking for. I'll take a look, thanks!
Hi, i have the same "UniqueId: INVALID" problem. Do you solve it finally ??
anyone know how to communicate with a the Client regarding sending values to the Animation blueprint from a server only place in code? Sending an rpc to owning client doesnt work because the server is the one who owns the creatures im trying to animate.
Hey everyone,
So I'm creating a multiplayer game with Steam OSS. So far I'm able to host and join on LAN. But, when creating over Steam OSS, third player is unable to see the hosted server, i.e. not listing in the server browser. Checked server settings and max allowed players. Everything works fine in LAN session but not so much in Steam session. Anyone having any insights on this?
Is there a UActorComponent function that guarantees that I can run RPCs from that point on?
Other than BeginPlay
I attach a ChildActor to a ParentActor using SnapIncludingScale, and set the Parent's scale to 0.5. They both scale down to 0.5. And the child's Transform.Scale is 1 (so it's relative to Parent). Nice. This is as expected.
Then I replicate the Parent (and the child) to a client, and there they show up with Parent scaled at 0.5 (correct) and the Child scaled at 0.5 (relative to parent, so 0.25 in world scale). Why?
How does the attached child inherit the scale?
Are you scaling the Actor directly?
Cause iirc ActorScale is already replicated
It basically takes the ActorScale and applies it twice then
Which causes your 0.25
So, I'm actually only spawning a ParentActor, with scale 0.5 in its Transform. That code only executes once, and only on the server.
That ParentActor then spawns the ChildActor (during its OnConstruction) and attaches it to itself using SnapToTargetIncludingScale. I store a (replicated) reference to the ChildActor in the ParentActor.
It feels like the ACTOR-instance for the Child is replicating itself with 0.5 scale because that's its RootComponent's world-scale on the server, disregarding the fact that its scale is 1 relative to its RootComponent's ParentComponent (since it's attached). Or.. something. This is hard for me. Could the ChildActor's "ActorReplication" be fighting with the ParentActor's "ComponentReplication"-stuff? Since the ChildActor is a "replicated actor reference" and a replicated component..?
(So no, I never apply any scale on the client-side, and never on the Child)
I'm wondering about the best way to set up locomotion to be multiplayer ready, would state machines be the best choice?
@mighty barn theres no multiplayer regarding state machines
and what do you mean by multiplayer ready?
Im hoping to use listen servers and allow players to host their own server by acting as a client for other people to connect to. I was wondering how I should set up everything so that it would be replicated properly
Hm okay, I would argue that scaling actors is already a bit of a hazzle
I usually only scale visuals and change collision sizes accordingly, cause I only had issues with Actor Scale and networking
@mighty barn as far as I know the replication of the animation blueprints its already handled by epic, if youre playing a specific animation based on a specific variable, u just need to make sure the clients and server are synced on the value
so yeah just using the normal state machine is probably the most common solution to your problem
How to call a function declared in client game instance from server game mode?
Thank you! I just needed some confirmation before spending time on it
From GameMode iterate PlayerControllers or w/e till you find the client you are talking about. Call a client RPC on it and from that client RPC access that client side GameInstance function
This is what I was playing with, but wasn't sure I should do this 😅
there is tolerance somewhere in editable config
i think its 3 UU by default
but that doesn't work for speeds much larger more then bipedal movement speeds
which is saying, it better be under 1000 if you don't want corrections
Replicate a variable
@dark edge yes it seems obvious and when I do that it doesnt replicate the variable down to any clients, im nto sure why
not even multicasting the variable works, this is specific because its being done inside a blackboard task, so im not 100% what that implies
As long as the object it's on is replicated, it should replicate.
As long as the actor is replicated to every client, a multicast rpc should get sent to every client (from the server) as long as the actor is relevant to that client.
@latent heart so the AIController is always relevant, and the monster or whatever that is using the controller is replicated and everything else replicates, but this specific BTT_BlueprintTask doesnt replicate its variables 😦
Controllers are never replicated except to their owning client.
It won't be relevant to any clients.
Doesn't mean the controller will be.
no, but is it the controller that owns the BTTasks ?
Probably.
Probably something like that yea
Might need to approach hwo those tasks are used a bit differently
I'm pretty sure BT's only run on server anyway. Why would a Task be replicating?
Only the server needs to know anything about it.
Put any variables you need to replicate on the actor itself
Yeah but if it has some value in the task, that u wanna get to say the animation blueprints, which wants to be on the client
then that is the issue
@latent heart yes I think that makes more sense anyway
Anything used by anim bp should live on actor
anim bp doesn't care abuot the brains, it cares about the body
@dark edge yes it makes sense that the animbp should read variables, thats the idea behind recieving information from its replication
Would anyone be able to help me figure out why my replication is not smooth please
It is in C++ and I'm just totally stuck
@clear swallow maybe check the update frequency of the actor
I did
what about it is that is not smooth?
I have to set it to 5 and then use the server to update it
But when i change the variable on the server it wont update and goes really laggy
Like the rate at which the object spins doesnt change on the server at all
ok so if its replicated then u should set it on the server
and make sure the whatever function ur running on the server is updating frequently enough for it to be smooth
or alternatively lerp the value
I am running the movement in tick
did u try setting the net update frequency to 10 ?
if i set it to 5 on my enemies they are also choppy
I can show you what im trying to do if you want
sure i can have a quick look
having trouble getting replicated actor deleting working, when the item is picked up and dropped once every time after that the actor will not be deleted on the client and only on the server how do I fix this issue any ideas? (video of the issue and the code )
If it's a replicated actor, you only need to destroy it while running on the server.
You can only call "Run On Server" RPCs on actors that are owned by the client.
It's also a really bad idea to have an RPC that tells the server to delete an actor as someone could potentially spoof that RPC and feed in whatever actor they want, and the server will destroy it.
So what you should do:
Update your Interface to pass along a reference to the interacting player controller or character based on wherever your interact event is.
Your interact event (key press I'm assuming) does as it does up to the point where you're about to pass to the Interact interface.
Instead of calling the interface, do your "Run On Server" event in your player controller or character, wherever your interact interface currently is. Pass through the reference to the actor that you want to interact with.
In the Run On Server event, call the interface on the actor, passing along a reference to player controller/character - this avoids you from having to use anything like "Get Player Character 0" within the item.
Once you validate that the player is able to pick up the item, proceed with destroying it.
Quick and maybe stupid question:
Is it normal to have weapons spawned X times? (for each client + server)
If I have 4 clients and each has 3 weapons would that mean the server has to handle 12+ weapons (which are actors)?
Does anyone know a good document/article that states the pros and cons of each type of networking? Like p2p, listen server, dedicated server, ...
In UE there is no P2P, only listen server and dedicated server.
Listen servers have one player acting as the server of the game. If the host leaves, all players are kicked from the game. It generally takes a bit more processing power to be both the server and playing the game.
Dedicated servers are their own copy of the server running with no player acting as the host. If all players leave the game, the server can still be running.
But a dedicated server costs money right?
No. The concept of a "dedicated server" just indicates an instance of the game running in which no players is also playing on that same copy of the game. That means you could run a dedicated server on your own hardware, or a player could run one on theirs. If you wanted to join your dedicated server, you'd have to run another copy of the game and connect to it.
Does your PC have to constantly run the game for the dedicated server to be up?
Or how does this work, is it like in the background?..
Yes. The server executable must be running in order for players to join that server. It doesn't have to be constantly up, but when it's not up, people can't join it.
Wait so let's say as a player, from the main menu you can create a server that others can find and join. This server doesn't have to be a listen server?
Technically yes - you'd have to set it up so it closes that instance of the game then launches the dedicated server (with whatever settings the player has chosen)
But still when that player leaves the whole server gets shut down right
Only if the player shuts down the dedicated server instance / turns off their computer.
Hm okay, so is there a way to have this system of creating and joining servers without depending on the host?
That would mean you would have to manage your own dedicated servers instances like an MMO.
At that point, you're probably spending a lot of money as you'd need to use some hosting service to handle multiple servers.
How about using this plugin? https://www.unrealengine.com/marketplace/en-US/product/host-migration-plugin/questions
Like when the host leaves, the server gets a new host?
Can't speak to it, it's not something I'm familiar with.
But technically would it work?
I have no clue.
Hmmm okay well very interesting setting up multiplayer is actually such a hassle lol
Thank you for your insights
You can ask the one who made it there in the comments or contact him
Good idea, will do!
It'd be interesting for you to ask someone trying to sell their plugin, if it works or not and they respond with, "nah"
XD
I will say this, if it does work, it's probably a ton of data that would need to be transferred over the network constantly (eg. you lose the benefit of actor relevancy, all players would have to know where everything is and what it is doing). It's probably still running as a listen server, and upon the host disconnecting, the new host's game launches their own listen server and is set up as it was before the host disconnected, then the other clients would be attempting to reconnect. This means its also probably not seamless.
Yes but I don't really see another alternative because I don't want the server to shut down when the host leaves...
Idk if you've ever played overwatch, there is a custom games feature in which you can also setup your own servers
When the host leaves, automatically another person becomes the "leader" of the server
Yes. Host migration.
But in OW it's seemless, I wonder how they pulled it off
But when the host leaves, how quickly is the transition to the new host? Is it seamless?
Yess
That probably means it was set up to be a P2P networking model from the get-go. All clients would have all the data, know all the states, share "rules" and determine if something happening is valid, one player leaves, the rest keep playing as is.
I know the owner of the plugin, so I know how it works a little bit
its actually basically how Datura explained
everyone saved the state of the world, then loads it
Does it affect performance?
never tried
But just assumption: it wouldnt
it just saves transform, actors etc.
my biggest worry was the size of the saved data
but owner said it'll be around a few kbs
biggest problem of that plugin is, its exploitable
since everyone saves the data locally
you can change it and become host somehow

not hosts, everyone
everyone can exploit a listen server
no way to fix it
thats why dedicated servers a thing
data is in somewhere far away in a server lab
you cant modify it
gawd dayum
which one
If you're the host, then you have control of the server, so yes, you can do whatever you want to the server.
Just because it's a listen server doesn't mean that players can exploit it.
true
the problem is, hosts are players
thats what I meant to say
but Im aware its poorly formalized
So what would be the best option if you want a system where players can create a server that lasts until there are no other players in that server?
If you want a seamless system in unreal, then when a player wants to start up a server, they're making a request to launch a dedicated server on some hosting platform that you've set up, and then that player joins it. Others can join by searching for it/using sessions. If the original player that start the server leaves, the game still continues without them. Once all the players leave, the server shuts itself down.
The easier approach pretty much.
But $$$
Provide server binaries. Have them set it up themselves 🤣
Yeah 😭
He's wanting the game to continue without having to worry about the server / host going offline.
I'm aware
Well what part of it costs money
Well, you're either going to be opening up your own data center to house the servers required, or you're going to be paying a hosting service (like AWS) to run those servers for you. Both cost $.
That's where the benefit of letting players run their own dedicated servers.... They then are paying that cost.
Literally or figuratively????!!!
Literally
What I don't want the players to pay for a server then no one would play 😂
In the early days of networked gaming that's basically all you had.
Had to boot up GameSpy and find people running their own Team Fortress servers and join some 2fort4.
And those people payed with money for a server?
Sure. Sometimes it can be as simple as just running an older computer in your house.
That still costs money.
Power, internet usage, etc.
If you host the server, you are paying for it.
So let me get this straight, i can implement:
-
A listening server system where the player is the host of the server. This is easily exploitable and the server shuts down once the host leaves
-
Set up a hosting platform and let the player connect to a dedicated server hosted there. This costs a lot of money for me
-
Let players pay to create dedicated servers. This costs money for the player and gets shut down once the player turns their computer off
What is the process to figure out how much it will cost to host your own servers? My guess is that you first need to determine how much cpu/memory is required to run one instance of your game and then try to find the best option where you can fit as many instances as possible into a single server without affecting performance. Then you also have to consider bandwidth costs...ughh
Correct me if im wrong
Could also do a mix of hosting options. Let players host it themselves and play with friends, host some dedicated servers on your own and allow for community servers to thrive on their own as well.
It depends on your game
If you're making something like a co-op horror game or whatever then it makes sense to stick with listen as small groups of players are probably friends and cheating isn't all that big of a deal.
But if you're making a game for a larger amount of players per game it makes much more sense to go down the dedicated server path.
Listen servers are only exploitable in the sense that a player is the host and they have control over the hardware the game is running on, thereby they can tamper with the memory of the game allowing them to do things that may not necessarily be valid.
If you allow players to create dedicated servers, it's a similar issue - they have control of the hardware the game is running on, so they can tamper with it. The dedicated server doesn't necessarily mean they're running it on their own computer, they can host it somewhere else if they decide that has 24/7 uptime, but that's up to their discretion.
I want the servers to be like a freeroaming space where players can PvP freely, chat and trade stuff
So like an MMO?
In a way, but like getting your abilities and stuff in a separate single player mode
Unlocking stuff in single player that can be used in multiplayer will result in lots of cheaters who are able to unlock stuff instantly.
Is a singleplayer mode that exploitable?
Single and listen are exploitable, even dedicated although to a lesser degree
Again, if you have control of the hardware the game is running on, you can manipulate the game.
Okay so what if I have an offline story mode where you unlock your stuff normally, and then in the online mode you can customize everything freely
Your game is just a process running on your computer. Any process can have its memory altered because well the memory is just there physically on your own computer. So in other words you can boot up a cheat engine and start changing the memory around to make the game do stuff without having to actually do the thing you designed the player to do. They can just hunt around and find the bit of memory that flips the switch to unlock all abilities...etc
If you allow players to upload their "saved data" to represent their character in multiplayer, then that saved data could've been cheated.
Save Data in unreal engine is also not secure. There's websites where anyone can simply upload their save file and it allows them to edit the values and re-save it.
Even AAA games struggle with that.
Cheating in NfS is as easy as in manipulating some numbers in your memory.
And that's a multiplayer game with the ability to play locally.
GTA online has the exact same issue.
Scrap the idea of transferring data between offline and online
Then you're having to save player data yourself which will cost you $$$ for database storage/usage.
So even if you were to use an external database server that you have full control over to manage the player's access to unlockables. That STILL isn't secure if its a single player game because the functions that reach out and make a request to the server can still be triggered manually by altering the memory.
Therefore the only secure way is to use a dedicated server which reaches out to an external database to manage player's access to unlocked things.
Jesus...
Security is hard if you want to make it secure.
I'm currently in the process of setting up a system like this for my game. It all comes down to a few JSON POST requests that are being sent from a dedicated server to the other database server. If those URLs were to leak then anyone could simply boost their high score or whatever just by sending authenticated POST requests.
I could throw a masterlock on my shed, and most people wouldn't care to go in, but someone with knowhow will know that lock will fail within 3 seconds if they could get to it.
By the way, if someone knows the answer to this question that'd be great! Thanks! 🙂
Haha it works™️
Why must people hack 😭😭😭
You mean like this ---> https://youtu.be/bfDPtt-bnAI?t=49
Exactly.
Yeah nobody plays Minecraft or Valheim or TF2 or GarrysMod
It takes that dude like 5 seconds to unlock that LOL
I think I'm gonna have to rethink my whole concept a little bit now that I've gathered this information
I decided to get a lockpick set myself to play with because of LPL.
If Valheim was more like Rust.... wow that could could of been such a crazy multiplayer experience.
Imagine a horde of enemy viking ships appearing on the horizon as the town's people start screaming and running around franticly.
Same problem. Something executing on your computer, you have control of. Nothing stopping you from cheating the anti-cheat system.
My (limited) understanding of something like easy anti-cheat is that you can pick an anti-cheat partner to work with and they perform a security audit of your game. You probably also pay some sort of license fee and then they make it so your game works with their exe which runs on your player's hardware to detect cheat processes.
Okay so scrap that idea 😂
And that still doesn't protect your databases etc.... If you have something exposed on the internet, people don't need to even run your game to access it and send commands to it.
There's also tons of things you can do with the design and development of your game to reduce cheating. For example Valorant came up with a custom "fog of war" system with their game. Essentially they hide all non relevant player characters (even when behind walls) and only reveal them at the very last moment. This helps reduce the effectiveness of wallhacking because you can't see an enemy behind a wall until they are just about to step out into line of sight.
Technically you could do some kernel level of anti cheat... But... 
I think I'm gonna have to go full online or seperate the two gamemodes
Correct the server would have all the 12, as it's the one who spawned them all.
BIOS level Anticheat yo.
Thanks. So my stuff works as intended. I already thought I did something very very wrong. 
My game is also a mixture of single and multiplayer. For the single player part its entirely PVE and there are some unlockable perks that aren't all that difficult to obtain in the first place. The unlockable custom events make a request to the external database which reads and validates the request. Sure it can be hacked but I don't really care because the unlocked item isn't all that amazing.
The unlockables on the multiplayer side of things are far more important for gameplay.
is there anyone that could help me with logging network related logs, im using steam and using listen servers and keep running into weird random disconnecting client and host side and cant seem to find a way to log what is happening
Does this cost money
External database
yea
Well you could try to host your own but a cloud solution is much better.
Yeah. Cloud solutions are actually pretty decent.
Cloud database is cheap though.
And in some instances, some companies have "free tier" access for development purposes that has certain limits on storage and access rates.
But be warned they can be very VERY expensive if you screw things up. They scale automatically and there's no hardware to manage.
I think I'm just gonna give up on the idea of transferring data between modes
Yeah AWS charged me $5 for some bloody error logging on a free database -_-
An example of doing something wrong to result in a huge cloud bill would be like writing some buggy code that does an endless loop of making some change on database table or something like that.
I have a few Firebase apps that I'm hosting for basically free. The highest I've seen my bill is like $0.03
Event Tick -> Write to database (All Player Data)
Normally uploading images over and over again isn't all that big of a deal, but it IS a big deal when you're running a website that is hosted in multiple datacenters across multiple regions.
omg that's horrible XD
You can find a version of this in ShooterGame btw
Oh? Do you happen to know which folder or file?
or perhaps a keyword I can search for?
I'm struggling with making clients possess a server-owned pawn. I was thinking I could just call a Server-RPC on the pawn, but since the calling client doesn't own it - the call is just dropped.
I understand this is by design.
I assume I have to tell the server to give "me" ownership over this pawn before possessing it (or have the server make "me" possess it), but how should I do that if I can't call the server through that particular pawn? Am I supposed to route the request through my PlayerController/Pawn? Like make a generic AMyPlayerController::ServerRPC_RequestPawn(APawn* Pawn) or something, which I would call whenever my current pawn interacts with the server-owned pawn, and then pass the server-owned pawn?
just place the script somewhere like the player controller
it just needs to be something that is owned by the client that way in can call rpcs
In the character cpp
There’s a should replicate function if I remember correctly
Where they implement a version of it
Tho it’s not perfect
Ahh yes, that makes sense.
I'm compiling already right now but I'll have a look for that code in shooter game. Thanks @eternal canyon
Is there a fancy way of getting the PlayerController of the client that is calling a ServerRPC, or would I have to pass it in the RPC?
Holup.. I'm using my frontend-brain again..
If I call a ServerRPC on my PlayerController, then the exectution will be on the server - but it will still be on MY PlayerController.. right?
Correct
Hello, I have no clue if this is a ue bug or replication bug but whenever I try to equip (Capes) And (Masks) It Cancels either or out, here is the code
Im On ue5
Instead of having multiple RPCs, consider passing along the integer through the RPC, then setting which mesh to use based on the integer.
Your "SwitchCloak" RPCs are modifying the "Mask" mesh. Are you sure that's what you wanted it to do?
Oh Shoot, I didnt notice that I was changing the mask mesh on the cloak lol that fixed it, thank you
Oh, this does look like a better way, I hate dealing with all my nodes, thanks for this 👍
yeah so youd want the input to call the rpcs on the player controller and from there they can call any event and it will be replicated, for instance, i possess a car by first letting the player controller know then the pc tells the server and then the server tells the car
I didn't follow-up, but this won't run for non relevant clients. Are you aware of that @iron crest ?
True 😛
if you want skeletal mesh updates to replicate youll need a setup that sets the skeletal mesh remote as well as calls it on the client, not just calling it on all
You need OnRep
OnRep for state changes - IE, changing the mesh of something.
RPC for one-off events - IE, an explosion effect
This one literally talks about how you change a mesh, so perfectly fits your example: https://vorixo.github.io/devtricks/stateful-events-multiplayer/ @iron crest
Perfect Thank You, Ill Check This Out, Seems Useful
Is it always illegal to call Possess from client? Even if my PlayerController owns the pawn?
I think you could possess a locally spawned pawn, but not a replicated one spawned from the server.
Only runs on the network authority (where HasAuthority() returns true).
There is a setting "bCanPossessWithoutAuthority" in the code.
Hmm that's new to me.
Either way, I think it's probably a bad idea to possess a pawn locally only in a multiplayer game.
Yeah honestly if it's that way by default I won't change it. Especially that stuff like this is authority
Wondering what the special cases to turn that on
I see.. If I have a server-spawned replicated actor and the server called SetOwner(SomePlayerController), what would the "owning" client's authority be? Not Authority, but one of the Proxy-values? (i.e. HasAuthority is false?)
A replicated server spawned actor would have Role_Authority on server
On client it's autonomous for you and simulated for others on your machine
At least for controllers it's that way
Wait, so the NetRole doesn't change when the actor's Owner is changed? Are they completely unrelated aspects of ownership?
oh shit, there's a RemoteRole too. I have to look more into this tomorrow.. 😴
Yeah there is LocalRole and RemoteRole. Not really sure about the details, but yeah LocalRole stays the same
Has to write a blog post about it eventually
I have a hard time finding a definitive answer on the web: what is the best way to send a large amount of data (more than a normal RPC) with Unreal?
Given that TCP sockets are not really supported..
TCP Sockets.
You can potentially make the data into chunks and send it through multiple RPCs and reconstruct on the other end.
The problem with TCP sockets is that Steam multiplayer isn't happy with opening more ports.
Sending data into chunks and reconstructing is probably the best idea, is something built in Unreal for that?
I don't think there is, but I don't see why, it sounds like a common use case.
I don't think there's a catch all solution, you'd have to make it yourself. What kind of data is it you're needing to replicate?
That’s the worst thing with Steam multiplaer. Pretty limited, it is what it is.
Currently working on voxels with steam multiplayer and damn you have to think sometimes
Something more or less voxel-like. It's not terrain but it's still 3D points with properties each, that I generate on the server around players and I now want to send to clients.
I could just limit the number of amounts of points I send to fit the 65kb limit, or I could compress a bunch of them into a binary, slice the binary, send it into RPCs and retrieve it.
For the binary strategy, I don't see why there couldn't be a catch all solution though. It wouldn't depend on the actual usage of the binary data exchanged.
That should be a repnotify
Some internet explorer speed you have there Adriel 😅
He saw them, but repetition is 🔑
I'm just about to start with UE. For doing a MP game, should I learn how to do multiplayer first, or do the base game and then implement mp?
It's not safe to start working with MP right away even if you had UE knowledge, how if you don't have any. I would suggest you know UE first, then try and indulge in MP. This is the MP starter pack: #multiplayer message
If you're a solo dev and your game is going to have a multiplayer experience then there's plenty of other stuff to learn before you start working with multiplayer such as getting comfortable with blueprints, level design, material design, character design, audio design and AI. Only then does it make sense to spend time making things replicate and learning about RPC's and organizing your code into the proper base classes and implementing a server authoritative structure.
If you're working in a team to make your first multiplayer game I'd suggest splitting the work up into programming and design. One person makes things work in both single and multiplayer while the other person makes things and makes sure they look good.
I'm in the planning stage and began to learn the basis. I'm an artist about to become a solo dev by now. So I will follow your advice and learn and get comfortable with ue bases, and then start again to do the mp
This is the best, free and official learning resource library: https://dev.epicgames.com/community/learning
You're not streaming the entire voxel world, right?
Are you at least having a base set and diffs to it?
does any one know the diference between private and public connections in this node?
/** The number of publicly available connections advertised */
int32 NumPublicConnections;
/** The number of connections that are private (invite/password) only */
int32 NumPrivateConnections;
thanks
another quick question
do these options look good ?
putting the name of the map first is enough right?
Correct
btw it's called MaxPlayers
/** Maximum number of players allowed by this server. */
UPROPERTY(globalconfig)
int32 MaxPlayers;
That gets auto assigned
In case that what PlayersPerMatch meant
that one is actually my variable
Are there any ways to check what is/isn't being replicated in the editor?
Getting a bunch of LogProperty: Error: Replicated TMaps are not supported. logs, but I'm 95% confident I'm not replicating any TMaps.

Its likely that you are.
Yea, but not that I can find
😛
Even after going through everything in the reference tree, no TMaps that I'm setting to replicate

Find where that error is in code and set a breakpoint?
Perhaps you're replicating a structure that has a TMap in it?
The voxel world itself is not replicated, just through a seed 😛
So dont worry lol
My dedicated server stuck at Bringing up level for play and doesnt show Engine Initialization. Help!!! anyone who can help me.
How do I do WLAN mobile multiplayer
By connecting via IP to the local IP of the Phones?
On Iphone, i got some net work error. Unreal@4.27.2, OnlineSubsystemNull. But it's success to create and join online session.
[UE4] [2022.08.09-06.40.57:252][191]LogNet: UIpConnection::HandleSocketSendResult: Socket->SendTo failed with error 37 (SE_EHOSTUNREACH). [UNetConnection] RemoteAddr: [fe80::33:511e:d503:e311]:7777, Name: IpConnection_2147479383, Driver: PendingNetDriver IpNetDriver_2147479384, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID Connection beginning close timeout (Timeout = 0).
Does someone know why the Set Collision Enabled isnt working?
I disabled it and now after a delay I am trying to enable it again, but it doesnt work
At the beginning of this code I added 2 custom events on running on multicast the 2nd on run on server
Everything is working (replicated too), only the collision isnt working
Hi everyone, are there any open source examples of a dummy multiplayer game? Nothing more complex than just allowing a few players to join a server and run around one of the template maps.
Which I could just download and use that is
shooter game example should work
quite a few games started as a shooter game, then evolved
Or Lyra 
i heard only weird/bad stuff about lyra
people messaging me "look what they did here weird"
They were happy till that teleport exploit was found xD
Haha nothing there makes sense tbh
one was matching some manually assembled strings with class names to pick which class of debug controller should you use
that was very awkward
Hell nah
Seems like they made it in hurry
Also the data driven approach overcomplicates stuff
Haha James should have went crazy over it
HLL had that iirc
Yeah it's mentioned in the post
so did SCUM
Wow, it really shows that games were built upon it lol
Yeah, found that pretty early on 😄
Tbh that's just the tip of the iceberg when it comes to working shootergame hacks
Lyra isn't any better
Took about 2 seconds to make a weapon speedhack
It's crazy how easy it's to miss these stuff at development
Was you the one who fixed it?
tbf I don't think they were really thinking about making things cheat proof when building the samples
Yeah though I "fixed" it because we essentially did our own ballistics system that required getting rid of all that anyway
Oh yeah it was all ditched then
Hi folks, I'm having an issue with client actors and movement. Hopefully this is something really simple that I have overlooked.
I have a multiplayer game based on the top-down game example. The game starts and spawns two actors - one for client and one for server. Both of these actors function correctly, as you would expect.
However, when respawning the client's actor (Actor instance is deleted, and then a new one is spawned using the same blueprint), that actor is unable to move correctly and the error message "Movement not allowed" is printed to the console.
When it is respawned, it is assigned a player controller in the same way as when we created the initial client actor, so I'm really not sure why it's failing. Could anyone shed any light on this?
I need an action triggered (client-side) on a newly possessed pawn, so I was hoping I could find and override something like APawn::OnPossessedBy(APlayerController), but it seems no such thing exist.
I can only find the other way around: APlayerController::OnPossess(APawn). Do I have to override this in the PlayerController and specifically check if it's a certain pawn class, then call the pawn-function from there?
Or are there other ways of being notified inside the Pawn when it's being possessed? I can see that PawnClientRestart should do something similar, but "restart" isn't that well documented so I don't really know what it means..
I don't want to clutter my PlayerController-class if I can avoid it.
Hello everyone, I have a problem, I dynamically load static mesh from an external server, then load it through the path and add it to the inventory/building system. Locally, everything works fine, however, in multiplayer, other users do not see this static mesh. How can I replicate this static mesh?
Hello all,
I am researching in creating a MMO using Unreal. I know that this is a huge undertaking but I might make something really simple. I am using this project as a guide for learning so that I can touch many aspects of Unreal and learn as needed. Like I said, it is going to be a pretty "simple" MMO for my learning purposes.
Currently, I have some very basic movement for a main character and I am currently looking at implementing an inventory system and also utilizing the GAS for my abilities. But before I get too thick into the gameplay side of things, I want to make sure that I build this with the view of MMO correctly so that I do not have to go back and spend hours redoing things.
My first set of questions are pretty basic.
- I was reading that for MMO, it is best to run the entire game on a headless server. Does this apply to Unreal?
1b) I know that Unreal runs the client-server model where a server hosts the game. When creating an MMO, do I make the game as if it is a single player game where the project implements everything and later it turns into the headless server to monitor the states? Or is there more special implementations that I need to consider?
1c) As a follow up. I am working on an inventory management system. For now, do I setup it up "normally" in my project for now? Or are there any special considerations that I need to think about when moving over to the headless server? - I am reading about networking from the Unreal documentation. For the MMO, can I consider it as one big multiplayer game or are there additional considerations that I need to take into account that are not mentioned in the documentation?
- Can anyone recommend some good resources for me look into implementing MMO with Unreal?
In the staticmesh actor class you got Replicates flag. Set it to true.
already done, didn't help
Why are you setting it to replicate at runtime? And anyways this won't work when you SetStaticMesh, unless you do it using an OnRep
blueprint also has replication installed
So the actor is replicating though you can't expect the set skeletal mesh to replicate too, because that is done locally
Even if you replicate the component it won't work
So my point still stands you need to set it when the actor replicates for example.
OnRep_ActorHasReplicated->SetStaticMesh
default staticmesh builds perfectly, but which is loaded does not appear
if I try to output the class name, it outputs an empty string
set SceneRoot and StaticMeshComponent replicated, doesn't help
this didn't help too
I'm not sure if there's something I'm missing but again this is how I would do it
I think the problem is that there is no static mesh class on the server that was loaded on the client, so it can't deliver anything
The thing is that BuildingSimMesh you are passing should be replicating too, by the time you set, which if not attached to the actor spawned there you can't guarantee they replicated at the same time
i try to set BuildingSimMesh variable replicated
I've got this problem where the host of the game shoots straight out from the camera to the forward vector but the player who joins the game shoots down even though they are looking flat (the angle of the gun is where their camera is looking). I'm not to sure what's going on, please help if anyone knows.
Thanks!
when i use local static mesh all works fine, but with downloaded one - unknown type
Hi 🙂 I'm looking for a function which is called on the dedicated server when a client leaves the server (on graceful disconnect, client crash, network connection crash...). The main Problem is that I need to have access to the Pawn (which seems to be already destroyed in AGameMode::Logout). Is there any overridable (C++) function that satisfies these requirements?
void APlayerController::Destroyed()
{
if (GetPawn() != NULL)
{
// Handle players leaving the game
if (Player == NULL && GetLocalRole() == ROLE_Authority)
{
PawnLeavingGame();
}
else
{
UnPossess();
}
}
if (GetSpectatorPawn() != NULL)
{
DestroySpectatorPawn();
}
if ( MyHUD != NULL )
{
MyHUD->Destroy();
MyHUD = NULL;
}
if (PlayerCameraManager != NULL)
{
PlayerCameraManager->Destroy();
PlayerCameraManager = NULL;
}
// Tells the game info to forcibly remove this player's CanUnpause delegates from its list of Pausers.
// Prevents the game from being stuck in a paused state when a PC that paused the game is destroyed before the game is unpaused.
AGameModeBase* const GameMode = GetWorld()->GetAuthGameMode();
if (GameMode)
{
GameMode->ForceClearUnpauseDelegates(this);
}
PlayerInput = NULL;
CheatManager = NULL;
Super::Destroyed();
}```
@final turtle
the PawnLeavingGame is what destroys the Pawn too
@winged badger Thanks! I gave it a try and the PawnLeavingGame function sems to work perfectly for my usecase!
Hello all,
I am researching in creating a MMO using Unreal. I know that this is a huge undertaking but I might make something really simple. I am using this project as a guide for learning so that I can touch many aspects of Unreal and learn as needed. Like I said, it is going to be a pretty "simple" MMO for my learning purposes.
Currently, I have some very basic movement for a main character and I am currently looking at implementing an inventory system and also utilizing the GAS for my abilities. But before I get too thick into the gameplay side of things, I want to make sure that I build this with the view of MMO correctly so that I do not have to go back and spend hours redoing things.
My first set of questions are pretty basic.
- I was reading that for MMO, it is best to run the entire game on a headless server. Does this apply to Unreal?
1b) I know that Unreal runs the client-server model where a server hosts the game. When creating an MMO, do I make the game as if it is a single player game where the project implements everything and later it turns into the headless server to monitor the states? Or is there more special implementations that I need to consider?
1c) As a follow up. I am working on an inventory management system. For now, do I setup it up "normally" in my project for now? Or are there any special considerations that I need to think about when moving over to the headless server? - I am reading about networking from the Unreal documentation. For the MMO, can I consider it as one big multiplayer game or are there additional considerations that I need to take into account that are not mentioned in the documentation?
- Can anyone recommend some good resources for me look into implementing MMO with Unreal?
Would it be acceptable to replicate things using the InitialOnly condition, so that players who join "late" get the current state of everything, then past that variables are kept in sync using only RPCs? I'm trying to think if there are scenarios in which they would not be synced correctly, such as when an actor is no longer relevant. Do the multicast RPCs still get triggered if the actor is not relevant?
The reason I need to do this is because I have 2 properties that work in tandem that must be replicated, but there is no way of knowing which is replicated first. I need to run functionality only when both have been replicated, but there is also no way for me to logically pair them up.
Everything would be so much cleaner just using RPCs, but I want to know I'm not shooting myself in the foot here somewhere down the line.
No.
Put them in a struct
Struct don't replicate atomically though by default
You will have to make them so
Stateful = replication
transient = RPCs
No way around that

hi, isn't replicating (repnotify) USTRUCT with multiple properties from server to client just a bad practice? I mean shouldn't RPC be used instead when more than one property needs to be replicated?
So I can't just slap a replicate property on it?
You would have to implement NetSerialize in there
The 2 properties I need replicated are an array of uobjects (weapons) and an enum (the active weapon slot)
Hmm okay, I guess I need to look into that.
If this is the case then i'm not sure what I should do
Same questions asked by Ghetto. See what I answered above
Nothing bad about that. What's bad is using RPCs
I need things replicated in a timely manner though.
When a player swaps weapon the change needs to show immediately
Ofc I can do both but still
Do it locally then, still replicate it
Oh I meant for showing other players weapons, I do that stuff locally already for the local player
You would have to wait to replication to occur I guess
Even if you multicast that, the change isn't going to be faster
so in NetSerialize you'd be able to tell when to send them over to the client? only if both weapons and the active weapon slot have been updated... how do you manage to tell if they both have been updated?
..before sending them over
If I'm creating a replicated actor and then storing a pointer to it in an array which is set to replicate, how am I guaranteeing that the actor is replicated before the array of pointers. Isn't it possible the pointers are just null on the client? I haven't had any issues but I realised I'm not entirely sure what's happening under the hood.
Definitely not
like simple example, I have this:
struct {
int x;
int y;
} struct_s;
how can I tell that both x and y have been updated and only then send that struct to the client. Won't they come as 2 separate updates likes this:
// this is repnotify
struct_s s;
s.x = 1;
// sending over to the client
s.y = 2;
// sending over to the client
NetSerialize() just means both properties will always be sent and received together. Still no garauntee however that a reference to another actor is valid when you receive it
If you change the properties in the same frame, they will arrive in the same update
I see thanks
then I have to redo my multicasts 😄
State = Property, Event = RPC
If you don't follow that general rule, you can't expect replication to work properly
So what's happening if I create say a weapon actor that is attached to a component on the player, then set a replicated reference to it in the same function. How do you know that the pointer won't be null on arrival.
You don't
But the OnRep will be called again when the actor pointed to becomes valid
So I should use RPCs for that?
No, you still use properties and OnRep callbacks - but you cleanly handle it when the property is null
Ah I see, that is very useful to know
OnReps will be called again when the object/actor pointed to becomes valid
That seems really important to know damn
can some help with this #multiplayer message
Yeah, without that it's hard to really do anything safely with object instances
And for a replicated tarray of weapons and a replicated enum for the active weapon slot, I should put them both in a struct? Since I need to do some functionality only when both have been replicated, but there's no way to tell when that has happened because I can't pair them up.
wdym by "downloaded one"
Not sure exactly what you mean there
i dynamically load static mesh from external server and load by path
- Dedicated server in unreal is headless, yes
1b. You have to make game as multiplayer from the beginning, im not sure what you mean by "turn into the headless server". You need to understand what server and client are and how to work with them, what server responsible for and how it communicates with clients etc.
1c. 1b already answers it - Its more than just multiplayer, but you can think about it as big multiplayer game for now, and then implement additional logic for MMO specifically, like saving state of the world.
- No idea
than i want to place it, but can't
I have 2 properties that get replicated, and I need to execute functionality only when both have been replicated. An RPC would make it easy but then there's state issues, so I need to "pair them up" somehow. WizardCell told me I should put them both in a struct and replicate that with NetSerialize.
It's up to you really, if it makes sense to put the properties together then having them in a struct seems sensible. NetSerialize() may not help a great deal
i need some way to replicate static mesh that dynamically loaded on client
Really I'm just asking how you would approach something like that, pairing up 2 replicated variables to ensure they are received together.
You could pair them yeah. NetSerialize at least ensures the struct cannot be in a state client-side that it was never in server-side
(besides null pointers obviously)
Thank you for taking your time in answering my questions!
Yes, I figured that I need to make it as multiplayer from the beginning.
I am reading up on the UE documentation on multiplayer because like I said I want to start implementing some of these before I get too far and having to redo the entire structure.
So far, this is what I am reading through:
https://docs.unrealengine.com/5.0/en-US/networking-and-multiplayer-in-unreal-engine/
But I think that the perspective is from a fps multiplayer game. Which is fine because I believe mmo and fps will use similiar systems. And then later I can add in more specific systems for the MMO.
Jambax, mb you can help me something, i need some way to replicate static mesh that dynamically loaded on client
Dynamically loaded? What do you mean?
Also replication is Server->Client, not the other way around
Please, do not jump straight into doing an MMO when you don't know multiplayer. Do at least a few small games. Some even in SP to learn UE as an engine.
load from external server by HTTP and then load by path
thats true, its better to start with single player, then multiplayer and then MMO
What are you loading though? A path to an existing file? Or are you building an entire mesh at runtime?
i load .usdz file and import in runtime, and then get only static mesh from it
You can't replicate that. If the file is stored on some other server, just tell other clients what the file is and have them retrieve and build it themselves
that is, all users should download the file and get static mesh from it and continue to work with it? And there is no way to somehow transfer this static mesh to everyone?
Not with gameplay replication logic no, apart from anything it'd be way too much data for a reasonable mesh
I understand the risks and the sheer complexity of doing everything. I am using this as a sandbox to learn different components. That is the best for me to understand what is going on.
Thankfully, there is a portion that I do not have to do which is asset and animation creation. All those I already have. Just need to focus on the gameplay part.
I am taking my time with this and am understand this will take time.... Alot of time. I am sure that I will be picking up other projects along the way. But this is like an itch that needs scratched every once in awhile
ok, thank you very much, very much appreciated
if there is quite big codebase written for a singleplayer game, how hard is to convert it into multiplayer?
Quite difficult.
Multiplayer introduces whole different approaches to the same problem in SP.
It's not a simple switch flip or "oh, I'll just throw some RPCs in here"
Not saying it can't be done mind you.
With that golden rule in mind, does it make any difference if a multicast has some nodes to execute directly on its chain, VS a multicast that only calls a single custom event which has the same nodes to execute.
Server-->Multicast-->Do this, do that, do some more of this, and finally that.
vs
Server-->Multicast-->Do this custom event
This custom event: Do this, do that, do some more of this, and finally that.
Not really. You're still executing the same stuff.
Unless you're talking about using RPCs for stateful replication.
thanks, I thought so but, haven't done anything like that for such a scale and wanted some input @quasi tide
The only difference is you could call that event somewhere else, but you could also just call the multicast implementation function directly
Okay that confirms my thinking, but I wasn't 100% sure.
Does someone know how to fix it, this is a disappearing platform which comes back after a delay, but when it comes back the collision is weird, if you try to jump on it the character glitches and falls through it (custom event 1 is multicast custom event 2 is run on server)
Sounds like it hasn't moved on the server and it only moved on the client
So if a multicast has input parameters, floats, int, bools ... etc those are also sent over the network, right? It's a good idea to keep input parameters for server and multicast events to a minimum whenever possible. Right?
1 and 2 should be in reverse order. Overlap --> has auth --> cast --> (isValid?) --> server event
Server event --> multicast event
Multicast event --> timeline --> change material param --> set scale ...
Why is your platform collision screwed up? Because you're changing the scale of the mesh on the server only but not for all clients so it looks larger than it actually is.
worth mentioning that Darnell mentioned that they might want to try fix it
but we are years beyond a secure Lyra
unless it somehow becomes a priority
I will try it out
now the glitching is gone, but still no collision
You're also reversing a different timeline
Perhaps you intended to reverse the existing one?
Hi, there are some phases where I want the pawn to follow server movements. I can't use AddMovementInput from server. How should I go about adding movement from server? Any help is appreciated. Thanks
But isnt the timeline just for the mesh?
and the collision is attached to the mesh
hmm
what if I separate them
virtual bool IsReplicationPausedForConnection(const FNetViewer& ConnectionOwnerNetViewer);
btw
this is what the function is called
Why is everyone multicasting and not using repnotify for stateful stuff
stop multicasting so much lmao
That's prolly the most repeated mistake here ^^
Multicast for life baby!
Not enough multicast!
What now xD
Hey,
In my game when I run as client and run the game under one process the bots in the game seem to be moving but when I run it under multiple processes the bots don't move at all but their tasks get updated. Looks like something is not replicated. I have replicated the task enum, and turned breplicates to true but I am trying to figure what is not making it to move
@fathom aspen you got any hint for this?
Have you tried stepping through the code with breakpoints? F9 on a node to add a stop sign, then Play your game and it will pause automatically (when the node with the F9 stop sign is executed) , then press F10 to proceed to the next node and F11 to enter a node. If it doesn't pause on anything then you know your breakpoint didn't even run.
You can also hover your mouse over the pins to see the current data in a popup
Didn’t know that
So if I F9 the set collision and it doesn’t stop then the node isn’t activated
ah-ha! so now what you can do is move the F9 stop a bit further back and watch as the red pulsing lines show the flow of logic and pinpoint why it stops
any good network plugins that push the limits of players higher?
not sure what your question is about, what do you mean by "limits"?
that was an example or a question xD
but I will try it
running into issues w/ default ue4 networking where we have roughly a 100 player cap
like what sort of issues? do they only happen with a full 100 player server?
performance issues on the server side
trying to find like a distributed server system, i only found one so far that's suppose to be releasing a plugin
the other one, the main dev got scalped by star citizen lol
yea i dunno, that's something i haven't done before
Question: Is there anything to be aware of with save game files for misc player settings in a multiplayer game? It seems that testing saving and loading with multiple clients using PIE is pointless because they all read from the same file.
Should I be using the User Index int slot? Is that just for splitscreen or something?
I am trying to get a message to display when a player joins a game, but the username being shown is always the hosts name. Is anyone able to look at my code and possibly tell me what im doing wrong? Thanks ❤️
I can't use AddMovementInput from server. How should I go about adding movement from server? Any help is appreciated. Thanks
This. You can't use GetPlayerController 0 in multiplayer on the server - it'll always reference the first player. You have the "New Player" pin on the event that you should be able to plug into this cast.
I was looking at the pic just now and spotted that and started to wonder if that could be the issue. My reasoning behind that is because i assumed get player controller 0 returned the server pc since its being called in the game mode
thanks
and i didnt think it mattered if the server or the client called that event since its a server event anyway
Actually the more I'm looking at it, the more I'm getting confused XD
You are right, it shouldn't specifically matter in this case.
The issue is likely contained within these functions. Check what the UniqueNetID is (possibly print it out?) and see if everyone has the same Unique Net ID, or check the GetPlayerNickname function.
i may actually try just including those 2 functions in the PC only and take them out of the initial GM step
easiest way is just to do it from PlayerState
it holds the replicated PlayerName, and replicates itself
do i need to set the player name in the player state?
so as long as your server is immediately aware of Player's Name (and it doesn't need to be sent to the server when the game starts)
solution is as simple as PlayerState BeginPlay sends a message to whoever local player is
im not sure i understand atm so il take a little peek at a player state. never actually used one before
if you're using something like steam
you can pull the steam data from the net ID
and just send a message using their steam name
its an actor that belongs to a PlayerController, unlike PC its replicated to everyone
and there is an array in GameState called PlayerArray that holds all of them
so instead of trying to do it from the game instance, i would instead call the "server - Issue liveplay event" from the playerstate using the local pc
now, being replicated to everyone, as long as PlayerState has the data about PlayerName on server's instance right away (so you either joined from lobby, send a name in login url or are using something like Steam)
all PlayerStates on every machine will have the correct PlayerName at the moment they call beginPlay on that machine
yeah im using steam
which makes your life much simpler
so from the post login event i can set the player state name using the incoming pc reference?
@graceful flame I tried the F9 on the Set Collision Enabled (Collision Enabled Query and Physics) and it stopped
it might set the steam name correctly
on its own in the engine
i don't remember that bit
engine code for autoassigning players (nick)name is all ways weird and convoluted
but
@graceful flame the problem is the timeline ... the one behind collision enabled
