#multiplayer

1 messages · Page 241 of 1

vague ocean
#

This is basically what im doing

#

This is coming straight from the ontick

#

what im wondering is how any of this is coming from the server, those are blueprintnativeeventns, which can't be server anyway

#

This is on the GameItem

dark parcel
#

can't tell the actor type

#

missing info

vague ocean
#

GameItem is the actor type

dark parcel
#

like where is even this

vague ocean
#

Oh

#

The player character

dark parcel
#

and you do IsLocallyControlled check?

vague ocean
#

Erm no

#

Should I

dark parcel
#

you don't want to run the logic on copy of Player's 2 character in Player's 1 world

#

or any other players for that matter

vague ocean
#

Damn... you may be right

#

I noticed the debug traces showing up liek that on both

dark parcel
#

I mean that's not gonna make your problem go away

vague ocean
#

But its a good start

#

I assumed the server stuff was coming from this parent call on the player character

#

But I wired it straight from the event tick node without the parent and it was still happening

vague ocean
#

Thank you for your help 🙏

dark parcel
#

you are just running the logic on other character copies

#

Server client communication only possible through RPC

vague ocean
#

Ah ok ok

#

I think I was screwing around with an RPC earlier because I was seeing a Sever: xyz log in the debug pritns

dark parcel
#

print will Prints the instance of the machine doing the logging.

#

if Print string is called by Client instance, it will says the Client_number

#

if server it will says Server:

vague ocean
#

Yep

#

and I was seeing Server logs

#

Idk what the hell was happening, but thats another bridge to cross when I get back there 😭

dark parcel
#

because the node runs on the server instance.

#

even if you play as 2 client, it just means there is a dedicated server

#

so 1 server and 2 clients

#

The server will have the 2 players in it's world.

The player 1 computer will also have 2 player in it's world.

So is the player 2.

vague ocean
#

Ah ok ok

#

THank you

ruby parrot
#

Whats the "right" way to Update WidgetBlueprints in MP? e.g. a health bar.

What I have thought of so far:
1.
Do I make a bind from the widget to the replicated HealthVariable? I know this basically uses a "tick" function to do so-> so it would update very often and set "health=100" like billions of times for no reason(given i am in a town or so,HP doesnt need to be updated)

Make the variable OnRep
But this means it would also try to execute this code on the server, that wouldnt need to do it as it doesnt have a UI for the player?

Is there a "right" way? is any of my 2 ways "the right way" or is there a 3rd way I have not thought of yet? 🙂

dire cradle
#

Binding it directly isn't inherently bad as long as it's not running any expensive functions or trying to pull it from somewhere else, for just a healthbar it makes nearly no difference on performance.
Updating the progress bar in OnRep is a bit more mindful as it won't be running every tick, so if you're concerned about best practices it's the better way of doing it

#

But it's mostly personal preference imo

ruby parrot
#

My concern was "its not the only variable to replicate".... but now that I think about it... Not every variable I need for a UserInterface needs to instantly update. I was thinking like "yo, what if i have hundreds of items,spells,whatever all of that would be "ticking" 24/7"...but thats not true, as inventory only would update if i show it... and the stuff that I want to show is not much...Playername,Class,Experience,Mana/energy and thats it, maybe 20-30variables, thats not much.
Yeah by "right way" i meant best practice 🙂

exotic wasp
#

and have it broadcast a multicast delegate

#

if you do it in c++ the OnRep will only get called when it's actually sent over network, so only ever on clients

ruby parrot
#

Nah, I am blueprint only for now, still new 🙂

#

I can program in c#...just cant get my head around c++ yet...

exotic wasp
#

using c++ in unreal is fairly similar to c# IMO as long as you stay within the framework

#

I wouldn't worry about the OnRep also triggering on the server. If you don't bind anything to it, it's performance impact won't be meaningful

ruby parrot
#

Maybe for you 😄 all these Something::Something else, doesnt make sense to me, but tbf i didnt give it much time yet 🙂 Wanna go as far as i can with blueprints and then well see about learning c++ ^^

dire cradle
#

In a complex project you need a hybrid of both, so having a good grasp of blueprints first before diving into C++ can make it easier

exotic wasp
#

agree

#

bp didn't really click for me until I started using c++ and understood how they were exposed to one another

grizzled stirrup
exotic wasp
dark edge
grizzled stirrup
rose pollen
#

Hey @grand kestrel first off huge thanks for the predicted movement plugin, it is fantastic already. I was about to start working on some additions but looking over the github it looks like some of what I want is already coming in 2.0.0 so I will wait for you to do your magic. Can you ping me on release? Reading through the feature set I am super excited lol.

raw drift
bold oxide
#

howdy. I'm having issues with a blueprint and multiuser. I made a thing that changes a material's texture on the press of a button, it changes on the local computer, btu not on the other three (virtual production setup..) any ideas? im not sure what to google even, i usually solve these stuff on my own but i have zero ideas on what to do now

dire cradle
#

How do you move it up?

sinful tree
raw drift
# dire cradle How do you move it up?

I tried to move it by interp in blueprint, or with an interp component, i also tried move component to, set location with timeline, always the same result.

dire cradle
#

How do you handle its networking?

bold oxide
#

i usually don't need to communicate stuff i change materials, run seqeuncers and such, and it just happens

dire cradle
#

Can you show its code

hexed path
#

Hello

The basic configurations that we add to DefaultEngine.ini, like this one for example
[OnlineSubsystemSteam]
bEnabled=True
SteamDevAppId=480
SteamAppId=480

[OnlineSubsystem]
DefaultPlatformService=Steam

Do we need to add this to DefaultGame.ini, for things to work in a packaged game?

dire cradle
#

To DefaultGame.ini

hexed path
#

Yes, do we need to add those things there too?

dire cradle
#

Yes you do need to add it to your DefaultGame.ini

#

Add in a new line at the bottom

dire cradle
#

in the package

sinful tree
# bold oxide https://tenor.com/view/i-don%27t-know-idk-idk-about-that-gif-7336250873949261946

Sounds like you need to go over multiplayer fundamentals then.https://www.youtube.com/watch?v=JOJP0CvpB8w

An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.

Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe

00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...

▶ Play video
dire cradle
#

Your delays are not syned up with the server

#

Client loads this platform a little later the server spawns it

#

The random float node is pulling the same numbers probably because they use the same seed in the background

#

But since the delay at the start is running at different times in the server and the client there is a mismatch on what you see and what the server sees

#

That may be causing the jitter you're seeing as the server is correcting your character's position

hexed path
dire cradle
raw drift
dire cradle
#

You need to use RPCs

sinful tree
# raw drift like this

Since everything is behind an Authority check it's only running on the server, except for when you get to the point of running the timelines - since the timelines are replicated, they will run on clients and the server, so then the server is setting the location, but then clients are also setting the location since it's a replicated timeline, so jittery motion is introduced there. Disable the timelines being replicated and it'll probably look fine, but clients will always be slightly behind the server.

dire cradle
#

If a client joins at a later time it will break completely though

sinful tree
#

If it's a replicated actor, the server will replicate the current position when the client joins (or rather, when the actor becomes relevant to that client)

dire cradle
#

Wait the timelines are replicated yeah true

#

Either way you don't need to have those timelines set to replicate at all, just need a multicast rpc

sinful tree
#

Shouldn't need a multicast either. Location is something that is replicated automatically for replicated actors when set on the server.

dire cradle
#

Yeah but he is changing the relative component location not the actor location

#

Would still work without the multicast though since the characters would be updated very well, the overlaps should fire at the same time in both the server and the clients

raw drift
#

Okay i'll watch this, caus still, i don't get how to make this work even with your very clear explanations :p

dire cradle
hexed path
#

Can someone link a proper documentation on how should I package my game for the Steam Multiplayer functionality to work.

All I have done so far, is configure the DefaultEngine.ini. I haven't touched DefaultGame.ini, and have no idea what steam_appid.txt is, where is it found, and how should it be configured.

dire cradle
#

You don't have the Steam plugin?

hexed path
dire cradle
#

If it works with Steam it should be the same

#

The steam_appid.txt just needs to exist in the package, and steam should be running in the background for it to work (For testing simply putting ''480'' in it will work, it just holds the game id)

thin stratus
#

