#multiplayer
1 messages · Page 168 of 1
so this means that i run the movement code
- on each clients
- on server
separately in parallel ?
this mean replication is set to off
the logic is running a BT
So client catches up(or slows down) to sync with server
making it replicated to somewhere would mean splitting me code more
Maybe im just incredibly naive and off the rails here
Never tried amything like this
rn the client is behind the server
since its has ping
i think the server is correcting the actor because it has a CMC
CMC is very likely to indeed correct and handle the actor location
unless you modified it heavily
i didnt modified it
well, this is causing lag on clients
idk why the CMC is correcting the client
the client isnt predicting anything since its replicating set location from server
that's what the CMC does by default - it handles replication of movement including prediction and smoothing etc.
well, its following a (for now) static path
so idk how the client could error
can anyone tell me why, when the server trace and the local trace land in the same location, that the server reports a hit on the other character while shooting over its head but the client does not. Why is the other character in the wrong place on the server?
Is the SkeletalMeshComponent set to update and tick bones and pose even if not rendered?
Cause if not then the aim offset might not have an effect on the server
That was it. Thanks much. I had always tick pose, but not refresh bones.
One question I want to create the same widget to make a small trading system between two clients, I am sending from the client to the server the creation of the widget by passing the player controllers of each one. The widget is only created when the client touches the server, but on the client it is not created and between clients it is not created directly because it has no reference to the widget. Do you have documentation and somewhere where you can learn about this well? thank you
Casting works, in fact above the controller of the instance that collides the trace is printed
Controllers only exist on the server (which can also be the host's computer) and replicate to the owning client, so they cannot be referenced on other clients. Making a replicated variable trying to reference them will not produce anything usable on clients.
Widgets also do not replicate. Anything UI driven that needs to be replicated means you need to use a client owned actor to send data to the server, such as their player controller, playerstate, possessed pawn, or any replicated component attached to one of these actors, or any other client owned actor/replicated component.
Hello,
Got a problem with the replication of my Widget.
https://streamable.com/145rq5
Here 2 screens where i put my replication :
Do you know what is the problem ?
As you can see, the widget only appears on the Server window, but not on the client window
Server on the left - Client on the right
@limpid zealot Widgets do not support any form of replication.
Therefore, attempting to utilize RPCs within a Widget is futile.
If you examine your Logs, you will likely notice a Warning suggesting as much
You need to use a NetOwningConnection in order to call RPCs
A NetOwningConnection is any Actor that has an Owner chain that goes back to a PlayerController.
i just dont want my widget s open for every player but just for the one called it
So the easiest place to manage these RPCs would be in the PlayerController itself.
oh, but its inside an event , so how can i do that from the player ? :/ ...
i explain :
there is an area with a trigger who detect the player character in the zone. and when the player enter the zone, the widget appears
i dont know what is the best solution to do it (i am beginner with UE)
If you are new to Unreal and gamedev in general, I suggest that you dont start with Multiplayer.
thank youfor your suggestion, but its my project
and that does not help me to say that
i just need some help to know more about this problem
Triggers are called in all Network contexts, you should be able to easily open the Widget when the Trigger is called.
You can use the node IsLocalylControlled on the Pawn that overlapped the Trigger.
To only execute code for that Player.
oh, i tryied this node, but that made the same 😢
when i use it, i dont have the message at all even on the server side
Here is my trigger box BP
more readable like it
As I said earlier, in order to call RPCs the Actor needs to be a NetOwningConnection.
You also should not need any RPCs at all for this.
Check the pinned comments in this channel and read the Network Compendium.
It is the first pinned comment.
You are missing a lot of basic understanding about RPCs and replication.
oh, then why that doesnt work without rpc ? i searched on internet and i saw this video : https://www.youtube.com/watch?v=2GYicrkCElA&ab_channel=MattAspland . He explain how to solve this kind of porblem, thats why i decided to add rpc, but before i didnt apply rpc on it. So if you think that i dont need to use it for this, can you explain me how should i do to make it properly ?
Hey guys, in today's video, I'm going to be showing you how to replicate user widgets. This means you can display a widget on one players screen, or everyone's screen.
Blueprint Interfaces: https://youtu.be/m90ZkbtPA9s
#Ue4 #UnrealEngine4 #Ue4Tutorial
00:00 - Intro
00:...
cause i already tryied with "IsLocalyControlled" and that doesnt work
Events like collisions can occur on both the server and the client as they each can detect it happening themselves, typically negating the need for a client to tell the server or the server to tell the client the collision happened.
yes that's what I thought too, it reassures me in a sense to read that
but then why does it not work even if I don't use rpc, where does the problem come from in this case do you have any idea?
by the way, thank you for the link pined. I am going to read it after i solved this problem
This part right here is basically filtering your collision so that:
- Only BP_FirstPersonCharacters can trigger what happens next due to the casting. (The isvalid you have there is redundant as the cast would fail if it wasn't valid)
- Only allow BP_FirstPersonCharacters that are controlled by a player controller can trigger what happens next by getting the BP_FirstPersonCharacter's controller and casting to PlayerController. This would also prevent the trigger from happening on clients that do not own the BP_FirstPersonCharacter that is performing the overlap since PlayerControllers do not replicate, so it would return None on other clients.
- IsLocallyControlled ensures that the server itself can trigger what happens next but only in the case that it's their own player controller, while still allowing the client's player controller to trigger it on their end.
So, because you know that whatever is going to happen next is for sure being executed locally for the character that is performing the overlap, there is no need for any RPC after this part. Whoever needs to see the widget from this point should be able to create the widget locally.
If the below part happens shortly after the above, then what is probably happening is that you are getting a message in your log indicating something along the lines of "No owning client connection..." as you're attempting to call this Server RPC on something which doesn't sound like it would be owned by a client (BP Shoot Zone Trigger)
Thank you for these explainations, so i try to understand. "IsValid" is not necessary after my character CAST ? then i delete the things about RPC
am i right ? or did i miss somthing ?
Correct. The cast itself is basically checking if the object is valid and if it was not valid the cast would fail.
You don't need to RPC, but you probably want to call whatever functionality S Create Widget is doing.
Does using SteamAppDevID 480 work in packaged/shipping builds? (Just trying to test while I wait for the steam-page)
Ok thank you for this explanation. I had courses with some instructors and they taught us that after a cast it was necessary to get if its valid . That s why i did it . So thank you for it, that make me not take a bad way since the start
And do i need to cast the controller ? or just call for the get controller basicly ?
This whole part is correct and will functon as it is. The only unnecessary bit is the IsValid check after the BP_FirstPersonCharacter, but it would still work.
I removed the IsValid ccondition, add the "IsLocalyControlled" condition and removed all the RPCS and now that works
here is my final blueprint :
thank you so much 🙂 guys
i learned things with your explanations
Hey y'all, I have a function that I want to call when a player joins the game while it's in the "waiting to start" state. But the function requires a reference to the game state. When I call the function via a client RPC in PostLogin or HandleMatchHasStarted in the game mode, "GetGameState" returns a nullptr on the client, so I'm guessing the game state hasn't replicated yet. Does anyone know a way to do this to ensure the game state is valid on the client?
Just use BeginPlay in the GameState?
There is no need for an RPC
Do you know why Epic uses RPCs to communicate changes in match state in projects like the shooter sample?
Its been a very long time since ive looked at that code, so no, I couldnt tell you.
Sometimes Epic does things for strange reasons.
Yeah, thanks!
Thing I learned doing local multiplayer #1001
When a map is re opened remove local players above index 0 so the game mode can create them again or else those local player ls will remain in the ether and mess up my logic based on local player indexing.
This works for server and owning client, but the other clients see the dead client fall from the world. If I stop disabling capsule collision, the problem is solved, but this time players can collide with capsule
Why is this happening?
@fierce egret You likely need to disable Gravity on the CMC
You probably want to zero its Velocity as well.
I added Set Enable Gravity and set it false, it still happening
@fierce egret Calling DisableMovement might be enough
I dont know how but adding Disable Movement solved it
Disabling gravity or others didnt work
Thank you
I created a second controller in my level blueprint and used it to possess my second character; my "Print String" tells me the character is possessed. In the second character blueprint my "Print String" tells me the mapping context was added, but my other "Print String" tells me the Casting to the Player Controller failed. Even though I possess my second character and have assigned the Mapping Context for the input system, I am unable to move my character. Could someone help me, please? I've been struggling with this local player stuff for 4 days now!
UPDATE:
When I assign the character to P1 by possessing it using "Get Local Player Controller From ID” set to 0, it works fine. I can move it no big deal. However, when I assign it to P2 by possessing it using the 2nd controller I made, it no longer says the casting to PlayerController failed, which is weird, my print strings say everything's good, but I can't move my character.
Hello everyone, i wanted to ask a quick question, and i checked game BaaS spreadsheet but couldnt really get an answer
- So we had our game backend ready and done on playfab and server hosted on it too
- but once we started testing in closed alpha, we found that playfab servers might be very expensive for an indie game
- so we decided to move the server hosting from playfab to another
- but for our game system backend we haven't fully decided yet
so my question is - if we have everything setup and ready on playfab, is there really another provider that would actually save us lots of money and we better start moving to it? if there is what would it be?
- we are using cloudsripts/economy v1/ player profile
any help is appreciated 🙂
Hi guys, I'm having an issue with the Net Dormancy of an actor. To improve performance by disabling the actor from replicating its properties, I set its Net Dormancy to Dormant All after a fixed period of time after spawning. When I need to destroy that actor, I set it back to Awake, and then destroy it. The problem is that Net Dormancy takes some time to take effect. And for that, I waited 10 seconds after setting it back to Awake before destroying it. Everything works fine when the server is good, but if there's a bad connection, the actor is destroyed on the server but may not be destroyed on some clients.
So how can I deal with that. Any help is really appreciated 
Call FlushNetDormancy() before destroying it
However it should still destroy the actor even if it's dormant, sounds weird
Thanks, I'll try that
The actor is actually destroyed on server, but it does not replicate back to client or something. It's still visible on client, but with no collision
im having a hard time trying to figure out how to run an event only on client side when having a listen server
with a dedicated server i just had to get authority, but with a listen server the event is executed on server so it will impact other clients
You'd need to post the actual issue/code
you can run Events on Owning Client only if thats what youre looking for
Without the actual issue at hand, you can suggest 50 things that would all work
yeah thats true
well its kinda generic
here is the code
wait i didnt try owning actor
Who's "OtherActor"?
player
Well you knew the answer. I already explained it to you last time (:
Bit of rubberducking helps yeah
i never understood the meaning of rubberducking
for google it means debugging by talking or writing your code/issue
It can have different terms. But Rubber duck is the most common one.
It basically means that you debug something by explaining the problem and the current implementation to someone (the rubber duck).
One often finds a problem in the way one tried to solve the problem, simply by reiterating over what one has done so far.
Without the rubber duck even saying a word.
okay ty
yeah thats what i do when i go to the bathroom/cook/shower/sleep
It's a fun little concept that works more often than not. If you tried to do something and it's not working, going over it again, explaining exactly what you did, often makes you aware of why it's not working or makes you automatically talk about alternatives.
or talking to my dad who is a software engineer
for my neighboor i might be a psycho talking alone

For me it's called Rubber Duck, cause I see it like people sit in the bathtub, talking to the yellow rubber duck that swims infront of them.
yeah its a funny thing to visualize
well i have to cook rn, so i guess ill talk to my rice for debugging
It's a somewhat cool feeling when you realizes you solved the issue by just talking about it, without getting an answer fwiw
or maybe the microwave
I heard the wooden spoon has some wisdom hidden
so many times, i start writing my issue on discord/whatever forum
and in the middle of it i find the answer
because when you ask for help, you are forced to write all the process
Yus
Hi, is this summary accurate with respect to the server defines?
TargetTypes:
TargetType.Game - for single-player and listen server
UE_SERVER=0
WITH_SERVER_CODE=1
TargetType.Editor - for editor
UE_SERVER=0
WITH_SERVER_CODE=1
TargetType.Server - for dedicated server. Requires cooking.
UE_SERVER=1
WITH_SERVER_CODE=1
TargetType.Client - for standalone client (no listen server). Requires cooking.
UE_SERVER=0
WITH_SERVER_CODE=0
If so, it seems to me that using UE_SERVER=1 would make dev more painful because it only works on cooked content?
In my case I am not shipping a listen server, so plan to use WITH_SERVER_CODE, so that I can iterate without cooking, via the editor.
Makes sense?
i use WITH_SERVER_CODE
or if stuff is dedicated server specific i use UE_SERVER
ie i use UE_SERVER to stop certain cosmetic stuff (that dedicated server doesn't need to do)
Thanks for answering, the client controllers are always 0, right? If I as a client passed my player controller to the server, wouldn't it give it 0? Shouldn't the server identify my controller? because for the server if they are 0,1,2,3
Hey! Just in case this got buried, I am still a bit clueless 😄
#multiplayer message
I'm getting segfaults when trying to do seamless travel in PIE in ue5.1. it works in packaged version but not PIE. seems like it's iterating over a stale world reference?
Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x00000030002e0040
[2024.04.01-15.33.48:973][411]LogCore: Fatal error!
0x00007f8df58fdecd libUnrealEditor-UnrealEd.so!UEditorLevelUtils::ForEachWorlds(UWorld*, TFunctionRef<bool (UWorld*)>, bool, bool) [/UnrealEngine/Engine/Source/./Editor/UnrealEd/Private/EditorLevelUtils.cpp:1436]
0x00007f8df58fdfea libUnrealEditor-UnrealEd.so!UEditorLevelUtils::GetWorlds(UWorld*, TArray<UWorld*, TSizedDefaultAllocator<32> >&, bool, bool) [/UnrealEngine/Engine/Source/./Editor/UnrealEd/Private/EditorLevelUtils.cpp:1451]
0x00007f8df58b2745 libUnrealEditor-UnrealEd.so!UEditorEngine::CheckAndHandleStaleWorldObjectReferences(FWorldContext*) [/UnrealEngine/Engine/Source/./Editor/UnrealEd/Private/EditorEngine.cpp:7172]
0x00007f8dfd2f199e libUnrealEditor-Engine.so!FSeamlessTravelHandler::Tick() [/UnrealEngine/Engine/Source/./Runtime/Engine/Private/World.cpp:7231]
0x00007f8dfd0f911f libUnrealEditor-Engine.so!UEngine::TickWorldTravel(FWorldContext&, float) [/UnrealEngine/Engine/Source/./Runtime/Engine/Private/UnrealEngine.cpp:14176]
0x00007f8df588dd7e libUnrealEditor-UnrealEd.so!UEditorEngine::Tick(float, bool) [/UnrealEngine/Engine/Source/./Editor/UnrealEd/Private/EditorEngine.cpp:1773]
I'm calling ServerTravel() from my GMB.i have seamless travel enabled via cvar and transition map
any help appreciated
Not that youd refactor all of this but wouldnt it make sense to simply use APlayerState as... well PlayerState? 😅
Yeah, I would like to go back to using player state honestly, but that implies modifying half our gameplay code which is too much time investment right now - I'd rather see if we can keep the current setup and make it work. I really don't understand why the PlayerHandle actor wouldn't replicate to clients
Guess youd need to check the parent class for that. Is it marked considered for replication/networking in the first place ? Can try to dig a little tonight ..
you might need bNetLoadOnClient = true; in constructor
Not sure if APlayerController explicitly overrides this or not
Aicontrollers dont replicate so could be explicit..
Nvm its an actor so thats prob not it
thanks, I'll try!! 🙂
Yeah, I'm checking that. I already put the flags (bAlwaysRelevant) to load on all clients. Not sure if it could be related to ownership, since this actor is owned by player controller
also, the spawn call should occur on server
yep, this actor is spawned exclusively by GameMode so that's for sure 🙂
@young spoke Actually bNetLoadOnClient did the trick! Thank you very much, I was clueless hahah
great, now if only someone could answer my question 
I had a look, sadly I have no experience with seamless travel 
BTW is actor spawn location automatically replicated? My actor always spawns on 0,0 on client
because your not passing in the location/rotation in SpawnActor
we use a deferred spawn:
const FTransform SpawnTransform = FTransform(GetRotation(), GetActorLocation());
AEntity* NewEntity = GetWorld()->SpawnActorDeferred<AEntity>(
EntityConfig->EntityClass, SpawnTransform, nullptr, nullptr,
ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
Have you solved this one yet?
Actor references when passed across the network aren't referenced by those ID numbers. When something is first referenced across the network a unique net ID or something like it is used to associate future calls to that particular object allowing both the client and server to know exactly what object it is that you're attempting to reference.
The server would be able to determine which controller is yours by reference as typically all controllers exist on the server, but as the controllers are not replicated to other clients, other clients would not have a reference to your controller, so even if the server was trying to tell all clients "use this reference" of Client1, clients other than Client1 would basically respond with "I don't have it" and you would get "Accessed None" errors if you attempted to use it on those clients.
I'm waiting for the packaging tomorrow to test it. With important actors I set them to Awake by default, and other I flush the dormancy then destroy them. Hope it gonna work :))
I also did some research and it seems like there's no callback when changing dormant value
except the one in UNetDriver
Hello, this is my first time on this server.
I'm struggling on my animation blueprint. Is this normal that nothing seem to run on the client, but everything works fine on the server ?
Does the Event graph and the AnimGraph can even run on the client ? 😵💫
ur spawning from gmb tho right? GetActorLocation of GMB probably isn't what you want to pass into transform
Nope, this is actually called from another actor (but in the server ofc) - in our games this entities are grouped in battalions, so the battalion spawns in a certain location, and then it automatically spawns its member entities on the same location - I have debugged and the SpawnTransform location is correct.
not sure then. the location should be automatically set on clients. i would triple check the transform is what you expect it to be and literally print out the location on the server and client tick() to confirm
excellent, I'll start there. Maybe I am checking the location too soon before it's properly replicated or something like that 😄 Thanks a lot!!!
The flag bReplicateMovement should not be necessary, right? I'm trying to set it to true just in case
Just making sure I understand this premise correctly. If an item is added to an array, by default it fills the array index 0, 1, 2, 3 ect? And if so, does removing an item from an array work backwards in desceding order, 3, 2, 1, 0?
Yes to add
No to remove
Remove removes the first index that matches the argument/item
So if you have 0,1,2,3 and say remove(2) you now got 0,1,3 leftnin the array
3's index got shifted
I would like to have my pawn rotate facing my mouse and having it replicated. What is the good way to do it ?
I am having trouble to do it the client never really replicate correctly :/
is it a pawn or character base class?
@dark edge character base class, the third person bp class you know
That already has the functionality, just have it orient to ControlRotation and drive ControlRotation however you want
what's the setup, 3rd person, top down, what?
@dark edge Not the top down just the regular third person I have just move the camera. If I do like you told me it work but my pawn always walk in the direction of my mouse, this is not something I waznt
I want to able to look forward and move backward you know
When you press S, you want to walk towards the camera right?
@dark edge I am like this, so if I press S I always want to go down doesn't matter what my pawn rotation is
is your camera able to be rotated ever?
no never
will always be like this
@dark edge oh ok I can unplug on the movement part ! But I can't manage to rotate the client I have done it like thuis
For the controller part :
OnrepNotify :
The bp of the pawn (the basic one, just renammed it baseclass)
the server does act correctly never the client 😦
Gus please do let me know if you have built some multiplayer games?
Can someone help me?
I created a Local Player with the Controller ID being 1.
I added Mapping Context with the Local Player as the Target.
I possessed my character using the created Player Controller.
The inputs don't work when PlayerController_0 is being used either.
Problem: My inputs don’t work and I can’t move my character.
Hello , please i'm struggling with PlayMontageAndWait and Wait Gameplay Event , i've read tons of different sources but i can't manage to make them work,
I can do a properly replicated animation but the thing is that EventReceived is never triggered , if someone is up to tell mm few words that can unstuck me , it would be verry appreciated. Thank you again and sorry for bothering
Hi, im currently working on a dash system using the launch character blueprint. All the code worked fine in singleplayer but no longer in multiplayer. The launch character bp is ran on multicast. When ran the game nudges the character forward and then back to the starting position. If any one has a solution please let me know
@dark edge Di you see what I did wrong ?
first off the Playercontroller is only on server and owning client
@dark edge ok so what you mean by that ?
@dark edge you mean that I can't achieve to rotate pawn using player controller because remote client wont see it ?
soooo im using this plugin called dynamic wall run and its not replicated so whenever player 2 falls in a client server theyre suspended in the air when they fall what do you think i should do to fix this bug should i replicate the plugin that allows this to happen or should i replicate the falling mechanic in alsv4 any idea helps dont be scared to chat i dont bite im just trying to fix the issue and im so dumb i cant figure it out
so i did a linux server target build, and the gameserver runs and boots up smoothly... and the clients can talk to the server. however the server cannot talk to the clients. All clients show no packets received.
For the sake of testing, the server has no firewall rules in place, and all ports are 1:1 mapped to the IP address.
[2024.04.01-23.12.25:849][805]LogNet: NotifyAcceptingConnection accepted from: player1ip:50262
[2024.04.01-23.12.25:849][805]LogNet: Server accepting post-challenge connection from: player1ip:50262
[2024.04.01-23.12.25:850][805]LogNet: IpConnection_2147482379 setting maximum channels to: 32767
[2024.04.01-23.12.25:850][805]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2024.04.01-23.12.25:851][805]LogNet: NotifyAcceptedConnection: Name: Arena, TimeStamp: 04/01/24 23:12:25, [UNetConnection] RemoteAddr: player1ip:50262, Name: IpConnection_2147482379, Driver: GameNetDriver IpNetDriver_2147482401, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
[2024.04.01-23.12.25:851][805]LogNet: AddClientConnection: Added client connection: [UNetConnection] RemoteAddr: player1ip:50262, Name: IpConnection_2147482379, Driver: GameNetDriver IpNetDriver_2147482401, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
[2024.04.01-23.13.24:756][567]LogNet: Warning: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 60.01, Real: 60.01, Good: 84.51, DriverTime: 85.85, Threshold: 60.00, [UNetConnection] RemoteAddr: player1ip:50262, Name: IpConnection_2147482379, Driver: GameNetDriver IpNetDriver_2147482401, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
I am at a loss for why. Does anyone have any pointers?
Have you tried running the server on your local computer and connecting to it?
does it happen?
i just spent 20 min disabling every *Engine.ini netconnection driver, online online subsystem interface, etc. Works perfectly. Subsystems that are disabled are screwing with it, -.-
But doesn't this prevent you from running editor dedicated server? i.e. you would have to cook.
in case anyone runs into segfaults with seamless travel in PIE ue5.1, the solution was to not use "Run Under 1 Process". Only works in multiprocess, which is much slower testing
FINALLY I FIGURED IT OUT!! It took me 6 days for something so simple!! I overcomplicated the whole thing because for my game I didn't even need to use multiplayer and create a local player. I just used the Player Controller with index 0, two different Mapping Contexts and Inputs, then I called them and checked my Player Variables if P1 = 1 or P2 = 2 to excute the movement. I'm so relieved rn.
is this event executed on client, server or both ? It's inside a player controller
Its only executed on the Server
If you need an Event when the Pawn is possessed on the Client, use OnReceiveRestart
I think thats what its called
can't find that
ccan't find it either
Search for restart
I'm stuck for days about an issue where my client can't move but the server can, I have no clue why it behaves like that 🤔
Any ideas where to look for ?
There is a lot of reasons why something might not work.
There isnt much to go on there.
Ok let me get some screenshot so you have a better overview of how my things are set up
Question: Does the Player Index mean the controllers connected to the game? If I were to create a second player index (PlayerIndex_1), would that mean I would need to plug in to my pc a separate physical "xbox type" controller to use that player index?
Here are the classes, maybe it could help you understand and guide me 🙂
This tells me nothing. You are providing no context around how any of the functions being shown are called.
There is a lot of bad practice here.
For example
Why is the GameMode, the PlayerController and the HUD all making changes to Inputs...
You are likely running into problems because you are confusing yourself, with all of the different places that you are making changes to functionality.
Multiplayer is not easy, you cant just throw things in random classes expecting it to work.
For example, you have in your GameMode a call to a function that is only executed Cosmetically.
You also have an RPC in the HUD class....
What's the proper way of doing that ?
Which one ?
What's the issue with that ?
Typically, only the PlayerController should ever be managing Input, thats one of its major purposes.
SetInputModeGameOnly, the little Icons on nodes do mean things, you should be aware of their meanings and how they affect their operation.
It makes no sense? The HUD is not Replicated.
How is that cosmetic only when enabled and disables input for player ? 🤔
So how and wheres should I put the input detection to open that Game Settings menu only for the host of the game ?
It does not "enable or disable" input at all. It sets focus for Input to the Game. You need to pay attention to the meaning of functions.
Only PlayerControllers on the Client process Input.
The Server does not process input (unless its a Listen Server)
that's my case here
Therefore calling SetInputModeGameOnly on the Server, will only ever affect the Host.
Even then, you should not be calling that function from the GameMode
Then that's good because only the host is able to open that menu which means the Set Input should only apply to him in that case, isn't it ? 🤔
🤦 no its not good.
then I'm confused on how I'm suppsoed to do that 🤔
Not where you are managing it isnt.
You should not be managing that in the GameMode
Separation of responsibilities.
Specific classes have specific roles.
So all of these nodes should be deleted right ?
Just because you CAN do something in a particular class, doesnt mean you SHOULD do it in that class.
You need to aggregate code that is performing the same/similar functionality for the same purpose, into a single function, on a single class, probably the PlayerController, given the nature of what you are doing.
You really should be doing research and learning about proper OOP practices.
The GameMode class has a specific role, the PlayerController has a different specific role, just as the GameState and the HUD and the PlayerState all have different specific roles.
I did but Unreal confused me as heck with its 6500 different classes
And nobody is teaching things properly in the internet (tutorials)
So instead of just randomly dumping things where it seems convenient, ask where the appropriate place to achieve X is.
Or search for resources that explain it.
Then I will ask questions every 10 min 👀
Nothing wrong with asking questions.
People dont do that enough.
There is also something to be said for trying to research it first yourself.
If you dont know what a class is for, go and find out.
There is plenty of documentation explaining the purposes of different classes.
Alright, let me fix things step by step with the suggestions you gave
Does this need a server RPC to check if the player is the host or it's good like this in Client ? Because to me this code looks like it could be cheated but at the same time I don't know how a server RPC would be able to call Show / Hide Game Settings Menu which is in the HUD class which is set to Not Replicated and on the Client Only 🤔
Well if you are using an IsServer check, how would a Client pass that check?
The Host of a Listen Server is a Server
So only the Host and a Dedicated Server would pass an IsServer check.
And since you are calling it from an Input Event, a Dedicated Server never fires Input Events because it isnt a Player.
So therefore only a Host would ever pass that check.
but isn't the IA_GameSettingsMenu being called on the Client only ? As Server doesn't handle input ?
If you want to be extra safe you can if(IsServer() && !IsDedicatedServer())
The Host also processes input because it is a Player
The Host is not considered a Client
But input isnt processed on the basis of the network context being a Client
Its processed based on being a Player
Here's how it's in my mind currently. For the host there will be no issue because he's the server. However, other players are clients and when they press that Input Action, it will go to the branch, there the Is Server will be checked and technically it will return false however I'm thinking that it's possible to cheat that as it's executed on the client making the game think that value return true and it opens that menu for them.
The only exception to that would be that the Input Event is executed both on server and client (and from my understanding there are 2 copies of the Player Controller, 1 on the client and 1 on the server and the checks is done both on client and server and the server one override the client one as it's authoritative but then that changes the first assumptions about InputActions handled only on the Client 🤔 )
At your level I wouldnt concern myself with worrying about cheats
Focus on understanding how to build a multiplayer experience first
Getting sidetracked with whether or not your code is cheat proof, is just going to waste your time.
Focus on the fundamentals and getting those right first.
Alright, so this is good now ?
Sure, if you only want the Host of a Listen Server to execute that code, it looks good.
Awesome, next thing to fix ?
You need to totally rework all of the different places you are managing Inputs
They are a mess.
Funnel all input changes through the PlayerController from a single function.
That is fit for purpose.
And by managing inputs, does that include the cosmetic ones or should that stay in Client Only classes like the HUD ?
One of the responsibilities of the PLayerController is processing and managing Inputs.
You should strive to maintain separation of responsibilities where possible.
Meaning, that if there is a class responsible for something specific, you should try to architect your code so that it adheres to that principle.
So if you need to manage inputs
And the PlayerControllers purpose is to do that
Pipe all input management code through the PlayerController
Including the cosmetic ones ?
The HUD is responsible for UserInterfaces
So the HUD should be managing those.
And offloading management of Inputs to the PlayerController
Cosmetic or not is besides the point here.
User Interfaces and Inputs are all "Cosmetic", they only affect direct change on a Players machine.
I'm so confused
Opening a Menu, typing into a text box... etc etc
I dont mean to confuse you.
Multiplayer is difficult.
Singleplayer you can just do whatever you like really...
But answering Cosmetic or not is besides the point here. is confusing me 😦 It would be clearer if I get a Yes or No 🥲
Yes
Thanks 😄 So If I understand correctly, the Input should be detected in the player controller and that should modify the player inputs if needed then call events on the HUD if the thing is related to UI stuff
Yes
UI should only ever react to changes in data. It should never change data directly outside of itself.
Interesting
It can inform other systems of desired changes.
Like, switching to a different Skin or something
But it shouldnt be the thing that manipulates whereever you store that Skin data
Thats probably a shitty example.
But hopefully that makes sense.
Yeah a bit better
I need your guide, it's recommended to use actors child for a multiplayer game? Because when I use the BP Actor my game runs well, but if I use a child, my game doesn't work well
I'm running into an issue with trying to replicate a gameplay tag in a GA so that it triggers a state in my ABP.
if (GetAvatarActorFromActorInfo()->HasAuthority()) {
LocalASC->AddLooseGameplayTag(ZSGameplayTags::Character_Rifle_Equipped);
LocalASC->AddReplicatedLooseGameplayTag(ZSGameplayTags::Character_Rifle_Equipped);
}
This was the only work around I could get working, which seems completely wrong. Initially, the replicated version has the animation working between clients, but the server sees none of the animations. Then when I add the non-replicated version, I see the animations for all clients and servers. I have the tags mapping to bools in this variable FGameplayTagBlueprintPropertyMap GameplayTagPropertyMap; that lives in the anim instance class. Any ideas why it acts this way and how I'd go about fixing it?
Why not just setup test cases for both scenarios and profile them both?
If the team cant understand setting up tests to profile different approaches, how are you going to achieve a " Large open-world game on dedicated server, about 100 player server cap, complex movement and combat systems. Fast-paced. A huge amount of world objects can be interacted with" game?
Open world isnt easy.
100 Players isnt easy.
Perhaps you need to consider constraining your vision a little to match the skill set of the team?
My opinion is to limit your scope to what is achievable. You will have a much more enjoyable dev experience than taking on something you are highly unlikely to succeed at.
And when I say "you" I mean the entire team.
Fair enough. I cant make you do it lol
But it would make sense to profile these as test cases.
They shouldnt be hard to setup.
Assuming the Tracing is happening on the Client only, it will likely be the more performant solution. You can even async trace if you are concerned with Perf, if you can deal with a frame delay in the result.
As i said earlier though its always best to test performance on these types of things, especially in large projects, if you are targeting 100 Players you are going to need every bit of perf you can get.
Couldnt you just verify on the server ?
Client traces -> thinks it can interact
Client interacts -> server checks/verify with a trace or distance check or smth, then go with it if all is ok?
Lag could be an issue i guess
Again, best to profile each case. Then you will know definitively which is more performant.
Personally id never touch an mmo project with an unexperienced team 😅
Guys I am trying to rotate my pawn facing my mouse and having it replicated, I am doing it with the control rotation in the player controller, it works only on the server I don't get why any ideas ?
Why not directly linetrace once on server ?
If you have to linetrace anyway to check
In my project, when player press the use key the server does a linetrace
On the focus system (that is looking for usables items) i am doing the linetraces on clients, since they are used for decorative gameplay
Is the pawn actor set to replicated ?
Also, show the code that rotate the pawn
to avoid the extra server load with 100 traces on tick, that dont need to be on tick ^^
would be my thought anyway
wether it actually saves sorta depends
Oh we are talking on tick
Not sure if it'd work seamlessly tho
I thought it was 1 linetrace per "use" key or whatever
Im not sure how much it actually would matter tho
the user experience waiting for the RPC to return sounds rather bad
Yes it is, it's the default third person bp, I posted the code it's like this
Here #multiplayer message
so what do you suggest ?
for now, i understood that you want to do:
- client linetrace
- client interact if hit something
- server aborts interaction if verify fails
seems weird
I agree, it does sound weird
i havn't really given it much thought
personally i just linetrace on server
but then again im not ||((((currently))))|| aiming for 100 players

@lament flax I thought if pawn is replicate I just had to set rotation in rpc server but doesn't work
Hello, I'm working on a multiplayer project and I'm struggling to learn how to manage the client/server logic.
someone have a good complete tutorial to understand this?
thanks in advance
Check the pins in this channel
Cedrics network compendium is a great start
Read it atleast 6 times
thanks
Does anyone know if the Unreal Water Plugin is replicated/if its able to be replicated semi simply? 🙂
My client does not load large parts of the level (using world partition). Seems like the same problem from June 2021: https://forums.unrealengine.com/t/world-partition-still-makes-client-fall-through-tile-if-walks-far-enough-from-host-multiplayer/236283
Does anyone know why this might happen? How does world partition work with muliplayer?
In UE4 World Composition, if the listen-server and client are on tile 1, and the listen-server walks far enough away to unload tile 1, the client will fall through the tile. And this also happened in UE5 World Partition, but it took much more distance compared to UE4. How does a game like Valheim (Unity Engine) manage to make its client go far f...
sounds like some of the settings could be usefull
Havnt gotten to that part of our dev cycle yet so havnt had the need to dive into it yet
Hi
Um i have the steam advanced session plug-in and I would like to know if I can only make steam friend list and invite by only using the steam overlay itself.
Like you click on the invite button and then steam pops up with the friend list
Hey, I'm hoping someone can help me understand network ownership a bit more clearly - I get that actors can't send RPCs unless they are owned by something, so for example if a player picked up a gun then that player could then own the gun, and do it that way. But what I don't understand is what about actors that are just in the scene? Who is supposed to own them?
For example, lets say I make an obstacle which is a wall slamming down on the player if they run under it at the wrong time. Now I understand that this should be done on the server, however what if we wanted to make it so that the clients can press a button which changes the colour of the wall for all players. Who would own this? Would you set the owner of the object when setting the colour?
Surely if we take that approach and change the owner every time the colour is changed, then this wouldn't work as the owner has to be set on the server, and thus the server function to change the colour and set the owner wouldn't be processed.
Please could someone help me understand this?
Server owns the unowned
Its one of the 'gotchas' while doing multiplayer
So to run a server event on an unowned actor you would need to RPC to the server on a client owned actor (typically PlayerController or Pawn) and invoke the server owned actor from the 'server side'
I see, so essentially pass through the player controller for example to reach the server?
One of my last takes on this was related to our dialogue
Shared a silly flowchart about it
haha silly flowchart sounds good
Hope it helps 🙂
it does thanks, I'm going to give this a go and see what happens
when the game starts, I want to select one of the players as the killer and store it as a bool. how do I do this?
I want to use the is murderer? bool that I assign to the murderer as a prerequisite for using special skills
Either a bool on PlayerState or pawn, or just a PlayerState or pawn ref TheMurderer, either one will work.
You wouldn't have a bool IsPresident in USACitizen class, you'd have a variable of type USACitizen called CurrentPresident. Hopefully that explains the differences between the approaches.
bool IsPresident(const USACitizen* Citizen)
{
return Citizen == CurrentPresident;
}
@dark edge sorry to bother you, I'm still struggling with my rotate pawn 😅
hello I got a general question on "how multicast works"
If I multicast, it will just cast on all machines, no matter what, no matter the distance of the players, so even a player across the map will display a VFX for exemple and have performance impacted no matter what ?
Or is there a distance / visibility restriction when using it ?
The actor has to be net relevant I'm pretty sure
heh ?
What happens if it relevant or not ?
Anyone have any ideas why simply adding a branch to a multicast function stops it running for both server and client?
show code?
error : access "none trying to get "variable" info" error ?
The multicast won't happen because the actor doing it doesn't exist
Actor A is a replicated actor, and it's relevent to clients 1, 2, 3, but not 4
The serverside version of Actor A calls a multicast
The clientside version of Actor A will fire for clients 1, 2, 3 but not 4
since Actor A doesn't exist on 4
okay, but then what happens when you do multicast, My question is just " does multi cast has any optimisation into it, or will it just cast on all machines no matter what and be garbage in terms of optimisation" ?
I'm assuming thing should exists on all clients if they are important enough to be replicated ? or should you make a system that makes it relevant only at a given distance ? but then how to recover the state of the actor when it becomes relevant ?
It'll send a packet to all machines for which the actor is relevent
the distance relevency thing is already built into the engine
oh i see, so the optimisation is not into the "multi cast" but into the revelancy code itself
If grenade explodes next to me -> I see it
if grenade explodes on the other side of the map, -> I don't
unless I do
that's all up to the designer and the relevency criteria
where can we see those revelancy settings and stuff ? into the actors directly ?
saved to favorite for further understanding, thanks
I dont need it like Right now, but I was wondering is Multi cast was actually a good Idea
I guess you could add a "revelancy switch depending on distance between the actor and the players into a collision sphere" to manually disable things, or just use the revelancy settings for VFX actor to dont display from super far
what does the client dont see ?
his own flashlight
server can see it
but client not
also 100% it's a replication issue
what are you using to replicate ?
something not appropriate or not properly replicated surely ^^
There is lots of ways to replicate things in unreal
Multicast is most reasonable for one-offs
RepNotify is for state
if its like that, i can see it everyone can see it
like flashlight isnt connected with camera, then it works nomrally
yeah the rep notify would be nice for that, rep notify the "On" variable, if ON, set visibility, if Off set visibility
to trigger a rep notify, and variable replicated need to change, not just be called BTW
might be due to parenting to a camera, then ?
Have you tryed to just parent it to the charactere mesh ?
parent it to the same things than the camera is parented to ?
i'm assuming when you parent, it's taking a replication of the parented thing, or, the light is into the mesh, and "Owner no see" makes it that the light goes trough the head on there own side
and you just need to move the light out of the body x)
doenst make sense when the result is like that
g
ah yeah i guess your right, I would try rep notify tho
way more appropriate for that
is that a plugin?
less chances of weird issues as well, no it's a basic feature, you select a variable go into replication, and select "Rep notify" and then each time the varable changes, it's sending the info to all machines
bro
i made a new bp character and readded all the old stuff from the old bp character#
now it works
like bruh
there is no magic into unreal engine, only parameters that are not working the way you thought, thats what I learn about unreal engine in a few years lol
xd
so the new BP probably has a default settings that lets you do what you want, and the customized one has an option, somewhere, somehow, that creates an issue x)
Anyone know a way around allowing a multicast function to call both server and client whilst the game is paused? (the server side only runs)
well first, why would it not work by default ?
I have a multicast function, that I realised, doesn't have the client call when not pausing the game during server call. If I have the game pause during the server call, the client gets called
I have no idea why it wouldn't work by default but that's what I've found when debugging
Cant find anyone else mentioning this with my google-fu
I repost a question here cause I didn't figure it out :
I am trying to rotate the pawn I am controlling facing my mouse, and having it replicate on clients and server, I tried to do it from the controller by setting the control rotation but it didn't work on the client, any ideas guys ?
first you said only the server gets called during pause
then you said if you have the game paused during the server call, the client gets called
that said, still don't know what problem you having
Sorry to be confusing.
It's a multicast function that executes during a pause. So the game is paused, the function gets called, and only executes on the server, not the client.
I found this out by testing it running whilst the game is unpaused. As then, both server and client sides get called.
But I need this function to run during game pause, for both server and client.
What's the actor in which you're calling this Multicast RPC from?
Gets called from player controller. Multicast function lives on game state
Is GameState marked to Tick when paused? (Dont remember the exact name of the property frmo the top of my head, but it's something close to that)
😮 it's not. That would probably be why. Thank you! I'll need to check that this is okay to change though..
It depends on how big your GameState is
You probably don't have anything ticking on the GameState, so you good - unless you have 481294814 billions trillions replicated properties that might compromise paused-game experience
But in general, whatever
Thanks for the info it's much appreciated! 👌
How can I reduce "Consider Actor Time" in tick? Is it related to Net Update Frequency?
Does the rotation of pawn is replicated ?
i just got a basic 2d fighter game set up, most of the game mechanics are there and now i want to start to add in the multiplayer part, so far the plan is to do local play and i really dont know here to start any tips?
One would think if you can live with those while the entire game is running, one could survive with only this running aswell :p
Ok I find something can someone explain me why if I do like this : its all replicated correctly, I don't even change the control rotation server side ? But if I put the RPC server side it doesn't work for the client
how is it possible ?
the thing I don't like but doing this is that I get the player pawn location client side which technically can't be trust no ?
Setting control rotation clientside should be enough, it has some amount of built-in networking handled for you already
I think it's just yaw but I'm not 100% sure
That's a mess. What are you trying to accomplish?
@dark edge I am trying to rotate the pawn I controll facing the mouse cursor
@dark edge And like I did it seems to work properly, I was just concerned about doing this client side and not server side
Pawn or Character as base class?
@dark edge Character
Character can just opt in to using Control Rotation to drive its rotation
look at the example projects
just adding controller yaw/pitch or setting control rotation on client should be enough
@dark edge That's what I do
@dark edge And like I said it worked
@dark edge Its just weird to do it client side
You don't need to do any of this, just use your event tick part and gate by IsLocalController
@dark edge Of you mean the custom event part ? yes of course I was trying to do it on serveur that's why I got an rpc, but for the rest I have to keep my hit under channel and the look at rotation
I find it so funny they ping you in every message lol
I want to select random murder. I can select it in gamemode but as far as I know gamemode and pawn cannot communicate. only server can reach gamemode. am i wrong?
Yes
You are wrong
Server has its ownnset of pawns
Clients may "own" them, but server also got them
I have a listen server running, and the client can join via another computer in the same house, but I can't seem to get it to work the same way through steam online with someone somewhere else. Anyone know of common things that may be preventing it from working online?
The murderer can be a variable on GameState or it can live on GameMode and be hidden
Anyone bought one of these pack and have some feedback on if it's good or not ?
Arguably the best products on the marketplace.
We use the EOS Online Subsystem product.
I recommend it to everyone.
^
EOS Online Subsystem is golden
Haven't tried the rest but if they're as good as that one, they're awesome
lots of good support too
@fossil spoke @solar stirrup But there are multiple and I'm not sure to understand what are the differences between all of them.
And also it looks a bit expensive, when will be there discounts ?
Is the documentation good, as the reviews on the product page talks about bad documentation 😬
uh, depends on what you want to do?
Just grab whatever you need
Also: there's a free version of the EOS one
I'm trying to make a multiplayer game
Yeah we figured 
Do you need those packs?
I need to make my game compatible with all platforms
The EOS plugin is good then
there's a free edition just use that during development
If you dont know whicj of those packs you need. You dont have the experience to use them.
I would hold off on buying any until you have a better understanding of multiplayer and sessions.
^
They dont just magically make it work. They still require some effort to utilize correctly
that would be in a long time then but I really need those to speed up the process and also have something good as I would do bad things 😄
Experience comes with time, there is no shortcut thats going to make you a good game.
Trying to speed up the process when you dont even understand whats involved is actually going to make it take longer.
Learning these things doesnt happen overnight. You need to come to terms with that and take the time to correctly learn these things.
I believe there are free alternatives to the features these packs provide.
You maybe better off trying those first instead of buying something expensive you might not be able to take full advantage of.
That's where documentation comes and handy
Youre assuming you will understand the documentation.
Try the free alternatives first.
which are ?
I dont know, do some research?
Based on your questions Diversity, you definitely need more experience. The way I did it was to just remake super small games in multiplayer. And each time focus on one aspect. Then I'd redo it all from scratch again and focus on something else, while also including the previous. Of course it wasn't the same small game each time.
What this made me do is have to wire everything up each time, through repetition. It isn't a one & done type thing.
They do exist.
Could you give me a list of games that you did so I can try to do those too 🙂 ?
I did upwards of like 20-30 little game prototypes. All while also constantly referring back to the network compendium
It can literally be anything
Make a collectable game
Just run around and collect coins
Make one where you have to run around and open doors in a specific sequence
Make one where you have to jump through hoops
Make one where you have to attack a wall
Make one where you have to run through different terrain
Make a wave based shooter
Make a tower defense
Literally anything
And just make it MP
~Make an MMO~
but those are more like mechanics than a full small game 😬
So?
Let's go
The point isn't just to make a full game
You still have to set up replication
You still have to set up RPCs
I prefer making a small game than mechanics because it's not that fun to do mechanics only 😬
You still have to handle login
You still have to learn about all things multiplayer
It's just faster to do it than to do it once per game and that game takes like 4 months to make
I already did the login thing in my game using sessions so that part is ok
Do it again in a different game
If you can't - then you didn't learn it
Doing things multiple times is what builds the understanding. Not once every X months.
ah
I wanted to make an among us like but it looks that's already pretty difficult 🥲
Then you need to scale back
yeah that's why I need ideas of smaller games 🥲
but those are mechanics ideas and not games 😦
And all of these things are things I've seen you struggle with time and time again
My second plan is to make a puzzle game like the series "We Were here", what do you think ?
Not familiar with the game and not going to look it up.
But it'll probably take you too long to solidify concepts
Which goes completely against what I'm trying to tell you
Obviously do w/e you want.
Diversity, you could try using Advanced Steam Sessions for starters, to test out your listen server with someone. It's a fairly simple subsystem to use for multiplayer. You can try to make a small game as a project to learn from, even if if multiplayer will add a level of complexity.
Already using that for my among us like game
It sounds like you'd more like to have your own game than create it. Bcz developing a game is pretty much just developing a chain of game features (which you didn't want to do) with some bugfixing/optimization inbetween for the fun of it.
Functionality plugins are in a weird spot, because you either don't know enough to make them, implying you don't know enough to realize how bad they are or to adapt them to your needs, or you do know enough, not needing them.
No, like in terms of fun and motivation I prefer having mechanics that would be useful to do a game instead of random mechanics not linked together
I think where these plugins shine the best is where you'd know how to make them for the most part, but you'd have to throw shitton of time at it, so you'll just save time by having it ready made.
If you get in a pinch, and you know WHAT you have to do, but don't have the time or technical expertise to really pull it off, then consider them.
then i should consider them
I use the low entry library and other utility stuff like that sometimes but I'd never ever use a game mechanics pack
they are almost all ass and horrible to integrate with other mechanics
You got some random ideas cz you asked for some. You're free to come up with your own feature ideas that are interconnected. Noone can read your mind about what exact features you'd enjoy (or not), so this is where your effort comes to play. Sit down and think of some that sound fun. Maybe analyze your favourite games and see why exactly they are fun to play. The point is to divide the whole process into smaller chunks, simpler features, and go at it one at a time. See where you get stuck and need to spend more time.
Yeah the issue is when you need to spend equal amount of time/effort tailoring it to your own needs and game, compared to just making it from scratch 🫠
And they are just code written by somebody, you have no idea if they're good or not
i totally agree
Yeah that's what I'm gonna do, thanks 👍
Is there a way to make a server actor always relevant to a specific player?
It can override the IsNetRelevantFor function
Thanks Matt. I'm a c++ newb, but how might that work? Based on the UE doc for IsNetRelevantFor, it just returns bool.
Ok maybe we should start a bit before that.
What are you trying to achieve?
Why do you think you need an Actor only relevant to a specific Player?
My game is a persistent world survival; multi-unit management. I am using the server to manage all of the pawns to perform tasks while the player is offline.
The game world is large, and I'm wanting the player to assign pawns various tasks while the player is online; the pawns run off and do the things. I'd like the player to be able to snap to a desired pawn.
I have a GUID system tracking the pawns on the server. And I pass the player a list of units they "control" by GUID when the player logs in.
So the player has a GUID. Player can give server a GUID and the server can run a lookup on a unit array that I am keeping in the game mode,. The server retuns a location to the player, and moves the player's camera to that location.
But this feels messy.
Do you know what Network Relevancy is?
Because given your description above it sounds like you are asking for something else.
That system you just described doesnt sound unreasonable.
The only thing I would probably change is instead of using a GUID, I would tag the Pawn with the UniqueNetId of the Player that owns it.
A UniqueNetId is a platform ID that uniquely identifies a Player. An example would be your Steam ID.
That way you are absolutely making sure they are unique.
How are you associating the GUIDs with a particular Player if they go offline?
Right. I've somewhat abstracted that. I use GUIDs for the pawns, and I use the UniqueNetId to determine which GUIDs belong to which player.
Lack of confidence in my architecture. This is my first game.
Fair enough, thats natural.
The idea is fine.
Maybe you might want to refactor it from scratch. This is a common process that systems go through.
Since you gain insight you might not have considered on a previous implementation, that you can then introduce to make the next iteration better.
It is very beneficial to practice this.
Haha, yeah - feels like every week I refactor something I did a few weeks before.
Thats normal.
Really appreciate the help btw,
As you gain experience (which doesnt happen overnight BTW) your designs, ideas and initial implementations will naturally become more robust.
Breaking down your systems into smaller parts that you can design and implement somewhat independently from the broader system is useful.
You can start asking questions like.
"What is the most achievable vs robust way for me to implement X".
Then you can ask.
"How does that implementation of X change how I need to deal with Y"
Etc etc
Taking them piece by piece.
That's really good advice.
Instead of asking something like "How do I build an MMO".
Which people do more often than you would think.
If you run your previous described system above through that thought process, its not difficult to come to the same conclusion you did in your implementation.
"How do I uniquely associate Pawns to a Player that goes offline"
That leads to questions like.
"How do I uniquely identify an Offline Player".
"Can I use that to make an association with a Pawn while they are Offline"
UniqueNetId is the answer
And thats what you did.
What might feel messy is your implementation of that overall idea.
But the idea is sound.
I guess to jump back to my question on relevancy.
I should note that my camera is isometric fixed and I am using that to keep my net cull very low (I'm concerned about server costs).
I'm wanting to build a UI that reads data from the player's actors who might be outside cull. So if I could make the player's actors always relevant while the player is online; I'd be able to stream data faster (I think?).
I'm using GAS for attributes, but right now I am storing inventory and equipment as actor components. I'd like to be able to manage those components while the actor is outside of cull .. but maybe RPCs are the answer to that.
Funny how the solutions come while writing down the actual questions.
Rubber Duck
IsNetRelevantFor allows you to say whether or not a given Actor is network relevant to a particular connection.
What information do you need another Player to know about another Player?
That sounds like something you would just have on a PlayerState?
If you are running a simulation while that Player is offline and you need to display that persistent information, you may need to come up with a concept of something like a "Persistent PlayerState"
Which shouldnt be difficult.
Hmm, what would that look like?
Off the top of my head, that would probably be just extremely similar to how PlayerStates are managed as they are now.
Right now I am using pawns to hold all of the data and logic; as they are all server-owned anyway.
Instead of a PlayerController owning them, it would just be a UniqueNetId that owns them.
Oh that's an interesting idea.
That way the simulation can continue when the Player they belong to goes offline.
Leaving others to still view that changing data.
I have an ai controller managing a BT while the player is offline.
Sure, thats just part of the broader concept of "simulation"
But yeah, sounds to me like you need something to the effect of a "persistent PlayerState"
As PlayerStates are destroyed when a Player leaves (not technically true, but the effect is the same).
And these "Persistent PlayerState" would all be relevant to each other, yeah?
They would follow the same rules as a regular PlayerState, except they wouldnt be removed when the Player leaves (thats the persistent part, so the simulation can continue to contribute to them and others can view that data).
And they would be associated by a UniqueNetId instead of a PlayerController.
I suppose I don't really know what the player state can do or is for. Homework!
Yeah you definitely need to know what the PlayerState is.
I feel like you are missing a lot of fundamental basics about Unreal.
Please read the Network Compendium, its the first link in the pinned messages on this channel.
Read it 3 times.
At least.
I've got that boookmarked. I know the basics of player state; I just don't understand why they would be better than using my pawns.
Because the PlayerState is always relevant to every other Player
Pawns can move in and out of relevancy.
So if I was building a persistent RTS for example
Where a set list of Players can actively move in and out of that session over time.
And their "base" and all their "units" continue doing tasks while they are gone.
Information that I need other Players to know about, i would put on the PlayerState.
But because the PlayerState only sticks around while im inside the session
Thats a problem for the offline component
Where the simulation needs to continue
I see what you're saying. I've been avoiding the player state out of fear of overloading my server.
Build a proof of concept first, think about optimization after you know how to at least build a working prototype of your idea.
There is no sense in optimizing an initial implementation
As its highly likely you are going to scrap at least 90% of it by the time you are done anyway
Optimizing something you are going to scrap is just wasted time and effort.
Well, I see it as time spent learning - not wasted. But I catch your point.
Optimize when you are satisfied that the implementation is robust enough in features to carry you through production.
Wasted might be harsh for a beginner sure.
But when you know what you are doing, it does just become a waste
The point being, its less efficient
I know there are a lot of factors, but how many concurrent players would be a good target for a beginner's dedicated server?
haha, I've got that far already.
Seriously though, thats hard to answer
As it depends a lot of the type of game you are going for, its features etc etc
Typically, most new people on here have very very very big dreams
I am one of those people.
My usual advice to them is to take whatever scope of work you have, want to achieve or think you can achieve and cut 80% of it.
Be so realistic about your chances of achieving something that it feels like you are building barely anything
Limiting scope is one of the hardest things to do.
The reality of building something always takes at least twice as long as you think it will.
It is, I'm just working an a vertical slice. Only 4 months in, but dang proud of everything that I've managed to cobble together so far.
The best feeling is finishing something you set out to achieve. The worst feeling is toiling away not being able to see the light at the end of the tunnel because you had rose colored glasses on.
Thats awesome man
Any thoughts on how I could test server capacity; without 20 friends? Would I just add a bunch of ai units running around and doing things?
That won’t do it, you need to simulate ping
The automation system might be able to simulate connections
But I cant really give you an answer on that specifically.
Thanks Matt, appreciate you helping me out.
@fossil spoke I modified the code from the BP_HUD handling input and handled all of the input stuff in the player controller like you suggested me to do yesterday, what do you think ? Is it good ? Or are there other things i should modify 🙂 ?
Does it work better than before? I dont really remember what you were doing.
When creating a multiplayer lobby, is it common to have a custom controller just for the lobby level? (It's a UI only lobby). If you use the general player controller for the rest of the game isn't it much more messy?
At least both the host and the client can move in the lobby however I can't open that menu (for the host of course) as "Is Server" and "Is Dedicated Server" returns false, then I understood that I had to use OR Boolean instead of AND Boolean but it still returns false so I'm kinda confused 😕
As I believe I said to you earlier, I dont think you are ready for multiplayer.
That's why I'm here to ask questions 👀
That doesnt really solve the core part of it
Theres gonna be new questions every time things start going south
And you're relying on others being able to help you out
Multiplayer is a pretty big endevour
That's how we learn 🤷♂️
Solving them yourself is usually a much stronger learning experience
Theres also other ways to learn, like reaeing up on some of the avaliable material
I disagree, because I could solve them in the wrong way (it would work but it's not a good way) and later when someone asks me a similar question, I will transmit a knowledge that's wrong or not the best way
Network compendium, frameworks, unreal replication system
At best u will get answer for one line question for multiplayer
If u hit a wall on your system with something like u present just now, chances are no one will able to help you
The sooner you grasp it the better time you will have
why ?
Because it usually gets way to specific
How ?
Only answers left to give is "you gotta debug"
It will be a hand holding session and No one will do that
It will be question after question as in after x, how do I do Y
Just my 2 cents, do with it as you wish
Me too
I can understand the urge not wanting to shelf or give up.
But there is a third option
I wish you all the best with your game ofc but if u haven't make a complete single player system, you are taking a leap of faith here
Parking it
Depends, like yesterday I had an issue with Players not being able to move while others were able to, then Matt made me understand that Player controls should be handled exclusively in the Player Controller, and from that I learned an important information that I will remember for the rest of my projects, then I started refactoring my code to apply his advice and came back today with the new code and he said it's way better.
Take it from someone setting out with multiple overscoped projects under his belt
Already completed a single player game
OOP principles is worth reading up on
Encapsulation
I gave him this exact advice.
You absolutely need to research OOP principles
Makes sense^
Already read that, but like explained before the main thing causing these issues is because of Unreal having 6500 different classes which makes learning even harder
Theres like 20-30 highly relevant core classes
That's already too much
If you believe that you are already way in over your head with your current scope.
Dial it back, work on your understanding of basic fundamentals.
Its advice made with the best intent
Where can I look for those OOP Principles ?
Overscoping is super common, likely everyome has done it
It's not like I want to do an MMO, I just want to make an among us like game 😦
Theres a bumcj of resources avaliable online both in text and video
It's probably gonna take a while, u won't learn them in a couple of weeks imo
I just wanted to make a multiplayer ShopKeeper
Should be simple enough. Except i had no clue what that entailed.
Could you give me some links please ? Because I don't want to drop on someone teaching stuff wrong and then coming here saying that I learned those stuff and people telling me that I learned them wrong 😬
Are you saying I have to put my name/rep on the line ? 😆
If I'm in your shoes I will just look at oop outside blueprint
I feel like blueprint tutorial might over stretched the concept
That applies to OOP
Where basic oop concept in any programming language should show you the simplest example
That's my opinion anyway
But guys, you're saying that as like I don't know OOP 😄
If you cant find OOP yourself, you have bigger problems...
Literally google the term
Do you?
The issue I have with Unreal isn't OOP in itself but just the fact that there are too many classes that you need to play with which increases possibilities of errors and placings stuff in the wrong classes.
Yes
If you truely understand OOP and its principles, looking at and understanding at a basic level the Gameframework classes should not be daunting.
It's true that there can be some overlap in their function and their functions aren't all that well defined in the documentation, though.
You can basically put anything anywhere and it'll sort of work (barring replication issues)
😄
He is struggling as it is.
Btu that's really a you problem. Take a look at the classes and understand what is implied by their names.
I am struggling lol, mp is hard
Not with replication stuff tho
"Controller" -> deals with controls. "State" deals with state.
State is a vague term, do you consider health as a state ? isDead boolean is that a state ?
Yes
Code from yesterday already breaches atleast one of the OOP Cores
But those aren't necessarily Player states, but controlled pawn states.
(the other way around)
I have no clue what this means, you already confused me 👀
Which one ?
The player state deals with persistent player data. Not specific character information, such as "is dead" or "health"
Unless those are persistent player states.
Persistent data in terms of what ? Switching Levels ? Session ? Data across game instances ?
how "health" is a state ?
Generally all data is reset when a level is changed, barring game instance stuff. You can optionally carry over player state information during that switch.
It's not a binary state, for sure.
It's not on or off. Or one of 5 different values.
so that's why I'm confused on how "health" is a state 😬
But then health isn't necessarily something you'd even have in a player state.
Generally your "health" would belong to the controlled pawn in the game, not the player state.
Depends on the game, sure, but yeah.
Yeah that's what I'm thinking but then it creates an issue of having some player datas on the BP_Character, some datas on the PlayerState, and some other data on the PlayerController, instead of regrouping everything in 1 thing as all are related to the Player himself
But all data doesn't belond to the player themselves.
That is a misconception you have.
That's not what I said
Like Health, isDead, isAllowedToMove are all related to the player but they need to be in different classes which is something I deeply hate
Well you said "instead of grouping as all are related to the player themselves" I mean, your network connection is technically "player information" but it doesn't really belong in the game framework.
what do you mean by "network connection" ?
The object that handles the network connection to the server in a #multiplayer game.
And the data related to taht connection.
Mhhh on that one that's understandable and debatable, but for the ones I gave, to me they should all be in the same class but Unreal decided that no, and that's why it confuses me and confuses everyone who's new to this
I would argue that they all could go in the same class.
Take a game where you spawn, go fight some people and then die - and you stay with your body in some sort of spectator mode.
You could put all 3 of those values in your character class and it would make perfect sense.
Take a game where you do teh same, but your body is destroyed and you can roam about, the "is dead" variable may then be on your player state because it is not bound to your character, but a more global state.
To me instead of having different class to have different properies, like persistance between levels, server only, client only, etc.. To me there should be some properties on the variables to check / select to give the properties we want.
Then UE is the wrong engine for you.
the question is the definition of "global state" because to me it's vague
A state whose value persists for longer than the character you control.
I said "more global" not "global" meaning the scope of the value is not just on your 1 character.
Put your values in the scope they belong to. It's as simple as that. If it pertains to your player put it in a player state. If it pertains to the thing they control, put it in the pawn.
That isn't just how UE works - it's how OOP works as whole.
You don't just have a single class with a list of variables and decide what belongs to what.
I don't understand why this keeps printing Is Not Server for the host, while this is a listen server and the code is executing in the Player Controller 🤔
A superClass
Are you seeing "Server: Is Not server"?
Fixed it. I was launching directly from the level instead of being first in the Main Menu and pressing the buttons to set up a session
Ditto
Barely scratched the basic systems and there's been quite a few curveballs to catch already
And this is with purely editor testing, which definetly doesnt cover all the bases for MP stuff
I think I'm alright with sending and receiving data
What data should be send/ sync
What code should be in server what code should be in client
I'm struggling with validation and rewinding
Yeah thats another beast
Oh and I think I need fastarray for my item
Really?
Not sure
I prob should too, butnive minimized thebdata sent
Brb back to work
😄
Now its mostly a DT handle and a value
Have you played with mover 2?
Nope, still stuck with 5.1 🐈
You might just be able to copy it from 5.4 and use it
Still trying to scratch Gas atm
Might work
Noted , ty.
That's actually a good idea wut
I do a lot of client aide struct updates for ease of use
So my struct is like 25 props, with only. A few of them replicate. Rest is updated after replication
I should prob move to fastArray aswell as theres little downsides to it but... that'll be later
I will attempt to use fast array just for the sake of learning
I tried it. I'm kinda ehhhh about it at the moment.
Hoping for a better API to be honest.
You'll be hoping for a while i bet😅
Yeah it works. Minus the example BPs though.
I had a very deep dive on NPP and Mover the last couple weeks for my current client.
I'd love to hear the results of that!
Yeah I can write something down at some point
Awesome. Thanks!
There is sadly a bug with NPP and Unreal Insights. It crashes very often. They are aware of it. Not sure how long a fix takes.
We ran into that when I tried adding reconciling of all Simulations under Independent Tick
Idk. It can't find recorded data matching the ModelID
NPP model that is
NPP only reconciles the Simulation that needs a correction if set to Independent Tick. And Fixed Tick is unusable atm imo
Why's it unusable?
It's fully lacking the part that bridges the tick rate between simulation and game
Ah heh
So if your sim is at 30hz and the game at 60hz, it won't have info for every second frame. And if you use it on e.g. Mover you'll see how terrible that looks
We went back to Independent Tick. Which is what CMC does already. But there, only the current instance that has an error reconciles. Means if you have a second simulation, like a weapon one, that relies on Movements and other way round, you have a problem.
I see.
And while trying to add that to the NPP I noticed the Insights crash, which happens without my changes too. That made it impossible for me to continue cause I had no data feedback to see if my implementation works
There is also a big ??? for performance and bandwidth with Mover and NPP which I don't have info about.
And an even bigger ??? for Epic even continuing with it cause they are visibly working on Chaos Physics prediction stuff
Yeah, we kinda want to implement our stuff in mover and cmc and see which is more performant in various ways.
I can't imagine it's worse than the cmc, though.
At the current time I would say that even with 5.4. releasing, mover should only used by peeps who can use C++, can get a good understanding of NPP and Mover by reading the code and documenting it themselves, and who are comfortable fixing problems (potentially complex ones) without Epic's help
Questionable. The InputState struct is a lot larger than the original one of the CMC. And they also, by default, send 3 or 6 of those at once.
We've got a couple of guys looking into it (who know c++)
What is Mover and NPP
And the SyncState is always sent, even if there is no change to it. There is no MoveCombining in NPP.
I'm pretty sure it's less optimized than the CMC in that regard
The NPP structure is cache friendly, so at least there is that
I'm sure it'll get better over time.
I doubt the cmc is going to see and drastic changes.
It hasn't been touched for weeks. And they demonstrated the Chaos stuff in Lego Fortnite. I would be careful
NPP is the Network Prediction Plugin. Basically something that supposedly allows making predictive multiplayer systems.
Mover is a CMC replacement fwiw. It's more modular and the prediction code is in the NPP instead of also in it, allowing other systems to maybe also predict alongside Mover.
Currently, with the CMC, there is barely any way to properly predict other systems in the same way without awkwardly hooking into the CMC
NPP requires C++ though. Mover is somewhat built to allow BP only usage. But we are working in C++ with it atm.
It's what the new "character physics movement" thing is based on, isn't it?
I guess. There is chaos code in there though
Ugh… this is all so depressing. I just cannot understand how character movement, GAS, network prediction etc is all just not sorted by now. I appreciate it isn’t trivial, but it’s just so core to so much general game requirements…
I’ve got GMCv2, and even with that, GAS and movement doesn’t play nicely. No matter which path you go down, seems to have downsides…
Game dev has always been about tradeoffs. I dont see that changing anytime soon.
NPP, Mover 2.0, GAS etc etc, wont solve every problem.
I think the problem is the current time/phase the Engine is in.
We started with a Sublicensed Engine that suddenly went free. A lot of the stuff in it was mostly just for what Epic needed it to be. fwiw mostly UT.
When it went free (I know there was a subscription phase), people started to use the Engine for a lot of different Games, and it's just not made for all of it. Paragon added some cool stuff and we got some updates on a lot of core features (RIP Paper2D), but as long as the Network Prediction part isn't as needed to Epic as it is to some of us, this won't change.
Fortnite somewhat needs it. They want predicted physics for their Vehicles.
And LEGO Fortnite did the first step in that direction by using Chaos, authority driven, to replicate none-controlled Phyiscs and properly smooth them.
They might push this further to allow local predicted physics, such as for Vehicles, at which point NPP might become redundant, because that would be yet another Prediction System. However, Chaos Prediction might also be shut off to the outside, not allowing other systems to use it (I haven't looked into it).
Stuff like NPP and Mover are somewhat "I want to make this." stuff of Epic Employees, that Epic themselves might not have that much interest and use in. With Dave Ratti not working on the Plugin anymore, it more or less stopped.
The people behind Mover probably though that it's gonna work nicely with NPP, but at this point I believe that resource-wise, NPP + Mover isn't really high priority.
I believe, at this point, that we (the community) would need to start working on Plugins that add some of those core features. NPP is great, but despite PR's, we can't really do much about its missing features.
We are somewhat lacking proper Open Source Plugins for this. The GMC stuff on the Marketplace is not it.
fwiw, that's also why I was and am very sad about the State of Unreal stuff. Cause it didn't show anything in that regard and only talked about MetaVerse, UEFN and Verse. +- some minutes about Animations. The Engine doesn't seem to progress into the direction that we need it to do.
NPP could solve a lot of problems if it was a fully featured Prediction System.
We know Epic has the ability to create Systems that are fully functional, and awesome in terms of Editor Tools. Yet, their Unreal Insights version of Network Prediction just crashes.
I agree it could solve some nice problems given that it gets over the line in terms of being feature complete
The thing is, I don't think it's "not sorted." There are solutions for every part of what you describe, after all! There's just not really a (good) entire single "here is all the hard stuff done, just make a game on top of it" solution. Which isn't that surprising to me; you can have little flexible building blocks, general solutions to things in isolation, but the more you start putting them together into a pre-made whole, the less flexible that overall whole will tend to be.
I would somewhat disagree with that.
I guess more that I see very important building blocks - and they dont work together out of the box. But the whole point of an engine is to have compatible parts. Common scenarios like "GAS + stamaina" or "movement and rollback" - they are clearly the purpose of UE engine.
This isn't about a "here is all the hard stuff done" thing
The problem is that Epic releases "all theh ard stuff done" 5 times.
And none of the 5 work together
That I'll agree with.
We don't need all of it done so we just have to move some building blocks.
Then we could just go over to UEFN and Verse and piggyback of Fortnite.
And who wants that..
The problem is that the things that UE/Epic offer aren't compatible but yet too integrated into the Engine to quickly create something better.
Like, look at the Overwatch Net Code video, where they show how their system works with Abilities, Movement, etc.
There is no reason that this is not properly possible in UE at the current point in time.
But I think the CMC itself is an example of what I mean. It made some choices, and now there's lots of things which depend on it (including certain animation modules which have no business integrating into the guts of the CMC when an abstraction layer would be enough). And if you need to do something in a slightly different way than the CMC does, you may need to accept you can't do it, or fight the CMC to make it do the things you want (but keep access to all the things that have put down roots into the CMC as a dependency)... or you can make your own solution, but at the the cost of extra work to retrofit or reinvent all those auxiliary wheels tied to the CMC. If that makes sense.
Hey guys has anyone experienced network related issues, actors not replicating some properties, etc, while using level instances ? the actors that have issues are children of the level instances.
@thin stratus - I would agree with your take as well, mind you. I think they're both problems.
I wanted to chime in on this, it is perfectly possible. NPP plugin is missing 2 features , Smoothing (both fixed tick and correction) and lag compensation. both of these features needs a minor changes to NPP to expose some stuff (adding 2 getter functions) so you can do it outside of the plugin (add it to mover for example). but you can make your own abilities, movement , etc.. and all in separate components , separate simulations and they would just work together perfectly. i understand your point of view that epic is just not invested in making something like GAS use NPP so we can have proper simulation and rollback.
That goes somewhat back to what I wrote about the NPP before
But yes
if it is truely that simple (exposing two functions) - we can just custom the engine to have those two exposed?
Sure
no need, need to get plugin locally along with every other plugin that uses it 😅
It's just annoying to work with cause as soon as you have a custom Engine, you gotta support that for the rest of the team
The Smoothing issue is mostly a problem with Fixed Tick or?
Were Independent Tick Corrections also instant?
there is no smoothing at all now
Right
That should be easy enough to resolve
What we are still working on is reconciling multiple Simulation Instances in Independent Tick
Instead of just the one that had a correction
i believe Fixed tick in the way to go no matter what. that is the only way to guarantee multiple sims can step together. only thing is missing is smoothing, but Independent is no different, still needs correction smoothing.
as you can see the chaos one, only works in fixed tick
Pretty sure we decided against Fixed Tick. Possibly cause of the Smoothing.
I already have code for the Independent Tick reconciling multiple sims.
Just can't test it properly due to Insights crashing
you really went the long way. 😂
Well, I'm not sure anymore why we didn't want Fixed Tick, but from the discussions we had we figured it doesn't work for us.
And "the long way" took me 30 minutes or so.
From what I looked at it's pretty straight forward to add.
Might be that I run into a wall with it. But I can only tell once Epic fixes the Crash
i hope epic would make changes to NPP or its insights, anything 😂
fixed tick is recommended in mover if you check the repo on main, but with engine fixed tick. deal breaker, not sure why they don't think smoothing is a must.