#multiplayer

1 messages Β· Page 26 of 1

fathom aspen
#

It's like everyone asks for tutorials

latent heart
#

Everyone asks for youtube videos.

#

😦

#

The guy that asked for a video tutorial on how to use c++ the other week.

#

Humanity is doomed.

fathom aspen
#

You didn't link him the "Learn cpp in one hour" video?

latent heart
#

I did not.

twilit radish
#

Ok but hear me out, books are annoying.

latent heart
#

Should link the comic, though.

twilit radish
#

I don't want to order some 40 year old book to learn a programming language.

solar swallow
#

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...

β–Ά Play video
fathom aspen
latent heart
#

There's a large range between "book" and "youtube video"

#

One of them is "website"

twilit radish
#

πŸ˜‚

dark edge
#

I mean at least learn the basics of the syntax but it's not hard until you get in the weeds.

fathom aspen
twilit radish
fathom aspen
#

At least from the writer POV

#

Updating a video/book is a pain in the arse

twilit radish
#

Just sell it as a new version and make more money πŸ’―

latent heart
twilit radish
#

Even better. The unity way.

fathom aspen
#

Just put ads, duh

twilit radish
#

Hey Wizard, can I send you a DM for a few questions?

fathom aspen
#

Of course. DMs are open for friends

dark edge
#

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.

dapper obsidian
#

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++.

dark edge
#

Also I'm super against using videos but The Cherno is great for explainign the actual usages and theory, not just playing Code-Along

limber gyro
#

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

limber gyro
#

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

smoky nacelle
#

Are we allowed to ask questions in here?

sinful tree
#

Yes.

plucky prawn
smoky nacelle
#

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

plucky prawn
smoky nacelle
#

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

plucky prawn
#

Only 100 pages

smoky nacelle
#

thanks!

rocky hazel
#

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

rocky hazel
#

or better to switch now

frosty mist
rocky hazel
frosty mist
#

the official docs should work for UE5 from what I can remember. the basics are straight forward and covered there

kindred widget
# rocky hazel makes sense, what is the best tutorial you can suggest please for UE5 to make it...

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.

jovial garnet
#

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?

fathom aspen
#

No guarantee. That's a race

jovial garnet
#

Thx

shy yarrow
#

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?

bitter oriole
#

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

shy yarrow
#

Alright , thanks

bitter oriole
#

FWIW I would have the reviver's perception be constant, both easier and imho a better feel since they're the one acting

dapper obsidian
#

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.

fossil veldt
#

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

winged badger
#

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

fossil veldt
#

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

fossil veldt
#

From digging around the answer seems to be partially, yes

woeful ferry
#

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

fathom aspen
#

What are the issues? You wouldn't know them if you don't try

#

But probably the new outer should be replicated fwiw

woeful ferry
#

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 πŸ˜›

fathom aspen
#

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.

timid moat
#

Hi!

#

How can I show the player's name over his character's head?

#

Thanks!

#

I mean while playing the game.

latent heart
#

Widget component?

fathom aspen
#

Or TextRenderComponent

timid moat
#

But, will the widget always face the camera?

fathom aspen
#

If you make it Screen Space then yes

simple crow
#

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 πŸ™‚

elfin lintel
#

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

simple crow
#

yea that makes sense and was what i was currently in the process of setting up πŸ™‚

fathom aspen
# simple crow How do people generally deal with the flow of initialization when it comes to re...

@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.

winged badger
#

replication of GameState is what calls DispatchBeginPlay on client Worlds

#

so, its there

fathom aspen
#

Then there must be something wired going on. Because I vaguely remember that James had literally the same issue with HUD

winged badger
#

HUD is an Actor, it won't call BeginPlay before GS replicated

#

it might be created earlier

simple crow
#

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

winged badger
#

ofc if you are trying to access a PlayerArray members there is no guarantee whatsoever PlayerState Actors replicated by then

timid moat
simple crow
#

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

winged badger
#

at BeginPlay it will be there, it has to be for BeginPlay to be called at all on clients

fathom aspen
winged badger
#

and that is your only guarantee

simple crow
#

in my case do you think on possess is being called before begin play?

winged badger
#