The steam_appid.txt file works like this:

  • If you have your own Game on Steam, whenever someone downloads it via Steam, Steam will put that file into the root folder of your application. That's why Epic/UE doesn't generate the file when packing for Shipping (which is what you'd choose for the final version that is delivered to your players).
  • Outside of Steam and Shipping, Epic/UE generates the txt file for you automatically when you package with Steam enabled iirc.
#

In other words, the only important point to know is that if you package for Shipping, the file won't be generated and if you don't distribute your game via Steam then, you won't be able to test properly without manually adding the txt file to the Shipping build.

#

All it contains is a single line with the AppID that Steam gives you when you set up your own game.
As Spynora said, 480 can be used as a test AppID in the meantime, but you can't distribute the game via Steam with it.

#

And you potentially run into a bunch of annoying issues with 480, such as it being overused by developers all around the world, so you might get Session results returned from other games or even game engines which UE then filters, making it look like you didn't find any games.

#

So if you are sure to actually release the game via Steam, get yourself your own ID.

hexed path
# thin stratus In other words, the only important point to know is that if you package for Ship...

Packaging it as Development Build, but through Tools -> ProjectLauncher. Could this be an issue?

I have my own page on Steam and using it's AppID.

Testing on 2 different devices with 2 different Steam Accounts (both have access to the game on Steam)

I have also, as per instructions of the plugin I am using, added bunch of lines to DefaultEngine. Should I add all those lines to DefaultGame before packaging?

Lines like these:

[OnlineSubsystemSteam]
SteamDevAppId=480
SteamAppId=480
bVACEnabled=True
bEnabled=True
bUseSteamNetworking=True

[OnlineSubsystem]
DefaultPlatformService=Steam

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000000
MaxInternetClientRate=1000000000
InitialConnectTimeout=120.0

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="SteamSockets.SteamSocketsNetConnection"

[/Script/SteamCoreWeb.SteamCoreWebSettings]
DevSteamID=480

thin stratus
#

You would need to, yes.

#

Not all, but some of them.

#

And the ID has to be your own of course.

hexed path
hexed path
thin stratus
#

IpNetDriver is the default NetDriver that is used if you wouldn't use Steam.
Not sure you need those lines, at least not for the general connection.

thin stratus
#

Somewhere in there should also be the lines that add the SteamSocketsNetDriver to the NetDriverDefinitions arraz

#

Not sure you need the SteamCoreWebSettings. Don't even know what that is.

hexed path
#

Here's the full lines I added to DefaultEngine

[URL]
GameName=GameName
Port=7777

[OnlineSubsystemSteam]
SteamDevAppId=480
SteamAppId=480
bVACEnabled=True
bEnabled=True
bUseSteamNetworking=True

[OnlineSubsystem]
DefaultPlatformService=Steam

[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000000
MaxInternetClientRate=1000000000
InitialConnectTimeout=120.0

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="SteamSockets.SteamSocketsNetConnection"

#

Changed the AppIDs, other than that haven't changed anything

thin stratus
#

Yeah I guess that is fine.

hexed path
#

Let me try to add these to DefaultGame, and try packaging again.

thin stratus
#

If you start your Game after packaging it for Development and having Steam active, does it show the Steam Overlay in the Game?

hexed path
thin stratus
#

5.5?

hexed path
#

Yes

thin stratus
#

Seems like a lot of people have issues lately with Joining Sessions.

#

It's difficult to help with these, especially without logs that have additional logging enabled.

hexed path
#

How do I enable additional logging? My launch is close, and the whole game is ready, including the multiplayer gameplay, except for the Creating and Joining Sessions/Lobbies functionality. Had left this as last, because knew would need to package the game bunch of times.

thin stratus
#

For your packaging settings you should only need to make sure that you have all levels included. But if one client can host and open the level then the other one will have the map just fine I guess.

#

Side note: One usually packages their game very often during development, because Play In Editor works differently.

quasi tide
#

Wait...you haven't tested sessions???

#

My dude - that is one of the earlier things you want to test.

thin stratus
#

Additional logging I would need to check

hexed path
thin stratus
#

Yeah Duro means the Session stuff

#

That's not really something for last minute 😅

#

If you develop Multiplayer games you usually should have a setup with some sort of Automation, Build Machine and upload to Steam. So you can regularly test the game.

#

Including Sessions.

#

Packaged Connection via Sessions can break a bunch of stuff too fwiw.

#

So once you get taht working you might look at a pile of bugs.

#

But I guess that's for the future.

quasi tide
#

That is always like..the 2nd thing I get going. First being basic gameplay working locally.

hexed path
#

So I need to publish to Steam to test the multiplayer, but to publish to Steam, the game needs to have multiplayer

quasi tide
#

Steam doesn't require MP

hexed path
quasi tide
#

You can still upload builds to test with

#

Upload build, give people access. Store still isn't published.

#

This is possible.

thin stratus
#

Logs you could raise the level of are:

  • LogOnline
  • LogOnlineSession
  • LogNet
  • LogOnlineServices
  • LogGameSession
  • LogGlobalStatus

And you could potentially add the TravelFailure and ConnectionFailure, or whatever they are called, events in your BP GameInstance and print the Reason on them.

#

Yeah as Duro says, you seem to have totally skipped the part where Steam allows you to upload builds and test them within your development team without actively releasing the game to the public.

#

You can create some temporary keys for some QA peeps or pre-release reviews and what not.
Or Demos, Alpha/Beta tests, etc.

#

The Store page can remain prepared and private for the entire time.

#

Or even unprepared fwiw.

#

You can make different "Beta Branches" to upload different builds too.

thin stratus
#
[Core.Log]
; This section can be used in DefaultEngine.ini to override the display level for different log categories, using lines like the following:
; LogTemp=warning
#

E.g.

[Core.Log]
LogOnline=VeryVerbose
LogNet=VeryVerbose
primal trellis
#

Guys, what is the correct way to create a loading screen in a multiplayer project (blueprint)? Something that really loads the level for everyone beforehand in some way. Everywhere I look, it's just a "workaround" of placing a widget for a certain amount of time and then removing it. But often I won't know exactly how long it will take for someone's machine to load, it's very variable.

dire cradle
#

Load the map into memory beforehand for each client, this won't open the map

#

When all clients report they've completed then open the new map

thin stratus
#

Or a Plugin if one exists.

dire cradle
#

Yeah this is a blueprint workaround

thin stratus
#

The Engine has a MoviePlayer module, which does actually take care of playing "loading screen movies".

#

Or, optionally, also simply display Slate Widgets.

#

So one usually tell the MoviePlayer to show a Slate Widget when the Map Starts loading, and tells it to stop when it's done.

#

Iirc there are two CoreDelegates for when either of those two events happen.

#

The setup is quite simple, but yeah, C++ and Slate.

primal trellis
#

Thanks for the excellent and comprehensive response, guys. I will take a look at all of this🤘

subtle kernel
thin stratus
#

Pretty sure that thing does the exact thing I said.

#

Good to know there is a plugin. Sad to know it's in Lyra and not in the Engine.

primal trellis
quasi tide
#

I know there is a plugin on the marketplace as well.

primal trellis
#

That's what surprised me too, being something so "basic" that exists in any game

thin stratus
#

It's even funnier that the MoviePlayer can also lock up the game if you do it wrong

#

The MoviePlayer manually ticks the GameThread. If you start open the Loading screen via the MoviePlayer by hand before doing, e.g., a Steam related event, like updating session info, you are in for a ride.

#

Cause the Steam stuff runs on a different thread and remains blocked until the MoviePlayer is done.

#

So if loading the level is set up to start after steam calls back, you managed to soft lock the game.

#

And I'm totally not speaking out of experience

subtle kernel
daring current
#

im using the steam advanced sessions plugin for multiplayer, im using ID 480 for the steam dev servers. Is it true you have to be in the same state as the other person to connect?

fossil veldt
#

can just do take widget on user widget and skip slate entirely

#

but problem is that for preload screen the game instance hasn't initialized yet, so there's no UMG available

#

i have wondered for a while if there's a way to actually cache slate widgets from UMG and package it with the game to be used for preload so you just dont have to fuck with slate at all

dark parcel
#

0o I haven't yoink Lyra plugin yet but I will need the loading screen.

So if I don't need instant loading screen at the start of the game I can stay away from slate?

#

Working with slate is kind of a nightmare for me.

#

Need something that I can drag and drop like umg widget but not in game thread.

mild sonnet
#

Add me to that please lol

#

Does the plugin support setting player rotation to a rotator (around a planet surface, etc) and handle physics interactions?

thin stratus
grand kestrel
twin roost
#

when using the same class,

could the instance of that class have replicated variables,

and another instance not have replicated variables?

dark parcel
#

Simply tick or untick replicates

twin roost
dark parcel
# twin roost perfect thank you very much

There are other ways to optimise them. Dormancy, relevancy, etc. I personally never go that far yet but if network bandwidth at stake then consider those options.

twin roost
#

yeah, I was intending on using them and have a "bad network" case where I assume the player has an unplayable ping so might aswell remove them from replication

subtle gulch
#

Has anyone got or know of a conclusive guide to setting up Steam Dedicated Servers? Struggling to piece together what i actually need to get it up and visible. I have the Server packaging and launching but steam is failing to load on it, im not sure if i need a GameInstance Class to create a session etc and register the server

hexed path
#

For anyone having Session Joining issues in 5.5, the reason is an incredibly dumb engine bug, that uses bUseLobbiesIfAvailable to false. It creates a mismatch with bUsePresence, which is the cause of the problem.

AdvancedSessionsPlugin seems to have implemented a fix, so just use their functionality.

Leaving this here, so that anyone having the same problem doesn't have to break the wall with their head for 2 days.

tardy fossil
#

which is what i believe advanced sessions does for their fix

valid kelp
ruby parrot
#

Alright,multilayered question:
I have my PlayerSave variables(Name of player,Health,level,etc) in an ActorComponent(PlayerData) attached to my PlayerController

  1. Is that the correct Controller/area to place it?

  2. On my PlayerCharacter I have an ActorComponent (lets say its health for example sake) with a variable currentHealt
    Now I would like to set currentHealth in BeginPlay on that component, but I cant. Because BeginPlay on the ActorComponent is being fired BEFORE PlayerCharacter is even "spawned" (see screenshot 1)

So I clearly am doing something wrong here, my current "fix"(screenshot2) is to put a delay right after the parent call of BeginPlay with 0.2 seconds wich makes it so that the PlayerCharacter actually exists,so I can cast to it, but I highly doubt this is how I am supposed to do this 🙂

Im pretty new, so any help would be appreciated

karmic trellis
#

Hello, bSetGamePaused doesnt works for clients when I run it on GameState. I tried to run them in clients PlayerController seperately but same, just server pauses but clients not 🤔 what should be problem here?

thin stratus
ruby parrot
#

and youre correct sir, its the PC not the PlayerCharacter 🙂

thin stratus
#

Your Pawn/Character has a function it can override called Possessed, that's Server only.

Or OnControllerChangedEvent, which is Server and OwningClient

#

Given the PC only exists locally and on the server, so it's null for other players.

ruby parrot
thin stratus
ruby parrot
# thin stratus Depends a bit on how you identify the player. Assuming you have a way to link th...

My approach would be like ARK.
You connect to a server and on said server(lets assume you could have more than 1 character on ark) you would get a screen with the characters to chose from or,if non exist, you would create one and after creation you go to the character selection screen and chose from there.

And yes, savegames shall be stored only on the server.

So Its correct what I did...I have an Actor Component on the PlayerController wich shall handle the loading of the saves.
"assigning it to the playerstate/pawn when needed".... well this is literally where i am stuck at 😄 I cannot load the PlayerController as we have established earlier ^^

fossil veldt
bright summit
#

is net load on client makes actor behave same as spawned runtime?

#

by the server*

bright summit
#

and second question, I finally included push-model to my project. If I mark variable as dirty and there is same value (no change), OnRep shouldbe called on clients?

chrome bay
#

no

#

push model is just a suggestion

#

Server still won't send a property to a client if it thinks it has it, client won't call an onrep if the local value matches servers value

bright summit
#

So I must just manually call OnRep on client? Or there is way to force replication if value of variable is the same

thin stratus
bright summit
#

how exactly?

thin stratus
#

I don't have the engine open atm. Search for NotifyAlways and you should find something

bright summit
lament flax
#

Since this is a MP channel, is there any people here that knows the details of how security rings works ?

#

Also, as i first asked there (#programmer-hangout message) im trying to find articles about why kernel r0 is the preferred anti cheat solution, and what are other studied/tested/searched solutions

bright summit
#

with BlueprintAuthorityOnly ufunction tag must I do hasauthority check when function is executed from c++? And for sanity check: in blueprints it is only executed with authority, right?

pale rivet
#

Heya, networking related question:
I have my Character with CMC, and my Character has weapon, when I start shooting and walking simultaneously I get client movement corrected.
Weapon firing is handled using GAS ability. I know that CMC is using RPCs to update movement, and GAS uses RPC for activating abilities(3 RPCs in worst scenario to activate 1 ability)
Its obviously that too many RPC cause drops or delays.

But, how to counter it?
I mean, it's the same actor channel, same connection that wants to send simultaneously updates about movement and fire weapon.

sinful tree
# pale rivet Heya, networking related question: I have my Character with CMC, and my Characte...

Not 100% on this, but it's probably not about too many RPCs going through, rather, you have conflicting movement data that needs to be handled. Like, you may be moving your character using a montage with root motion, but still allowing the inputs to the CMC to go through, so then the character is ending up in the wrong spot according to what the CMC thinks it should be and you end up with corrections from the CMC.

twin juniper
#

and do any of the abilities affect movement

twin vessel
prisma merlin
#

I have a very serious problem, passing an actor reference from the server to the clients returns the wrong reference to the clients.

sinful tree
prisma merlin
sinful tree
# prisma merlin

If this bit of code is called on the server (which it should be if you're trying to multicast) will return the first Player Character that the server has.
If you run that same code on a client, it may not necessarily return the same Character on the client.

prisma merlin
#

FUll print

sinful tree
wet crypt
#

Does anybody know how can i make multiplayer compatible graphic settings ( when someone changes settings it need to only affect him not everyone)

sinful tree
#

Usually graphics settings would only be changed on the local machine.

blazing bear
#

Hello, does calling a server RPC from another server RPC lead to additional calculations and is bad or not? For example, a Server RPC function that adds an item to the inventory, which is sometimes called by the clients through UI, and also by a Server RPC function that picks up an item.

prisma merlin
#

So when I use the line trace event to get the location of the actor for the reference, the server has one result and the client another @sinful tree

rose turret
#

I'm trying to build a simple rollback networking system ala the Overwatch architecture but had a philosophical question

I understand that the client simulates ahead of the server so that the server can buffer its input frames. and I understand that how far ahead the client is can fluctuate

what I don't understand is what the client displays during those frames. if the server is on frame 14 and I'm simulating frame 17, I might only have data up to frame 12 for the stuff around me (other players, etc.)

how do I determine which frames to show for other entities? the most recently received frame (frame 12)? should I buffer received frames on the client, too?

wet crypt
sinful tree
wet crypt
sinful tree
sinful tree
wet crypt
#

i am testing it on listen server

sinful tree
#

Are you using other machines to connect to that listen server, or just doing PIE?

wet crypt
#

doint it on the same machine

#

listen server 2 players

prisma merlin
#

*All actors replicate their own location

sinful tree
# wet crypt listen server 2 players

So just through PIE.... Which is by default the same game instance, so any change to one would change others. In a real world scenario, where you have a separate machine, the game settings are only going to change on that instance unless you specifically make your game communicate those changes out to others.

sinful tree
# prisma merlin

So this here should trace from self (the NPC Pawn) and trace to a single character (the one you've replicated down from the server). Do you have a screenshot of the trace in action?

sinful tree
# wet crypt listen server 2 players

If you want to simulate separate game instances, in the dropdown instead of using Play In Editor, you can do Play Standalone, then I believe it will actually have separate game instances running in which case you should see the settings only changing on the individual instance on the same machine while they are running.

wet crypt
#

thank you for the help

prisma merlin
sinful tree
# rose turret I'm trying to build a simple rollback networking system ala the Overwatch archit...

In default networking and using the Character class with the Character Movement Component, clients are allowed to freely move and it will display their location based on the values they have set within their local copy of the CMC. This allows for client predicted movement as the CMC sends the moves it is making to the server and the server then plays back those moves to see if they are valid based on the values it has for that CMC, and if not, it will send a correction, in which case the correction attempts to adjust the position on the client to the last valid location the server had and the server keeps the location of the actor at that last valid location until a new valid location is received.

The client is always running on what ever current information it currently has, which will be out of date on the server when they send a movement, and in which case if there is a conflict, the client would still see their movement working up until the point the server disagrees (as an example, to characters running towards the same spot) and then pushes whichever client was last to that spot back to its last valid location.

sinful tree
#

Or at the very least, if you can see two, they should both be going from the NPC to the one Target Actor.

dark edge
#

Might be an artifact of testing in PIE

wet crypt
#

i tested it it was about not testing it on standalone

#

thanks again for the help

#

@sinful tree And also i wanted to ask do you happen to know a detailed graphic settings tutorial or a way to do it detailed

#

i mean my graphic settings are okay but i feel like it does not affect much

#

it's like this rn

sinful tree
#

Sorry it's not something I've messed around with very much myself. I know there's tons of console commands, and that the blueprintable Game User Settings doesn't fully cover everything one could do with graphical settings.

wet crypt
#

alright thanks i'll keep looking

pale rivet
# twin juniper are ur rpcs reliable?

Just to clarify.
Its a vehicle with the turret.
No anim montages are played when performing firing.
No abilities affect movement.

Ability activation is by default Reliable RPC in GAS.
I found out it is related to RPC after testing firing. I ability is local - all good, as soon as ability is local predicted or server - issue is present.

You can also reproduce it in Lyra with any weapon with high RPM

pale rivet
sinful tree
pale rivet
prisma merlin
#

weird

prisma merlin
pale rivet
#

Ye, thats what I thought too, weapon firing logic needs refactoring, probably ability batching is appliable in this case.
I wonder how it works in Fortnite, because Epic said that they use 1 ability activation for each shot.

One more thing to mention is that issue is still present with low RPM, but if I lower down NetUpdaeFreq of the vehicle problem is almost absent, which is funny

I don't quite understand relationship between NetUpdateFreq, RPC sending and variable replication

sinful tree
# pale rivet Ye, thats what I thought too, weapon firing logic needs refactoring, probably ab...

NetUpdateFrequency is how often the server would check if any replicated variables need to be sent/checking for relevancy/sending rotation & location updates of the actor or scene component, etc. RPCs if I remember right are always sent immediately regardless of what the update frequency is.

Since you've mentioned vehicle here.... Do you happen to have a character that you're placing into the vehicle? If so, maybe you could try disabling their CMC when they enter the vehicle if you haven't already done so?

pale rivet
unkempt tiger
#

So I have a rounds based multiplayer game where the map should reset (without server travel) back to some starting condition at the end of each round, what is the best approach to implement the map reset? Will the save object system do the trick in a multiplayer server?

fossil spoke
red mantle
#

can someone tell me why this isnt working for the clients

unkempt tiger
fossil spoke
#

Something to watch out for with ResetLevel is that its only called on the Server (since its a GameMode function).

#

All it really does is call AActor::Reset on all Actors in the Level. Except for a select few.

#

Its on you to do what needs to be done for Actors that care about a Reset.

#

Meaning, they need to Override their Reset function and roll back any properties or state to defualt.

#

Its an Opt In system

unkempt tiger
#

Very interesting, I had no idea the notion of resets even existed

fossil spoke
#

Its primary purpose back in the day would have been to facilitate Round restarting in UT

#

Is my guess.

unkempt tiger
#

perfect fit, you saved me days, potentially, thanks again 😍

red mantle
#

@fossil spoke any chance you would be able to assist me ?

fossil spoke
#

Just saying "this isnt working, how fix" helps no one.

#

Please elaborate on your issue.

red mantle
#

so i have a closet that i can open and close that reports a noise event

#

the ai seems to hear it for the server but not for clients

lost inlet
#

well you didn't explain what calls this RPC, a multicast to control AI behaviour also seems pretty suspect

dark edge
#

starting from the triggering event

red mantle
dark edge
#

or, the first player rather

quasi tide
#

Why does the client need to respond to the noise event? AI processes on the server.

dark edge
#

also why does this matter, sensing should just have to happen on server

dire cradle
#

Yeah you don't need clients to execute AI at all

red mantle
#

i see

dire cradle
#

The server can run the AI, and the clients would see the AI move

dark edge
# red mantle

Totally not your problem but if you want to have instigator be "who caused that sound", it should be the character that opened the door, not the hosts character

red mantle
#

does it need an instigator ?

dark edge
#

idk

#

depends probably

#

if you wanted to filter by team etc so zombies don't investigate their brethren etc

#

It's just there so you can have a generic "who's fault is this?" parameter

red mantle
#

yea it seems it doesnt work if there is no instigator

#

so thats the problem then its cause im using get player character, its only the host triggering it

lost inlet
#

also to call a server RPC as a client, you need ownership of the actor

red mantle
#

so what exactly would i put in place insted of this ?

lost inlet
#

whoever did the interaction, presumably

dark edge
#

Yes, you should bake WhoIsDoingTheThing into the very beginning of your interaction chain

#

useful for Press Button To Kill Self or Interact To Aquire Item

lost inlet
#

this is why your run of the mill interaction tutorial on youtube ain't gonna cut it for multiplayer

#

the interaction will need to be proxied through something the client actually owns, for example their pawn (or an actor component within the pawn)

#

server RPCs sent from anyone but the actor owner will be ignored, apart from the server, because they're... the server

static owl
# lost inlet also to call a server RPC as a client, you need ownership of the actor

I am actually having a similar issue.

Currently I have the health variable in the character blueprint. When the health goes below 0, then I am trying to Set "Is Downed?" bool in that characters Animation Blueprint, which makes them go into a crawling state, and I would like to replicate that to the other clients.

I get the error "Has no owning connection" on my character and then it doesnt call "Downed on Server" .

How could I fix this?

dire cradle
opal pulsar
#

how would I get the out packet size of a NetSerialize?

I tried

size_t PriorSize = Ar.TotalSize();
Ar << HealthStruct;
size_t SentSize = Ar.TotalSize() - PriorSize;

but that doesn't work at all

#

i am serializing my health struct in a special way and It would be nice if I could just log the size for testing

I know insights kind of would help but I want to log it here

fossil spoke
#

@opal pulsar Thats more of a general #cpp question, you might have better luck getting the answer you need there.

chrome bay
#

The bunches for an actor may be split into multiple packets and assembled as they are received.

opal pulsar
lusty yarrow
#

Is it a good practice to add authority while logging to know if the log has been called from the server or client in the editor?

dark parcel
#

The print string already comes with identifier of the caller

#

Look at ukismetsystemlibrary::printstring if you need to know which machine does the logging.

upbeat basin
#

There is also GetDebugStringForWorld() in case you want to append the same on your UE_LOG messages

#

Whether it is a good practice or not might depend on the context of the log or if you actually need it or not though

lusty yarrow
#

Thank you! Is there any way to get the previous value of an onrep variable from a simulated proxy? I'm using this but it doesn't seem to work for simulated proxies. // Signature to pass const reference UFUNCTION() void OnRep_ConstRef(const int32& LastHealthValue);

dark parcel
#

Should work but why is it a reference?

lusty yarrow
#

Well, I'm using it to replicate a FGameplayTag but when the actor becomes relevant and Onrep gets called, if the actor is a simulated proxy the result on my client is None.

#
    UFUNCTION()
    void OnRep_StateChanged(const FGameplayTag& OldStateTag);```
#

Actually, my issue isn't that it doesnt' replicate. My issue is it doesn't have a previous value when going in and out of the relevancy distance.

#

if both players are within relevancy range, variable replicates just fine but if I go out and back in again, it still replicates fine but there is no more previous value.l

verbal ice
#

Map loaded actors are different since they don't get destroyed outside relevancy range

#

They just stop updating

upbeat basin
#

How stupid is using online beacons to create a friends system, if it's possible? 🤔 I'm using EOS with connect interface, so I don't have EAS functions like crossplatform friends and presence. Would it be theoretically possible to just save friend id's to cloud file, then try to either connect that id's beacon as client or wait for it to connect local host beacon to achieve "Hey your friend is online" kind of a thing?

chrome bay
#

I'd use them for parties, probably not friends though..

#

that seems like more of a backend feature to me

upbeat basin
#

It is, EOS subsystem provides that covering cross platforms as well, only if you use EAS and show extra login screen on the game startup. I'm trying to see if it's possible to find a workaround for not using EAS

#

Which apparently is possible, according to June, from Redpoint

#

They achieved cross platform friends on their subsystem plugin, with the connect interface, instead of EAS

meager spade
#

@chrome bay you around?

#

you remember to to serialize array of ustruct inside netserialize?

#
{
    FGameplayAbilityTargetData_SingleTargetHit::NetSerialize(Ar, Map, bOutSuccess);
 
    //So it can be sent over the network
    Ar << SelectedMana;
    SafeNetSerializeTArray_Default<10>(Ar, SelectedGems);
    Ar << ArtifactName;
    
    return true;
}``` its complaining SelectedGames doesnt have or cant find the << operator
#

i tried FArchive& operator<<(FArchive& Ar, FArtifactForgeSlot& Slot) { Ar << Slot.AssociatedSpell; Ar << Slot.SelectedLevel; Ar << Slot.ManaCost; return Ar; } but its sayng its malformed

#

Maybe I should just have a nrtserislize function on it and be done

chrome bay
#

I think you need the non-slot version of <<

#

Though I don't know tbh..

#

yeah that would make sense actually, I don't think the net archives are slotted ones

#

whatever slotted archives even are 😄

lament flax
#

idk Kaos if your struct has anything special but i dont remember having any issues with using NetSerialize on USTRUCTS

#

my primary use case was for atomicity

narrow wadi
#

Hello! Has anyone had experience with network physics and physics prediction in games? I’m trying to figure out the Unreal Network Prediction Plugin, but there is very little information, and almost no templates. The task: synchronization of two cars in a racing game with high speeds

#

We used smooth sync before but it very depend on ping. Now try find another way to sync players

dire cradle
#

As far as I know the Network Prediction Plugin is deprecated and isn't supported anymore

#

Unreal's built-in physics is not deterministic, meaning it will produce different results each time even if the initial conditions are the same

#

So you need to add a deterministic physics engine to Unreal to do proper physics prediction

#

I use Bullet Physics Engine in my project, it's deterministic and really easy to install and set up

#

You'd still have to make the prediction and rollback correction yourself, but take a look at the Rocket League GDC talk about networking, they explain it very well and it's straight forward to implement by yourself

#

Smooth Sync won't produce good results if you need fast speeds and constant acceleration, there is always gonna be some lag on what the clients see, and is ping dependent as you said

thin stratus
dire cradle
#

I remember reading somewhere that the person in charge of developing it left, not sure if it's still under development

subtle kernel
#

Guys, I'm being kinda slow. I have an actor that is owned by the server, I mean server spawns it. It replicates. On click event I want to call server RPC on it, but it doesn't work, I guess it's because it's not attached to particular connection. I wonder how can I make it work without getting logic, that is only related to that actor somewhere outside?

dire cradle
#

If you are a client and want to call a server RPC on an actor you have to be the owner of it

#

Check the Output Log and see if that's the issue, it should fire a warning

subtle kernel
#
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Tutorial_CorpseInACell_C_0. Function CheckAndAddItemsIfNeeded will not be processed.

yea this is exactly it

dire cradle
#

You can't use on click events on this instance since it will be called on the actor you're interacting with.

#

Instead you can make an interaction system, make the interact event a Server RPC

subtle kernel
#

Damn it, I don't want to route everything through PC

dire cradle
#

So the interaction would run on the server, but you'd be calling from the player and you own the player

dire cradle
#

Put it in your player controller or the player actor, since you own them it would work with RPCs

subtle kernel
#

it's kinda boiler plate to solve this every time you need it like this. Could be solved more elegant I guess. Like picking connection of current local player automatically..

#

I wonder why not

quiet yarrow
#

I have a scene with hundreds of moving balls. They need overlap events in some contexts, but most of the time they dont need them. Whats a good way to toggle them that is cheaper than leaving them on overlap all the time?

subtle kernel
dire cradle
#

You can use the same interaction system and the interface for all kinds of interactions, you need to do it only once?

subtle kernel
#

Well, yea. Okay. Who said it will be easy, right? 🙂 I just don't understand why it can't use current player connection to get thing done with this particular actor, even if it's not owned by current connection

#

It could have been handled automatically, right?

#

I guess it's pretty common use case and everybody does this same interaction system to do it 🙂

dire cradle
#

Because it would cause conflicts, when you restrict a client to own an actor to call a server RPC you're making sure only that client call that event on the server

#

Otherwise all clients could call the same server rpcs and would likely cause some race condition issues

subtle kernel
#

It's not very rare when all players can interact with some object that server owns

dire cradle
#

Because then it's the server that's in charge of handling interactions on that actor, the server decides which to execute first

#

It eliminates ambiguity due to latency, that gets handled beforehand in the PC that you own, that only your client can call RPCs on

#

There are probably more in depth reasons I don't know of

#

It's to optimize and keep networking stable

#

It's also better because the client simply tells the server what it wants to do, and the server handles and executes it. Instead of client directly dictating which gameplay logic to execute on the server

#

It would make it easy to cheat otherwise

subtle kernel
subtle kernel
devout sonnet
#

After trying for a solid week to see if chatgpt would be able to help me learn shit, I've found it's completely useless.

devout sonnet
#

What's a good example project that I can buy from the UE5 store to study?

karmic trellis
#

Hi I have a question about networked Character Movement and Pawn Movement. Which is better for network lagging? I m currently using "characters" for Aimove based creatures but it should be changes to pawn, are they better for network health? Listen server based by the way.

north jacinth
#

I'm trying to generate some sort of unique ID for all (or maybe just some) gameplay effects, and map it to effect classes, at compile time (before the game starts, or PIE, or whatever), and have it be accessible across all characters. This is because I'm using a proxy struct to replicate the ability system component's state without replicating the full ASC to remote clients.
Any suggestions?

#

I will be eternally grateful for any help

north jacinth
north jacinth
crisp shard
#

i've been testing removing instances of a building (basically a simpel "destruction") and i notice that when a player is to join later or be far away from a destruction, the repnotify will fire but it wont remove the instance, but the server still has removed it but the client doesn't actually get it. is this an hism thing ? or perhaps could it be something else ?

molten dagger
#

Anybody ever had an issue with Channel Name serialization?
Setup is 2 packaged clients, one is a listen server. And they start receiving what seems like corrupted packet after a while.
Client gets kicked because of the following error. Every time, this error is the same, with control channel receiving a matrix

[2025.02.26-21.08.23:993][ 84]LogNet: Error: Existing channel at index 0 with type "Control" differs from the incoming bunch's expected channel type, "Matrix".
[2025.02.26-21.08.23:993][ 84]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 76561199817674649:7777, Name: SteamNetConnection_2147473130, Driver: GameNetDriver SteamNetDriver_2147478850, IsServer: YES, PC: BP_PlayerController_Gameplay_C_2147472908, Owner: BP_PlayerController_Gameplay_C_2147472908, UniqueId: STEAM:XXXXXX [0x11000016EB5CF99], Channels: 200, Time: 2025.02.26-21.08.23
[2025.02.26-21.08.23:993][ 84]LogNet: UNetConnection::SendCloseReason:
[2025.02.26-21.08.23:993][ 84]LogNet:  - Result=BunchWrongChannelType, ErrorContext="BunchWrongChannelType"

The main error is I see that seems to happen earlier in every log

[2025.02.26-21.07.51:492][663]LogCore: Error: String is too large (Size: 925311904, Max: 16777216, String: )
[2025.02.26-21.07.51:492][663]LogNet: Warning: Channel name serialization failed.

It seems to happen randomly, and it happens pretty quickly on I'd say 1/3 of our internal team.
Any tips on how to approach debugging this? Is there a way to mark packets reliably so I could track packets from clients to server?

mild sonnet
devout sonnet
#

@north jacinth just trying to figure out RPC's and how to get the client to communicate their variables. Starting out with just sharing the username for a lobby. Both players enter their own names and when connected, both players can see each others names.

north jacinth
north jacinth
# devout sonnet <@207771453460971530> just trying to figure out RPC's and how to get the client...

basically, server RPC runs on server, client RPC runs on owning client (client that "owns" the object that function is a member of), netmulticast runs on everything. Based on my limited understanding you'd want some multicast rpc to share the username, or a server rpc that validates it and then calls multicast if it is valid. Or you could have the username be a replicated property on an actor or something

bright summit
#

This means bIgnoreClientMovementErrorChecksAndCorrection can be switched on/off at runtime to omit server corrections?

dire cradle
#

The client has access to the username, the server doesn't, so you pass it to the server with the Server RPC, then the server can broadcast this username with a Multicast (or a replicated variable, ideally in a Player State)

fossil spoke
devout sonnet
devout sonnet
#

Either multiplayer is way too complicated and/or I'm just an idiot

#

Multiplayer will be 1 of my 13 reasons why.

fossil spoke
#

Multiplayer is one of the hardest things to learn in gamedev, it takes a lot of time.

crisp shard
#

do hism's have an issue when it comes to removing isntances ? i am removing them on a repnotify but it seems to not update the hism when you're far away. it will fire the repnotify but the instance remains on the client, and you could walk through it despite beinga ble to see it

dire cradle
#

Check the ''always relevant'' checkbox in your hism actor to verify if it is a relevancy problem

dark parcel
dark parcel
#

RPC is arguably one the easier side when it comes to multiplayer.

crisp shard
# dire cradle Sounds more like a relevancy problem to me

I think this is the case but the event doing the removing is a rep notify so I had assumed when you come back into relevancy to the player would receive that updated version of the building with whatever instance(s) were removed

dire cradle
#

Yeah I'd assume that to be the case too

#

Not sure why that doesn't happen

crisp shard
# dire cradle Yeah I'd assume that to be the case too

The repnotify actually does fire on the server but the instance doesn’t get removed on the client. That’s the thing that confuses me. It’s like it doesn’t replicate the removal back to clients but only if the client was far enough west from the initial event. Or joins later

dire cradle
#

Is the actor set to replicate?

crisp shard
#

It’s a building bp made up of HISMs

dire cradle
#

The RepNotify should still get called on the client when they're in range again, try checking if it's getting called at all

#

Maybe it doesn't get called on the client at all

crisp shard
#

I think it’s because the server has the instances and when the client goes to remove that instance on the client it’s getting the server indexes and that index is actually gone so the client doesn’t have it removed because the server already removes it and when it gets to the clien there is nothing left to remove but the client never actually removes it

#

Idk if that’s why but it would make sense kinda

dire cradle
#

is your hism component set to replicate?

#

if it is try removing the replicate flag

crisp shard
dire cradle
#

yeah they shouldn't

dire cradle
#

Since the client wouldn't have it removed yet

#

How are you handling the removal?

crisp shard
crisp shard
dire cradle
#

wait, so each removal changes the same variable?

crisp shard
#

Yes

#

So more than one would result in it not destroying

#

Other parts

#

Yea?

dire cradle
#

Then the player will only get the last removal not the all of the removed indexes (when they join late or become relevant again)

#

yes

crisp shard
#

Makes perfect sense. Going to need to test that specifically to ensure that is the issue but that would make sense

#

Curious just how I would be able to ensure that all the destruction gets repnotify’d then. Cause would def not want to have to store all of the destruction in an array or somethingg that would seem a bit extreme.

#

I’ll have to think through that when I text it

#

Test*

dire cradle
#

An integer array wouldn't be that of a problem, just replicate the indexes that's it

crisp shard
#

Yea legit was just typing something along those lines. I like it

#

Basically just add each destroyed index

dire cradle
#

yeah

crisp shard
#

I’ll update on this later today for sure

#

Thank you for your help

dire cradle
#

no worries

north jacinth
#

so I'm sort of confused on how abilities are or aren't replicated on mixed mode

dire cradle
#

abilities?

north jacinth
dire cradle
north jacinth
bright summit
#

any idea why the velocity is not being applied to the movement component? It prints out correct value but it has no effect. I commented out velocity += acceleration * dt to check if there will be effect and there was.

#

want to apply additional push forces from world and CalcVelocity override seems to be good place to do it, maybe not in acceleration segmenet but I was checking things

#

ok it works, I was applying force onto Z only and it propably was overriden by gravity calculations

#

soo, I assume I should add it to all physwalking, physfalling etc

bright summit
#

ok I put this into UpdateCharacterStateBeforeMovement, seems working

thin stratus
#

Also, your for loop is copying each element of the CurrentTriggerPushProps array.

bright summit
#

ty anyway

#

but

#

as I said CalcVelocity is called before gravity calculations

#

so applying force to Z axis is not working

thin stratus
#

Hm hm

bright summit
#

and as I mentioned I think I should put it into PhysWalking, Falling funcs

thin stratus
#

You probably have to do this in the Falling Velocity Calc too then?

thin stratus
#

Yeah I know, just trying to be careful, cause CMC is very specific about what stuff hapepns where.

#

If it works in UpdateBeforeMovement, then that's fine i guess.

bright summit
#

tested it under 300ms ping

#

no corrections at all

thin stratus
#

Yeah those things are maintained via Overlaps?

bright summit
#

yes

#

🙂

thin stratus
#

Yeah then you wouldn't even need to add that to the CMC tbh

#

That's the neat thing about Overlaps.

#

Client and Server will step into it at the same "timeframe", so the prediction is basically coming "for free".

#

But since you have multiple of those that can affect the player at the same time, it's of course totally fine to have it in the CMC.

#

Only wrote this to make clear why you shouldn't expect Corrections anyway.

bright summit
#

yes I took into account situation where will be applied more forces than one

thin stratus
#

Yeah I set this up the same way for Bang on Balls

#

They also add Water and Wind volumes that affecte the player.

bright summit
thin stratus
#

But no idea anymore where I placed it

bright summit
#

and

#

why volumes?

#

those are brushes

#

or you mean by that just box components

thin stratus
#

I just meant some Actor with a BoxComponent that adds its info to the CMC's array on overlap.

subtle gulch
#

Hello everyone, i've been learning UE & CPP for about 7 months and finally started working on my own project. I'd previously learnt how to do Matchmaking with Steam, but for my Project i want to use Dedicated Servers.

I have the Dedicated Server Building and Launching correctly with the 480 App ID.

However i cant seem to join from a client, im getting a timeout message. Here is where i am so far:

  • Dedicated Server running on a Server elsewhere on the network.
  • Ports Forwarded Correctly Etc.
  • Cannot join from a client either using local IP or WAN IP.

Im really struggling to find current information about what i need to do be doing in terms of Game Instances and Game Sessions.

I setup a BP Game Instance and set it to Create and Start a Session, however this fails because there is no Player Controller on a Dedicated Server. I read some information which was more recent that says this is redundant as the server now does this itself on boot up.

I read some more info on needing to Register the Server when it loads, RegisterServer() is in the Source Files in GameSession.cpp but its currently empty.

Do i need to override this in my project? If so what do i need in there?

Any help on just the general logistics about all of this (Steam Dedicated Servers) and specifics on getting it appearing in the Server List etc would be great.

tardy fossil
#

I would use a game mode class, not game instance

subtle gulch
dire cradle
dire cradle
subtle gulch
subtle gulch
thin stratus
#

You need to create the session for the Dedicated Server. You can do that in the RegisterServer function you mentioned if you want to. Otherwise you can do it in e.g. the current GameMode if no session already exists

#

GameSession class is handled by the GameMode anyway, so the lifetime should be the same as whatever you would do with RegisterServer override

#

Sessions have nothing to do with the direct IP connection though.

subtle gulch
#

@thin stratusthanks for taking the time to try and help i appreciate it. Basically i have some existing code from a Stephen Ulibarry course i did which handled SteamOSS Match Making. I was trying to integrate into this the RegisterServer() Function, however the main difference is that in the course the session functionality was built into a Child class of GameInstanceSubsystem, which i think is still ok to do here

#

I think im most of the way there but currently i have some issues with it not resolving external references to steam_gameserver.h

#
void UMultiplayerSessionsSubsystem::RegisterServer()
{
       if (!IsRunningDedicatedServer()) // Prevents clients from registering
    {
        UE_LOG(LogTemp, Warning, TEXT("Not a dedicated server, skipping RegisterServer()"));
        return;
    }

       if (!SteamGameServer())
    {
        UE_LOG(LogTemp, Warning, TEXT("SteamGameServer() is not initialized!"));
        return;
    }

       // Set Steam Game Server Properties
    SteamGameServer()->SetProduct("spacewar");
    SteamGameServer()->SetGameDescription("Spacewar");
    //SteamGameServer()->SetModDir("yourmod");
    SteamGameServer()->SetDedicatedServer(true);

    // Log the server into Steam anonymously
    SteamGameServer()->LogOnAnonymous();

    // Set the game type and map name
    SteamGameServer()->SetMaxPlayerCount(16);  // Max players
    SteamGameServer()->SetServerName("TUE Game Server");
    SteamGameServer()->SetMapName("YourMap");

    UE_LOG(LogTemp, Log, TEXT("Steam Dedicated Server Registered Successfully!"));
}
#

Then in GameInstance:

void UTGameInstance::Init()
{
    Super::Init();

    UMultiplayerSessionsSubsystem* SessionSubsystem = UGameInstance::GetSubsystem<UMultiplayerSessionsSubsystem>();

    if (SessionSubsystem)
    {
        SessionSubsystem->RegisterServer();
    }
}
rugged heron
#

Hey everyone, I created a new project and using default pawn. I set number of players to 2 and as listen server. In client screen server is moving but in server screen client is not moving . I have also checked all the replicates checkboxes but still it's not. Default Pawn does not replicates as the Default character does ?

dark parcel
#

if you are using pawn you will have to handle the replication your self.

#

not worth the stress even if you can do it.

rugged heron
#

Ok, so does that mean even for default pawn I have to write networked movement code right ?

#

Actually, I need a spectator pawn. So for that, should I use character also ?

dark parcel
#

use character for your player character and AI

#

I never touched spectator pawn at all, but if the idea is just flying ball but it needs to be visible to other player.
Then replicating the position and rotation is easy enough. Im just gonna assumed collision will be turned off so that's not much work at all.

#

but if you don't need spectator pawn to see each other, then there's no need to replicate it?

thin stratus
#

At least for most of the settings you are setting.

#

UE already does that for you.

#

OnlineSessionAsyncServerSteam.cpp Line 399

rugged heron
thin stratus
#

At the end it should call UpdatePublishedSettings

#

Which will then set the MaxPlayerCount etc.

#

There is really no reason to manually Register the Server via SteamAPI. You "just" need to use the Session Interface and ensure Steam Subsystem is enabled.

dark parcel
rugged heron
#

Not the mesh

dark parcel
#

Then you can just make server tell every single spec pawn to move to w.e location you like.

#

You can achieve this by getting the ref to all the spec pawn and do a client rpc, teleport

#

Passing the location as the parameter

rugged heron
#

I already did that but clients are not being moved to host location after he presses the button

dark parcel
#

Well I can't see your code or what you did.

#

Gtg to bed, hopefully you can debug it or someone else come along.

#

At the end of the day you just need the client to run a function when the host click the button. Nothing fancy.

subtle gulch
#

ill try get that implmented and see how it goes

crisp shard
#

am i wrong to see event begin play as a sort of "repnotify" when it comes to a player losing and regaining an actor's* relevancy ?

crisp shard
# dire cradle no worries

quick update, so i've discovred a solution that works by making small struct to keep track of the destroyed hisms and the indexes that have been destoryed. it seems like a bit much but im not sure , cause it works perfectly now, just not sure how deadly it would become having a struct array that is going to get filled up, and it would be doing that loop on each one, but ultimatley should ignore the function after the first time casue it would probalby not be valid the second time , unless it was updated then yea should be good, but still not sure if i should remove those instances from that struct like immeditatley for the clients or if keeping it like that for now wouldn't give much issue.

the rep notify is called where i wouldnormally just remove the instance but instead i just add unique to the array if it hits and destorys said hism

#

ok maybe this doesn't work like i htought, it irnoicaly is doing the opposite now, where it's removing them correclty and updating for clients, but now it's not removing the mesh on the server

crisp shard
#

really am quite baffled, it really seems i can't get one or the other to work in tandem. and i notice when i make arrays repnotify, they simply don't seem to fire on the server at all? it really makes no sense to me

final update for now: i just set the buildings to "always relavant" and that works , but not an ideal solution , not even sure if there is one tho

subtle gulch
narrow wadi
thin stratus
#

Does the log say that it properly inits steam?

subtle gulch
#

Give me a second and ill attach log and show what engine config i did

#

DefaultEngine.ini:

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
 
[OnlineSubsystem]
DefaultPlatformService=Steam
 
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
 
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
#

.uproject

{
    "FileVersion": 3,
    "EngineAssociation": "{0D3D9D3F-4786-2D6D-678A-908E2F4FE673}",
    "Category": "",
    "Description": "",
    "Modules": [
        {
            "Name": "TUE",
            "Type": "Runtime",
            "LoadingPhase": "Default",
            "AdditionalDependencies": [
                "Engine",
                "UMG"
            ]
        }
    ],
    "Plugins": [
        {
            "Name": "ModelingToolsEditorMode",
            "Enabled": true,
            "TargetAllowList": [
                "Editor"
            ]
        },
        {
            "Name": "ElectronicNodes",
            "Enabled": true,
            "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/5cb2a394d0c04e73891762be4cbd7216"
        },
        {
            "Name": "OnlineSubsystemSteam",
            "Enabled": true
        },
        {
            "Name": "AdvancedSessions",
            "Enabled": true
        },
        {
            "Name": "AdvancedSteamSessions",
            "Enabled": true
        }
    ]
}
#

Build.cs:

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class TUE : ModuleRules
{
    public TUE(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput", "Slate", "SlateCore", "OnlineSubsystem", "OnlineSubsystemUtils" });

        PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "AdvancedSessions", "AdvancedSteamSessions"});

        // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
        DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
    }
}
#

Server.Target.cs:


using UnrealBuildTool;
using System.Collections.Generic;

public class TUEServerTarget : TargetRules
{
    public TUEServerTarget( TargetInfo Target) : base(Target)
    {
        Type = TargetType.Server;
        DefaultBuildSettings = BuildSettingsVersion.V5;
        IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_4;
        ExtraModuleNames.Add("TUE");

        GlobalDefinitions.Add("UE_PROJECT_STEAMPRODUCTNAME=\"480\"");

        GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDIR=\"spacewar\"");

        GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDESC=\"Spacewar\"");

        GlobalDefinitions.Add("UE_PROJECT_STEAMSHIPPINGID=\"480\"");
    }
}
#

As far as i could tell that SHOULD be it covered? :\

#

and as you say just pretty much launch the dedi and connect

#

Launch args are: MapName -log

#

I did also try forcing -steam -port=7777 etc

shut vigil
#

Hi guys whenever I run my game in editor with 2 players as either a listen server or client I get these errors: Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetLocalPlayerSubSystemFromPlayerController_ReturnValue". Node: AddMappingContext Graph: EventGraph Function: Execute Ubergraph BP First Person Character Blueprint: BP_FirstPersonCharacter

dire cradle
#

For physics prediction you need deterministic physics, Bullet plugin achieves that.
You'd still need to make the Prediction & Rollback Correction logic yourself

hexed path
#

I know that for engine Internal replication, Owner is traced all the way up the chain.

But is it the same for == comparison?

If Actor1 owns Actor2, and Actor2 owns Actor3,
Will Actor3->GetOwner == Actor1 be true?

#

And if not what alternatives are there for this comparison?

dire cradle
#

it doesn't appear to be doing any internal checks for that

#

it simply returns an actor reference pointing to the immediate owner

#

So it would probably return false

dire cradle
thin stratus
#

@hexed path Owner just holds a pointer to Actor2. It will just fail the == check for Actor1 cause it's. well, not Actor1.

#

The == operator can't be magically overloaded or overridden for just the Owner variable. It is type based.

#

Unless, of course, Owner would be a custom type :P, which it isn't.

neon snow
#

Hi does anyone have any info on setting up client side prediction for inputs in chaos vehicles?

shut vigil
#

I'm having an issue where when an event that is called that destroys an actor crashes my editor. If the event is either multicast or executed on the server, then the Player 1 (aka the server) causes the event, the editor crashes. The editor however does not crash if both players are a client

dire cradle
rich geyser
#

Is the player controller still the most reliable way to track a player on the server? Even after a disconnect? Looking at the implementation of AGameMode::Logout() they even check the validity of the PlayerController pointer.

#

Dealing with a team that has not really built their game systems around APlayerController or pawns, making things that much harder.

raven bone
#

Is it possible to replicate simulated physics for skeletal mesh? like replicate ragdolled character position?

sinful tree
rich geyser
#

If I had my choice of things, the game would have been built around APlayerController and APlayerState.. but it simply wasn't

dire cradle
#

Player Controller gets destroyed on logout, but you can make the PlayerState persist

sinful tree
#

These are the relevant functions that cause the PlayerState to go away.

void AController::Destroyed()
{
    if (GetLocalRole() == ROLE_Authority && PlayerState != NULL)
    {
        // if we are a player, log out
        AGameModeBase* const GameMode = GetWorld()->GetAuthGameMode();
        if (GameMode)
        {
            GameMode->Logout(this);
        }

        CleanupPlayerState();
    }

    UnPossess();
    GetWorld()->RemoveController( this );
    Super::Destroyed();
}
void APlayerController::CleanupPlayerState()
{
    if (PlayerState)
    {
        // By default this destroys it, but games can override
        PlayerState->OnDeactivated();
    }
    SetPlayerState(NULL);
}

Default PlayerState implementation:

void APlayerState::OnDeactivated()
{
    // By default we duplicate the inactive player state and destroy the old one
    Destroy();
}
rich geyser
#

So you need to modify both player controller and playerstate to make playerstate persist?

#

Well I guess looking at this code you can just modify playerstate. Wondering if that's a good idea 🤔

#

What happens when a player disconnects and then rejoins later? If there's 2 player states now with the same uniquenetid it definitely could lead to problems. Looks like there would be much more work involved fixing other things.

sinful tree
rich geyser
#

Ah we are using AGameModeBase and not AGameMode though 🤔

#

too scary of a change to make at this point

dire cradle
#

It just adds more functionality

rich geyser
sinful tree
exotic wasp
#

you could just copy those functions

rugged heron
rich geyser
quaint roost
#

realistically can a dedicated server get more perf with > 1 core?

thin stratus
#

It was originally one and the same class, and they created the Base version for games that needed less, such as Singleplayer games.

chrome bay
twin vessel
#

For simulated proxies, to replicate the "trail effect" of hit-scan shots (in the specific case of shotguns, which shoot multiple bullets at once but have a predictable scatter), should i:

  • a) multicast an array of position vectors for the end points of the traces
  • b) multicast the aim transform (world space of the client crosshair that was passed to the server) and compute the traces on the proxies themselves
  • c) something else?
