#multiplayer
1 messages Β· Page 26 of 1
Everyone asks for youtube videos.
π¦
The guy that asked for a video tutorial on how to use c++ the other week.
Humanity is doomed.
You didn't link him the "Learn cpp in one hour" video?
I did not.
Ok but hear me out, books are annoying.
Should link the comic, though.
I don't want to order some 40 year old book to learn a programming language.
the 31 hour video is better
Learn modern C++ 20 programming in this comprehensive course.
π» Source code: https://github.com/rutura/The-C-20-Masterclass-Source-Code
βοΈ Course developed by Daniel Gakwaya. Check out his YouTube channel: https://www.youtube.com/channel/UCUYUFiuJ5XZ3JYtbq5dXRKQ
π¦ Twitter: https://twitter.com/learnqtguide
π Want more from Daniel? https://www.l...
They are not.
Now this seems legit.
If you're comfy with Unreal already, just make a BPFunctionLibrary and make a small function there to learn the ropes.
I mean at least learn the basics of the syntax but it's not hard until you get in the weeds.
π
Like sure, I get certain complex stuff might only be available that way. But I really don't find some book I have no idea about if it will be good for 40 bucks on Amazon not really accessible. If being paid is the option there are different ways to get money from something. I can't even imagine most of the money goes towards those authors anyway honestly.
And it's the best 
At least from the writer POV
Updating a video/book is a pain in the arse
Just sell it as a new version and make more money π―
The FIFA/COD strategy.
Even better. The unity way.
Just put ads, duh
Hey Wizard, can I send you a DM for a few questions?
Of course. DMs are open for friends
Books are ass for programming, just look at examples and maybe do a super simple intro course for C++ online (NOT UNREAL).
You just gotta kinda Do the Thing and then you'll get better. It took me like 3 days to implement a function library, now I'm pretty comfy in C++.
I still wouldn't try to do any real asset oriented stuff in C++ but I feel pretty good with Subsystems and core systems stuff.
I think it really depends on the book, and particularly on the quantity and quality of its exercises.
Stroustrup's PPP2 is a really good book for learning C++.
Also I'm super against using videos but The Cherno is great for explainign the actual usages and theory, not just playing Code-Along
Im trying to do a steam call in the server (that i have sucessfully done in the client)
its just a ping the server thing so that steam returns a server ID
is there anything that the client does automaticly that the server doesnt? i had to call "SteamAPI_Init();" in the server
so i was wondering if any 1 knows of any other function that needs to be called so that i can get a response in the server
found it, had to call "SteamAPI_RunCallbacks();"
it seems that in the client this is done for you, in the server you have to call it yourself, calling it in the tick function did the trick
Are we allowed to ask questions in here?
Yes.
That's a question so I guess you are getting b&
shoot i wasnt really trying to. It looked like people were just discussing in here so I didnt know if there were actual channels for asking troubleshooting questions
Ye I was just kidding. Ask away
Was going to ask if anyone had any good resources for learning multiplayer in UE. ive been working on it for a few days and its just not really clicking
been having a lot of trouble knowing when to tell the server what to do and when to do it
Check the compendium in pins
Only 100 pages
thanks!
Hey, most tutorials say you need the source code version of UE5 to have your game on a Dedicated Server, is that still the case, or does the epic games version have it now, as I dont wanna take the time and switch to it if I dont need to
still required
got it, thx, can I finish my project on Epic, and later on switch to sourse code version to export it?
or better to switch now
should work, but I'd recommend switching as early as possible if you plan to use it later to prevent and issues that may come up
makes sense, what is the best tutorial you can suggest please for UE5 to make it multiplayer on a dedicated server, would really appreciate it, most of them are old from EU4
the official docs should work for UE5 from what I can remember. the basics are straight forward and covered there
thx for your help 
There is no large differences between 4 to 5. Some minor implementation changes. And there is no real difference when creating a game for a dedicated server versus a listenserver. Your netcode is mostly the same disregarding some server specific optimizations you won't do until probably much later into development when you have test cases to work with.
As a general example, I usually point to ARK:SE since it uses singleplayer, listenserver and dedicated all in the same game with basically no real differences except that in Listenserver mode your clients are forced to stay near the host to not run too many actors on the listenserver machine.
Hey. Is there any order between sending RPCs and property replication? If I call rpc and set value to replicated property next line, may I assume that RPCs would be called first on a client and than property will be set? Or it isn't guaranteed?
No guarantee. That's a race
Thx
how can use a delay in multilayer so all players, the server, and clients have exactly the same delay? I want to use it for when a player is down on the ground because of damage and if anyone dont revive him, after some seconds he will die
I know there is a delayed time ,when things sent from client to server and back again to clients
how can calculate it?
Depends on your goals
If you want all players to have a consistent perception of that delay, you can make it client-based : have the client use a purely local timer starting from when the info replicate, and then on server, allow that delay + the ping time
Obviously that makes the revive time larger from he dead's POV
If you want the dead's perception of the delay to be consistent instead, replicate the final revive timestamp instead, based on a shared time
Can't have both
Alright , thanks
FWIW I would have the reviver's perception be constant, both easier and imho a better feel since they're the one acting
Will the built-in APlayerController::ToggleSpeaking() do for a bog-standard voice chat solution to enable (up to 20) players on a dedicated server (hosted by GameLift) to speak to each other? What advantages does EOS Voice bring?
I don't need any waiting lobby voice functionality, literally just the ability for people to speak to each other in-game.
Yo anyone know anything about INetworkPredictionInterface and the role that it's playing with UMovementComponent? It seems like there's various code around the engine that pretty hardcodes itself into the concept that you're using UPawnMovementComponent, For example in APlayerController::TickActor and APlayerController::SendClientAdjustment
when server replicates actors to a connection, it also calls the SendClientAdjustment
on it, and any child connections it may have
but requiring a INetworkPredictionInterface from a movement component is not unreasonable
hmm
So does Network Prediction Plugin aim to replace or compliment this system is a question I have
because all the examples from the extras plugin seem to just go from regular actor components instead
From digging around the answer seems to be partially, yes
I have some replicated UObjects I need to change the outer of.
Can I just change the outer or do I have to make a new object with the other object as template and assign the new outer.
I've heard there are issues with changing outer on replicated stuff
What are the issues? You wouldn't know them if you don't try
But probably the new outer should be replicated fwiw
I don't know, I just have this comment ingrained in my memory from someone who said it was a bad idea π
So figured I was gonna ask first to see if they were right
I'll try then π
I mean a case where I see it as you would change the outer of your replicated object is if some other outer takes control of that object. The new outer ofc should be of the same class (not really, could be different classes inheriting the class that has the replicated object) as the old outer as they should be replicating the object in question.
Hi!
How can I show the player's name over his character's head?
Thanks!
I mean while playing the game.
Widget component?
I don't know. It could be.
But, will the widget always face the camera?
If you make it Screen Space then yes
How do people generally deal with the flow of initialization when it comes to replicated objects. What im struggling with right now is getting my HUD to read some information from the game state, because the game state is not ready on the client yet.
it all works fine if i stick a delay in there but i know thats terrible π
I'm not sure if this is best practice, but I don't load any widgets until they are ready to be initialized. So when a player logs in, I start a reoccurring timer that checks certain initialization info that I know needs to be replicated before I can really display game information through widgets. If the check goes through and everything is there, I tell the player controller to spawn the player's widgets/HUD
yea that makes sense and was what i was currently in the process of setting up π
@winged badger This is making me believe that by the time BeginPlay fires on actors, there is no guarantee GameState has replicated unless that's a static/pre-placed actor.
The issue is that there could be a possibility where the HUD has already been spawned and BeginPlay was already dispatched as part of the life cycle chain call. So when GameState replicates it doesn't dispatch it for the 2nd time.
I feel like the way around this is to have some other special function called from AGameStateBase::OnRep_ReplicatedHasBegunPlay() so that it fires fine on actors when GameState replicates.
replication of GameState is what calls DispatchBeginPlay on client Worlds
so, its there
Then there must be something wired going on. Because I vaguely remember that James had literally the same issue with HUD
HUD is an Actor, it won't call BeginPlay before GS replicated
it might be created earlier
sorry to be clear, im not using HUD actor here. Im starting all this log in OnPossess of player controller, which my understanding was a server only event
but then i use that to call the OwningClient function to create the hud on that player controller
ofc if you are trying to access a PlayerArray members there is no guarantee whatsoever PlayerState Actors replicated by then
I don't know how to make it screen space. I get this:
Yea, in my case id settle even for a reference to just the game state at this point
i just keep getting display name: none when i print its name on the client
at BeginPlay it will be there, it has to be for BeginPlay to be called at all on clients
From details pane
and that is your only guarantee
in my case do you think on possess is being called before begin play?
Sorry. Instead of searching for Space, I searched for Screen. Sorry.
yea im not using the HUD actor, im just creating a UMG widget on a player controller, no other actors involved
use the HUD actor, its there to manage your widgets
and engine will instantiate it with class set in GameMode at the appropriate time for you
its also only local, with 1:1 relationship with PC, so you won't end up crosswiring your widgets
There is usually a race between the two, so you can never know
haha i see
ok that makes sense, ill move to that, thank you for the explanation. maybe a bit more of a structural question, but would you usually put all of your widgets in the same HUD, like your main menus, etc? Or would you maintain 2 HUD classes and maybe 2 game modes for menu vs in game
I'm using TextRenderComponent, as you have suggested me, and I can't find the User Interface because, I think it is not a Widget.
Usually it's the latter. LobbyGameMode vs. CombatGameMode
Same goes for HUD
With a shared parent for the shared stuff
Yeah that's only for the Widget.
perfect, thanks
I don't think TextRenderComponent has it
Well, how can I make the TextRenderComponent face always the camera?
See how WidgetComponent does it and imitate?
The hard path of the apprentice. When you know nothing.
Thanks a lot!
In that case, I'm going to use a Widget.
I mean if you find it hard, then you can opt for a widget
Exactly
hey everyone, is it possible to have custom Session variables?
like ping or server name
To show the text, do I have to use Widget or User Widget?
You'll probably want UTextBlock : public UUserWidget
OK. I'll try to do it in C++.
Thanks!
I wouldn't recommend that
You're best off creating the base class in C++ and then actually doing the UI design in a blueprint subclass
OK. Great. Thanks. I've just started with Unreal.
You don't need any cpp for this. Make a WBP, attach a TextBlock widget to the canvas and you are fine
a User Widget?
Thanks again.
You can make the text render component always face the screen using a custom material.
Materials ftw
@sinful tree I'm going to use it to show the player's name in a multiplayer game.
Should technically still work, but you probably want to use a widget if that's the case.
I checked the older threads on this (probably very common issue).
My MaxWalkSpeed variable of my client doesn't replicated to the server, meaning sprinting animations don't show up on the server for the client.
-> Server POV: client sprints, but sprint animation not activated
-> Client POV: everything is fine, speed is adjusted to sprinting speed and sprint animation plays correctly.
What's a good way to solve this?
You should handle Sprinting via OnRep_Speed variable
And then set the value on client and server (via rpc)
Then it should update properly
Set MaxWalkSpeed on the OnRep_Speed function then
Speed being a variable you would create
Doesn't that not work tho? Or are you sort of dumbing it down for the problem at hand?
I mean it works but you get a stutter unless something's changed with the CMC lately
Yeah of course
You also lack the whole Replay stuff of moves
But they do it in BPs so I assume CPP is not an option anyway
Does anyone know why itβs so hard to add multiplayer
I would have known if multiplayer wasn't hard π
because multiplayer is an inherently hard topic
It's an inherently hard issue, if you consider what it needs to do in order to work. It's coordinating the game states of different computers that can only communicate through the internet, which has a bandwidth that is many orders smaller than any information channel inside the computer itself, and a latency many orders higher.
This means you can't just send the entire game state all the time, but only a small part of it, relatively infrequently, compared to how frequently it's actually changing locally.
it gets easier when you understand it. My understanding of it from day 0 to day 7 increased a lot. Just gotta practice it
Agreed
Iβm on Lauraβs side, it really depends on the kind of game. If youβre making a MMORPG vs something simpler like a turn based game then thereβs a whole world of difference.
Just to name some extreme choices π
Iβm working on a Viking game and it definitely needs an online mode.
Ok Iβm not the most intense developer just messing around trying to make something
I know mp is hard
Nevermind
I prefer to add to my project graveyard every few months
Very relatable
Iβve set my goal to make a server browser tomorrow that I will never use afterwards again π
Tried Blender, gave up learning at some point.
Yea itβs complicated but itβs also really usefull for animation
Yeah, but not for animations
Pretty much every hobbyist uses blender
Mind blowing to see such tools exist for our own convenience
Is it just while debugging? But in real life is executing just fine?
Hmmm. Is it an overridden RPC? because they involve gotchas
So If I assume right, it's a server RPC that is being called client-side?
I mean if that's the case, then if that actor is not owned by client, then it could be that the RPC is dropped
also make sure you don't have the run as separate process option enabled in PIE
can't debug a process if you're not attached to it π
The best you know is if you debug your way through AActor::CallRemoteFunction, but pretty sure that's the case
Not really. Usually you would use the client-owned actors you have provided by the engine for such task
Pretty much like you would not own a door to open it
MP guys are hackers in origin
That also works
Right totally forgot those exist
Turbo hacking ftw
That flag makes sense for server
Not that I did it before, but you can choose where they load in GF right? (Server/Client)
I guess you do server only and make sure they replicate
Hmmm weird, yeah could be it.
Using blueprints. How do I handle actor visibility? Should it be a multicast or strictly server?
For some reason, when i change to secondary, it wont set secondary to visible, but still sets primary to not visible. Then if i change back it will make the primary visible again, but still the secondary doesnt come back.
I dont know if this matters, but secondary is set not visible by default
Is there better way to replicate aiming directions when the mesh is parented to the camera? Ie, say if you have a tank and the cannon is separate geo(not skeleton mesh with blend space), how would you replicate the aiming? Use the controller pitch on pawn rotates the whole tank, so that's not desired outcome.
I tried to use the player controller to set ControlRotation and replicated the camera component to other players with a run on server event.
It works but comes with other hiccups when you want to teleport and force player pawn orientation.
BaseAimRotation should already work for this
Visibility is a state. States are handled by rep notify variables
Multicast won't make sure new players or out of relevancy players get the update later
thanks a lot!!
where to start learning multiplayer networking and replication.... like in valorant?
Not sure I'm using OnRep right, acccording to GetLocalRole its only being called on the instance of the game that has authority
Replicating a variable using ReplicatedUsing=OnRep_Function
Made a past of the relevant stuff from header and / cpp file. https://pastebin.com/YTiXywgn - header, https://pastebin.com/a4rBaaXs - cpp
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
must be messing up something really simple
I'm trying to package my project with AdvancedSessions and AdvancedSteamSessions plugins on linux arm64. The build does not work because it's not able to find a bunch of files that seem to be part of steam and referenced by AdvancedSteamSessions. Here is the actual error message: AdvancedSteamFriendsLibrary.h(38,10): fatal error: 'steam/steam_api.h' file not found. Is there something I'm missing? What are those files?
The other files are steam/isteamugc.h and OnlineSubsystemSteam.h
I have OnComponentHit events in some of my actors. I would like them to be triggered both on the client and on the dedicated server, but I cannot get it to work - they only get triggered on the client. Anybody has an idea? Is there a setting for it maybe?
depending on what you're trying to make happen, you can accomplish this in a few ways. If you're doing something like changing the health or other attributes of something oncomponenthit, then you should set those fields to be replicated and dont actually replicate the component hit itself. if on component hit you're doing something like playing sounds, then you should do a replicated multicast event for your oncomponenthit
I'm using it for mass stuff, I want it to trigger the MassComponentHitSubsystem with it's hit, and my MassComponentHitEvaluator only runs on the server.
But if they are only triggered on the client then I need to do some sort of workaround
i think you want this:
have your onhit handler call this custom event that runs on the server
and maybe create a helper function that both the server event and the client event call
The actors that I want to have on hit events are server-owned, so the RPCs would be dropped I think
What I find strange is that the overlap events are triggered both on client and on the server, but hit events are not... I'm probably missing something important here π
Hi, I created a custom dedicated server which works fine on desktop. Next, I wanted clients to connect from their android mobiles and iPhones too, is there a way to achieve this?
Hi, how can i know when the gamestate is available client side ? I didn't find any OnRep function
Get it, see if it's valid
Yep but if it's is not, i would like to avoid checking if it's valid in a tick
Just do it on tick
Ok π’
if i use a WithValidation tag and call the method in bp does it go through validation first?
Validate->Implementation?
Validate is always called first
If it returns false the client is kicked and the RPC is not executed
if i want to do something like a range check between two characters on the server how would i do that without a return type on the implementation? if i do it on validate, it will kick the client. the issue is i want my game to not be prone to hacking, but i cant return something like a bool
maybe a repnotify?
You do it inside the implementation? Not sure what you're trying to do
theres no return type on the implementation
You can't return anything from an RPC, they're asynchronous calls
i cant just return false if the player is not in range
The client would check range before calling the RPC. Then the RPC would also check range on it's end and either execute the behaviour, or skip it
But not in "Validate"
why would the client have to check the range first?
RPC's are asynchronous - you're sending a request via internet, so it's impossible to "return" something from them.
So that the client doesn't try and do something it doesn't think it's supposed to
The client should check conditions locally first, then call the RPC. The Server then decides if the request should actually be processed or not.
Without any context it's hard to say what the best approach is
But a client shouldn't request something that will obviously fail
You can if you like - but if that's something the client already knows, why waste bandwidth asking the server to do it when it knows it will be rejected
In the same line of thinking, if the client has no ammo in their gun - why would they ask the server to try and fire it
im under the impression doing checks like that on the client are prone to hacking
No that's not where the hack comes from
"hacks" happen when the server does what the client asks blindly, without any kind of checking on it's own
The idea is that if the Server rejects something, since it's authoritative over the overall state of the game, the "hack" would have no effect.
Let's say the client machine locally hacks ammo to infinite. The game logic checks client-side if they have ammo to fire, decides that they do, so asks the server to fire.
They might even simulate firing locally
in your previous example; if the client has no ammo in their gun, but since the ammo is on the client the player can hack the ammo count to be higher, then the client does the check, and itll return true so it calls the rpc
Yes but the server will still check against it's ammo count, and the server will therefore do nothing
so there should be both a check on the client and the server?
The client might simulate the shot locally, but in theory if the game is properly authoritative, the shot would have no effect on the actual game state
is this just to reduce the RPC count?
yes
makes sense
It should be available. In which class are you retrieving it?
From the widget constructs, created by the hud
Well widgets are not actors, so no that's not guaranteed
So if i init those widgets from an actor beginplay for example , it should be valid ?
Yeah any actor's BeginPlay
Ok !
Where does the HUD create those widgets though?
Is it BeginPlay?
Mh i init it in OnRep_PlayerState
All bets are off in that case
The thing is that there is no such event in HUD.
Or you mean the HUD listens for that, but anyways what James said
I mean i init the HUD from the playercontroller::onrep_playerstate
So i guess i should check if the actor has begun play
Fair enough. Which also means the HUD hasn't fired BeginPlay in that case
Same as checking if GameState is valid
Yep, thanks !
Hey everyone! I am able to host a session and other clients can join it. Issue is when the host leaves the game every other player or client gets disconnected, is there any way around it?
Thanks
Use dedicated servers
Like right now I am using steam and unreals online subsystem
so by dedicated you mean is creating my own servers on some service providers like amazon?
Read the doc, it should explain it
There's not a golden way to fix it yeah. The problem with dedicated servers is very much the price though. You can also consider trying to implement "host migration" but that's a deep hole of weird problems honestly.
The cost, development hassle, etc
okay getting it
right now I was just into learning unreal engine multiplayer, I have a functional third person shooter game ready, with different game modes and players have to first join a lobby and then proceed to main map when host decides to start the game, but this issue was eating my head, when hosts leave everyone was being taken back to main menu. I guess I have to live with that for now
Or you can buy this: https://www.unrealengine.com/marketplace/en-US/product/host-migration-plugin?sessionInvalidated=true and learn what they do
What makes me wonder is they say this: "The system will work even if the host's game crashes unexpectedly".
But at least from what they are saying they reconnect other clients, so it's not going to be smooth
ya guess so
BTW how do you guys implement chat system
is it like using multicast rpcs?
for every text sending an rpc to all the clients?
The engine has an already built in one
what?
AGameMode::Say
okay can you share some links?
Pretty much a client RPC to other players
I googled this stuff but never came across a single doc
Hi, i'm having a strange issue, after switching pawn, the host player pawn returns False on isLocallyControlled, how could that be? while the client is doing fine
If you're doing that check client-side then that's normal
It returns true only server-side for the host
i'm doing it on beginplay when the actor is spawned
and while writing i may have figured out a problem but that does not explain why the client works tho
At this point I would see code cuz I'm not sure what you're trying to do
Also when BeginPlay fires there is no guarantee the pawn has been possessed yet
So there could be a slight possibility that the Controller isn't valid yet
That's why peeps opt for Possessed
that is what i just realized
there is a method called when a pawn is possesed?
In BP that's what it's called
In cpp OnPossessed I guess
But in both cases it only fires on server
If you want a function that fires on both server and client
Go for APawn::Restart
but that also can occur before that is possessed no?
oh thank you that is really helpful
going to try that now
Thanks WizardCell it did fixed it, although how was it working on the client?
because the client was calling the begin play only after the possession already took place for sure on server i guess
while on server the pawn spawned and called that before being possessed
Because on clients that race usually end up being for the sake of Possessed event happening before BeginPlay
But anyways that's unreliable
We never count on races, we count on guarantees
yeah of course, i just missed that race thing when i was coding that feature, got a more clear idea now thanks
I thought we all used Delay nodes with a second and pray for the best? π
That's bad, I told you it's 1.73 seconds
π¦