also, are you talking HUD as heads up display or AHUD derived actor?

#

it can be

timid moat
#

Sorry. Instead of searching for Space, I searched for Screen. Sorry.

simple crow
#

yea im not using the HUD actor, im just creating a UMG widget on a player controller, no other actors involved

winged badger
#

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

fathom aspen
simple crow
#

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

timid moat
fathom aspen
#

Same goes for HUD

#

With a shared parent for the shared stuff

fathom aspen
simple crow
#

perfect, thanks

fathom aspen
#

I don't think TextRenderComponent has it

timid moat
#

Well, how can I make the TextRenderComponent face always the camera?

fathom aspen
#

See how WidgetComponent does it and imitate?

timid moat
#

Thanks a lot!

#

In that case, I'm going to use a Widget.

fathom aspen
#

Exactly

buoyant crag
#

hey everyone, is it possible to have custom Session variables?
like ping or server name

timid moat
eternal lake
timid moat
#

Thanks!

eternal lake
#

You're best off creating the base class in C++ and then actually doing the UI design in a blueprint subclass

timid moat
#

OK. Great. Thanks. I've just started with Unreal.

fathom aspen
#

You don't need any cpp for this. Make a WBP, attach a TextBlock widget to the canvas and you are fine

fathom aspen
#

Yes

#

BP UUserWidget = WBP

timid moat
sinful tree
fathom aspen
#

Materials ftw

timid moat
#

@sinful tree I'm going to use it to show the player's name in a multiplayer game.

sinful tree
#

Should technically still work, but you probably want to use a widget if that's the case.

tacit bough
#

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?

thin stratus
#

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

dark edge
#

I mean it works but you get a stutter unless something's changed with the CMC lately

thin stratus
#

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

graceful yoke
#

Does anyone know why it’s so hard to add multiplayer

fathom aspen
#

I would have known if multiplayer wasn't hard πŸ˜”

hollow eagle
#

because multiplayer is an inherently hard topic

terse delta
# graceful yoke Does anyone know why it’s so hard to add multiplayer

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.

solar swallow
twilit radish
#

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 πŸ˜„

graceful yoke
#

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

solar swallow
#

I prefer to add to my project graveyard every few months

twilit radish
#

Very relatable

#

I’ve set my goal to make a server browser tomorrow that I will never use afterwards again πŸ‘€

graceful yoke
#

Does anyone else but me use blender

#

Kind of irrelevant just wondering

twilit radish
#

Tried Blender, gave up learning at some point.

graceful yoke
#

Yea it’s complicated but it’s also really usefull for animation

solar swallow
dark edge
fathom aspen
#

Mind blowing to see such tools exist for our own convenience

fathom aspen
#

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

hollow eagle
#

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 πŸ˜›

fathom aspen
#

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

fathom aspen
#

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.

smoky nacelle
#

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

silk abyss
#

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.

thin stratus
thin stratus
#

Multicast won't make sure new players or out of relevancy players get the update later

silk abyss
vagrant yoke
#

where to start learning multiplayer networking and replication.... like in valorant?

tidal veldt
#

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

#

must be messing up something really simple

urban mason
#

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?

urban mason
#

The other files are steam/isteamugc.h and OnlineSubsystemSteam.h

mystic basalt
#

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?

urban mason
# mystic basalt I have OnComponentHit events in some of my actors. I would like them to be trigg...

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

mystic basalt
#

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

urban mason
#

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

mystic basalt
#

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 πŸ˜„

warped hawk
#

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?

elder sable
#

Hi, how can i know when the gamestate is available client side ? I didn't find any OnRep function

bitter oriole
#

Get it, see if it's valid

elder sable
#

Yep but if it's is not, i would like to avoid checking if it's valid in a tick

bitter oriole
#

Just do it on tick

elder sable
#

Ok 😒

dim trail
#

if i use a WithValidation tag and call the method in bp does it go through validation first?

#

Validate->Implementation?

chrome bay
#

Validate is always called first

#

If it returns false the client is kicked and the RPC is not executed

dim trail
#

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?

chrome bay
#

You do it inside the implementation? Not sure what you're trying to do

dim trail
#