dire cradle
#

Always compute on clients whenever you can get away with it

#

Preferably the server shouldn't have to multicast on every shot either

#

Unless your game really requires it

#

It would butcher the network pretty fast if you multicasted each shot of an smg or a minigun etc

#

What I like to do is to just replicate inputs, multicast only when the player starts and stops shooting

#

All kinds of trail effects, sounds, impact effects etc can just be computed on the client

#

The server would have the final say by lowering the enemy health if hit, which would already be replicated by its own means

chrome bay
#

Unreliable Multicast would be fine probably, but presumably you already have a method to get sounds and muzzle flashes to those clients, so you will likely want to do it in tandem with that.

dire cradle
#

It'd be very noticable if a few of those multicasts get dropped though

twin vessel
chrome bay
#

The problem you have is by the time the multicast reaches the client, everything you shot at will have moved anyway, so it'll never be perfectly accurate to what happened on the server unless you send specific start/end locations - but whether you really need to care about that, I don't know.

#

It's also the same downside as trying to reproduce the effect on the client, you won't be able to do it with perfect accuracy.

twin vessel
#

Yeah i know, but i feel like it would be confusing to see someone shoot at you and missing everything bullet by a meter, and still taking damage

chrome bay
#

It is yeah

#

speaking from experience 🥲