Also making code for just dedicated servers that do not show up for clients is weird. I'm in the process of making a server list system and it's not straightforward xD
Some (ex?) Epic employee made a post in 2014 about how they do it in Fortnite and that's all I could find LOL.
Yeah those posts are scarce to find but they are cool though
That does not sound right.. Is Fortnite that old?
Blog post incoming π?
What are you trying to do with dedicated only?
Well it was in the making since 2014 (that's what I know at least)
I want a server browser. So a dedicated server can automatically register it self with a web server, but obviously you don't want a client to register it self.
IsNetMode(NM_DedicatedServer) ftw

Why dedicated only though? Shouldn't that just be a session owner check for the server regardless?
See it as "community server hosted" thing. You don't want random sessions to show up to the public, but people that have dedicated servers for communities would possibly want to advertise their server / make it easier to find.
This is not for a real project btw.
But that's the idea behind my server browser. Not regular sessions, just dedicated servers π
But to answer your question properly. If this was a real game you could mix it up yes and just have clients/dedicated servers provide a tag or something of what they are.
Ah. π Huh. Never thought about discluding entire modules from a build. Makes me feel even better for separating all of my UI stuff into another module. That and the much faster livecoding.
It's mostly because I just wanted to learn how to do this.
Imagine you have Rocket League, then you need private code for connections to backend services/databases etc. Ideally you don't expose that stuff in a client build.
Even though they can't connect without tokens or whatever you don't want to ship half of your backend logic in a client I would say. That should be kept nicely separated π
I get ARK in mind too much when I think about gaming networking. Should largely work the same in Singleplayer/ListenServer/Dedicated. Only really used to stripping stuff out of the dedicated server side.
Yeah fair enough. It's definitely a bit of a niche case as most games won't have real backends lets be fair. (Way too expensive for indies). But it's just to learn and see how it works if you wanted to properly separate it π
Although this Epic person on the forums mentions everything needs to be wrapped in #if WITH_SERVER_CODE. Which sounds weird considering that it's a module that doesn't get added to the client build. You would expect that module to not be compiled on the client right lol.
Is it possible to have a property in a USTRUCT that gets replicated, but is not considered for marking the struct dirty?
So let's say I have a struct with
int IntValue; float FloatValue; and I want to replicate both of them, but only when the IntValue changes? Marking FloatValue as NotReplicated will skip the replication entirely
Do that in PreReplication
But that's for Actor properties, not sure if it works for inner struct properties
You might want to implement NetSerialize if it doesn't
With the DOREPLIFETIME_ACTIVE_OVERRIDE, right? I'll try
Yes
Hey guys! This might be a slightly noob question, but is there a way to 'eject' the camera for a client window so I can fly around in the client world and inspect the scene?
isn't it debugcamera or something in the console?
^
ToggleDebugCamera
Nice, I will try that, except I am getting an insta crash every time I try do so something in any client windows. I'm using 5.1 so that could be why
Assertion failed: !GIsPlayInEditorWorld [File:D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Editor.cpp] [Line: 881]
It's occurring when I attempt to switch focus. I'll have a go in UE5.0 and see if it still happens
So it doesn't crash in 5.0 now, but unfortunately that command that doesn't seem to work for me. I'll try and investigate where it falls over
π€
Wizard if you're still around, is the first one the CDO?
I'm so confused lol.
NetworkGISubsysem hmmm. That's a custom you made?
Yeah.
class SERVERMODULE_API UNetworkGISubsystem : public UGameInstanceSubsystem, public FTickableGameObject
```I think the problem is the `FTickableGameObject`, but I kind of need it.
I'm not sure what you're trying to do with it
I need a tick function inside my subsystem.
Ah and there you are printing its name
void UNetworkGISubsystem::Tick(float DeltaTime)
{
CurrentTimePassed += DeltaTime;
if (CurrentTimePassed > 10.0f)
{
UE_LOG(LogTemp, Warning, TEXT("Called from: %s"), *GetName());
CurrentTimePassed = 0.0f;
MakeKeepAliveRequest();
}
}
And the fun fact is that the Initialize() only ever gets called once. So it has to be the Tick on a CDO you would say right?
Does that first line keep getting printed?
So it's printing both all the time on tick
Yeah.
I mean it could be printing the names of the client-side and server-side GISubsystems
No because this is a dedicated server.
It runs on a completely different device too.
I see
Ugh, I see now that in the post I looked at that they are checking for multiple ticks per frame.. Presumably a workaround for this lol.
Ah yes.. FTickableGameObject registers it self inside of the constructor :/
Hey Wizard I got a cool blog post idea. "How to make a proper tick system inside a subsystem" π€£
Wow that was the post I wanted to suggest to you
Custom engine build ftw
The engine has a weird workaround because they use it in an AI subsystem, lets go x)
But I don't want a world subsystem. Unless you mean that also uses the dumb workaround?
But it's World π’
Yeah it's not something you would use, but was referring to the workaround
β
I should make a forum account and post this on a thread I found with like 10 people having the same issue lol.
Assuming it actually works.
That and Knowledge Base π
Knowledge Base?
A new forum corner where people can write their own posts and share knowledge
Ah.
Came with the ue5 release
ez pz
Woop woop, it actually works. And doesn't cost me any performance because it unregisters it self π
Or well.. Rather never registers it self.
Time for the first forum comment on my account xD
What's wrong with just using FTickableGameObject? https://benui.ca/unreal/tickable-object/
That's what I'm using.
However it ticks the CDO.
The way that article solves it is just by looking at if it was already ticked this frame, which is not a good way if you ask me.
For me it didn't because I already have one, but if you go for it then I'll also do.
Well - Hojo (or was it aquanox?) likes to do the very long way of creating a "proper" tick system. IE - copy exactly how actor does it.
Anyone have experience testing a Linux dedicated server on Windows? I'm running it under WSL2 but I can't seem to access it via open whether I use localhost or 127.0.0.1 and whether or not I specify a port.
So long as it's a World-bound subsystem you can register a tick function
Ah so that's why they have this
Is it a bad practice for GI SS to has it?
That does not seem "easy" π€£
Right. How about our posts be: "Read my <link to my article>"
Its the same way actors/components do it really
Idk - looks pretty easy to me. Super minimal code honestly.
If you want them part of the level tick stuff
But hear me out.. Use FTickableGameObject with less lines of code.
Type traits ftw
The problem with FTickableGameObject is you have no control over when it ticks relative to other tick groups
But if you don't care about that then it's simpler π
Assuming you know about the workaround, otherwise it's a headache lol.
π
yeah LatentActionManager is between PostUpdatePhysics and PostUpdateWork I think..
Somewhere in LevelTick.cpp (convenient file name)
Just before TimerManager and FTickableGameObject lists π
The fact that you instantly know this scares me, Jambax.
@chrome bay Has HLL ran into issues with UE's slow transform updates?
scarred by tick dependency growing pains
Nah - impresses me honestly. Jambax is a treasure trove of knowledge of UE π
My post needs to get approved :c
UWorld::Tick btw for all your ticking tickable ticklies
FTickFunction::bHighPriority is spooky also
Run this tick first within the tick group - but what if you have more than one π₯²
y no explicit tick priorities epik
the tick dependency thing they do currently have is apparently.. not great
I very much try to avoid it
I just realised I can access the UWorld inside my subsystem.. All of this entire tick system for nothing π₯²
Does unreal engine have multiplayer features like server authoritative movement with client side prediction, lag compensation and tick accuracy?
Characters have built in predicted movement that's server authoritative yes. If you mean with lag compensation specifically for characters then also yes. It will correct the player if needed. If you mean like as in shooters then no, and is definitely tricky because of the way the physics engine works. Not sure what you mean by "tick accuracy".
Thank you for the explanation. By tick accuracy i mean can we perform actions based on a data change on a specific tick. Like if i shoot my gun on tick 22 then when server rolls back the simulation to tick 22 for resim then all the proxies should perform the action of my character shooting the gun on tick 22
That's not possible within Unreal. The engine doesn't use a fixed timestamp physics engine and currently also has no good alternative to it unless you want to mess with the engine code your self, which some bigger companies did but I've not seen it used anywhere else honestly.
That's what i suspected. Thanks a ton for the help
Just tick next frame. TRICKS TIM SWEENEY DOESN'T WANT YOU TO KNOW
UE5 has a WIP fixed timestamp physics engine system but I believe it was never finished π¦
Not sure if they still plan on doing anything with it.
So is deltatime this frame or last frame's time? Hmm. Which frame are we on anyway?
UE is not deterministic, and never will be. Prediction/Rollback are implemented for special cases only.
That's sad, it's really difficult for indie devs to modify the engine to have such features, and most shooters won't feel right without this
You saying Valorant and Fortnite aren't tight?
There are systems that support prediction and rollback, such as character movement and the ability system.
But you cannot do any kind of "generic" gameplay rollback
Well , deterministic engine is not necessary for this feature, just the world State should be synced on tick basis. Determinism has a totally different meaning
If you care about bandwidth determinism is a requirement for something like that, you're talking about lockstep determinism
I'm hundered percent sure they did some modifications to the engine
Uh why?
UE's entire heritage and back catalogue is basically online shooters
Nope, i come from unity background and unity have alot of networking libraries (Photon fusion being the best) that offers full tick based simulations, client side prediction, hit box rollbacks , interest management etc. And the delta compression makes all the BW troubles go away, they can be used to make any large-scale shooter or RPG, and unity is not deterministic by the way
But yeah like Jambax also said. Unreal is just not that great by default for rollbacks.
well no game is honestly
Unless it's the character movement system, then they have a complicated method to make it work π
Takes a lot of effort to do actual "rollback"
No game? i mean most competitive shooters have perfect rollback and resim
If the question is "can you roll stuff back in Unreal" - then of course you can, but you have to implement this yourself where you need it. There is no such support for rolling back the entire state of the game.
Yes and they implement it themselves
Not necessarily, humbly speaking from my experience with unity.
I've no doubt Unity has a library or tool for doing such a thing "out-of-the-box" - but that doesn't exist in UE. Might have some luck on marketplace
Maybe in future they will be ported to unreal π
You are talking about "Netcode for game objects" that is the official unity networking library
"Rollback" is a very generic term though
I'm not agreeing. There are a lot of systems that work based on the 'frame number' of the physics engine. Unreal just can't do this.
That is kind of bad. But third-party solutions are extremely powerful. leagues ahead of unreal
Press X
Is this the grandpa way of doing the "doubt" meme, lol
I couldn't be arsed to type the full meme π
To answer what I think you're asking though @fringe flume - there is no off-the-shelf rollback system for shooter mechanics, you would have to do your own. This isn't that complex to do but the requirements depend on your specific game.
Source: Got the T-Shirt
yeah i did some research and there is nothing like that even in the unreal marketplace
As in.. been there and done it all π
Yeah that doesn't surprise me to be honest. If you give away that kind of stuff, you're pretty much asking for hackers/cheaters to take it apart and find weaknesses
And supporting it on a "generic" level is pretty hard to do
I mean why would cheaters care. You can cheat with fully predictive rollback systems already. There are several cheats that you just can't stop no matter what you do Β―_(γ)_/Β―
Giving away any part of a multiplayer codebase is asking for trouble tbh
π―
Not true at all. Because the system has nothing to do with how your game do things, it's just a platform to build your game upon. They are not drag and drop components but rather a complete system of data transfer that have the ability to sync data to all clients in a way that everyone is on the same page at all times
Would need extra hands to count the number of games that were easily hacked due to being based on ShooterGame for e.g, and adopting its methods.
You are confused between a game template and a multiplayer framework IMHO
Those two things are not entirely separable
that teleport another player locally infront of your bullet did show up on quite a few of them
Unreal has the ability to sync data to clients, of course
But again what you sync and how you sync is dependant on the game
Of course they are. They are totally separate concepts. I can make the same game with the same features using two different frame works. Both working in the same engine.
just syncing the data and syncing it in a way that it is eventually the same on every client on a particular tick are two different things
yes, second is a pipe dream
really ?
And I really doubt any engine does it too
Unless it's a lockstep RTS engine
Made specifically for that purpose
Ticks don't happen at exactly same rate, lag is not constant, even if you could assume that exactly half is uptime and half is downtime
packets get lost, arrive out of order
lol it's not about that at all. It's about server rolling back the state of all clients each delta snapshot they receive from the server so that each client sees what other performed during that specific tick, i used the word
I'm not entirely sure what's being asked, none of this is required for a decent shooter experience anyway
"eventually" not "instantly"
100 percent it is
We made a popular shooter it's not lol
What's the average ping between players in your shooter
What specific mechanic of a shooter requires complete game-state syncronisation?
Anywhere from 30-500 ping
uh.. shooting ?
π
100 players on a Server means perfect sync across all connections is impossible, it's far too much data. Replication is designed to be "lossy"
AND your shooter doesn't fall apart at above 150 ping ?
UE doesn't explicitly stop you building a system to rollback player positions server-side for checking hits for e.g.
No not at all
you can rewind stuff on demand... like... that's gameplay code.
^ Exactly
If you have 100 players you just use interest management and eventual consistency
It's a gameplay concept not an engine one
I've repeated multiple times that unity is not deterministic and the frameworks I'm talking about sync the world state in a tick-accurate manner. Why do you assume that the engine has anything to do with it?
you can't even get the exact world time on the server
you can get close, but not exact
i'm not here to disrespect anyone's knowledge or any engine BTW
just think there are some confusions on technicality
Simple overview of how the shooter rollback system works in HLL:
-> Server stores a brief circular history of character transforms, capsule sizes etc. About 400ms worth for each player.
-> Client shoots another player
-> Client tells server they shot someone
-> Server receives the hit, checks where the victim was at the clients' estimated hit time
-> Server applies or denies the hit.
Ez.
The "rollback" portion of that is very specific to our game, the player might have hopped into a vehicle, they might be in a different stance - we have to save that into the history. It would be insane to try and serialize the entire character state and rollback the entire game
And more to the point.. it's not needed
But this is all stuff you can do at the gamecode level in UE without making any engine modifications
Don't be silly. That guy 3 miles away just might have got in the way of the bullet
Speedhacks are a thing!
re: (cont)
bounding box based practical example https://vorixo.github.io/devtricks/simple-rewinding/
Didn't the original Doom or Quake actually try to sync the entire state of the game, thus causing it to be super laggy
Yeah that's essentially it
so you could add this component in everything that moves, adjust ur shooting logic a tiny bit, and profit (profile pls)
How that is too much data? if for example there are 24 players in the game. You only have 24 transforms+ 24 transforms for their weapons+ the animation states+ plus few floats for their stats etc + their input each tick. All delta compressed comes down to a few hundred kb's for a single snapshot, 30 Hz server tick rate. And you interpolate on the proxies . All good to go
So while there is no out-of-the-box solution, you can easily do that without the curse that is third-party stuff
Well the third-party stuff we have is not a curse but rather a magical boon that saves thousands of hours of custom code and testing while being pretty cheap
Hey guys I'm a bit stuck when it comes to doing some visual debugging in the editor when running a listen server. I have created a debug component and a visualiser. Added the component to an actor, and registered the visualiser. When I press play with a listen server and 3 players, I can see the visualisation in the editor when I click on stuff, but I can't see anything in the clients. Is there some way of enabling this, or is my approach wrong?
What are you trying to debug that you need a separate component?
I'm talking about the volume of data. it's not too much. And yes IT IS tick accurate. A hundred percent
I think there are a lot of crossed wires tbh
It can't be tick accurate on the client becaues the data can take longer than the length of a tick to reach the client.
We also have deterministic solutions from the same providers, But they are only useful for very large scale rpg's etc
I'm trying to make a panel that can float above a character and give me some feedback about that character
Also can I just say this entire conversation is not going to work. With the time you all spend on arguing you could have rebuild Unreal from the ground up and made the perfect shooter game lol.
This just sounds like generic replication, server sending minimal game-state data to clients
Which is 'zactly what UE does
Or just use cryengine π
Not really. It's only been like 40-ish minutes.
Yeah, but it's tick accurate in a way that server auto rollback every client on each snapshot it sends to the clients, all clients resim and eventually end up on the same page a hundred percent of the time
That's the joke, indeed 10 years have not passed by π
The client will never match the server perfectly. It's not possible.
It will be corrected, but that information will always be stale by the time the next tick happens.
For rigidbodies it may not (depends) , But everything else it does
Try syncing even the most basic clock between two PC's
Which will win? Coro or emoji states? π
Thanks I'll go take a look!
It's not possible for anything that changes. Ever. Unless it doesn't change for a long period of time (compared to tick/ping times.)
That is totally different, I need not to have the same data on every client "instantly" but "eventually "
That's exactly what replication does
But by definition, "eventually" cannot mean it matches on all clients perfectly every tick
This isn't being explained very well..
Again you guys are talking about an instant replication system, all i'm talking about is a system that make sures that each client have the identical world state on a given tick
and it does mean that on average Tick, at least half your clients will be slightly out of sync
Every tick of the server, that is re simulated on all clients, sooner on some and later on others
I'm not talking about instant replication either. I'm saying that no system will guarantee an identical world state of any tick if the world is constantly changing. It would require a pause.
Unless of course, you sent the entire game state in a single blob - which is GLHF territory
Even then it would be behind by a tick, at least.
You guys don't send your network data per email?
yeah
Because of the data volume ?
And the srever and client might calculate that next tick differently.
Yes - UE deliberately does NOT do this
Because it's too costly
Different objects update at different rates and frequencies, based on distance to user, relevancy etc, their own settings
Carrier pigeon is my go to personally
Yes but that's where the state-of-the-art delta compression comes into play. The bandwidth benchmarks show that these systems are far superior even than some AAA games
and its generally too costly on server's CPU, not on bandwidth
compression will not help
how ?
(UE already delta-serializes objects + compresses packets too)
Well, deltas in that only changed states are sent - not the entire object state
on top of calculating delta for god knows how many actors, you need to do an extra layer of compression
And again, i know there cannot be a perfect instant sync on all clients at all time. But the server just sends a snapshot to all clients and they all rollback and resim everything (that is networked)
been here for years, in all that time, people constantly ran into CPu limitations - NetBroadcastTick taking way too long
We're still glossing over the fact that UE has predominantly been the basis of countless multiplayer shooters for decades, and is even criticised for being too "shooter focused"
very few had actual bandwidth issues
so if client is 3 ticks ahead of the server it will rollback and resim 3 ticks as soon as it receives a snapshot from the server
Yes! I have done this:
- Created a pawn call Humanoid
- Created a scene component called 'Humanoid Debug component' that does nothing for now
- Added this component to the pawn in the constructor and set it as an editor only component and attached to the root component (a capsule)
- Create (in a separate editor module) an FComponentVisualizer called HumanoidDebugVisualizer
- Overriden DrawVisualization and made it draw some stuff
- Registered it in the editor module
It all draws in the editor just fine when I am the server and I eject the camera from the player, it's just when I run it in the editor as a listen server with another client I can't see anything on the other client. I feel that my approach is either wrong (component visualizers are not supposed to be used for visualizing things on clients), or there is some setup I am missing
YES, true, That's why i'm surprised that unreal does not have these features built in
I know of not one game that does this honestly
Why on earth would you resimulate probably the most expensive part of your game repeatedly? You just got the latest state from the server - why would the client resim?
Actually al of the competitive shooters does
like the one Jambax has been working on past 5 years? π
So that the client sees exactly what the other client did on that exact same tick
But client shouldn't care what another client sees? And how does that help what they already saw in the past?
In the past in what sense? it's the present for that specific client, So server is always behind clients, and eventually wind them back to it's state using rollbacks
The server is never behind clients - it's ahead
The server is behind your local client however
worse yet, you have ambiguous timestamps - situations where you don't know if you need to resim 6 ticks or 7
true, that was a typo
I just don't understand why you need to resim things client-side
The client receives the most up-to-date state from the server, and applies it instantly
Yeah
So that all clients have the exact same view of the world on a given tick
So that the small differences and sudden movements done on each tick are replicated perfectly onstead of approximately
I'm answering 3 people at once so it's getting confusing
The only game I've ever seen do client-side rollback is rocket league, for physics purposes only
I can't see any scenario where it makes sense to do client rollback in a shooter
And FYI, rocket league had to dedicate a huge portion of their budget to that "feature"
yeah, but RL has 7 or 8 physics objects and a custom physics engine
yeah exactly
It makes sense so that you can have super accurate competitive shooters where even subticks are perfectly aligned. And also makes sense for meele fighting games
specially for fast paced ones
Now you wanna do characters.. animation.. weapon state machines? Forgeddaboutit
Fighting games are a different ballgame
Everything is tick accurate in fusion, Even the animation states are tick aligned
Syncing animation in UE is a lost cause, no chance in hell
Weights, blends etc
And again.. you dont need this for a good shooter experience
Yeah that's what it feels like the way you guys think it's useless and impossible
Global cross platform multiplayer game backend as a service (SaaS, Cloud) for synchronous and asynchronous games and applications. SDKs are available for android, iOS, .NET., Mac OS, Unity 3D, Windows, Unreal Engine, HTML5 and others.
We are speaking from positions of experience - I mean Unreal Tournaments source code is on GitHub, you can see for yourself. We know Epic are using Gameplay Abilities for Fortnite, Lyra etc.
And you can count the number of competitive shooters using Photon Fusion on one hand I bet
it burns
Are the "Details" of a replicated actor replicated through the network? For example if I want to make a box stop blocking only in my client and change it that way will it change it all around the network?
i don't doubt your experience at all sir, it's just something good to have in the game incase it get's to a point where it's really needed
I just honestly don't think you'd ever need it
I hope so π
Whatever is marked as a Replicated UPROPERTY is replicated. Go check that thing to see if it is.
UE definitely won't get in the way of making a good online shooter. If it does then well.. a bad workman blames his tools π
Even PUBG does the same, both made in UE
but I'm sure they do implement some kind of rollback system though, those insane sniper shots from mind-boggling distances are impossible without it
Yeah no doubt at all
But supporting/doing something like that, is very diff to doing generic game state rollback
When i say game state it means only changed state of networked game objects (i think it's obvious though)
In UE, you generally hope that clients are getting enough packets about other clients to have a reasonable interpretation of the game world - but they are always "interacting" with a latent state of the game
Does characters interpolate between snapshots automatically or does this have to be implemented manually ?
So it's usually the server which rolls back that clients' actions (such as hitting other clients) to accommodate for the clients' error
That's automatic, already done by the character movement system
The capsule snaps instantly, but the visual mesh interpolates over time
Perfect
you'd be impressed by knowing how pubg shooting works
good ol trust n verify π
impressed or horrified π
i leave that to user discretion
i think it's the perfect demonstrator of a very successful shooter that "gets away" using simpler heuristics
also fortnite
the validation is based on.... pure distance!
so sometimes... all you care is whether what the client provided was plausible in the given timestamp or not
as you can probably guess most of these games don't rewind all the bones
oh no
right
there are tricks to leverage not running anims on the server
input driven output poses for computation (valorant)
but that's far more complex
yeah sod that π
But we're less bothered about what bone you hit (well not at all, really) - so not such a big deal in our case
Its super cool (I want to do it), but you don't need it in the majority of the cases
with that said, I want to do many things that I end up doing none π€£
Worst thing about large-scale multiplayer is you don't even get to try any of these fun things
Using the term "fun" loosely
XD yeah out of the table fo sure
I'm creating a game where I need the client to control a character on a server without having the character locally
Is this hard to do?
What's the default server tick rate when playing in editor?
Whatever it can handle
Is there a way to set a limit/fixed rate?
Say more
What are you trying to do
Trying to make an AI tech demo where the actual game is hosted and updated privately and players can download a client that interacts with it
How does their experience differ from any other game?
You just don't want players to have the AI/Server code?
Yeah exactly
That's just your usual server/client split
It's nothing fundamentally different from any other online shooter or whatever
Has anyone managed to get voice chat working on a dedicated server with OnlineSubsystemNull?
Is there even a default implementation for that?
Time to find out.
is there a way to check the onrep values that changed?
i need to see if the value decreased or increased
pass the old value as a param : OnRep_MyValue(int32 OldValue)
then you can compare : if Value - OldValue > 0 the value increased
Sorry question
How do I make a blueprint event that runs on the server when a client calls it?
I am having way too much issue with this
You make sure the actor that runs the server RPC is owned by client, that is usually PlayerController/PlayerState/Pawn
I'm running 4 clients in editor with "listen-server mode" i have on server but the clients are running as "standalone", is this the expected behaviour ?
I don't think so. Not with the default settings at least
Mhh
Is there an example of this somewhere? I would rather use blueprints instead of C++ for this
Since rpcs are only C++
RPCs are not cpp only
This has nothing to do with BP vs cpp
The perfect examples are found in this channel pins (multiplayer compendium)
Yes.
- Make a custom event.
- Mark it as an RPC. (Replicated or what that is called. You will know what I mean when you press on it)
With client mode, the is one dedicated server and clients, does someone has the same problem with listen-server mode ?
Okay but how does a client call the server through that
It is only server to client
Am I missing something obvious here?
I click replicate and the server tells the client that something changed
The client cannot do an event and let the server know
Yes. You're missing few points here:
- How to make RPCs in BP.
- What RPCs are
And I already told you how you make them in BP
It does not work I have done that
I call the event from the actor the client owns on the client instance and nothing happens server side
I just need like a code snippet of this working
Cause I am super pissed fiddling with these settings
Okay
Actor file. This calls a function that calls the event below in the Actor Component
PlayAnimHelper that has the event. Note it is set as Net To Server
Is the actor component replicated?
Yes
Where is this RPC event called from?
Within the function that the actor calls
Full screenshots is a thing
I know that already
I don't know what function calls is it though
And that is vital
I would say from the Pawn
Correct
I can see a char movement comp
The CMC
In the first screenshot
Wizard talked about a full screenshot
So he can help you further to see the chain executions etc
Are we #guessing-game now?
I should have done all this before I started messing with it
Totally
Lol
Example: This could be called from BeginPlay, and that is bad.
Thought I explained it well.
Basically: Actor calls Component function, Component function calls the event Play Anim Networked
No it is not called from Begin Play
A menu options gets the hud and the hud lets the player actor know that that option was selected to start playing an animation
But we have no idea what engine function in Actor calls it really
I mean, it literally just gets called from another event that goes off from the menu
You press the button, it gets to the player
Player gets to that function
Nice. Then that should be firing on server just fine
How do you know it doesn't
I checked with breakpoints
What did you check
All the functions. The event that gets called from the networked event that the player listens to
Honestly I over complicated it cause I wanted to see if it was an issue with calling a networked event from within the same actor while listening to it
That doesn't talk to me much. Easiest you would know is if you print the LocalRole and see that it's Authority
The player function that happens from the menu works. The function in the actor component works. But the event itself does not
Let me check if that event works when server to client
Cause my issue is everything only works server to client. Clients basically cannot play
I might just do C++
Can't be that hard
Yeah really easy
Okay shutting off the event with the networking setup does not work.
Maybe I just figured out the issue
Nope
This is frustrating
Tomorrow I will just use C++ and chalk it up to Unreal not really liking Blueprint only networking
Ok got it
You had to add the networked event from right clicking the graph and not from adding an event dispatcher from the side
I found this out from 4.26 documentation because it was not present in 5.0 documentation
I am using 5 though
What does that even mean haha.
EventDispatcher vs CustomEvent?
can someone confirm me when running multiple client from the editor with listenserver netmode, the clients shoud be in client mode and not standalone ?
you canβt really choose, if you play as listen server then any additional players will automatically be set as clients, not standalone
Well i dont want to choose, but the other clients are in standalone netmodew wich is a problem i have multiple gamemodes because of thatw i cant find why i don t have clients
I only have clients with client mode
I didn't change any options π€¨ Any ideas what could be the problem ? I have multiple game modes everything is broken now :p
If you set it to listen server then yeah, any extra windows will be clients
Check the logs, make sure they aren't instantly kicked or something
Have any GameLift users here had an issue where sometimes their servers get initialized correctly and sometimes they don't? In my Game Mode I have:
int Port = FURL::UrlConfig.DefaultPort;
auto onGameSession = [=](Aws::GameLift::Server::Model::GameSession gameSession)
{
gameSession.SetPort(Port);
gameLiftSdkModule->ActivateGameSession();
};
FProcessParameters* params = new FProcessParameters();
params->OnStartGameSession.BindLambda(onGameSession);
params->port = Port;
gameLiftSdkModule->ProcessReady(*params);
which should make the port passed in using the command-line -Port= argument the one used by the GameLift Game Session. I then initialize the processes using -Port= with the ports in the range, but it's hit-and-miss as to whether it's correctly initialized. When I run aws gamelift create-game-session ... sometimes Port is there and sometimes it isn't.
And it seems within a fleet, either all processes will initialize correctly or none will.
Are there any resources on how to build client replication through the CMC? I want to replicate client side simple move to location
The fact that itβs not replicated in the first place upsets me
that takes a lot of doing
especially if the Pawn is not directly possessed by the PlayerController
there are a few places that assume that Pawn is directly possessed by PC, has ROLE_AutonomousProxy and such
one of the offenders would be APlayerController::TickActor
in BP OnRep_ happens whenever I change the value even on Local Player And Server yes ?
dose it check for diff or it just call the onrep_ ?
f** BP
It doesn't, it's always triggered (like RepNotify_Always in cpp)
Suggest reading this ^
BP doesn't technically have a replication callback
its a property changed callback
No idea why they have they chose to go for a different behavior in cpp vs. BP
Why not make it unified
so whenever I change the propert (client, local client, server, ..) it just invoke the onrep ?
im guessing same reason they didn't fix the timer blueprint node
that for some reason sums up the interval and initial delay and assigns it to initial delay
Correct. On server triggers it on both, on client triggers it only on client
would break all projects that had to hack around the original miscalculation
im writting some basic client prediction stuff but since it calls my onrep everywhere I have to put my code into norep even those who are related to local client
Epic needs to shift delete all those all shit deprecated stuff and rebase new fresh codes
let the developer get angry
π
In before Iris replication deprecates the entire system π
iris replication is a myth
That's why they are working on it yes.
π
Also don't ask me why someone named their commit literally "iris' LOL
Leave Iris alone and go watch JBs GameDev day
Who what where.
It didn't even start yet, you lied to me.
Lel, that was a hot warning
kekw
Actually I should write my server. I only have 2 hours left before work D:
Good luck, promising timeframe
Speed run time π
if it works as well as Chaos physics, it should be ready for production around 5.17 π
Spicy
Does the default online subystem(null) provides LAN sessions for the players in VR ?
On PC it should work just as normal, I'm not sure about Quest. I would suggest just trying that, wouldn't be surprised if Meta/Oculus closed off the device but who knows.
But in general VR doesn't change anything about how the networking works in a fundamental way. They are still the same systems.
I'll also try out theopen 192.168.1.2 command which maybe can directly connect to the listen server(or dedicated)
192.168.1.2 doesn't necessarily have to be the listener server/dedicated server. On Windows you can use ipconfig in a terminal to see the local address within the network, on Linux ifconfig
That's right but i will setup subnet mask because there will be no router or wi-fi connection they will gonna only connect via crossover ethernet cable
Just a forgotten test code breaking everything, thanks ! :p
That I am an idiot lol
I got the basic setup, now I just need to timeout the data if no response comes in any more, make a get route for the data that is stored and make a route that can delete the data if the server shuts down π
Neatto
/// NetSerialization.h ///
Generic Delta Replication
* Generic Delta Replication is implemented by FStructProperty::NetDeltaSerializeItem, FArrayProperty::NetDeltaSerializeItem, FProperty::NetDeltaSerializeItem.
* It works by first NetSerializing the current state of the object (the 'full' state) and using memcmp to compare it to previous base state. FProperty
* is what actually implements the comparison, writing the current state to the diff state if it has changed, and always writing to the full state otherwise.
* The FStructProperty and FArrayProperty functions work by iterating their fields or array elements and calling the FProperty function, while also embedding meta data.```
Is there anyway I can find where those said functions at? There is no where I can find them π
The only function I find in the said sturcts is NetSerializeItem and pretty sure they aren't referring to it, because example:
bool FArrayProperty::NetSerializeItem( FArchive& Ar, UPackageMap* Map, void* Data, TArray<uint8> * MetaData ) const
{
UE_LOG( LogProperty, Fatal, TEXT( "Deprecated code path" ) );
return 1;
}
Is there any order of replication when joining the server? For example, is it guaranteed that game state will be replicated before PC?
What would that impact?
Actors don't have a set replication order, and because of things like packet loss you shouldn't rely on it anyways if it does have "some" order.
When a Pawn (not pc) is spawned, it should get some replicated (COND_InitialOnly) data from Game State.
Yeah, I can build it so it does not matter when things are spawned, but the complexity is increased greatly. Thanks @twilit radish
"A solution" that Jambax showed us was to just make a world subsystem for example and then keep track of when everything is initialised.
Oh thanks guys, I have a subsystem responsible for fetching images (profile pics) for other users. At the beginning, I replicate set of urls to download and then use uint8 to reference them.
The problem was, that when user is spawned, it can reference profile picture that is not replicated yet. My workaround is in that case to create a dummy dynamic texture and "repaint" it when the url is replicated
One more question if I may regarding this topic. In most games you have a loading screen when joining a server, which fetches data from the server, loads textures etc. Once client is ready, it spawns the pawn.
But I have not found any waiting for client in the GameMode or GameSession code.
I would expect it to be somewhere between AGameSession::ApproveLogin and AGameModeBase::InitNewPlayer, what am I missing?
The pre-downloading some images would be an ideal candidate for a loading screen operation.
I could not find anything like an βasyncβ login either for a certain project, so I ditched the default pawn spawn system and spawned it whenever I wanted to.
Anyone know of any good resources for learning about networked character movement? I found this video in the pins: https://www.youtube.com/watch?v=RtQRMcupJs0
which has been really helpful, but I'm getting a lot of net corrections in my custom movement mode at high ping, and I'm not sure how to go about fixing it
Support the channel through donations. Crypto accepted!
PayPal: https://paypal.me/reidschannel?locale.x=en_US
Patreon: https://www.patreon.com/reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv
Join our community discord!
Discord: https://dis...
in case it's relevant, my custom mode basically wall running, but the net corrections occur when rapidly going around curved surfaces
i.e.: rapidly changing the surface normal
Character movement comp is a beast, which is hard to tame.
I wrote this, which is well commented and might help you https://github.com/Pavel-Konarik/ReplicatedMovementWallrun (You are in luck because it is wallrunning exactly like in Titanfall)
Another good resource is https://www.youtube.com/watch?v=DoZyH86n_gs&t=5528s&ab_channel=HarryPearce
My code has some inefficiencies, but performs without correction at 300+ ping
Character movement comp is a beast, which is hard to tame.
been well aware of that for a while now, lol
looks promising, I'll take a look. thanks!
What do you mean by rapidly changing surface normal? Is it stationary wall or is it moving?
Running around a curve
I do line traces to get the normal of the wall and to see if I'm still next to a wall. If it misses, then stop wall running (fallen off wall). If the normal changes, alter velocity to match the new normal
wallrunning around the outside (or inside) of one of these
Oh yeah, my wallrunning CMC handled those.
mine handles it fine with low ping, with slight stuttering, and perfectly smooth at 0 ping
Oh darn I missed those, this opens a new door of research for me. Was losing my mind with not finding the functions, but I mean I already have trust issues with the docs so it's understandable. Thanks Hunter, you saved my last few bits of braincells!
@rancid monolith https://www.youtube.com/watch?v=ulGbZUoucCY 500 ping with network corrections on
how do you turn on network corrections?
p.NetShowCorrections 1
When does server spawn PC and Pawn in relation to client loading the map?
Let's say client joins sever, server does AGameSession::ApproveLogin and then tells the client to load specific map, right? Does the server wait for client to finish loading the map?
The whole join process is so confusing
Hi guys, I need your help trying to solve an issue with determinism in Chaos engine.
Background: Multiplayer Racket&Ball game
In order to prevent the jitters and laggy feeling hits, I currently have the ball simulated on all the clients and whenever one client hits the ball they update the hit information to the server which then calls a multicast (that is applied only if you're not the one who hit the ball). Then, the other client applies the hit information to the ball such as world location, velocity, angular velocity. The unexpected behavior is that one in 5 shots or so does not land in the same spot for the hitter and the receiver
The simulation of physics is on a fixed timestep with 120hz.
While I was trying to debug yesterday I thought that maybe it will help to prevent the enemy's racket to physically hit things so I set each player to view the enemy's racket as NoCollision, that way the only way that the ball moves is if the other client sends the update
AFAIK, this should give a deterministic result - but in reality it doesn't
This is very interesting but impossible topic to solve. I don't think you can have determinism with client-sided prediction.
There is an amazing talk about this exact thing from Rocket League guys https://www.youtube.com/watch?v=ueEmiDM94IE
Really? Isn't Chaos engine deterministic with fixed timesteps?
Yep, I have already seen it. It is a great one
How far is it off and are you doing ANY physics on the ball during flight?
Also you'll want to turn off any damping on it
the damping won't be deterministic
Pretty sure chaos is not deterministic
I thought it was deterministic, one of the benefits over PhysX
They have some rollback stuff that ties into the yet to be properly released and introduced prediction plugin
The fixed tick rate is probably to support the rollback stuff
Well it's hard to tell because it hits walls on the way. But we aren't talking about a few centimeters - it's very unaccurate
I think I was wrong about the determinism, can't find any articles about that, so Cedric is right! My bad
It might be it, but damping is pretty crucial for such a game
Are you confident that it is not deterministic?
Hi, Im working on this together with @sage light . What we are currently doing: Once your local client hits the ball, the velocities and location are passed to the other client. The only client that updates the velocities and locations are the one that generates the hit event. Why would the balls reach a different final location 10% of the time?
Are the locally calculated physics so random ? (we are talking about a simple ball trajectory)
If we would talk about a multiscale particle system I would understand, but there is a single ball involved
And the frame rate is pretty high
BTW, are there stateful hit events in UE5? On enter and on exit?
I'd start by making 100% sure that the initial conditions are exactly the same on every machine on hit
Also test if your resetting process is consistent locally, does it clear/override all velocities?
Only the other clients not the local velocities
The assumption is that the only impact on the ball is the linear, angular velocities and the balls position
It being deterministic was supposed to be one of the selling points I believe.
I also seldom pay attention to that to be honest. Too many other goodies. I just need basic collision detection π
@fiery trailAre you sure you're broadcasting the post-hit position and velocity?
Its set to change the velocity without "adding to current" and the position is changed with "teleport" which is supposed to disregard the movement to the new position
On each client, the only things the ball should be able to collide with is the owning client's paddle and the static geometry.
Each client sees the other client's racket as a mesh with no collider
K so start with confirming that everyone agrees on the position and velocity immediately post-hit
We'll check it out π
How can I make sure it is indeed post event?
That's up to you. I'd start by doing the Get -> RPC -> Broadcast at some time after the hit (0.2s or so). Make sure everyone sees a teleporting ball and EVERYONE agrees on the position and velocity
Then figure out how to do it exactly at hit
enums are cheap like bytes already right? I don't need to convert to a byte right... right?
Hi all! I was wondering, does anyone have any idea why my game will not connect to my dedicated server, using the Steam subsystem? As well, I want to mention the engine version is UE5.0, and everything Steamworks, etc. is set up in both Steamworks and the game, as needed by both. Any help to resolve this issue is appreciated!
Hey guys is anyone up, I have a game build ready, with loads of gameplay and voice chat system to test
would love if someone could just hop in
As well, this is in the log files of the client, when trying to connect to the Dedicated Server via IP:
Literally numbers, yes
Unsigned, usually starting from zero, normally byte sized
And, here's the log file for the Dedicated Server:
I thought they default to 32 bits or is that just BP enums?
anyone know where in the engine code I can put a breakpoint to see which/where unreliable packets are being dropped.
Do you mean for the emulation system? Otherwise it's not possible, that's kind of the whole problem with this. You don't know what gets dropped.
but there has to be something that checks per frame to see how many reliable vs unreliable packets there are in the buffer and then sending the reliable ones over the non reliable and then the nonreliable if theres space or something. it shouldn't be hidden because we have the engine code
FWIW there's this: https://docs.unrealengine.com/5.0/en-US/networking-insights-in-unreal-engine/#packetoverviewpanel
there are some network config variables implying its possible to detect and/or measure it
never went into it though
From PlayerController.NetConnection you can access a lot of these stuff
InPacketsLos, OutPacketsLost
And they even have convenience functions to get the percentage
This should also answer your question, UNetConnection::ReceivedPacket
You can breakpoint for example this line: InPacketsLost += MissingPacketCount;
a Game State has authority should return authority if server/listen server right?