theres no return type on the implementation

chrome bay
#

You can't return anything from an RPC, they're asynchronous calls

dim trail
#

i cant just return false if the player is not in range

chrome bay
#

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"

dim trail
#

why would the client have to check the range first?

chrome bay
#

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

dim trail
#

say i want to check if hp > 20

#

why not just do the check on the server?

chrome bay
#

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

dim trail
#

im under the impression doing checks like that on the client are prone to hacking

chrome bay
#

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

dim trail
#

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

chrome bay
#

Yes but the server will still check against it's ammo count, and the server will therefore do nothing

dim trail
#

so there should be both a check on the client and the server?

chrome bay
#

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

dim trail
#

is this just to reduce the RPC count?

chrome bay
#

yes

dim trail
#

makes sense

fathom aspen
elder sable
#

From the widget constructs, created by the hud

fathom aspen
#

Well widgets are not actors, so no that's not guaranteed

elder sable
#

So if i init those widgets from an actor beginplay for example , it should be valid ?

fathom aspen
#

Yeah any actor's BeginPlay

elder sable
#

Ok !

fathom aspen
#

Is it BeginPlay?

elder sable
chrome bay
#

All bets are off in that case

fathom aspen
elder sable
#

I mean i init the HUD from the playercontroller::onrep_playerstate

#

So i guess i should check if the actor has begun play

fathom aspen
#

Fair enough. Which also means the HUD hasn't fired BeginPlay in that case

fathom aspen
elder sable
#

Yep, thanks !

vivid lichen
#

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

vivid lichen
#

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?

bitter oriole
#

Pretty much

#

Or give up on the issue

vivid lichen
#

oh damn

#

so can you tell me where I can learn about these dedicated servers

bitter oriole
#

Read the doc, it should explain it

twilit radish
#

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.

bitter oriole
#

The cost, development hassle, etc

vivid lichen
#

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

fathom aspen
#

But at least from what they are saying they reconnect other clients, so it's not going to be smooth

vivid lichen
#

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?

fathom aspen
#

The engine has an already built in one

vivid lichen
#

what?

fathom aspen
#

AGameMode::Say

vivid lichen
#

okay can you share some links?

fathom aspen
#

Pretty much a client RPC to other players

vivid lichen
#

I googled this stuff but never came across a single doc

fathom aspen
#

It's not always docs

#

I just read through source

vivid lichen
#

okay got it

#

thanks man

echo dragon
#

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

fathom aspen
#

If you're doing that check client-side then that's normal

#

It returns true only server-side for the host

echo dragon
#

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

fathom aspen
#

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

echo dragon
#

there is a method called when a pawn is possesed?

fathom aspen
#

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

echo dragon
#

but that also can occur before that is possessed no?

fathom aspen
#

No

#

It occurs when possessed

echo dragon
#

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

fathom aspen
#

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

echo dragon
#

yeah of course, i just missed that race thing when i was coding that feature, got a more clear idea now thanks

twilit radish
fathom aspen
#

That's bad, I told you it's 1.73 seconds

twilit radish
#

😦

fathom aspen
twilit radish
#

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.

fathom aspen
#

Yeah those posts are scarce to find but they are cool though

twilit radish
#

That does not sound right.. Is Fortnite that old?

kindred widget
#

What are you trying to do with dedicated only?

fathom aspen
twilit radish
#

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.

fathom aspen
twilit radish
#

no

#

That's the lame way.

fathom aspen
kindred widget
#

Why dedicated only though? Shouldn't that just be a session owner check for the server regardless?

twilit radish
#

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.

kindred widget
#

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.

twilit radish
#

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 πŸ˜„

kindred widget
#

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.

twilit radish
#

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.

mystic basalt
#

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

fathom aspen
#

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

mystic basalt
#

With the DOREPLIFETIME_ACTIVE_OVERRIDE, right? I'll try

fathom aspen
#

Yes

twin juniper
#

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?

woeful ferry
#

isn't it debugcamera or something in the console?

twin juniper
#

Assertion failed: !GIsPlayInEditorWorld [File:D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\Editor.cpp] [Line: 881]

twin juniper
twin juniper
# woeful ferry ToggleDebugCamera

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