#

There's not really much you can do about it though in practice. You're ahead of the server locally, everything else is behind. You might try to "adjust" things on the local client to make it look more convincing that the other player actually hit you but there can be plenty of false positives.

#

The easy option is not showing bullet trails 😄

twin vessel
#

I feel that by just replicating the start location of the trace, it would not look right unless i replicate it atomically with the burst counter struct.
But then still for high rpm weapons idk what to do... maybe i can catch up with the shots fired interpolating the start location from the old one

twin vessel
chrome bay
#

Thing is, you've then got the problem of trails not originating from the gun barrel

#

Which looks equally as jarring

twin vessel
chrome bay
#

Right yeah, in that case just the aim transform and the "seed" that was used to spawn all the shots might be enough

#

and perhaps, you don't use the burst in that case, and use unreliable multicast instead

#

Unreliable Multicast goes down the same path as property replication so they might get dropped occasionally, but only if you're already saturated, which in most cases you shouldn't be

twin vessel
#

Ok so multicast it is, thanks!

chrome bay
#

It's also basically exacrly what gameplay cues do, and you'd be amazed how much crap you can pipe through that nowadays

nova wasp
#

imo it's always "what could make this look weird"

twin vessel
nova wasp
#

I feel like GAS cues can exist outside of the asc to an extent

