#multiplayer
1 messages · Page 121 of 1
So I was thinking we don't really need a custom float, we can just return the values directly i was thinking, and in calc velocity i have
Yeah but, what do you mean with "return directly"?
GetMaxSpeed has to return something
Well, GetMaxSpeed() returns CustomWalkSpeed, and now somewhere else we have to set CustomWalkSpeed to be whatever
can't we just have GetMaxSpeed() to return whatever we are setting CustomWalkSpeed to?
If you explain me how :)
How exactly are you planning to connect the function that handles unpacking the NetworkMoveData with the GetMaxSpeed
Without having the first set something that the second returns
What you have there won't work
Cause the Server will also run that
I don't see the gain
so in calc velocity we do GetMaxSpeed but i just overwrite it
I would not touch CalcVelocity for this
What does Super::GetMaxSpeed return?
So in GetMaxSpeed, can I reference the network data?
Pretty sure it returns MaxWalkSpeed
here, it just returns the MoveSpeed attribute
No, you usually use the unpacked data in the function that the CMC provides to update the CMC
well if it has the appropriate attribute set it returns the movespeed attribute
Yeah
and some other stuff based on movement mode but we dont care
okay so this, but i set MaxWalkSpeed in this other Before/Pre/Whatever Movement Update function,
- Client sets
MaxWalkSpeedinUpdateCharacterStateBeforeMovementto the Attribute Value - SavedMove SetFor uses
GetMaxSpeed - SavedMove PrepFor sets
MaxWalkSpeed - Client sets NetworkMoveData MaxSpeed from SavedMove (I assume)
- Server sets
MaxWalkSpeedfrom NetworkMoveData
There is one more thing that might be missing
The function that replays the Moves
You might want to override that
And save the current MaxWalkSpeed to some local variable
Then call the Super call
And after the Super call set MaxWalkSpeed back to the saved one
Might not be needed though cause you are setting the Speed every frame before movement anyway.
But at least that one frame you don't move with the saved moves value by mistake
Maybe
i'll give it a shot
Do the dotted list first
And see if it works
Do you already override that one function that the Server uses to get the NetworkMoveData unpacked to set stuff on the CMC?
I think so, I think its just the serialize function
and they do it in reverse on the server
So for that funciton i just do Ar << MaxWalkSpeed
and it will deserialize appropriately
I don't think i need to modify the PackedBits stuff, i think it will be handled automatically if i use the serialize function
But that is missing the part where the Server actually set the MaxWalksSpeed of the CMC or?
Cause that Ar part is inside the NetworkMoveData struct
That doesn't actually touch the CMC
iirc, the CMC sets the Current NetworkMoveData Container Pointer on the Server Side when the Server performs the move
It may set it multiple times to different packages
Old Moves, Dual Move, etc.
And calls the same function afterwards
That function you'd need to override, get the current network data and set the MaxWalkSpeed on the CMC
This is from memory, so you'd need to double check and in doubt show me some native code lines so I can remember
i see
there is another function called "ClientFillNetworkMoveDat"
This is my addition
it looks like this gets the value from the SavedMove
Can you screenshot the native ServerMove_HandleMoveData
Right, can you do the same with ServerMove_PerformMovement?
Trying to see where you can best do this again
It is extremely long, let me see
Yeah I would try to override that one
And get the MaxSpeed from it
MoveAutonomous I could overwrite?
Interesting
MoveAutonomous is called for Client too
We don't want that
void UTowerCMC::ServerMove_PerformMovement(const FCharacterNetworkMoveData& MoveData)
{
const FTowerNetworkMoveData& TowerMoveData = static_cast<FTowerNetworkMoveData>(MoveData);
MaxWalkSpeed = TowerMoveData.MaxWalkSpeed;
Super::ServerMove_PerformMovement(MoveData);
}
Don't know if that cast needs FTowerNetworkMoveData& or none ref
In my CMC constructor though I have set the kind of container already
{
SetNetworkMoveDataContainer(TowerNetworkMoveDataContainer);
}```
So that container already has my custom move data, so I would still need to cast?
i do not know why we are doing this haha
The MaxWalkSpeed variable of the CMC exists on Server and Client, right?
The Client sets its local Version of that Variable via the BeforeMovement function. Okay?
Okay
The Client then uses the GetMaxSpeed function, which returns that variable, to set the SavedMove MaxSpeed variable. Okay?
SavedMove native does have a MaxSpeed, it is just not sent over the NetworkData
Ah, I didn't remember that
Are they setting it from GetMaxSpeed?
Alright, yeah I forgot about that. Then forget that part
for whatever reason, this is not part of the serialized data though
So Client sets MaxWalkSpeed in UpdateCharacterStateBeforeMovement to the Attribute Value
So this is native:
When do replicated actors receive their initial bunch of data?
Just after the Super call fwiw
No you'd need to do that only if AutonomousProxy actually
Yeah
GetMaxSpeed() actually just will return that value for the WalkSpeed
fyi the MaxSpeed in the SavedMove is probably only used to check if the Move can be combined/is important
Yeah
NetworkMoveData needs to cary along max speed.
In GetMaxSpeed() function, I have something that references the network move data
Now you have your custom NetworkMoveData with a custom MaxSpeed value that you serialize.
That is set in the Fill function from the MaxSpeed of the SavedMove, right?
Yes yes
Yeah, so the last part that I posted before is the part where the server uses that data to set the variable on his end too
Is there anything I need to do to make sure that GetMaxSpeed knows what the current NetworkMoveData is? 🤔 or can I just reference it?
Cause without that, the MaxWalkSpeed on the Server isn't set
Why do you touch GetMaxSpeed again
I see, here!
We don't touch GetMaxSpeed at all in this case
okay i see i see
Yeah
bro i have just learned so much
I think you still need to use the PrepMoveFor function of the SavedMove
I will message your studio here in a few hours when I'm done with my next bit of work
To set the MaxWalkSpeed to the MaxSpeed of the SavedMove
Cause Epic doesn't do that
There might be some more things that we overlooked, cause CMC is hella complex
so should I change it?
Where is it not mutable?
In PrepMove For
I believe so, I was having trouble doing that directly before
Character->GetCharacterMovement()->MaxWalkSpeed = WalkSpeed;?
Uff, that's one of those questions that I can never remember
Somewhere between PostInitializeComponents and BeginPlay it seems
you know what, that worked, not sure what I was doing wrong. I think i was just typing "MaxWalkSpeed = " instead of doing that chain
that makes sense
Okay sweet, i have to go now unfortunately but this was hugely helpful, i feel like i really understand so much more now!!
Aren't there these PreNetReceive etc. functions?
Ah yes but do you know if there's a property tracking the initial bunch
ie the COND_Initial properties
ah it's probably PostNetInit
/** Always called immediately after spawning and reading in replicated properties */
virtual void PostNetInit();
Could be. :S
Hey all, Im just making sure I have the right idea about this process.
So I have client authoritive movement in my racing game, I want to replicate the players variables to the server, and then to all versions of that player on the clients
the process would be an RPC to the Server , and then RPC multicast to all clients? or would I use client RPC ?
What do you mean "the Players variables"?
Which variables?
Depending on what you are trying to achieve you may want a different approach
But it would first start with an RPC to the Server in most cases.
Im sending a float of the velocity and Bools ive set up for the current state : "total velocity,Drifting,Boosting,tricking" mainly to control VFX on the remote vehicles
i first thought to use a Rep var , but I believe those only speak from Server to client
You would likely want these to be Replicated Properties as they are "Stateful"
You would use RPCs for one off "Events"
Events are not stateful
Properties are stateful.
Replicated Props are only replicated from Server to Client yes.
But they serve a different purpose than RPCs as I explained a little above
You would use an RPC from Client to Server to notify the Server of the change in those properties
Then the Server would update the Replicated Properties so they can send their values down to Clients
Via property replication
Because they are stateful.
If they were not stateful
Like
"Started Boosting"
Thats an Event
You might use a multicast RPC instead
"Started Boosting" isnt stateful
"IsBoosting" is stateful
RPCs are not stateful
Rep Props are stateful
Does this make sense?
gotcha that makes perfect sense , So then RPC to the server, Server updates variable. and that updates all clients.
Yes
You can then use the OnRep specifier to get a function which executes when that variable changes on Clients
You might use that to trigger things like the toggling of effects
I suggest you read up on how OnRep works
The Network Compendium pinned in this channel explains all of this
You should take a look at it.
thanks a million! Ive frequently watched that video and alot of others, its been extremely helpful , I just wanted to double check the process . I appreciate the clarification
The compendium is not a video
Its a document
You really need to read
More than once
And reference in the future.
Ooh, this I havent seen , ill give this a scrub through, thanks
Its literally the first pinned message lol
sorry my brain saw the video underneath first , ive watched that alot whenever its been awhile since ive touched my netcode lol
is the built in replay system up for the task of capturing an entire playtest session (held on a dedicated server with multiple clients connected), and then outputting some file I can download and watch myself (from different angles etc)?
my main objective is to basically be able to produce a trailer from real gameplay sessions from the replay (that is, not in real time)
ideally by being able to change camera angles, and other directing controls
okay, per the documentation, the answer is a vague yes, still not sure how it all works and how easily one can get some directing controls during replay playback
so I guess I'm changing my question to: did anyone here ever get to work with replays and/or did something similar to what I'm asking?
https://portal.productboard.com/epicgames/1-unreal-engine-public-roadmap/c/1281-mover-2-0
so this is the next CMC, and it mentions a generic rollback networking model that all systems can use
So network prediction plugin isnt being forgotten about after all?
well I'm sure it is, I got confirmation that NPP was dead, but I suppose this is an "NPP 2.0" type effort
Eitherway, I welcome progress in both these areas thats for sure
me too, it's been a long time coming
Generic Movement and Generic Network Prediction
Both good things for the wider audience
I just created a dedicated server for my game, anyone know how I can start up my server with custom server name, player slot, level?
@fossil spoke wasnt really necessary, but people told me it was a bad idea to maintain a connection with the server inside a game instance
You can easily pass parameters via the commandline.
Your question doesnt make sense, can you rephrase it?
Or add detail
well, I have a server console which receives a buffer from the game
receives data
and then retrieves the data back via tcp socket connection
Where can I get such commands? My dedicated server doesn't let me input anything. I see it though the cmd..
to stabilish the connection I need something to connect to that socket inside the game
Can I have a configuration file of some sort before starting a dedicated server to set up game settings?
Of course.
then I started looking for plugins or features inside unreal engine to connect
@tropic snow Research how to setup a config.ini file
Which the Server would read settings from.
somebody from here told me about Ftcplistener, but I didnt find any documentation or feature inside unreal for that
@limber minnow You must not have searched very far, the Engine certainly has those features and are used in many areas of the engine
well I downloaded the plugin from Spartans and just created a class, builded inside my project adding in the build.cs and now the connection works fine
but I need to cast as object inside the game instance and then connect
TcpListener.h is literally a listener for TCP connections
does it also send messages ?
Just look at the Networking Module
It has everything you need
A Socket Builder
A Listener
A Receiver
Go and look my friend.
well I dont know where to look and how to learn it
If you dont know how to research this, how on earth do you thiink you are going to build an MMO?
Take some time to look around the engine
Understand its classes
How to search for things
well the game is already working and connected
also with mysql database
I just wanted to get somebody opinion where I should stabilish the connection
in a subsystem or in the game instance
A GameInstance Subsystem would make sense
good thanks
Im still working in the class so it can work
ha
I was trying to cast the gameinstance subsystem at first inside the game instance but for some reason didnt work
but now it works outside the game instance and still connected when I switch the levels 🥹
if autonomous proxy sends reliable server RPC, and then, after 0.1s, an unreliable server RPC, can it be that the unreliable one comes to server before reliable even thought it was sent 0.1s later? 🤔
Reliable = I will eventually get there
Unreliable = I may or may not get there
Once an RPC is sent, there is no way to predict when it will be received.
So there is a potential for unreliable to reach the target first, if its received at all.
Hello,
I have a basic question and I'm seeking some assistance. I need to create a VR multiplayer game, but I only need two devices to be in sync: a VR headset and an iOS device. In this setup, the primary gameplay will occur on the VR device, while the iOS device won't be actively playing but will** display a real-time sync of the game being played on the VR device**. Essentially, the** iOS device will act as an observer or inspector, showing the player's character's transformations, the game map, and various widgets displaying player game details and progress.**
I've read several resources and articles, but I'm struggling to understand which server solution to use. Most tutorials and courses demonstrate how to connect devices on the same network, but in my case, the two devices will be connected to** different networks**. Furthermore, I only need two devices to be in sync, which makes me wonder if there's a simpler solution available.
I've explored options like EOS, which allows us to join sessions, but it appears that connecting across different networks might require an additional server solution like GameLift- this i am not sure pls let me know if there is some solution with EOS.
I'm looking for a more straightforward approach if possible. I've also considered Photon Realtime, which seems suitable, but I'm concerned about the availability of resources and support. Additionally photon doesnt support unreal engine multiplayer system ig.
I've also looked into PlayFab, but it doesn't seem to support iOS and Android.
Could someone please suggest the type of server or system to use, or if there's a simpler technique to address my specific problem
Would you generally implement teams on the game state and keep track of what player is on what team there?
Not really. Your better to create an Actor that represents a "Team" and have that keep track of the Players that belong to it.
The GameMode could be the one that creates those Team Actors though.
You would probably want to have the GameState replicate a reference to the Team Actors as well.
So they are easily accessible.
This is how Unreal Tournament handled Teams.
Its a fine solution for traditional Teams if thats all you need.
Traditional in that there are only 2 teams.
If you need nested teams
Like, squads within teams.
Probably better with a different solution.
Ah okay thanks. I'll try that
?
You've named 3 different things that have nothing to do with each other. EOS is not a server hosting platform or a networking layer, it's a layer for platform services (friends/lobbies/matchmaking/achievements/etc, but not actual server hosting or networking). Photon realtime is a networking layer (and also user data storage and platform services? honestly unsure), but unreal already has a full networking layer and you'd have to have a damn good reason not to use it. PlayFab has server hosting but also user data storage and platform services and has nothing to do with your game's networking.
What are you actually looking for?
Hey,
I'm passing trough some variables to a projectile at spawn so It can modify it self at begin play. However this does seam to work on Singleplayer only. I run this on the server and even with a Multicast those variables are never replicated on the Projectile Movement. Any idea why?
Multicast isn't needed for this. If you pass the data into the Actor when spawning it via ExposeOnSpawn then they should be available at BeginPlay. Did you try printing the values on BeginPlay
Yes did try to print it and they are not correct in Multiplayer.
Yes the variable I spawn with are correct. But the Projectile Movement won't update to those values
I had some uncertainty about the choice of backend and dedicated servers. In my scenario, I only have two devices in sync: one device is primarily for inspection, but it will still load maps and data. I'm wondering what type of multiplayer system to use and whether I need a dedicated server for this. Additionally, how can I ensure synchronization between these two devices on different networks?
Also yeah now i understood i could use EOS as backend which is free too and all i need some dedication server service -- is this effiecent solution?
Hello everyone, I have a question regarding the Lyra Sample Game (using it as base for my project) at this moment I have a "fully" working Dedicated -> client model with the server running on PlayFAB (only using it as host at this moment) I'm able to join the server with the console command on the client "open IP:PORT" and I can play on it against the bots. Now for the problem. Each time the 3rd round start I get "spawned" in the ground and can't do anything. EOS is fully working, and I register myself (player) without problems and the EOS backend reflects this as well (a play slot gets taken) -> If I exit the game on the client on the 2nd game I also UnRegister the player and this also get's reflected in the EOS backend. Does anybody have the same issue or an idea why on the 3rd round I'm not able to play anymore?
Here are a Server and Client log
are u using playfab GSDK plugin?
is playfab better compared to gamelift?
is it free or paid?
Those services are down the line all paid
Yes both SDK and GSDK
even we cant test for free, like for development?
Yes on PlayFab you get 750 compute hours for testing. And like eXi said above once you really want to make use of the services you’re going to pay for it. But for me at the moment to test in a real/live environment the 750 compute hours are enough.
ok
are u using EOS and only server as playfab ?
EOS is free ryt and playfab analytics those stuffs are also paid ryt?
any reason u dont prefer EOS
Are you saying you don't have the same issue with playing without EOS and PlayFAB?
EOS does not host Servers for you
And possibly other differences
and also gamelift is expensive than playfab?
what about photon have u used it in unreal engine?
Buddy, people already explained you this stuff
Photon is irrelevant for UE
And for Gamelift vs PlayFab Pricing you have to check their website
They generally all will cost you multiple hundred $ per month depending on your game
I’m sorry eXi just trying to be helpful and friendly. Just hope someone had the same experience as me with the Lyra Sample Game and not being able to play more than 2 rounds when running dedicated servers.
Eh?
I simply asked if the same happens without EOS and PlayFAB
Cause it generally sounds like you should be able to reproduce this locally
Which would make debugging easier
I can not test this locally as I can’t run a dedicated server and a client on the same IP?
Sorry I missed your previous comment/answer I was replying to the above. But no I can not test it locally as I can not run the server and a client on the same ip.
Unless that is something you caused, I don't see why not
open 127.0.0.1 should work just fine
🤔 then I have to make a separate Server and Client builds that disable PlayFab (otherwise it will crash as it can’t receive heartbeats) I will try that now.
And I guess I have to disable all the EOS register / unregister nodes.
Yeah it's a good habit of allowing this to run without all the fancy systems
Working on setting that up now.
Hello everyone, I’m Parzival (Parz for short), i’m new here and have recently decided that I want to try and learn Unreal Engine in my spare time and hopefully meet some like minded folks to hangout and network with. I have a few tutorials i’m going to start with, Smart Poly on Youtube seems to cover a lot of stuff, but if anyone has any comments or suggestions on that i’m open ears. This next thing is a two parter, I wanted to jump in and start making a game, but based on his tutorials it looks like having a really good understanding of all the available tools is a better idea. I was wondering what you guys think, should I learn on the go or actually take the time to navigate and explore everything first? Last, I have a little drawing board for my first game idea, obviously i’m a long ways away from developing a pleasurable multiplayer experience, but I was curious as to what the limitations are in terms of player size, for a game that compares similarly to early day fortnite in both appearance, weapons, and player capabilities. If I wanted smooth gameplay, how many players can I expect to be able to host without frame drops? Thanks in advance for any tips and direction, I look forward to hanging out here more often!
*Side note, the game would eventually be a battle royale, much smaller map than fortnite maybe about 2/3 to a 1/2. No building, maybe destructibles here and there. I was thinking about 20-36 players max. This will just help me plan a little bit better if I have an idea of what’s capable but I haven’t been able to find much information. Thanks again!
Well, 20-36 players is fine.
Wanting to make a Battle Royal as your first game, when learning the Engine and its Multiplayer, is nonsense though.
It's up to you how you learn best. The Engine is huge and you are required to use C++ for a project like this ultimately anyway.
So if C++ is not a thing for you yet, I would suggest you scrap the Multiplayer part and learn BP/C++/UE in Singleplayer first.
Im first year CS so i’m going to need to be proficient in C++ at some point might as well start now. And yeah I know a BR is ambitious but I have no intention of going down that road anytime soon, I just let to have the vision in my head and on paper. But I would be happy if I was able to do something like that in a years time. Do you have any beginner tutorials you could recommend?
Only for Multiplayer specifically, which is the Compendium pinned to this channel
Everything else, not sure. Depends on how you learn best
YouTube tutorials are littered with false knowledge, even from Epic. Even paid ones might be bad.
So it's probably best to watch/read a lot of different stuff and just toy around
The biggest headache will be learning "the proper way" of doing something
Cause you will find more people teaching you the wrong way
Thanks brother👍🏽
Does NetUpdateFrequency affect RPCs at all?
guys. i made a simple sessions widget which works but if i'm in the same network? kind of i think?
i have my pc connected via lan and my laptop is connected to the same wifi and it works when i run it like that. but when i change my laptop's wifi to my mobile hotspot it doesn't work anymore
i tried to implement Epic online subsystem but idk if i did fully because i don't see any activity in it's analytics
Well I got it to run sort of from the editor (build from source) with net mode client (as it will start a server) and I was able to get through the 3 rounds albeit a bit wonky. I don’t know why registering someone with the EOS backend, and hosting the server on PlayFab would make it have problems not wanting to go past the 3rd round. @thin stratus (don’t know if I’m allowed to mention you or not as I wanted to update you on the status of your suggestion.)
Can also confirm it happens locally without EOS/PlayFAB now
but it took much longer
UActorChannel::ProcessBunch: New actor channel received non-open packet. bOpen: 0, bClose: 0, bReliable: 0, bPartial: 0, bPartialInitial: 0, bPartialFinal: 0, ChName: Actor, ChIndex: 78, Closing: 0, OpenedLocally: 0, OpenAcked: 1, NetGUID: 0 seeing a lot of this (errors)
Do you need to create a C++ class for every actor you want to replicate, to implement Getlifetimereplicatedprops()? Trying to replicate a simple AStaticMeshActor by setting replicates/replicates movement to true, but that doesn't work
Just to verify.... there's literally NO way to have instanced maps loaded in like you get in an MMO using client hosted listen servers, right? Like, not without some crazy C++ stuff?
Our world is getting too big and I'm considering just having players load up new maps for our future content zones, but I know that means all players in the game have to then travel to the new map currently.
Hey when I use AttachComponent, how do I get this new subobject to obey SetOwnerOnlySee? It's being attached to a skeletal mesh with that set to true, but I can still see it on other clients.
oh I think I see the problem attachcomponent doesn't change the owner
I couldn't find a SetOwner, but I will try Rename, ty!
That will absolutely do bad things in multiplayer, I expect.
yep its very angry about that lol
for some context, I'm trying to take the first person starter project and make it multiplayer. I've added a third person mesh, and trying to show the weapon in the right place for 1st and 3rd person meshes. I'm beginning to think that I may just have to change the way weapon pickup works completely instead of using AttachToComponent
this is what I get right now 🙂
I think you basically want to NOT have attachment replicated (not sure how you opt out of that) but insead, attach at different places for different views
Is there a way to optimize TSubclass<UDamageType> when sending it over RPC? Judging by the insights profiling, it takes 112 bytes which's like 3 times of all the other shot data
inb4 why the hell do you even send TSubclass<UDamageType> for damage data - i'm kinda a victim of the situation here, optimizing someone else's netcode and would really like to avoid any tangible refactorings at the moment
hm, checked out other bunches, for some reason, sometimes TSubclassOf<UDamageType> takes only 2 bytes. and sometimes 896 🤔 what could be the reason of this?
maybe this is why over the shoulder view was invented 😄
It is likely sending the path to the damage type over the network. Though really you should only really need to send the damage type if it's relevant to the client at all.
The reason one might be 2 bytes occasionally is if its path is in the static FName table
Since in the engine there is a table of common FNames in a table that will be networked by a numeric index rather than the string representation
path to the type, huh. for some reason I hoped that TSubclasses are something like int GUIDs or something like that. ok, thanks anyway. In this case the only thing to do is refactoring I guess, because I personally don't know why people before me decided to send damage type in server RPC for shot data
Yeah it's an odd choice, is this a client to server RPC too?
it is
Because yeah I would expect the server to be able to figure out the damage type on its own without the client sending it
I wouldnt trust the client to tell the server at all
code structuring question
my game starts with players in a 3D "select your character" screen and when they click on buttons it moves them around the level to take the next actions (marking themselves as ready, etc.)
right now I'm spawning a camera Actor on the server and using that to move them around the UI, but it doesn't seem right for me to do this on the server (replicating down position vs. being able to smoothly interpolate around on the client)
any tips for how to structure this? should I have the server run the Possess function but turn off replication for the camera actor and just move it around on the client and intentionally let client/server get out of sync?
Why does the server need to know about something cosmetic like that?
If its just a selection screen, the client should control that entirely.
where I'm getting stuck is that I didn't think I could have the PlayerController possess the camera actor without the server
when can I safely use GetPlayerState() in a player controller? I'm getting NULL in BeginPlay(), BeginPlayingState(), etc.
why doesn't my eos work? i think i "set" it up right
the multiplayer sessions work as long as i'm in the same network
After OnRep_PlayerState() and the playerstate is valid.
!!! didn't know that existed. thank you!!
Hi guys, I created a new project using the ThirdPersonTemplate and enabled Network Emulation with an Average profile, however this causes a noticeable jitter on character movement (quantization?) what could be the cause of this and how to ease it. Can a product like Smooth Movement help with this? Thanks!
When I move the object by applying force on it, I cannot replicate this, the client starts to vibrate. How should I replicate such a system?
I am using chaos
when I uncheck Replicate Physics to Autonomous Proxy my object start flying not going crazy
Anyone know why my player when being spawned into a lobby is not receiving input from the Enhanced Input please?
this is in the Lobby GameMode
this is in the base character that is spawned
The 8 Keyboard Event prints out "OK" and the "IS NOT VALID" print string does NOT print out so I can only assume that the Enhanced Input is attached to the character.
The 8 keyboard event is not coming through Enhanced Input. Start by looking at your Mapping Context (IMC_Default) and see if it is setup correctly. Keys pressed there should generate your IA_SomeCommand and you should see that as an event.
@severe bough I double checked the input default and its all populated with mappings.
Look here at the section Adding Input Listeners. You should be able to add one of the Enhanced Input Action events to your base character's event graph. Then you should see it when you press the matching key.
Ok thank you will do!
Hi, is it possible to get the array size of a replicated fast array ? I can get it with a replicated using function but i would like to have a single call function
hmm i got a weird issue
when im trying to show the "tooltip" on the client side it gives null error :/ ?
hmm anyone ?
Seems to me that it's not able to find the property you're trying to reference (yeah, obvious. I know).
Perhaps you could track where the property is supposed to be getting initialized
and see if it's happening on both the client and server sides?
And otherwise just add log reports every time it's otherwise supposed to be getting used. If you can find a point between two log reports where it suddenly stops behaving how you want it to, then you've narrowed the scope of the problem.
(But that's the best general advice I can give, since, as of yesterday, I couldn't even figure out that the text field for the text widget was a text box, and not an unresponsive check box.)
xD
well im creating the widgets inside another widget and asigning it ot a player contoller index that might be the issue tbh
Guys, should i use player state or player controller to store my player data?
I am making an offline game but i want to try to do the best practice
My play data include items, inventory, hp and mana
State persists for the level, while controller persists for the entire duration of the game
At least if I am correct
got any source though?
You could test it
Create a variable. Assign to state, and try to access it in the next level
But otherwise, no, I don't have a source.
fk it, i'll just put all code in player state until it bugged out then i'll fix
Honestly, a good response. Work hard, and fail quick.
Fail hard, and learn quick?
I certainly hope you learn quick if you fail hard
I need some advice.
I am trying to make a online game, the game part is easy enough. Shouldn't take too long. Its the online part thats killing me. I cannot get it done. I have learned most of the theory but there is a lot more for things like subsystems and just general application. And the slowing down is making me lose motivation. I thought to find a tutorial that will show me how to actually make a online server (+ master server for browsing servers). Is this the best way to continue?
Hey, is there a way to have an actor change "only relevant to owner", but not to be seen on the server ?
does the server ever know about the actor?
You can just spawn a non-replicated actor
I guess it shouldn't know, you are right. Thankyou
You should be able to just spawn the actor clientside and do whatever you want with it. Only client will know about it
I did a test, the actor is in the scene, not spawned. On the client does not appear, anyhow, if collision detected, the server sees it
So the solution was not check if has authority, but if is local controller.
Hi everyone, i start by saying that i never did replication and im trying to replicate the als turn in place but im getting a lil frustrated on this error. You may ask, why didnt you get directly the replicated als? thats because i only need this turn in place feature to work and i can make the other features myself without sticking to als functions and methods. i successfully replicated the method of rotating the player and capsule als use. The turn in place itself works fine in first person but then gets fucked up when trying to replicate it. It only happens when you are playing from a client, meanwhile from the server view it does not happen and you can see the other players performing the turn in place perfectly. I tryied printing a few values and even tho im not that sure i think that the problem may be the get the actor rotation, since the value im printing on the screen should reset to 0 every time i pass a certain treshold (in that clip its 50).
This is firing on the client, it says 'i see the rep notify'
but this bind to never fires
it binds and never prints 'see inv update' on the trigger
When I try to add Replicated to the UPROPERTY of a struct I get an error saying struct properties cannot be replicated, however I can mark a struct variable as replicated. In this second case, will the struct be replicated properly?
My example started to work when I put the bind event first. Why the hell would that be the case
what do you mean you mark a variable as replicated?
This code causes the compile error
`USTRUCT(BlueprintType)
struct FHEInteractPromptStateTeamOverride
{
GENERATED_BODY()
UPROPERTY(VisibleAnywhere, Replicated, Category = "Interact Prompt")
uint8 TeamID;
UPROPERTY(VisibleAnywhere, Replicated, Category = "Interact Prompt")
EHEInteractPromptState PromptState = EHEInteractPromptState::Hidden;
};`
but I am able to mark that struct itself as replicated in an actor, like so
UPROPERTY(VisibleAnywhere, Replicated, Category = "Interact Prompt") TArray<FHEInteractPromptStateTeamOverride> PromptStateTeamOverrides;
right, you need to replicate the instance of the struct
not the members of the struct
the struct is replicated as a whole
ok cool, so I guess then it just replicates all the UProperties?
yup
awesome, thanks!
there's a flag to ignore a specific property
but I dont recall what it is
but yeah, by default all UPROPERTIES of a struct are replicated
ah
UPROPERTY(NotReplicated)
float NotReplicatedProperty;
Hi everyone, I have a quick question. I noticed that UE original movement has huge data to replicate so the total amount of character you could have in a multiplayer game is very limited due to the network bandwidth.(Like 100 characters fighting, each character may have 12+ floats data per frame). Does any plugin that optimized the networking on this to support more character on the screen(I know something like GMC but not sure if it do this kind of thing)? Thanks.
How do I get the character controller in multiplayer? ive been trying for hours to make a client possess a random pawn when Tab is pressed with no luck 😦
tried all kind of things, this is what I have now...
guys someone help please
i am unable to login for some reason although i do see the brower epic confirmation
hey I'm developing the game OwnRules RPG for this I need a way for server operators to have the function to set a password, the number of players and a whitelist system. My question now is how do I create such a config file that can be adjusted by the operator at the end like e.g The server name or number of players or whitelist, maybe someone has an idea or perhaps a tutorial or documentation ?
The easiest way is to mark the variables as Config. Some of this stuff can probably go into the GameInstance. You can then add Config=MyConfig to the UCLASS of your GameInstance to get your own MyConfig.ini
If you want it more custom, then I would suggest simply using a Json File and having a matching struct for it which you can auto deserialize to via the JsonSerializer stuff
Thanks 🙂 Is there perhaps a tutorial on how to do this exactly or maybe example pictures that would help me a lot 🙂
It think the only wrong thing is the client rpc
The Json stuff can be googled. It's all c++ though in case that wasn't clear
BP would probably requires a plugin for the Json solution. No clue how to do the config stuff in BP. Doubt it's possible
Ultimately you also need to utilize all of those settings and for those you need at least custom sessions code, so advanced sessions plugin or c++
Okay, that helps me a lot, thank you very much. I'll google a little about how exactly you create this, which might also help who has the custom config plugin system. I'll take a look and then report back how it went in the next few weeks 🙂
Question, I hope that I'm finally learning or if it was just a fluke. When calling a server request (e.g. replicated server event > spawn an actor) it HAS to be called from a player controller or a pawn owned by a player controller? Or else nothing will happen if it's called from an actor without a PC? I just want to make sure I understand because it's driving me nuts learning it.
can anybody suggest a course or a book to learn how to make multiplayer in unreal? I know basic c++ and python
The pinned Compendium is probably a good start for bare knowledge
That's somewhat like a book
Yes and no
The point is kinda the PlayerController, but the actual term is Ownership
Ownership is something very important to understand. You already saw a table that contained entries like “Client-owned Actor”.
Ultimately it boils down to the Client owning the Actor you wish to perform the ServerRPC in.
Owning means that the Owner of the Actor (you might have seen the Pin on the SpawnActor node) is set to something that ultimately results in the PlayerController if you recursively call GetOwner on the Owner.
So your PlayerCharacter, if possessed, can also work as an Owner.
The Owner has to be set on the ServerSide and only one Client can own a given Actor at a time.
can anyone tell me why does my packaged game crash but works fine in standalone mode in editor?
Thanks for the explanation and the link. I'll still muck around with it and try the whole ownership thing instead of having the actor requiring a PC ref to do the spawn command. I thought I was getting there but I think I was wrong haha
Hm, haven'ts een that one yet. Seems to crash when loading the default object of something
I would suggest attaching Visual Studio to it if you have any C++ experience
it is a bp project
That is pretty unfortunate
and it works fine in editor
Did this start recently?
like i run standalone instances and it works fine
but when i package game doesn't even start
There is something with steamAPI in the callstack
Does the same happen if you disable EOS?
Just to get somewhat of an idea where this comes from
Yeah it's just for figuring out what is missing
I mean, it does somewhat look like it tries to grab steam api dlls
Not sure why
But you can try putting the steamapi dlls into the binaries folder of your packaged game
Just for funs
And see if that helps
C:\UE\UE_5.3\Engine\Binaries\ThirdParty\Steamworks\Steamv153\Win64
advanced steam sessions plugin is enabled for some reason idk if that's a pre requisite to have advanced session plugin
?
My random guess is, since I see load helper and steam api dll, that ittries to load the dll and fails or so
The path I posted, mine has 5.3 and the steamv153 might be different if you use a different version
But the rest of the path should be similar
There is the dll in there
You can try copy pasting that into your packaged binaries win64 folder
But disabling steam requirements is probably the better solution
ok before i try that i'll try disabling steam plugin
That's all I can suggest atm. I also gotta leave now, got an appointment in 20 minutes.
Feel free to ping me if anything changed on the issue and I will read it once I have time
thanks man i've been beating my head around from two days hoping someone would respond

(fyi:
actually means that you suggested a solution and the person asking for help simply ignored your solution and started trying other things)
(at least iirc)
oh
Dieter is a user that got ignored so often in the past, he got his own emoji
now to test if the multiplayer works from different networks
i'll probably need to re- enable that plugin to implement crossplay
😩
OMG it works thanks soo much @thin stratus
i'll probably not mess with cross play for now
This is literally going to save my life haha. I was getting so frustrated yesterday with the whole spawning actors and why it wouldn't work, all I had to do was simply set the Owner on actor spawn.
Isn’t it as simple as disabling steam support / plugin if it’s not being used? Like in plugins / subsystems? Edit: ahh seem it was already suggested.
ok so my first conundrum is i want to swap player pawns. (i don't have 2 player start objects and i don't know how both the players are spawing using the same player start in the default third person template map)
- how do i spawn the second player(more importantly how do i identify the second player) in a certain spot with a certain pawn
My method of spawning was done in game mode on OnPostLogin, added the controllers into an array all players were added to the game and then looping through each controller for their selected pawn, spawned it on server and then possessed it with the controller.
There is probably a whole bunch of different ways to do it.
hmm.. i login in menu widget and once the session is created the map is opened. so can i write the event functionality in the level to add players? but that's not where i login so idk it doesn't make sense to me
also the game modes are weird. i was following a tutorial which made a new game mode for the main menu level. and used it through level override. same happens with the tpp template into third person player game mode
So when you select the session you want to join, it will call a OnPostLogin when joining, you can handle all the "initial" setup of the controllers there on the server.
I have 3 game modes, MainMenu, Lobby and MainGame.
and where does it happen for the server host?
i only have 2 players btw
The host of the server calls the OnPostLogin call too.
Want to jump into a chat? Might be easier to say it than to type it 
uhh i'm currently in a class 💀
All good 😂
Class and working on a game? I love it.
yeah i have to show my progress by next class
and although i am satisfied with my current progress my faculty is kind of a jerk so he might not be
so i want to atleast get the swapping work
So, host creates the session, it will open the level that you have selected to open, which will run the Gamemode set for that level. When the host or another client joins, the OnPostLogin function will be called. You can Spawn Actor From Class and then add Possess with that controller that recently joined the session.
so i'm assuming you want me to store the controllers into array and pass it on
Yea, I think it's best practice to store them into an array. I stored them into one because I want all the players to join the game before it spawns anyone.
also i don't know how the tpp bp does it i'm assuming it does it through cpp(the spawning and possessing the pawn)
weird i don't have OnPostLogin in the scope of the main menu widget
It'll only be in GameMode
oh
You can create another GameMode and have it run only on that specific level.
so how do i pass it onto the next game mode?
I assume you want to take variables with you to the other level?
i mean i do have the menu game mode specifically for menu
just the context of identifying which player is which
i just need to identify if the current player is player 1 or player 0
I don't know the proper way to actually carry variables over, so I just created a Game Instance which stores the username and selected class then call it from the GameMode for each controller.
i feel like this shouldn't be that hard
let me ask this.
since i'm opening a level(thirdpersonmap) would the postlogin be called there or would it be called in the menu level where the host/join buttons call the session create/ join nodes
because both exist in different levels with different game mode overrides
It will be called on both.
that should make it easier then
You're opening a new level, so it's a new game mode, so when the controller goes through servertravel from the ExecuteConsoleCommand from the host, OnPostLogin gets called for each controller that connects again.
Everytime someone joins, post gets called.
So, host opens a sessions, which opens a new level. Players can join and then you can store their selections or choice or anything that they do within that level through a Game Instance (probably not the correct way, I think you should Player States or something like that)
You can test it and see if it works.
the game mode somehow by default has the pawn to thirdpersonbp
i need to change that just for 1
just remove it, have none if you want.
if i do that i have to also do it for 0 then right?
I have no pawns in menu/lobby levels.
Nobody will have a pawn if GameMode default pawn = none
because on my game you can select which class you are, I set it to default = none and called the spawn request on the server for the players selected class.
You do a server call Spawn Actor From Class and then you Possess it with the player controller
It's a server call so it gets replicated to all the clients connected.
werid i don't see anything in details panel
Also, make sure the Pawn has Replicates to true
For what?
https://github.com/TheFiftGuy/Rollback-Networking-Shooter does anybody tried this rollback implementation in unreal 5?
i need to somehow get the reference for the player start in game mode
and also posession
By reference you mean their class choice?
I didn't figure it out so I just did a Cast to the "parent" bp I'm using. You can always pull from the return value and cast to pawn to get the Possess
player start object that's in the map
i need to get it's reference to get the spawn transform
I did BeginPlay > Get All Actors Of Class and put them in an array and looped through it for each controller so only 1 would spawn on each
BUT I think OnPostLogin gets called before the BeginPlay event.
looks good?
and this is what i did i duplicated the third person player for now and changed one of the material
called it second player
it didn't work
@frail temple ok my class ended
and i have like 15-20 mins for before my next class if you want to do that vc again
@frozen moat sorry I was in a game of LoL and afk. I'll be available a bit later if you still need help
They will spawn on top of each other here.
Get actor of class
Hey does anyone know why the movement becomes all jittery when changing the max walk speed at runtime? this happens only in client server and not in standalone but it happens both if i run the "set" code on the client and on the server
Don't you just need to set it up on the Server? Begin Play > Custom Event (CL) > Custom Event (SR) Set Max MS? Or I could be wrong
You need to predict the changes by changing it locally, then server changes it, replicate to client to update again.
Or to start, you can do the latter portion first
Only server changes, replicates the variable to client, using onrep to set speed on client
jee this actually worked..
thanks! I wasted too many hours on this
Most prediction kinda goes by the same rule, update it first, server updates too, then replicate to update again.
Not really a multiplayer expert, but i understood it that way.
I certainly hope its correct 😅
fair enough ahah
Hello everyone, i wanted to ask something. How can i replicate the get actor rotation node? Because ive been trying but im not getting any result. Would be glad if someone can give me any tips or suggestions on how to do it.
hellow there, having problem with the leaving lobby system, when i leave the lobby as a normal player, i cant rejoin the lobby
the session was found but can not join the session
question, wondering if its performant in a multiplayer RTS to use actor components to keep track of which unit belongs to which team?
If you think performance is going to be an issue, you want to look at MassEntity.
I mean eventually I'd want to. But for now just trying to learn UE game framework before I deep dive into more specialized systems
Hey guys question what would be the best way of blocking players to join if game is “on”? (Listen server)?
Then I would probably make a base class for all the units that contained common info such as team that all units need, and then use subclasses for the individual unit types. Actor components are best use for adding functionality that only some actors will need. For example, if some units have weapons and others have an inventory to carry things, you could use actor components for each.
Hello guys! Does anyone encountered the problem that some components are not loaded on clients on time (In Lyra they added dynamically btw)? For example, server knows about first person mesh comp I've created for Lyra Hero, but client still has it as nullptr. I cannot operate on those comps nor on BeginPlay(), neither on other events which I fired recently after BeginPlay(). If I do my stuff after, for instance, 0.5s - this will work. Any ideas how to solve that issue?
Hi, I am encountering a very annoying but where whenever I try to send my player transforms (motrion controller data, player data, and camera data), the skeletal mesh becomes super laggy even though the transforms are sending smoothly.
However, this ONLY happens when I have either physical animation or physics control applied to my skeletal mesh. Any ideas how to fix this?
I would set up some error handling checking if the componts are just a nullptr or not and only run the code if they arent nullptrs, and the event begin play will fire once the client is fully loaded in. If this doesn't solve your issue, use the event logged in/connected (i forget what its called its eomthing along those lines) instead of begin play.
Oh, that's a pretty good idea to make an error handler! Thanks, I'll try this one
yes no problem
Postlogin in gm, or possess in pawn /playercontroller
Hi!
does anyone know if TSets and TMap are still not replicated?
It has been made pretty clear that TMap shouldn't be replicated and that it would be a bad thing thus it won't happen
Hi there
Um im having a Problem with the server Traveller or not
everytime when I start the match in a lobby with friends blabla
i have to hold left click to look around
walking etc works normally but I have to hold left mousclick to look around
Mb
It is likely that you have caused the UI to retain focus.
Oh okay
It works only when I start the level (Startmap) I can look around normally etc. but in the lobby and start the lobby and teleported to startmap, can’t look around, works only when hold left mouseclick
@unique forge As I said its not likely anything to do with travelling, you should ask in #ue5-general
Is it possible to essentially stop clients from practically shuffling a net serialized array? Anytime I remove an item from the array on the server the clients just completely unorganizes everything.
Ex: if I remove index 3 on the server, what was index 4 for clients can possibly become index 0
It's super weird
Like just become the new index 3 bro
I appreciate any help.I created a third person template (C++) however when enabling network emulation with an average profile I am noticing a heavy stutter, I mean, it makes a very unpleasant gaming experience with a 'real-world' lag setting. So is this normal CMC operation? If so, could you point me to some solutions? Thanks!
worth noting the same behaviour occurs when using Clumsy to simulate real-world network operations.
Hey guys. On BeginPlay I have my actor spawn a fireball on a looped timer. My client's seem to be out of sync with the server's spawning of these fireballs - how can I sync this? Is it just an editor thing, as the client starts its own window, or is it an actual initialization issue?
during replay playback, is the replay system supposed to 'resend' the same packets the server originally sent out?
Any idea why this happens? T
[2023.10.08-01.30.12:826][610]LogSockets: Warning: Tried to bind address with protocol STEAM to a socket with protocol IPv4
[2023.10.08-01.30.12:826][610]LogNet: Warning: Could not create socket for bind address 76561197984884899, got error SteamSockets: binding to port 7777 failed (0)
[2023.10.08-01.30.12:826][610]LogNet: Warning: Encountered an error while creating sockets for the bind addresses.
[2023.10.08-01.30.12:826][610]LogNet: Error: InitBindSockets failed:
[2023.10.08-01.30.12:826][610]LogNet: Warning: Failed to init net driver ListenURL: /Game/Scavenger/Maps/DevMap?listen:
[2023.10.08-01.30.12:826][610]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = NetDriverListenFailure, ErrorString = , Driver = GameNetDriver IpNetDriver_0
[2023.10.08-01.30.12:826][610]LogNet: Warning: Network Failure: GameNetDriver[NetDriverListenFailure]:
[2023.10.08-01.30.12:826][610]LogNet: NetworkFailure: NetDriverListenFailure, Error: ''
[2023.10.08-01.30.12:826][610]LogWorld: Failed to listen:
[2023.10.08-01.30.12:826][610]LogNet: DestroyNamedNetDriver IpNetDriver_0 [GameNetDriver]
[2023.10.08-01.30.12:826][610]LogNet: Error: LoadMap: failed to Listen(/Game/Scavenger/Maps/DevMap?listen)
(the first warning is repeated dozens of times)
ok I think I fixed it, I enabled SteamSockets, and changed my net driver to:
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="/Script/SteamSockets.SteamNetSocketsNetDriver")
why does this only work for the first client?
i dont have the events replicated
(ping me pls)
Array order is not guaranteed in any way.
You should not be relying on the indexes that elements exist in to be in order.
If you need that, then you will need to setup some mechanism to identify their order separately.
You should be setting the "fireball" to be replicated and only run the timer on the Server. This will "sync" to the Clients so they see the same thing.
Right so I get that but I'm afraid to loop through an array everytime I need to "get" something. Like what if I had an array with 1000 entries and I looped through the entire thing. Could c++ handle this efficiently? Maybe I am overthinking the costs
I could just profile it but I am for some reason convinced it will be an expensive process
1000 elements is nothing
If you had 1m elements, then maybe you need a different solution.
Okay so I am way overthinking it
Oh wow
I mean blueprint looping 1,000 times seems scary to me
Maybe I am severely underestimating c++ capabilities
You are
anyone?
Your 2nd image is far to small to even read.
so what do you suggest?
The GameState has a list of all Players that are accessible to everyone.
Use that instead
how do i use that to get a player controller?
You dont. PlayerControllers only exist on the Server and for the local Player.
The PlayerState exists to represent other Players to each other
You need to read the Network Compendium in the pinned messages.
i see
that makes sense
so is there another node i could use to replace the set view with target blend?
@fossil spoke ?
No there isnt. You likely need to rethink your approach
agh
i hate to ask but do you have any ideas?
ive been confused for like 2 days..
@fossil spoke ?
also if it would help you can ask any questions about what i have set up here
Anyone?
Is there a way to avoid lag spikes in a team death match? Happens when players respawn..
Sounds like a perf issue. You need to use the profiling tools
Hello, I am developing a racing game and I would like to get your opinion on my approach to networking. My vehicle works with physics, the first thing that comes to my mind is to send values such as speed to the server with ServerRPCs and apply the necessary forces within the tick. I wonder if this approach is correct. Is this how racing games in the industry work?
This is normal. You need to learn and implement lag compensation techniques.
To prevent cheating, the server must control speed and other parameters.
Would it be more logical to change the values that move the vehicle with serverrpc or to mark them as replicated and send them to the server?
Replication does not work from client to server. Only from server to clients. Server RPC is only option.
I see, thanks
Is there a short cut in unreal for make client side prediction?
So I can compensate a portion of lag
Only if there is already some implementation in existing movement components. But it's probably just interpolation. Basically you need to implement this yourself.
Thanks a lot
Hi, thanks for your reply. The thing is, I have not added a single line of code, all movement is default replicated by CMC so this should be handled by built-in replication CMC has, can this be due some project network configurations? I mean, after all CMC has client prediction and reconciliation built in, right?
There is only interpolation. Something more complex needs to be implemented independently.
I see, thanks. Could point me to some info about it, that would be greatly appreciated!
Some "creating multiplayer shooter" courses may contain lag compensation techniques.
Err... I just read up. You're getting incorrect information. CMC works out of the box and with network emulation or clumsy too
You definitely don't want to implement lag compensation in CMC, because it already has it, you'd just be breaking it
Hi Vaei, thats what I though : /
mmm, could this slightly desync caused when network simulation enabled be related to default settings? I watched a video about fixing rubber banding
Can you show your lag compensation settings
default values, using Average and Bad profiles with ue 5.3.1
These are mine
I don't know the default values or 5.3 sorry
Do the default values have any packet loss
Remove it, packet loss isn't part of a normal simulation
It does occur when something goes wrong, so you do need to use it sometimes to make sure corrections are being handled properly, but for regular testing it should be off
Any time you lose a packet it should desync, its specifically what you want to happen
Yeah that's basically simulating a faulty connection
Which is worth doing, on rare occassion, not each time 😄
ah so the desync is expected to happend 🙂
Yes when packets are lost the inevitable result is something goes out of sync and then its corrected
You mean movement interpolation. I mean more complex techniques like client side prediction.
thank a lot for help, it was driving me crazy hehe
Also because you have 100-200 on both incoming and outgoing you're going to get closer to 200-400ms latency
No I do not mean movement interpolation
CMC has client-side prediction built-in
yes, I was trying to 'test' maximus
and reconciliation, causing the location pop when needed right?
For autonomous proxy maybe, not for simulated proxy.
OK?
thanks for help, I appreciate it!
Why the user widget isn't displayed in the client ?
Inside the ConstructUI the function ConstructIngameHUD exists.
Use Add to Viewport on the widget
I do call add to view port after that function.
It shows on the server but not on the client
If this is on BeginPlay, then that's too early to call isLocallyControlled
The client may/will return false, cause the Pawn/Character isn't actively possessed yet
In Multiplayer you always have to use Events that make it absolutely clear that you have everything available/setup that yo uneed to perform your code.
So here it's better to use an Event that calls when the Pawn is actually possessed.
PossessedBy would come to mind, but that's ServerOnly.
Next alternative would be an OnRep_Controller, but that's C++ only (and wouldn't call for the Server).
For BPs you can use OnControlledChanged, which calls for Server and Local Client, so there you can do IsLocallyController and do your UI stuff.
hey guys question
so im using this code to join the listen server
is there a way to get information from the server before joining ?
to check for a bool inside the game mode for example
@velvet jacinth
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
TryTestCharacterReady();
}
void AMyCharacter::OnRep_PlayerState()
{
Super::OnRep_PlayerState();
TryTestCharacterReady();
}
void AMyCharacter::OnRep_Controller()
{
Super::OnRep_Controller();
TryTestCharacterReady();
}
void AMyCharacter::PossessedBy(AController* NewController)
{
Super::PossessedBy(NewController);
TryTestCharacterReady();
}
void AMyCharacter::TryTestCharacterReady()
{
if (bIsCharacterReady)
{
return;
}
if (!GetController() && GetLocalRole() > ROLE_SimulatedProxy)
{
// Warning: This means that characters that don't have controllers can never be made ready
return;
}
if (!GetPlayerState())
{
// If we are possessed by AIController and don't want a PlayerState, then we're ready
if (!GetController<AAIController>() || GetController<AAIController>()->bWantsPlayerState)
{
return;
}
}
OnCharacterReady();
}
void AMyCharacter::OnCharacterReady()
{
if (bIsCharacterReady)
{
return;
}
bIsCharacterReady = true;
if (OnCharacterReadyDelegate.IsBound())
{
OnCharacterReadyDelegate.Broadcast();
}
K2_OnCharacterReady();
}
@queen escarp sorry I just scrolled your question off, didn't mean to
x) np
Cedric Neukrichen probably know this im reading about his suggestion thath once u joined then use the post login function to dissconect and that was my first though however would be nice to get info even before joining but that might not be possible
Yeah that's why we have a plugin with BP extensions
Also have a Widget that does something similar
Its not my strong suit but I imagine that joining forms the prerequisite connection
Cause there are Games where the Character gets destroyed and has to be relinked to the Widget
Honestly it irks me that Epic haven't added a solution 😄
Doesn't have to be elaborate, but just something simple like... what I posted
cause their original stance on this stuff is: You all have the ability to add this yourself and release a plugin.
Gosh, those poor new users
Best example: AdvancedSessions
Probably, but not really straight forward or event possible in BPs
The only two native things you can use are Sessions, where your boolean is a SessionSetting.
Or the whole nightmare setup that Beacons are (C++) to connect to the Server beforehand, without actively joining it.
aye i figured,
so i guess ill use your dirty suggestion then
thats how i imagained it first also tbh easy fix
( for now =
Yus
Not to my knowledge
PlayerState has ping
I think they meant actively ping the Player by IP
Ah
But maybe I read too much into it
I only do gameplay multiplayer 🤣
That's also the sanest thing to do
I've never been called that before 
hmm
am i missing something, when another player in game game dose something im switching the bool "game started" on the game mode
You can't use the delay like that
and if i new player joins and the bool is true do >
It's easy to forget but as soon as you delay even by a frame, the input of your PostLogin is not guaranteed to be the same anymore
If two players join close to each other you would already have an issue
oh ok well the delay was just a test i removed it dident use it*
Why is that boolean marked as replicated :D
but is the event on post login happening before game mode ? no that cant be the case since it always running `?
idnno * since its only held on the server 🙂
altho it dose nothing if replicated right ?
if its only on the game mode
just uncessary
oh right
oh right yeah that was the problem 😛
sec
lol im not chaning it anywhere-.-
dumb
aye so that works
Hey, do you know how many units Unreal can handle (on and off screen) for a rts multiplayer game using the Actor framework (and not ECS) ? I guess there is a lot of factors to take into account, but I just need a gross estimation to know if I should move to ECS right now. The game would be of the unit number scale of age of empire or starcraft.
I've read about 1000 actors? Take that # with a grain of salt though. Your mileage may vary.
We are talking about actors on screen or on the whole map?
I don't know honestly. I'm pretty new to multiplayer programming in UE. Maybe someone else can respond who is more knowledgeable.
Depends on how you do the networking as well. But UE's networking isn't really built for this.
Definitely don't use Characters
Won't get SC levels of units with that class.
So Pawns are out of the question then? 😄
In that case, You would recommend using their experimental ECS framework ?
It has no networking support really. So it depends on how much you're willing to do
Pawns may be fine. Pawn is just an actor with controller functionality. It doesn't come with the CharacterMovementComponent
But you wouldn't need Pawn in an RTS for the units anyway
What would you recommend?
Just regular ol' actor
ah ok
If you're trying to stay in the Actor framework that is
Thanks Durox.
yeah thanks
Nic you could use the replication graph system to get more mileage out of your game. That's mainly for networking purposes and dealing with large amount of actors in a multiplayer game. ECS is probably good if you dont want to do multiplayer games.
Taking a look, thanks. Also saw this guy: https://www.reddit.com/r/unrealengine/comments/pr77su/100k_units_in_multiplayer/ but the amount of work to get there seems not doable with 2h a day after work xD
Yeah I agree, prolly not doable in 2 hours of work :D. If your goal is to ship something in the same year you start development I'd say good luck. (it's super sick though)
Yeah my point exactly, would make sense if I was fulltime on it but meh. Also considering Unity ECS framework at this point
@thin stratus So after many days of testing and also after you asking me if I tested without PlayFAB and EOS it seems i get spawned without a valid pawn. Some times after a few rounds, and sometimes after an hour of testing
Yeah - GB has built his own tech for this. Definitely outside of the scope of someone who can only do 2h a day
Not to mention, it requires a pretty deep knowledge of some fairly low level stuff
Extremely low level
Did openCL at college and custom rendering engine, was not the easiest courses haha
That is probably extremely lightweight compared to what GB has done
So lightweight that I wouldn't be surprised if it is about as equivalent as having never done it at all.
(Obviously you don't need to be as extreme as GB though)
I did my fair share of doing stuff from scratch, that's why I decide to use a framework for once, and I am here on unreal, being limited by the technology x) So yeah, I will not going into the cuda/directX etc path. I will try to figure something out with what unreal offers.
What do you think about a "squad" system like dawn of war did. Maybe there is a way to create a "squad" character actor which is lightweight on the replication, and do the singular units processing on the client ? Downside would be all clients wont see the exact same things (like the positioning of singular units on the squat would be determined by the clients)?
For large unit numbers, stay far away from the Character class
The CMC is going to be too heavy
What does CMC stand for?
Having multiple "units" be represented by one actor is a common trick devs use though.
But still, do not use character for a game with large amounts of unit counts
I'm calling this function on tick.
I created a custom function to control the rotation on the character and unchecked in the character blueprint - UseControlRotation, Orient etc... The player controller doesn't control any rotation.
The client rotate perfectly and I can see it on the server side.
But when the server moves his YAW locked and he doesn't rotate in the direction of the movement.
I just can't figure out what's the problem here.
I see, thanks for your answers, I will try the squad system without the character class
Was wondering if I could get some input on this idea for keeping track of ownership of units in an RTS?
I was going to have a team actor component attached to all my actors. This would have a unique ID and their team on this component.
In gamestate:
I would have map mapping all unique ID's to their team. So if I needed to update anything with regards to ownership of an actor.. like an actor dies then just delete them from this map in gamestate.
Any thoughts? Does this seem reasonable?
Now that I type this out I'd need an easy way to grab the component and update the it..
I just started playing around with Unreal 3 weeks ago. How would you go about implementing shared screen multiplayer with (mostly) turnbased mechanics?
The way I understand it, it would be best for every physical player to get an instance of a playercontroller which all control an instance of a pawn, which then would get input only when its their turn. All the pawns would then somehow share the same camera.
Also I want the players to be able to move small units around, but I think those wouln't have to be pawns right?
(sorry for the basic questions, there are still a lot of things that I didn't fully understand)
Anything i nthe logs?
Well the logs just show the msg
[2023.10.08-14.23.28:844][324]LogNetTraffic: Error: UActorChannel::ProcessBunch: New actor channel received non-open packet. bOpen: 0, bClose: 0, bReliable: 0, bPartial: 0, bPartialInitial: 0, bPartialFinal: 0, ChName: Actor, ChIndex: 11, Closing: 0, OpenedLocally: 0, OpenAcked: 1, NetGUID: 0 [2023.10.08-14.23.28:961][333]LogNetTraffic: Error: UActorChannel::ProcessBunch: New actor channel received non-open packet. bOpen: 0, bClose: 0, bReliable: 0, bPartial: 0, bPartialInitial: 0, bPartialFinal: 0, ChName: Actor, ChIndex: 11, Closing: 0, OpenedLocally: 0, OpenAcked: 1, NetGUID: 0
and keeps giving the error. If I recconect to the server I can play again.
The issue is:
[2023.10.08-14.38.03:354][493]LogBlueprintUserMessages: [B_Crowbar_LyraPlayerController_C_0] Player Pawn: Not Valid
I think? As I don't have a valid pawn assigned I can't play? We do have a valid Controller, PlayerState and UniqueNetId (just for loggin)
I just don't undertand why it's happeing so random? It's just the Lyra Sample Game, No default assets change or anything.
Hey guys. Is there a way to manage all the sessions running? I am new to multiple-player stuff and I think the system UE5 offered is so weird. How can I debug for the dedicated server part?
I want a way to controll all the player controllers and build a kind of subsystem to deal with these controllers, so I can controll all the players more freely, like assign them to specific session or something else.
Anyone can give me a hint on this? Thank you very much
so im having some issues trying to figure out how to replicate this item picking up feature, any ideas?
nevermind i figured it out, if anyone wants to see the results just let me know i can share :)\
Created an inventory system base on an array of UDataAsset that I inherited in c++
I then populate the inventory array with empty slots calling with an event on server.
Why the inventory doesn't load on the client and only on the server?
Why not just use the built in orient rotation to velocity?
It's very clunky. Orient the character fast and he's start to misunderstand him self.
Using this approach I can just rotate the character to the mouse location and have a much smoother rotation.
Is there a way to replicate an actor for a short amount of time (like after a trigger)
(in blueprint)
oh god my replay playback is so broken
i really kind of expected it to work seeing as normal gameplay works
and i figured 'it'll just be as if im controlling another pawn while every other actor will be a simulated proxy and the packets sent from the server will replay'
but barely anything works :((
Hey, using the OnlineSessionSettings in my join function, I'm trying to use the Get method to get settings defined in the create session function.
FName Value;
result.Session.SessionSettings.Get("MatchType", Value);
But can't compile and have this error:
unresolved external symbol "public: bool __cdecl FOnlineSessionSettings::Get<class FName>(class FName,class FName &)const " (??$Get@VFName@@@FOnlineSessionSettings@@QEBA_NVFName@@AEAV1@@Z) referenced in function "public: void __cdecl UEVMultiplayerSessionsSubsystem::JoinsSession(class FOnlineSessionSearchResult const &)" (?JoinsSession@UEVMultiplayerSessionsSubsystem@@QEAAXAEBVFOnlineSessionSearchResult@@@Z)
@grave lynx Did you forget a module dependency in your Build.cs?
yup "OnlineSubsystem"
class ONLINESUBSYSTEM_API FOnlineSearchSettings
I mean no x) I don't think so
I have a game that allows clients to draw a sketch and it shows up on the screens of other players
I'm using a texture render target to do the drawing, but now I need to RPC that around so the other users have access to it
I'm getting LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: TextureRenderTarget2D /Engine/Transient.TextureRenderTarget2D_2 NOT Supported which I assume means that I can't send a render target in an RPC
is there another way I can get that information across the network?
You will have to explain a bit what you mean
Probably only 2 options:
- Send the data needed to recreate the drawing instead of the drawing and draw the image again on the other Player
- Turn things into a Texture2D, serialize it and send it like that and then deserialize it back to a Texture2D object on the other Player. That's C++ though and also more a "This should work." Idea. Can't give you more on that. Might be that there is a similar way.
Awesome, will look into these. It’s a single color so I think serializing into a bit vector makes the most sense. Thank you!!
uint8 array yeah
Pretty sure the texture type already has something for that but it's mostly an idea cause I haven't actively done that yet
Quick question. When an actor becomes net relevant again, is there any way to trigger blueprint logic at this point?
On the client it became relevant for?
If so: BeginPlay() gets called again once it spawns from replication
Thanks!
Question,
I'm calling an event called DropItem on server, first checking if has authority, if does then calling the actual drop item function.
This logic doesn't work on the client side only the server.
But, if I do not replicated the DropItem event, it works perfect on both of them.
Is it that problematic to not use event replication? without using also the has authority ?
You only wanna drop items on the server
And then replicate the fact the player doesn't have the item to the client
But the client never have authority
This too doesn't work. only the server drops the item
Also, When I do not replicated any event (when it works) I'm calling get owner (in the inventory component) to get the actor location.
Then the client drops at the server location and the server drops at the client location 🤔
When setting a text in the inventory widget, using GetOwningPlayer it prints for both the same player controller.
Although that GetOwningPlayerPawn shows 2 different player pawns.
You can only call server RPCs in an actor you have ownership of (generally player controller and your possessed pawn)
@velvet jacinth
Includes components of said actors
You also probably don't wanna be using a multicast rpc to drop on everyone
This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.
this is a good read
Where can i find
bShouldUpdateReplicatedPing ??
cant find it anywher not of google either
PlayerState
yeah should be in class defaults
what version are you on?
5.1
Should definitely be there
You need to make a custom Player State too
you set the type of Player State to use in your Gamemode
Indeed a good read thanks for that!
So just to clearify, If I would print the GetPlayerController from the begin play on the player pawn, it will print the same PlayerController instance for the client and the server (?)
Client: PlayerController_C_0
Server: PlayerController_C_0
I think so but do try it out
cant a widget get a referense to game mode 😮 ?
The gamemode only exists on the server, not clients.
And widgets, unless you're on a listen server (a player is also the server) or standalone, are client only
im on listen
asye
aye but still
if the widget is owned by a client
then that widget shuld be able to get a reff to the gamemode via him right O.o
also why is this failing :/
on event post login im adding to "all player contrller" array annd then looping casting from those controllers to the player Bp
i dont get it 😮
You aren't really sharing enough to help you
i mean all im trying to do is to cast to all players controller from withing the controller i get a reff to the player and do stuff
What is the goal here anyway?
well
And what does UpdateHeroFriends do
That looks really wrong
well im kinda hooking up an old system but
ok so each unit frame is a widget and the widget updates all stats based on the player chracter index
and that im doing when updating friends basicly is setting the index and check how many frames should be seen*
but its breaking from the Gamemode first instance
You should not use the PostLogin event to update UI.
For one you can't even make sure the Character is valid at that point, and on the other side, you would need to ClientRPC to even get the UI.
why not post login ?*
Why would you use PostLogin? (:
too early
how else would i detect when player joining/leaving
Well you seem to think that PostLogin is the right choice
lawl
That Index is not for online Multiplayer
so update friends calls this initializing
oh
This will not include characters of remote clients
....-.-
that make sense
Well, either way, you shouldn't use PostLogin to begin with
If you need Characters to be valid, use Characters BeginPlay
Just do it on BeginPlay of the Character, that'll ensure at least 1 character is around
true