twilit radish
#

πŸ€”

#

Wizard if you're still around, is the first one the CDO?

#

I'm so confused lol.

fathom aspen
#

NetworkGISubsysem hmmm. That's a custom you made?

twilit radish
#

Yeah.

#
class SERVERMODULE_API UNetworkGISubsystem : public UGameInstanceSubsystem, public FTickableGameObject
```I think the problem is the `FTickableGameObject`, but I kind of need it.
fathom aspen
#

I'm not sure what you're trying to do with it

twilit radish
#

I need a tick function inside my subsystem.

fathom aspen
#

Ah and there you are printing its name

twilit radish
#
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?

fathom aspen
#

Does that first line keep getting printed?

#

So it's printing both all the time on tick

twilit radish
fathom aspen
#

I mean it could be printing the names of the client-side and server-side GISubsystems

twilit radish
#

No because this is a dedicated server.

#

It runs on a completely different device too.

fathom aspen
#

I see

twilit radish
#

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" 🀣

fathom aspen
#

Wow that was the post I wanted to suggest to you

twilit radish
#

πŸ˜‚

#

It's even worse that they hardcoded this system right into the engine loop.

fathom aspen
#

Custom engine build ftw

twilit radish
#

The engine has a weird workaround because they use it in an AI subsystem, lets go x)

fathom aspen
#

Neattt

#

Also UTickableWorldSubsystem does it

twilit radish
#

But I don't want a world subsystem. Unless you mean that also uses the dumb workaround?

fathom aspen
#

But it's World 😒

#

Yeah it's not something you would use, but was referring to the workaround

twilit radish
#

βœ…

#

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.

fathom aspen
twilit radish
#

Knowledge Base?

fathom aspen
#

A new forum corner where people can write their own posts and share knowledge

twilit radish
#

Ah.

fathom aspen
#

Came with the ue5 release

twilit radish
#

I already have an account! Wow.

#

πŸ˜‚

fathom aspen
#

ez pz

twilit radish
#

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

twilit radish
#

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.

fathom aspen
#

For me it didn't because I already have one, but if you go for it then I'll also do.

quasi tide
#

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.

dapper obsidian
#

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.

chrome bay
#

So long as it's a World-bound subsystem you can register a tick function

fathom aspen
#

Is it a bad practice for GI SS to has it?

chrome bay
#

ooof discord gimme snippets (ez tick function for subsystem)

twilit radish
#

That does not seem "easy" 🀣

fathom aspen
#

Right. How about our posts be: "Read my <link to my article>"

chrome bay
#

Its the same way actors/components do it really

quasi tide
chrome bay
#

If you want them part of the level tick stuff

twilit radish
#

But hear me out.. Use FTickableGameObject with less lines of code.

fathom aspen
chrome bay
#

The problem with FTickableGameObject is you have no control over when it ticks relative to other tick groups

twilit radish
#

Assuming you know about the workaround, otherwise it's a headache lol.

#

πŸ˜‚

chrome bay
#

yeah LatentActionManager is between PostUpdatePhysics and PostUpdateWork I think..

#

Somewhere in LevelTick.cpp (convenient file name)

#

Just before TimerManager and FTickableGameObject lists πŸ˜„

twilit radish
#

The fact that you instantly know this scares me, Jambax.

quasi tide
#

@chrome bay Has HLL ran into issues with UE's slow transform updates?

chrome bay
#

scarred by tick dependency growing pains

quasi tide
twilit radish
#

My post needs to get approved :c

chrome bay
#

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

twilit radish
#

I just realised I can access the UWorld inside my subsystem.. All of this entire tick system for nothing πŸ₯²

fringe flume
#

Does unreal engine have multiplayer features like server authoritative movement with client side prediction, lag compensation and tick accuracy?

twilit radish
#

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".

fringe flume
twilit radish
#

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.

fringe flume
dark edge
#

Just tick next frame. TRICKS TIM SWEENEY DOESN'T WANT YOU TO KNOW

twilit radish
#

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.

dark edge
#

So is deltatime this frame or last frame's time? Hmm. Which frame are we on anyway?

chrome bay
fringe flume
dark edge
chrome bay
#

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

fringe flume
chrome bay
#

If you care about bandwidth determinism is a requirement for something like that, you're talking about lockstep determinism

fringe flume
#

Uh why?

chrome bay
#

UE's entire heritage and back catalogue is basically online shooters

fringe flume
#

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

twilit radish
#

But yeah like Jambax also said. Unreal is just not that great by default for rollbacks.

chrome bay
#

well no game is honestly

twilit radish
#

Unless it's the character movement system, then they have a complicated method to make it work πŸ˜›

chrome bay
#

Takes a lot of effort to do actual "rollback"

fringe flume
chrome bay
#

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

fringe flume
chrome bay
#

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

fringe flume
chrome bay
#

It's extremely simple to do

#

Well.. simple

fringe flume
#

You are talking about "Netcode for game objects" that is the official unity networking library

chrome bay
#

"Rollback" is a very generic term though

twilit radish
#

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.

fringe flume
chrome bay
#

Press X

quasi tide
chrome bay
#

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

twilit radish
#

The T-Shirt?

#

xD

fringe flume
chrome bay
#

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

twilit radish
#

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 Β―_(ツ)_/Β―

chrome bay
#

Giving away any part of a multiplayer codebase is asking for trouble tbh

twilit radish
#

πŸ’―

fringe flume
chrome bay
#

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.

fringe flume
chrome bay
#

Those two things are not entirely separable

winged badger
chrome bay
#

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

fringe flume
fringe flume
winged badger
#

yes, second is a pipe dream

fringe flume
chrome bay
#

And I really doubt any engine does it too

#

Unless it's a lockstep RTS engine

#

Made specifically for that purpose

winged badger
#

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

fringe flume
chrome bay
#

I'm not entirely sure what's being asked, none of this is required for a decent shooter experience anyway

fringe flume
#

"eventually" not "instantly"

chrome bay
#

We made a popular shooter it's not lol

fringe flume
chrome bay
#

What specific mechanic of a shooter requires complete game-state syncronisation?

#

Anywhere from 30-500 ping

quasi tide
#

😈

chrome bay
#

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"

fringe flume
chrome bay
#

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

winged badger
#

you couldn't do it with 2 players either

#

not unless you pause the game

pallid mesa
#

you can rewind stuff on demand... like... that's gameplay code.

chrome bay
#

^ Exactly

fringe flume
chrome bay
#

It's a gameplay concept not an engine one

fringe flume
winged badger
#

you can't even get the exact world time on the server

#

you can get close, but not exact

fringe flume
#

i'm not here to disrespect anyone's knowledge or any engine BTW

#

just think there are some confusions on technicality

chrome bay
#

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

latent heart
#

Don't be silly. That guy 3 miles away just might have got in the way of the bullet

#

Speedhacks are a thing!

quasi tide
#

Didn't the original Doom or Quake actually try to sync the entire state of the game, thus causing it to be super laggy

chrome bay
#

Yeah that's essentially it

pallid mesa
#

so you could add this component in everything that moves, adjust ur shooting logic a tiny bit, and profit (profile pls)

fringe flume
#

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

chrome bay
#

So while there is no out-of-the-box solution, you can easily do that without the curse that is third-party stuff

fringe flume
twin juniper
#

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?

twilit radish
fringe flume
#

I'm talking about the volume of data. it's not too much. And yes IT IS tick accurate. A hundred percent

chrome bay
#

I think there are a lot of crossed wires tbh

latent heart
#

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.

fringe flume
#

We also have deterministic solutions from the same providers, But they are only useful for very large scale rpg's etc

twin juniper
twilit radish
#

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.

chrome bay
#

This just sounds like generic replication, server sending minimal game-state data to clients

#

Which is 'zactly what UE does

latent heart
#

Or just use cryengine πŸ˜‚

quasi tide
fringe flume
#

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

twilit radish
latent heart
#

It will be corrected, but that information will always be stale by the time the next tick happens.

fringe flume
chrome bay
#

Try syncing even the most basic clock between two PC's

quasi tide
#

Which will win? Coro or emoji states? πŸ˜…

twin juniper
#

Thanks I'll go take a look!

latent heart
fringe flume
chrome bay
#

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..

fringe flume
winged badger
#

and it does mean that on average Tick, at least half your clients will be slightly out of sync

fringe flume
latent heart
chrome bay
#

Unless of course, you sent the entire game state in a single blob - which is GLHF territory

latent heart
#

Even then it would be behind by a tick, at least.

twilit radish
#

You guys don't send your network data per email?

chrome bay
#

yeah

fringe flume
latent heart
#

And the srever and client might calculate that next tick differently.

chrome bay
#

Because it's too costly

#

Different objects update at different rates and frequencies, based on distance to user, relevancy etc, their own settings

quasi tide
fringe flume
winged badger
#

and its generally too costly on server's CPU, not on bandwidth

#

compression will not help

fringe flume
chrome bay
#

(UE already delta-serializes objects + compresses packets too)

#

Well, deltas in that only changed states are sent - not the entire object state

winged badger
#

on top of calculating delta for god knows how many actors, you need to do an extra layer of compression

fringe flume
#

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)

winged badger
#

been here for years, in all that time, people constantly ran into CPu limitations - NetBroadcastTick taking way too long

chrome bay
#

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"

winged badger
#

very few had actual bandwidth issues

fringe flume
#

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

twin juniper
#

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

fringe flume
chrome bay
#

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?

fringe flume
#

Actually al of the competitive shooters does

winged badger
#

like the one Jambax has been working on past 5 years? πŸ˜„

fringe flume
chrome bay
#

But client shouldn't care what another client sees? And how does that help what they already saw in the past?

fringe flume
#

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

chrome bay
#

The server is never behind clients - it's ahead

#

The server is behind your local client however

winged badger
#

worse yet, you have ambiguous timestamps - situations where you don't know if you need to resim 6 ticks or 7

fringe flume
chrome bay
#

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

fringe flume
fringe flume
#

I'm answering 3 people at once so it's getting confusing

chrome bay
#

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"

winged badger
#

yeah, but RL has 7 or 8 physics objects and a custom physics engine

chrome bay
#

yeah exactly

fringe flume
#

specially for fast paced ones

chrome bay
#

Now you wanna do characters.. animation.. weapon state machines? Forgeddaboutit

#

Fighting games are a different ballgame

fringe flume
chrome bay
#

Syncing animation in UE is a lost cause, no chance in hell

fringe flume
#

Weights, blends etc

chrome bay
#

And again.. you dont need this for a good shooter experience

fringe flume
chrome bay
#

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

winged badger
#

it burns

quasi tide
#

πŸ™ƒ

#

No option to just ignore it

fringe flume
#

something wrong with your system

#

I'm sorry if that's the case

pallid mesa
#

u forgot to put it in lifetimereplicatedprops πŸ™„

#

kekw πŸ˜…

sage light
#

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?

fringe flume
chrome bay
#

I just honestly don't think you'd ever need it

fringe flume
latent heart
chrome bay
#

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 πŸ˜„

fringe flume
#

Even PUBG does the same, both made in UE

chrome bay
#

PUBG - famously based on ShooterGame btw πŸ˜„

#

ShooterGame.exe has crashed

fringe flume
#

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

chrome bay
#

Yeah no doubt at all

#

But supporting/doing something like that, is very diff to doing generic game state rollback

fringe flume
chrome bay
#

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

fringe flume
chrome bay
#

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

pallid mesa
#

good ol trust n verify πŸ˜„

chrome bay
#

impressed or horrified πŸ˜„

pallid mesa
#

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

chrome bay
#

I'd be amazed if they even run anims on servers

#

(alas we do not)

pallid mesa
#

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

chrome bay
#

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

pallid mesa
#

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 🀣

chrome bay
#

Worst thing about large-scale multiplayer is you don't even get to try any of these fun things

#

Using the term "fun" loosely

pallid mesa
#

XD yeah out of the table fo sure

gritty crater
#

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?

rancid monolith
#

What's the default server tick rate when playing in editor?

latent heart
#

Whatever it can handle

rancid monolith
#

Is there a way to set a limit/fixed rate?

latent heart
#

t.maxfps x ?

#

Or r.

dark edge
#

What are you trying to do

gritty crater
dark edge
#

How does their experience differ from any other game?

#

You just don't want players to have the AI/Server code?

dark edge
#

That's just your usual server/client split

gritty crater
#

Ha

#

Gotcha

dark edge
#

It's nothing fundamentally different from any other online shooter or whatever

gritty crater
#

Hahaha cool cool

#

Thanks @dark edge

dapper obsidian
#

Has anyone managed to get voice chat working on a dedicated server with OnlineSubsystemNull?

twilit radish
#

Is there even a default implementation for that?

dapper obsidian
#

Time to find out.

dim trail
#

is there a way to check the onrep values that changed?

#

i need to see if the value decreased or increased

modern cipher
glossy hollow
#

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

fathom aspen
#

You make sure the actor that runs the server RPC is owned by client, that is usually PlayerController/PlayerState/Pawn

elder sable
#

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 ?

fathom aspen
#

I don't think so. Not with the default settings at least

elder sable
#

Mhh

glossy hollow
#

Since rpcs are only C++

fathom aspen
#

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)

glossy hollow
#

Thank you

#

I mean, are you able to make rpcs inside the blueprint editor?

fathom aspen
#

Yes.

  1. Make a custom event.
  2. Mark it as an RPC. (Replicated or what that is called. You will know what I mean when you press on it)
elder sable
glossy hollow
#

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

fathom aspen
#

Yes. You're missing few points here:

  1. How to make RPCs in BP.
  2. What RPCs are
glossy hollow
#

I have made rpcs in C++

#

I have done them before

fathom aspen
#

And I already told you how you make them in BP

glossy hollow
#

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

fathom aspen
#

Well I'm the one who's supposed to see the code you're referring to then

#

Send code

glossy hollow
#

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

fathom aspen
#

Is the actor component replicated?

glossy hollow
#

Yes

fathom aspen
#

Where is this RPC event called from?

glossy hollow
#

No

#

Not an rpc

#

At least Unreal Engine does not call it as such

fathom aspen
#

Well CallPlayAnimEvent

#

Where is it called from

glossy hollow
#

Within the function that the actor calls

fathom aspen
#

I don't know what function calls is it though

#

And that is vital

twin juniper
fathom aspen
#

Correct

twin juniper
#

I can see a char movement comp

fathom aspen
#

The CMC

twin juniper
#

In the first screenshot

glossy hollow
#

This function in the actor component

twin juniper
#

Wizard talked about a full screenshot

fathom aspen
#

Those are custom functions

#

How would I know who called this either

twin juniper
#

So he can help you further to see the chain executions etc

fathom aspen
#

Are we #guessing-game now?

glossy hollow
#

I should have done all this before I started messing with it

twin juniper
glossy hollow
#

Lol

fathom aspen
#

Example: This could be called from BeginPlay, and that is bad.

glossy hollow
#

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

fathom aspen
#

But we have no idea what engine function in Actor calls it really

glossy hollow
#

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

fathom aspen
#

Nice. Then that should be firing on server just fine

glossy hollow
#

Nope

#

Nothing

fathom aspen
#

How do you know it doesn't

glossy hollow
#

I checked with breakpoints

fathom aspen
#

What did you check

glossy hollow
#

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

fathom aspen
glossy hollow
#

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

fathom aspen
#

Yeah really easy

glossy hollow
#

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

glossy hollow
#

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

thin stratus
#

EventDispatcher vs CustomEvent?

elder sable
#

can someone confirm me when running multiple client from the editor with listenserver netmode, the clients shoud be in client mode and not standalone ?

deep shore
elder sable
#

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

elder sable
#

I didn't change any options 🀨 Any ideas what could be the problem ? I have multiple game modes everything is broken now :p

chrome bay
#

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

dapper obsidian
#

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.

dim trail
#

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

winged badger
#

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

rose egret
#

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

fathom aspen
#

It doesn't, it's always triggered (like RepNotify_Always in cpp)

#

Suggest reading this ^

winged badger
#

its a property changed callback

fathom aspen
#

No idea why they have they chose to go for a different behavior in cpp vs. BP

#

Why not make it unified

rose egret
#

so whenever I change the propert (client, local client, server, ..) it just invoke the onrep ?

winged badger
#

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

fathom aspen
winged badger
#

would break all projects that had to hack around the original miscalculation

rose egret
#

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

#

😁

twilit radish
#

In before Iris replication deprecates the entire system πŸ˜›

dim trail
#

iris replication is a myth

twilit radish
#

That's why they are working on it yes.

#

πŸ˜›

#

Also don't ask me why someone named their commit literally "iris' LOL

fathom aspen
#

Leave Iris alone and go watch JBs GameDev day

twilit radish
#

Who what where.

fathom aspen
twilit radish
#

It didn't even start yet, you lied to me.

fathom aspen
#

Lel, that was a hot warning

twilit radish
#

Goes back to Iris

#

πŸ˜‚

fathom aspen
#

kekw

twilit radish
#

Actually I should write my server. I only have 2 hours left before work D:

fathom aspen
#

Good luck, promising timeframe

twilit radish
#

Speed run time πŸ‘€

winged badger
fathom aspen
#

Spicy

echo geode
#

Does the default online subystem(null) provides LAN sessions for the players in VR ?

twilit radish
#

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.

echo geode
#

I'll also try out theopen 192.168.1.2 command which maybe can directly connect to the listen server(or dedicated)

twilit radish
#

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

echo geode
elder sable
glossy hollow
twilit radish
# fathom aspen Good luck, promising timeframe

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 πŸ˜„

fathom aspen
#

Neatto

fathom aspen
#
/// 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;
}
split siren
#

Is there any order of replication when joining the server? For example, is it guaranteed that game state will be replicated before PC?

twilit radish
#

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.

split siren
#

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

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.

split siren
#

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.

twilit radish
#

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.

rancid monolith
#

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...

β–Ά Play video
#

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

split siren
#

My code has some inefficiencies, but performs without correction at 300+ ping

rancid monolith
#

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!

split siren
rancid monolith
#

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

split siren
rancid monolith
#

mine handles it fine with low ping, with slight stuttering, and perfectly smooth at 0 ping

fathom aspen
#

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!

split siren
rancid monolith
#

how do you turn on network corrections?

split siren
#

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

sage light
#

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

split siren
sage light
sage light
dark edge
#

Also you'll want to turn off any damping on it

#

the damping won't be deterministic

thin stratus
#

Pretty sure chaos is not deterministic

split siren
#

I thought it was deterministic, one of the benefits over PhysX

thin stratus
#

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

sage light
split siren
sage light
#

Are you confident that it is not deterministic?

fiery trail
#

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?

dark edge
split siren
#

Also test if your resetting process is consistent locally, does it clear/override all velocities?

fiery trail
#

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

quasi tide
#

I also seldom pay attention to that to be honest. Too many other goodies. I just need basic collision detection πŸ˜…

dark edge
#

@fiery trailAre you sure you're broadcasting the post-hit position and velocity?

sage light
dark edge
#

On each client, the only things the ball should be able to collide with is the owning client's paddle and the static geometry.

sage light
dark edge
#

K so start with confirming that everyone agrees on the position and velocity immediately post-hit

sage light
#

We'll check it out πŸ™‚

fiery trail
dark edge
#

Then figure out how to do it exactly at hit

short arrow
#

enums are cheap like bytes already right? I don't need to convert to a byte right... right?

twin juniper
#

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!

vivid lichen
#

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

twin juniper
bitter oriole
#

Unsigned, usually starting from zero, normally byte sized

dark edge
pulsar river
#

anyone know where in the engine code I can put a breakpoint to see which/where unreliable packets are being dropped.

twilit radish
#

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.

pulsar river
#

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

fathom aspen
real ridge
#

is there any chance to print packet loss in game in unreal engine?

#

somehow

winged badger
#

there are some network config variables implying its possible to detect and/or measure it

#

never went into it though

fathom aspen
#

From PlayerController.NetConnection you can access a lot of these stuff

#

InPacketsLos, OutPacketsLost

#

And they even have convenience functions to get the percentage

fathom aspen
terse prawn
#

a Game State has authority should return authority if server/listen server right?