#

but It's really just

  • turn vfx into one atomic asset
  • it has tags
  • it has rules that describe if it shows up and how it looks
#

you might not really need this much extra stuff going on

#

but turning it into distinct asset is really just plain nice from an organization standpoint for most things

chrome bay
#

They can. At work we've separated cues and prediction from GAS with no real difficulty

#

I just hate cues, but apparently I'm alone on that hill

#

Epic just has no interest in making GAS less of a monlith sadly

nova wasp
#

I think people tend to make two broad kinds of cue assets

  1. play a niagara system
  2. change 200 different material parameters, make them tied to a timeline and spawn 20 different other vfx things from the cue bp graph with

and I think cues are fine for both but I wish the second one was less spaghetti in practice

#

I have had to make a lot of stuff to help with the latter that doesn't come with the engine (unless I missed it... I never know)

#

and yeah I am a bit of a GAS hater but for the ways it forces design... when it fits it really is nice

#

I think their plans of breaking it up a bit sound perfect (if they ever do)

chrome bay
#

yeah.. big if 😄

twin vessel
#

Is there anyway to smooth clients animations from the host's point of view?

nova wasp
#

what does animations mean here

#

you also haven't really described why they are jittering in the first place

#

or if that's even what is happening

drifting harness
#

hello guys, quick question is there's really any difference between packaging the dedicated server through visual studio vs doing it through unreal engine itself? knowing that in both cases it's a source built engine. I tried both and they both work the same

tardy fossil
#

well one difference i know of off the top of my head is when you build through VS it doesn't cook content (at least i dont think it does)

chrome bay
#

Yeah, all you're doing is build there, you're not packaging it

drifting harness
tardy fossil
#

if you package through the editor, it will build it before packaging it

#

no need to build through VS if you dont want to

drifting harness
tardy fossil
#

oh.. maybe dedicated servers need to be built at least once in VS to show up on the package list in the editor.. not 100% sure on that

drifting harness
quasi tide
hexed path
#

Hello

Is there a better channel to ask questions about Local Multiplayer?

I have a card game, that already has fully coded Singleplayer, and Online Multiplayer modes. Trying to add Local Multiplayer to it.

Since it's a Turn-Based Card game, split-screen is very much Not appropriate for it. So I disabled it in project settings.

How I want it to work:
Whenever it's player's turn, the camera of that player's pawn is used. When the turn changes, the camera of the other player's pawn is used.

Currently when changing the turn I do this:

  1. Get the player controller who's turn it is Not. Disable input, set tick enabled to false, get pawn, deactivate camera and spring arm.
  2. Get the player controller who's turn it Is, do the opposite. Enable input, set tick enabled to true, get pawn, activate camera and spring arm.

As far as I can tell, everything above works, but the problem is, the viewport stays at the deactivated camera.
How can I transition to the other pawn's camera, essentially transition to controlling the other player controller?

#

I really want to avoid using a Single camera, or single player controller setup, since the LOT of logic coded relies on having 2 of each.

odd iron
#

Hi ,
If I want to create a sharding , Zoning or Meshing
From where should I start ?
Thanks In Advance

sinful tree
# odd iron Hi , If I want to create a sharding , Zoning or Meshing From where should I sta...

Unreal out of the box only supports 1 world running at a time, so this generally means you need to spin up a separate server instance for each zone or location you want to have exist independently. This would need to be handled by something external to Unreal that would spin up instances for you as needed. Your instances would communicate back to some kind of manager system when they're coming up or going offline/becoming available for reuse. This can also mean having to create some additional higher layer server that can facilitate communication between multiple servers for you if they need to know about one another or have things like cross-server chat. This method requires hard travels to each server, so there is always going to be a loading screen whenever you move to a new area. GameLift is an example service from AWS that can be used to spin up additional servers for you based on loads and the like. There are plenty of other BaaS (backend as a service) out there with varying features and capabilities that can help facilitate creating a mesh/zone/shard based server system for your games.

An alternative approach is building networked multi-world support into Unreal, but that is likely a huge undertaking and would likely require many major engine edits to accomplish. If you did so, you could technically have one physical server running many zones, and the Unreal server itself managing anything it controls, but I imagine this can only scale so far as well since you'd likely be limited to the resources available on that one particular server. A third approach is ditching Unreal's networking system altogether and again relying on some other means of communicating gamestate to your clients so they can represent the world. You'd effectively have to rewrite the networking system entirely to facilitate either of these options, but would allow you to have seamless travel between different zones (no loading screens).

twin vessel
odd iron
hexed path
# hexed path Hello Is there a better channel to ask questions about Local Multiplayer? I ha...

I solved the camera issue by using SetViewTargetWithBlend.

But the problem is, the controller is still the same. Is there a way to switch between Player Controllers? Something alike of Possessing, but Possessing a Player Controller, not a pawn.

Because Interactions rely on owning player controllers. For example a player can interact with a card, if that card is owned by their player controller.

sinful tree
# odd iron Thank you for this clarification .. I have ability to create Server management t...

That's not answerable within the context of Unreal Engine. How you do that depends entirely on what you're using to facilitate network communication. The end result is if you need to have something shown to other players that exists on some other server, then you need to communicate that to the clients that need to know about it. So if you're using a websocket, you'd likely need to keep track of coordinates and where players are in relation to borders so you can determine what a player should be able to see, get any relevant actors and send their data through the websocket so the client can reconstruct it and see it.

odd iron
quasi tide
odd iron
quasi tide
#

Who knows

odd iron
#

Since I need to make something like this in near future ( 3 months) xD

quasi tide
#

Definitely not that soon

odd iron
#

Yea

vapid gazelle
#

I don't fully grok this section of the Editor Preferences. What does it mean for only the Server, Client or Both to be an Emulation Target? Does that mean emulation will only be applied to that particular part of the network, and the other game instances will operate normally?

Also, when the menu says min/max latency on incoming or outgoing traffic, is that simply the editor adding a delay to those packets, making them potentially skip a tick or more before they're sent out?

dire cradle
#

If you set it to client only, then the latency will only apply to client-to-server comms

#

Set it to both for realistic emulation

#

And yes it's just an artificial delay, and packet loss percentage will simply drop the packets at random

quaint roost
north jacinth
#

Are there any good resources for understanding how movement is replicated by default?

quasi tide
#

The source code is going to be the best resource.

lament flax
#

There is one audio thread, one render thread

#

Maybe others that i forgot

#

The rest is miscs and called worker threads

round glacier
#

I'm finding that if I uncheck "run in one process", everything goes to hell for the client (lots of desync) -- I'm not finding this when running in one process or when we do actual playtests and are connecting on separate machines. Is that.... normal?

#

(listen server, 2 clients)

quaint roost
#

anyone know of a session based game that has crash recovery/actor persistence?

#

I suspect there aren’t many if at all, not worth the effort

uneven lion
#

I have an actor in my level, how do I get Begin Play to call on the client? I just want to do some UI stuff

exotic wasp
#

begin play is called independently for server and all clients

dark parcel
#

So a listen server host, it would have call begin play for him self.

When a client join 20 seconds later, the client will call begin play on it's machine.

Nothing is networked / communicated unless with RPC.

#

you can create your widget on your HUD begin play.

#

Should you want to use character for what ever reason, make sure that only the character that you OWNS run the widget. Otherwise when you receive a copy of other player's character in your world, their begin play will be called and you will end up with duplicate widgets.

#

So what you can do if you want to use the player character is as follows.

BeginPlay-> IsLocallyControlled -> CreateWidget

uneven lion
#

Hmm that's weird, cause it's not calling on my client

#

Says Server: test only

dark parcel
#

need context

#

some entities not copied to client (replicated)

#

e.g. game mode

#

game instance

#

yada2

#

Read the pinned material if you haven't

uneven lion
#

It's just an actor I dragged into the level

dark parcel
#

and your playing as?

#

what's the setting for the PIE

uneven lion
#

Listen Server

dark parcel
#

with how many players?

uneven lion
#

Just one

dark parcel
#

then there's no client wouldn't it?

#

you are playing as the host (which is the server)

#

set the number of players to 2

uneven lion
#

True but I'm using Wait Gameplay Event and it doesn't call

dark parcel
#

then you will have 1 server and 1 client

#

well that's got nothing to do with begin play?

#

or even multiplayer so to speak

#

All codes run locally to each machine. Only things communicated is through RPC

vapid gazelle
#

Has anybody here ever tried shipping a dedicated-server-less game where instead of it running the host player as a listen-server, the same machine that the game starts on runs 1. a dedicated server 2. a client connecting to the dedicated server right away locally ont he same host (think along the lines of what the editor does in Client mode) ?

The player launching the game that way wouldn't really need to know anything about this internal implementation, that they're not a listen-server, but from a developer's perspective it would standardize the logic for every player in the game, treating them all like clients, instead of most players being clients and one of them being special, having direct access to the authoritative game state.

sour cradle
#

I need some opinions. I'm thinking about creating an energy system that refills over time. I want it to be server authoritative to prevent cheating but I'm worried that it might have to send too many float values over the network in a short period of time. I WAS thinking about interpolation however I don't know if that's the right answer still. My game is going to be a rather large MMO type setting with maybe 50 to 100 connections at a time. Do you think sending a float values over the network every couple of ms is a good idea or should I explore other alternatives.

#

I like to simplify the thinking of it as a constantly changing value

nova wasp
#

I feel like you mean something a bit less

#

assuming a couple means two of course

sour cradle
#

Well I was thinking of trying to get away with as much refreshes as I can without introducing lag or other issues

#

I think the default is 60 updates per second but so doubt I even need 30

#

But it is an important value

nova wasp
#

a few things

  • you might not need an entire 32 bit float... if the maximum range of values isn't huge you can probably send something smaller or just netquantize it a bit down to not have as much accuracy
  • if this has to smoothly go up and down perfectly replication will simply not do that on its own. Property replication is effectively random in the timings of when things arrive for distinct objects and you will either have to smooth it or simulate some of the changes to its visuals/value locally
  • unreal networking scales a bit poorly CPU-wise as the server handles things per-connection and you will likely have to take advange of things like RepGraph (old networking) or Iris filters (new experimental stuff that you should not use if you are not willing to fix engine bugs) (I would bench first to see what happens though)
#

for example: for players near by to your connection's viewpoint you probably care more about their energy values as opposed to players on the other side of the map

sour cradle
#

Yeah I considered using an integer for it. This value is going to have allot of algorithms mutating it so predictability is a slight issue for me. I was thinking about some sort of last value pass "which would be one or 2 refreshes behind" and lepring the 2 values for a smooth change.

#

I was worried about sending too many refreshes at once over the network but maybe this isn't something I should even be concerned with. The value would only be relevant to the owning client and server so I won't be repnotifying it.

nova wasp
#

have you ever done a bandwidth profile?

#

also you should probably not leave out that this is just for the owner :U

sour cradle
#

No it would be my first time. I'll definitely study that

sour cradle
#

Well mega you might be right. I might actually need to replicate this value to other clients MAYBE

#

I considered using visual cues instead of passing the actual data which would be a different function

#

yeah that will work nice. I am encrypting network traffic and I might be able to see how long it takes for the traffic to be decrypted with this

latent heart
#

That pale yellow thing is really badly positioned.

#

A physics constraint?

feral narwhal
feral narwhal
latent heart
#

Multiplayer physics like that is going to be extremely janky unless you spend thousands of hours redesigning how it works correctly. Well, from what I gather.

#

(plus I may be exaggerating)

ember jasper
#

Hello there !
I'd really like to allow my players to smoothly move their friends with their trolley.

Here are 3 videos demonstrating the issue :

#

In the first one, you can see the other player seems perfectly smooth moving on its own. (video fps is lower than actual fps, so trust my words : it is smooth)

#

in the second and third videos, when bumping on top of the red part (the only one with collisions - moved away for testing purposes). The whole environment gets shaky for the player being carried.

#

The game is using Listen Server.
The movement is client-authoritative.
The trolley is replicated but not its movement.
The trolley is **attached **to the carrier on both server and clients.

thin stratus
#

Although in theory this should be fine

#

Counts as based movement

#

Do you have the same issue the other way round?

ember jasper
#

Hi eXi ! Thanks for helping out ! 😁

#

Yes, exactly the same issue when the server is the one driving ^^'

thin stratus
#

Is the trolley attached to the capsule or the mesh?

ember jasper
#

not exactly. It' is attached to a SceneComponent attached to the character.
But I have the same results if I attach the actor directly.

thin stratus
#

Point is that you might want to attach to the mesh

#

At least trying it fwiw

#

The mesh is the smoothed thing at least on the client

#

Not sure anymore if CMC smoothed mesh or capsule for sim proxies

ember jasper
#

Okay, I'll attach to it and check the result. Thanks!

thin stratus
#

Other than that, do you get any errors about based movement in the logs/output?

#

In theory this shouldn't matter unless the actual trolley is lagging which you might not be able to spot without standing on it

ember jasper
#

WOW! In fact this is a lot better !

#

Huge thanks for that one eXi!

#

Wow and when I change the network emulation profile from bad to average it gets perfect !

@thin stratus By solving my issue, you just made my day ! 🥳

thin stratus
#

No worries. The whole mesh vs capsule thing is easy to miss. In most server auth setups (you said yours is client auth), people forget about smoothing and attach visual things, like VFX,other meshes and what not, to the capsule and then it's often very jittery

lament flax
thin stratus
#

At least for the local player when it gets corrections only the mesh

#

But I would expect the same for sim proxies

#

Would need to read the code

lament flax
thin stratus
dire cradle
#

Why would the server still override client position when replicate movement is turned off?
There are no movement components or manual overrides, but the client still rubberbands to server position

#

I need the client to be able to desync positionally, while still being replicated

dark parcel
#

@dire cradle Turn off correction?

#

don't turn off replicate movement

#

look for the bool in CMC, something along the lines of Client ignore correction

dire cradle
#

I'm not using CMC

#

It's a pawn

#

I solved my issue with another way though it's ok now

dark parcel
#

cool, share the solution?

#

for the curious mind

dire cradle
#

I couldn't get the actual pawn position to not get constantly overriden by the server, even with replicate movement off

#

It's was so stubborn to rubberband into the server position

nova wasp
#

ticking order can matter here too

#

but attaching will make the other pawn move when the base moves too

dire cradle
#

I'm using fixed time steps, Im not attaching them either

#

I just make the client control the actor that represents the pawn (at the same time sending inputs to the server), as that is not replicated I can make that client authorititive. And that actor interpolates to the actual pawn's position to sync up based on distance

nova wasp
#

are you interpolating between fixed timesteps?

dire cradle
#

Yeah it seems to works well up to 300ms

#

More than that I dont really care if it works well anyway

nova wasp
#

300ms is quite a lot

dire cradle
#

but I still use fixed for simplicity

nova wasp
#

I also use a fixed scheme but I also kind of replace most of the game framework

#

fixed ticking is nice but I try to make camera rotation run at full rate
but gameplay takes the rotations only once every fixed tick of course

thin stratus
#

Fun fact: ms don't matter for prediction.

nova wasp
#

yes it does...

#

longer ping = more resim time needed

thin stratus
#

Yeah, that's not my point

nova wasp
#

and if they have a cap it might be hitting that

#

but yeah in theory it should not matter

#

but every implementation has sensible limits I find

thin stratus
#

Sure, if you have some limit that breaks the system above x ms, then it matters.

dire cradle
#

For physics objects I use full prediction and those can have several seconds of latency with no real impact unless there is player input.

thin stratus
#

But beyond that, if movement works on 30ms, it will on 300ms.
The important part is if the movement handles corrections and dropped packages well.

dire cradle
#

For characters I do semi-prediction, player doesn't wait for the server to move but interpolates to the server position at the same time

unkempt galleon
sturdy sand
#

Do servers have garbage collection? Like if I would create many objects and replicate them and after a little stop using them and also stop replicating them will they get garbage collected inside the server or do I need to do that manually?

verbal ice
#

So just assign nullptr to whatever UPROPERTY() holds the UObject

sturdy sand
#

I knew that. But does the server do garbage collection too?

nova wasp
#

the server is also your unreal engine game... so yes

sturdy sand
#

What I did was call the RemoveReplicatedSubObject() function to remove the object from replication and then call ConditionalBeginDestroy() using the object I removed replication from

sturdy sand
nova wasp
#

is that the only thing referencing it?

sturdy sand
#

or something

#

It's an object not an actor so maybe?

#

I have no idea lurkin

nova wasp
#

is it stored in a uobject pointer that is a strong referenced pointer (uproperty on a regular pointer for example) or added in AddReferencedObjects?

#

you can also just print object refs if you know the name of the object

sturdy sand
#

How do I do that?

sturdy sand
#

This would make it easier to see if I removed all references from the object or not

nova wasp
#

looks like they are stored as weak pointers by default in the old replicated subobject list

#

reading the source code to just see what is happening is worth doing here instead of guessing

sturdy sand
#

ok

nova wasp
#

I think you would have to store a reference to these yourself somewhere else

#

in your game's code

#

an example of obj refs

remote tusk
#

Should i create my systems like Inventory that is going to be replicated, in C++? I already created the system in BP but since i want to replicate it, I can convert into C++.
I heard BP is also available for multiplayer but limited, so i dont want to think about if i am going to encounter with obstacles in blueprint side, and then try to convert everyting into C++. 😄

thin stratus
#

You have access to more functions and variables of existing classes that aren't available in Blueprints.
There are also a lot of general concepts and "ways of doing things" that are not possible with Blueprints.
Especially your Inventory is usually done via "FastArraySerializer" stuff (which is rather complex for beginners), which won't ever be a thing for Blueprints (at least not natively).

exotic wasp
#

you don't have to use c++, especially if you aren't going crazy with your game

#

but I'd make an inventory system in c++ anyway

fallen fossil
#

I though I understand replication, but it seems I can't move my actor on client lurkin

remote tusk
remote tusk
thin stratus
#

That's actually rather easy

#

You can make C++ classes of UUserWidget and code everything you need there. And if you need a "link" to the actual visual thing, like a Textblock, and Image, etc., you can create variables that bind to those if they are added later.

E.g.

UPROPERTY(meta = (BindWidget))
TObjectPtr<UTextBlock> StackCountText = nullptr;

If you then make a Widget Blueprint based on that C++ UUserWidget, you'll get told that the widget needs a Textblock with the name StackCountText.

Can also be made optional via BindWidgetOptional.

That way you can freely design the widget, place the Textblock and what not where you need it, but use it in C++ just fine.

Just make sure you check if the pointer is valid. 😅

#

It should support all existing UWidgets as well as UUserWidgets. So you can also require things like VerticalBox, or even your own classes.

#

Or a generic parent fwiw. Like if you want to support either vertical or horizontal box, but don't want to decide it c++, you can use the parent class.

It's quite flexible. And having a c++ class of your inventory, slot, entry etc widgets, is very useful if you want to reference them, create them from c++ etc.

remote tusk
#

Hmm, that sounds easy actually. And to reference to that widget, for example when player clicks "I" button, should PlayerController create Inventory widget and then access to its methods for binding etc, to create slots for example.

thin stratus
#

If your Inventory exists on the PlayerController as Component, then that's fine.

#

If it exists only on your Pawn/Character, then the PlayerController makes less sense.

#

Cause you would be able to open the Inventory (or try) even when the Pawn is invalid.

#

On top of that, I would probably have an InputMappingContext and InputAction for the Inventory, and then have the InventoryComponent bind that stuff directly.

#

That way everything is nicely contained and you can expose a TSubclassOf<UYourInventoryWidget> variable in the Component and set that to the Blueprint Widget child class, so the Component can spawn it.

#

That way you can also have stuff like Chests spawns a different widget fwiw.

#

For binding the Input, if the InventoryComponent is in fact on your Pawn, the easiest way would be to override SetupPlayerInputComponent on said Pawn, and then getting the InventoryComponent and calling a custom function that passes the InputComponent along. Fwiw already casted to EnhancedInputComponent, cause you gonna be using that in most cases anyway.

#

Then the InventoryComponent can push the IMC and bind to the InputAction (you can expose both also to Blueprints so you can set them in the Editor).

#

There is also a way to do that via the WorldSubsystem of EnhancedInput, I believe, at least I saw some code for doing it for "stuff" that doens't have an owning player.

#

But I would argue that a Component on a Pawn that has an owning Player does not fall into that category.

fallen fossil
#

Seems a bit weird, wrong and redundant 🤔

void APlayerCameraPawn::MoveActor(const FVector& forward)
{
///     some code with logic...
    this->SetActorLocation(this->GetActorLocation() + moveVector);
    ServerActorLocation(this->GetActorLocation() + moveVector);
}

void APlayerCameraPawn::ServerActorLocation_Implementation(const FVector& newLoc)
{
    this->SetActorLocation(newLoc);
}
remote tusk
#

One thing confused me is, I created simple Interaction system with BPI_Interactable. Inside Player, I press E, and call ServerRPC, then Multicast and call the Interact method of the target object.
I thought i made it right, to test things out, Other client didnt see the object disappeared. Is this because Player only destroyed its own instance even if its sending RPC? Should that interactables also be replicated? What was wrong here?

#

Here is my method, i think i am kinda confused about local and etc. Now by looking, i also check for all clients to active interactable etc, which causing "zero" since they dont have any active interactable. Hmm. Thats kinda... well. I just only want to destroy the object on the other clients, which actually "Interact" method do.

thin stratus
remote tusk
thin stratus
#

You can later add some form of prediction and handle some things locally first, but unless specifically needed, Multicast doesn't seem needed

remote tusk
#

I simply go on a rock with server, then interact, and send rpc.

#

So that other clients should check. But i can see now, they will also call that method, which causing "active interactable to be zero". right.

remote tusk
thin stratus
#

Depends on how you set that

#

I will have a look in a few min. Currently on the move

remote tusk
#

Thanks for your time mate!

#

I am just trying to find a way of doing things without "multicasting" to share data other clients with "states". Disappearing objects, changing world state etc.

#

BTW, I read your docs, its really written well and basic. It makes much more sense to all those stuffs.

thin stratus
#

@remote tusk Are you using a ListenServer or DedicatedServer?

#

ListenServer being a Player is the Host.
DedicatedServer being a headless Server process.

remote tusk
#

I am using Listener server, so i am both server and client.

#

I am inside an empty project, and testing things out like, creating widget for local users.

#

At the end of the line, I add widget, because thats the earliest one that i can detect if Is Locally Controlled working.

#

All the tutorials are shown in Youtube for replication interaction system, is using ServerRPC and Multicast bug

#

So i cant find another way.

remote tusk
thin stratus
#

But in C++ would then better, cause you can't get that Widger ref otherwise, but let's stick to BPs.

#

What helps me a bit is visualizing the World as seperate copies of one another.
In 2D they would just be squares, next to each other, but invisible to each other.
One square is the ListenServer, the other is the Client.

For ListenServer stuff, you don't have to think about an RPC, as you are already the Server.
You will still let the ListenServer run through the same code, as ServerRPCs will automatically be handled as a normal function call for them.

Now if you picture these two squares being empty despite a blue circle and a gray triangle.
The Blue Circle is the Pawn, the Gray Triangle is your stone.

If the Client modifies the Triangle to be pink instead of gray (so changing it state), it will work, but only for the Client.
The other square, the Server in this case, won't get an update. If you add another world as a square next to it, for another Client, that also wouldn't get the update, cause replication only goes Server -> Client (dispite the ServerRPC).

So, you gotta ServerRPC in the Pawn/Blue Square in this simple example, as that's the only thing owned by the player here.

The ServerRPC can be pictured as the invisible connection over to the other square. Its code will execute in the Server's blue circle. If you then multicast, you'd bridge the gap between the Server's square and the Client (clients if there are multiple). At least in theory that is.

Now the color is a state though, so multicasting is wrong. You'd instead set a replicated variable, such as a color, and mark it as RepNotify. The Server changes it, the change gets replicated to the Client squares, and the OnRep will get called when the value changed and arrived (in BP also for the Server, in C++ not). Then the OnRep can use the color variable and change the color of the triangle.

That concept works for all your interaction stuff in theory.

#

@remote tusk

#

I hope that somewhat helps for your Inteaction stuff.

#

And also might explain why you don't really need that Multicast RPC.

#

You did, however, ask something that I forgot to answer:

Should that interactables also be replicated?
In most cases: Yes.

#

Otherwise, you can't have the State replicated down to the Clients.

#

If you want to do the example of interacting with the Stone and destroying the Actor, then you'd need to mark it as Replicated as well. Calling DestroyActor on the Server will automatically replicate then. No need for an RPC or ReplicatedVariable/OnRepVariable

#

All you'd need to do is:

  1. ServerRPC in your InteractionComponent (or Pawn, whatever you example currently has).
  2. Determine the Interactable on the Server. That's a key-point, because the Client shouldn't send a pointer to the interactable to the Server. That would mean it can cheat and tell the Server it interacts with something out of reach. If you want to interact via a LineTrace, you should do the LineTrace on the Server (too).
  3. Call the Interact Interface Function on the Interactable (e.g. HitActor of the LineTrace).
  4. In the Stone, where you implement the Interact Interface Function, simply call "Destroy Actor" or whatever the BP node is called.
#

btw, if you want to test "Late Connecting" clients for Multicast vs OnRep, you can enable the Late Join feature (experimental) in your Editor Preferences iirc.
Should be in most UE5 versions. That will add a new button at the top when you are playing as a server that will add a new client.

kindred cypress
#

Hello,

Do dedicated servers using steam network should have port 7777 forwarded?

I tested with spacewar and I can see my dedicated server as a LAN server, but not on "internet"

LogNet: Display: SteamNetDriver_2147482492 bound to port 7777
LogNet: Name:GameNetDriver Def:GameNetDriver SteamNetDriver_2147482492 IpNetDriver listening on port 7777
maiden flame
kindred cypress
#

Alright, I'll give it a try on my vps

remote tusk
#

Shouldnt this work only for the server side? For example, If client clicks I (i mean the client that is not the server, not host.) nothing will happen right? Thats what i assumed, because its only executed on Server.. But since the client is not the server, how MY UI is also activated in second client?

#

I think i completely misunderstood Run On Client RPC, I thought Server would execute this only. Even client can call it. But isnt the same as calling it locally? Whats the difference than calling it locally, or calling owning client? If i do it locally, both client will open Inventory, is that the reasonn? So its like checking; IsLocallyControlled, then calling local function?

#

This is also working.. IDK why i made owning client RPC. Watching a tutorial. I thought this one would cause an issue of opening UI on both side. Since we didnt check locally controlled etc since we click on I. Is this because Enhanced Input action has some differences?

thin stratus
thin stratus
#

It's the inverse of a ServerRPC

remote tusk
#

On the first setup, if I click "I" on the second client, which is not host or server, it still opens the UI

thin stratus
#

Client calling a ClientRPC will simply run it as a normal event.

#

Again, inverse of the ServerRPC.

remote tusk
#

Alright, that is much more clear, so we dont have to check "IsLocallyControlled" because its already working on owner. not on the others. I liked that actually.

thin stratus
#

You would only use that RPC if you want to tell the Client to do something as the Server.

#

Not to gate execution.

#

RPCs are generally not meant to gate execution.

#

Your usecase for the ClientRPC is bascially the most redundant one.

#

Because both ListenServer and Client only execute input locally.

#

So the ClientRPC will, in both cases, only run on their Machine.

#

If the Server would get the Pawn of the Client and then call a ClientRPC, then it would call on that client.

remote tusk
#

When client calls clientRpc.

remote tusk
thin stratus
#

A random setup to try the ClientRPC:

  • Put a ClientRPC into the Pawn that opens/closes the UI.
  • When IA_Inventory triggers, use "GetAllActorsOfClass" and put the Pawn class into the input
  • Loop over the returned Array (optionally cast to your Pawn class if it's not already), check "IsLocallyControlled", and if that returns false, call the ClientRPC
#

And then see what either of them do.

remote tusk
#

Hmm, good idea to debug actually. Thank you man, going to try this out

thin stratus
#

The result would probably be that:

  • If Server presses it, it will open the UI on the Client.
  • If Client presses it, it will try to open the UI on the Client, but via the Pawn of the Server, and that is probably not having a valid RootLayout reference, and simply do nothing (or rather report accessed none upon stopping play).
thin stratus
#

Here are the two tables for the RPC Invoked from the/a Server/Client

#

Anyway, I gotta log out for now.

remote tusk
thin stratus
#

(just to double down on the suggestion)

kindred cypress
#

I opened both 7777 / 27015 on udp and I can connect only using session id. (open steam.90261081941983260)
since i can't search & find my dedicated server

Probably I have to set the server as "secure" or something else. (My DefaultEngine.ini )

*not a big deal, I'll figure it out later, thanks for helping

rose pollen
grand kestrel
rose pollen
grand kestrel
#

@rose pollen Just btw, turn in place is typically disabled under root motion, so I don't think it will do what you want

rose pollen
grand kestrel
#

I see. Then I can't help with that 🙂

rose pollen
# grand kestrel I see. Then I can't help with that 🙂

the rotation rate cap does exactly what I want already, it just client/server staying in sync and not triggering any rotation corrections if the cap changes that I am concerned about, is smoothly handling changes to the rotation rate fundamentally different than changing the move speed?

grand kestrel
#

Oh. Wait. You're talking about predicted movement, not my turn in place plugin
Got my wires crossed

#

You can just override the functions where it applies the rotation rate lol, you don't need my plugin to do anything

fallen fossil
#

what is correct way to implement moving replication in unreal engine? I am not using move component thus I am making my own.
I am thinking about 2 concepts:

  1. Send RPC to server wait for updated position.
  2. Move actor locally, send update to server. In this case I don't understand why pawns are also updated in all clients except current player. Is cpp RPC different?
#

How do I properly predict local changes? 😛

fallen fossil
#

I asked more about repolication