#multiplayer

1 messages · Page 628 of 1

winged badger
#

the total length of 2 function bodies also goes from 9 to 2 lines

vague fractal
#

I hope i'm understanding it correctly.
So i should just use the (server) set function as initial call where it will call the (client) set function ?

#

I'm feeling really dumb rn(Probably cuz i am, but also cuz the lack of sleep >_<)

peak sentinel
#

Is actual ping is Ping (playerstate variable) * 4? I remember Kaos mentioned it somewhere but couldn't find it

winged badger
#

iirc yes

#

better to just wrap that into a normal function in your custom PS

dreamy sable
#

I'm working on a networked sailing game. It all seems to sync well except for this one thing that we can't figure out. A player is able to tip the ship, We thought it was physic interactions from the charactermovement component but we disable it and it's still happening. We then thought it was depenetration from desync, It happens less on the server-client than remote clients. We tried reducing the depenetration lengths on the character but that didnt help either. We would greatly appreciate a push in the right direction

summer tide
dark edge
sharp kestrel
#

Do all players spawn with a Spectator Pawn at beginning of game?
I'm doing a multicast event, it casts through my spec pawn but for some reason when I use print string after this cast it treats it like everyone passed the cast.

desert idol
#

Hey I looked up a little and i found no video about voice chat . is there a way i can implement voice chat my mutliplayer game?

dark edge
vague fractal
#

@winged badger So i still hope i understood you correctly(Now with enough sleep :D).
I've changed the code to this here now

void APlayerCharacter::TakeStamina(const float Stamina)
{
    M_StaminaCurrent = FMath::Clamp(M_StaminaCurrent + Stamina, 0.f, M_StaminaMAX);
}
void APlayerCharacter::Server_TakeStamina_Implementation(const float Stamina)
{
    TakeStamina(Stamina);
}

Where i'll only call Server_TakeStamina(SomeFloat) if i wanna add/remove stamina from the player.
So far it also seems to work for both, server client and just the player client

hybrid zodiac
#

Hi everyone, I'm really stuck trying to get Seamless Travel to work. According to the UE4 documentation, all you need to do is set bUseSeamlessTravel = true in MasterGameMode, define a transition map, and then called GetWorld()->SeamlessTravel and it should all just work

#

But it doesn't work for me. The client is left behind in the previous map

#

I'm not sure how to debug this

#

ServerTravel works fine, but I have an issue where I need some client settings to persist during a level change, but of course with non-seamless they all get disconnected and reconnected, so it's impossible to track things like whether the player had admin privileges

#

I'm working with C++ by the way

bitter oriole
#

For the most part bUseSeamlessTravel is enough really, IIRC there's a default transition map

#

Dunno what SeamlessTravel () does though, I just use ServerTravel for seamless

hybrid zodiac
#

Ah, so it is enough to just set bUseSeamlessTravel, you don't even need to call seamless?

bitter oriole
#

The doc doesn't even mention SeamlessTravel()

hybrid zodiac
#

Oh my god I'm dumb. I just assumed you had to call SeamlessTravel() since, well, the function is there

#

I just removed the call to SeamlessTravel() and went back to ServerTravel, but with bUseSeamlessTravel = true and it works

#

Thanks!

bitter oriole
#

Cool !

tawny mason
#

Hi guys, i'm having trouble with high framerate clients - server (listen). Networking seems to stabilize around 100fps but any higher like 120 is just drowning my networking, i have tried clamping network update rates to 30-60 fps enabling different values.

ConnectionTimeout=80.0 InitialConnectTimeout=120.0 MaxNetTickRate=60 NetServerMaxTickRate=60 LanServerMaxTickRate=60 NetClientTicksPerSecond=60 KeepAliveTime=2 MaxClientRate=100000 MaxInternetClientRate=100000 bClampListenServerTickRates=true UseAdaptiveNetUpdateFrequency=true

#

Any idea what else i can try ?

strong vapor
#

use the netprofiler is always a good move

#

you can see exactly what the drag is

#

theres some youtube material on it..

#

Does Unreal Insights do network stuff?

#

i dont remember

#

that might be another good avenue

meager spade
#

the problem is clients will be sending RPC's in at say 120hz

#

listenserver needs to handle these

#

even at 60hz with 8 players it will be quite a lot for the listen server to process aswell as maintain its game thread for playing

tawny mason
#

@strong vapor I have already tried using the profiler to find out what the issue is, but i don't see anything odd.

#

@meager spade that is basically why i'm trying to limit the rate, but i can't seem to figure out what to do exactly

#

i have no multicasts on update and stupid stuff like that 😄 i have spent the last couple of days checking that kind of stuff

meager spade
#

CMC sends RPCs on tick

#

so if you have a playable character, you have rpc's on tick

tawny mason
#

yes, cmc is the main offender

meager spade
#

ofc

#
[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=200000
MaxDynamicBandwidth=40000
MinDynamicBandwidth=20000
ClientAuthorativePosition=false
ClientErrorUpdateRateLimit=0.015f
MAXCLIENTUPDATEINTERVAL=0.25f
MAXPOSITIONERRORSQUARED=6.f
MaxClientForcedUpdateDuration=0.60f
ServerForcedUpdateHitchThreshold=0.150f
ServerForcedUpdateHitchCooldown=0.100f
MaxMoveDeltaTime=0.125f
ClientNetSendMoveDeltaTime=0.0166f
ClientNetSendMoveDeltaTimeThrottled=0.0222f
ClientNetSendMoveDeltaTimeStationary=0.0166f
ClientNetSendMoveThrottleAtNetSpeed=10000
ClientNetSendMoveThrottleOverPlayerCount=24
bMovementTimeDiscrepancyDetection=false
bMovementTimeDiscrepancyResolution=false
MovementTimeDiscrepancyMaxTimeMargin=0.25f
MovementTimeDiscrepancyMinTimeMargin=-0.25f
MovementTimeDiscrepancyResolutionRate=1.0f
MovementTimeDiscrepancyDriftAllowance=0.05f
bMovementTimeDiscrepancyForceCorrectionsDuringResolution=true
ClientNetCamUpdateDeltaTime=0.066f
;If ping goes over this value, we have bad ping. Value is milliseconds.
BadPingThreshold=200
;If ping goes over this value, we have severe ping. Value is milliseconds.
SeverePingThreshold=500
;If packet loss goes over this value, we have bad packet loss. Value is from 0-1.
BadPacketLossThreshold=0.05
;If packet loss goes over this threshold, we have severe packet loss. Value is from 0-1.
SeverePacketLossThreshold=0.15``` put this in your DefaultGame.ini
tawny mason
#

i think i have something pretty similar, but i will try with your values

#

MaxMoveDeltaTime=0.125f ClientNetSendMoveDeltaTime=0.0166f ClientNetSendMoveDeltaTimeThrottled=0.0222f ClientNetSendMoveDeltaTimeStationary=0.0166f ClientNetSendMoveThrottleAtNetSpeed=10000 ClientNetSendMoveThrottleOverPlayerCount=24

#

this part is basically the same on my part

meager spade
#

yeah

#
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName=OnlineSubsystemSteam.SteamNetConnection
bNeverApplyNetworkEmulationSettings=true
MaxClientRate=25000
MaxInternetClientRate=25000
bClampListenServerTickRate=true
NetServerMaxTickRate=30
MaxNetTickRate=30

[/Script/Engine.Player]
ConfiguredInternetSpeed=25000
ConfiguredLanSpeed=25000``` also these values
#

obvs if your not using steam, this should be your current net driver

winged badger
#

that is 8 clients config btw

meager spade
#

^

#

well tested with 8

tawny mason
#

[/Script/OnlineSubsystemSteam.SteamNetDriver] NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection" ;[PacketHandlerComponents] ;+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface ConnectionTimeout=80.0 InitialConnectTimeout=120.0 MaxNetTickRate=60 NetServerMaxTickRate=60 LanServerMaxTickRate=60 NetClientTicksPerSecond=60 KeepAliveTime=2 MaxClientRate=10000 MaxInternetClientRate=10000 bClampListenServerTickRates=true UseAdaptiveNetUpdateFrequency=true

#

I have this

meager spade
#

well 10k

#

is really low

tawny mason
#

should i bump it ? to say 20 ?

meager spade
#

we have ours at 25k

tawny mason
#

k, i will bump it and try again

meager spade
#

also sort your network actors priority and update frequencies

#

those can kill your networking and cause a heavy load on the listen server

tawny mason
#

yes i already had a nice chat about that with @winged badger :3

winged badger
#

when our blueprint people played with net priorities

#

ouch

#

basically, actors are replicated in order of priority

tawny mason
#

same, we noticed some of them yesterday on 100 - 200 netprio

#

rip

winged badger
#

when they are passed in an evaluation pass, their net priority increases a little

#

takes ages to get panick past a 100

#

our short lived actors like grenades and projectiles wouldn't even live long enough to replicate once

golden nest
#

Hi, does anyone know why FindSessionsAdvanced always finds all sessions ignoring wheater the session is LAN or not?

bitter oriole
#

Using which OSS ?

golden nest
#

only the default one?

bitter oriole
#

Assuming that's NULL, it only does LAN anyway

golden nest
#

mmm i have a bunch of oss enabled, but i don´t know which one is running. Should i disable them all?

bitter oriole
#

You only have one running

#

The one set in DefaultEngine.ini

#

"DefaultPlatformService"

golden nest
#

[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum

[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/FANLab")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/FANLab")

[/Script/EngineSettings.GameMapsSettings]
EditorStartupMap=/Game/Maps/MainMenu.MainMenu
GameDefaultMap=/Game/Maps/MainMenu.MainMenu
TransitionMap=/Game/Maps/Transition.Transition
ServerDefaultMap=/Game/Maps/MainMenu.MainMenu
GameInstanceClass=/Game/Blueprints/AllLevels/GameInfoInstance.GameInfoInstance_C

[Internationalization]
+LocalizationPaths=%GAMEDIR%Content/Localization/Traduccion

[/Script/Engine.PhysicsSettings]
MinContactOffset=0.000100
MaxContactOffset=0.001000
ContactOffsetMultiplier=0.001000
DefaultTerminalVelocity=7600.000000
MaxAngularVelocity=10000.000000

bitter oriole
#

It's NULL, then

golden nest
#

So, i have no one?

bitter oriole
#

The one that's LAN only

golden nest
#

Mhhh so it will only create and find lan sessions?

bitter oriole
#

Yes

golden nest
#

And how can i create online sessions without steam?

bitter oriole
#

By using another store's service, or building your own service

golden nest
#

Does epic have one?

bitter oriole
#

They do, it's called EOS

#

Though Steam players would rather use Steam

golden nest
#

Oh

#

Thanks

#

There is any tutorial about how to enable EOS?

bitter oriole
#

Last I checked it was less "enable" and more "write the UE4 integration" or "buy an expensive plugin that does it"

#

And it's not like you can sell on EGS right now, so I'd suggest working on supporting multiple stores - Steam works out of the box with no setup

golden nest
#

what is EGS?

bitter oriole
#

Epic Games Store

#

The store (loosely) tied to EOS

golden nest
#

Oh so i would need to find the subsystem to use based on the player preferences?

bitter oriole
#

Not really

#

It's more like you'll have a Steam build, maybe a GOG build or EGS build if either platform does a deal with you

golden nest
#

But i´m not trying to make a deal with a platform

#

If i need my game to be hosted online but not making deals with those platforms i would need my own service?

#

Can i use only an Epic service to do it?

#

Or there is no such a thing

bitter oriole
#

As far as I know EOS is the only one that explicitly doesn't want you to sell through their store to use their services, at least for now

#

With the caveat that most players will take a dim view of creating an EOS account to play your game

#

But most players will take a dim view of not buying on Steam, in the first place

#

So I guess you're fine

vague fractal
#

Is it possible to ignore everything expect the own player with it's attached components when using USceneCaptureComponent2D ?
Currently I'm able to just capture the player, but it would also capture other players

meager spade
#

it takes in an array of ignored actors right?

#

so you can grab all players and add them that is not you

#
    UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category=SceneCapture)
    TArray<AActor*> HiddenActors;```
#

this just needs to hold all players that is not the local player.

vague fractal
#

Thanks, seems like i read too fast so that i didn't even saw that in the source code

#

Oh actually, it seems like this isn't inside of USceneCaptureComponent2D, but USceneCaptureComponent then

meager spade
#

yeah ofc

#

its shared

#

its not unique to the 2D

rain ledge
#

Hey, I made a widget with a crosshair and if it over an enemy it should go to red. this is my line trace that cast to the widget and change a boolean. If the function non-replicatedt, the croshair for the server goes red,but not for the client that target the enemy and if the server target someone nothing happens, if its multicast all go to red if 1 client target something,but nithing happen on server. if the function server or owning client, nothing happen anyway. so i read a little and try a way where the tracing for all only go on server an the server send via player id check the boolean to clients but it doesnt work. have anyone some ideas or inspiration, tipps how i can solve it so, that wenn the server target a enemy it goes red for server and if the client target something ot goes red for the client. I programming not so long for multiplayer so this might be easiere than i think , but io stuck actually and turn around over this problem 😩

rain ledge
#

now i replicated the widget var, and if the server got a target the client one goes res und ist the client target one the server goes red.... i realy dont now what goining on

strong vapor
#

@rain ledge so i dont maybe have the right context for your question by your screen shots cause i dont know what script they're being called in BUTTT... i can tell you that widgets dont have any replication.. they're owned BY the client.. so the server never sees any of it... thats a dedicated server atleast.. listen server's still have Widgets but its still not good architecture to try to put replicated variables in widgets or something

#

also just a general suggestion for debugging is to start throwing Print statements off all those "cast failed"s and "isvalid"s

#

so you know where its going wrong or whats missing

rain ledge
#

thanks for the input, its an interesting fact about widgets

royal isle
#

hey, I am trying to convert the vanilla SocketIO c++ client to using unreal systems (notably unreal websockets). In that regard, I want an unreal replacement for the asio library. What would be the best thing to use here?

soft relic
#

anyone knows why move to actor from server makes the player who controls it lag? I guess its the sync between the two but not sure how to solve this

rain ledge
tawdry viper
#

Hell;o guys i have a short warning but its in real its a error:

meager spade
#

the warning is quite clear

#

you tried to read a property that is not valid

tawdry viper
meager spade
#

yeah no idea without know what is happening

#

clearly its trying to find an invalid object

tawdry viper
#

hmm strange

charred wren
#

How difficulty would it be to migrate from listen servers to dedicated servers late in a project's development cycle?

#

I am trying to prototype and get something out, but the requirements to get a dedicated server properly tested seem a bit much for a project in the prototyping stage

dark edge
charred wren
#

Perfect, so I just need to make sure it isn't throwing exceptions and I should be golden

#

(not showing UIs, playing sounds, etc.)

kindred widget
#

Quite a few games actually use both styles in the same game. Ark is a great example. It's very heavily dedicated server oriented, but it also has the ability for people to play listenserver style for coop with friends. In reality your server code should almost always be written like it's going to run independent from a client. So that style ends up leading to it not mattering if the server has a player as well, or if it's on a dedicated instance.

shrewd tinsel
#

will is controlled be valid on client?

kindred widget
#

@shrewd tinsel Only for the local player's character.

#

The call gets the pawn's Controller, and casts it to APlayerController. But controller won't be valid on the client unless it's the client's controller, which would be controlling the client's pawn.

summer tide
soft relic
#

Anyone knows how to fix the lag when server calls move to actor and you control the character moving?

bitter oriole
#

Instead, move the character locally, tell the server your input, simulate deterministically on both, and reconcile server commands accounting for lag

halcyon totem
#

I have a widget thats suppose to say either active or inactive when I press a button, its showing up on the server but not on the client , what do I need to do to make it show up on the client?

soft relic
#

@bitter oriole No I dont want to do iinput, player can already move locally, its just that the server needs to also assign him a move to actor, thats the only thing im missing right now, I know the concept for all the multiplayer stuff quite well already but seems like when server says to move to, the client sync stuff from the movement component makes it jerky for the owning client

#

Its like a MOBA game where you cna also move with WASD

bitter oriole
#

Pretty sure the "move to" stuff isn't really meant for client-driven multiplayer

#

But okay

soft relic
#

I could just not possess it but that wouldnt be an option due to direct input

#

Yeah thats what I miss, I tried calling on server/client/server and client at the same time, all were jerky

bitter oriole
#

I mean it probably completely bypasses client synchronization

soft relic
#

Yeah thats what I thought, is there a way not to?

#

Directly giving directional input wouldnt work either since I need pathfinding, unless I make some logic for it on the client, but there has to be a better way

bitter oriole
#

Not a big character expert here so I don't know, dig into the ACharacter code to see if there's a code path for a moveto that doesn't rollback clients

soft relic
#

I can maybe try unpossesing and possessing the character on input as well

cyan crane
#

Can someone suggest how to properly replicate the grabbing of objects in a VR game? It doesn't work out of the box

severe widget
#

same way you replicate any complex mechanic - based movement in CharacterMovementComponent might give you some inspiration. No cliff notes on that one, afaik.

it's not an easy answer and you're going to need some foundational study

halcyon totem
#

@cyan crane use the Vrexpansion plugin its already there

#

can someone help? For some reason my text binding is not showing up on my client widget, its suppose to say if its active or inactive, but its not showing on the client, how can I make it work so the client see it

severe widget
#

cast failed?

#

Like to write things like this as CastWorked && Condition so if the cast fails it explicitly does the false case (because either way doesn't use the character state beyond asking for the yes/no.)

lament cloak
#

Anyone know why this is happening?
Linux Dedicated Server on Development - Works
Linux Dedicated Server on Shipping - Works
Windows Dedicated Server on Development - Works
Windows Dedicated Server on Shipping - Doesn't work
STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.

For Linux Shipping to work, I had to put steamclient.so adjecent to the server exe, I see no mention of this anywhere when it comes to Windows though, is it maybe something like that?

#

I don't even understand this error anyway, it's completely lying when it comes to dedicated servers. I've had multiple servers, plus a game instance running on the same machine fine, as long as the ports are different. Just not on Windows Shipping.

sick creek
#

@lament cloak ive had the same issue before do you have your own steam app id?

#

cause i get that error when i use 480 dev app id

#

also are your ports open on your modem

#

cause my mistake was opening them on the router and not the actual modem

lament cloak
#

I got it working. I needed steamclient.dll and steam_appid.txt adjecent to the server's exe. So it was the exact same problem with Linux and Shipping. Getting real tired of these undocumented, unexpected behaviors.

sick creek
#

ok

lament cloak
#

thanks for trying Spooky!

sick creek
#

np just speaking from my experience 🙂

lament cloak
#

Im definitely going to document the 100 "gotchas" i've had with steam dedicated servers and UE4 lol

unreal epoch
#

so I need some help with networking. I basically need to set the weapon child actor class to the one in the game instance, and make sure that both the server and the client have the right weapon class before executing the rest of the "begin play" events.

#

It doesnt seem to be working on the client. all of the weapons from the players on the client are not properly initializes

#

the code to replicate the initialization is the second pic, which I know for sure works

twin juniper
#

Quick question, was going to work on building the dedicated server and was wondering if anyone has any experince with utilizing a config for things such as server name, player count, etc.

summer tide
#

When you posses and unposses do they only have to happen on server RPC/

strong vapor
#

@summer tide they only happen on the server that's correct

halcyon totem
#

can someone help? I have created a widget HUD in my player controller but it will only show up on a button press on my character, if I connect it to the begin play of my character it wont show up. does anyone know why?

summer tide
#

right

strong vapor
#

@halcyon totem have you tried a slight delay yet?

#

if it fixes it. that doesnt mean its the best solution.. but it atleast lets you know the problem

karmic briar
waxen quartz
#

Is there a way to join a session without a level change? I have a menu which requires players to ready-up etc. before actually travelling to a map, and when joining that session it kicks the clients to the home screen since it reloads the whole thing.

#

Worst case scenario I can do logic in construct to build it differently if already in a session, but the animated menu elements would both freeze and start from the beginning no matter what this way.

lament cloak
#

Is it possible to have a config for the server and a config for the game client?

#

I know it's possible per platform, but wondering if doable per build target

chrome bay
#

It's not I don't think, the same question came up a week or so ago

foggy smelt
#

Hello all, I am looking for someone to help with a small project. I will pay money for time/services.
Sorry if this is in the wrong channel, as I could not find a specific one for private projects

bitter oriole
random nymph
#

Any idea what could be causing steam session to not appear in search result and not be joinable after 2 players have joined the game? I have set the NumPublicConnections to 10 when trying to test it but the session allows only 1 more player in addition to the host

chrome bay
#

You may have to enable to uber-verbose logging to get any reasonable info.

#

LogOnline is the category I think

winged badger
#

also worth making sure that you didn't incorrectly modify a session manually when you detected a player joining

#

like instead of putting "there are 2 players in the session" in the session data

random nymph
#

Hmm my bAllowJoinInProgress was false. I try to set it to true

winged badger
#

capping the connections to 2

random nymph
#

i'd assume session is considered started when there is at least 2 players?

chrome bay
#

IIRC the default implementation marks it as "Started" once the gamemode match state changes to "In Progress"

#

So it's up to the game really

#

I don't know if steam even cares about that flag tbh

winged badger
#

without custom code to control it that happens as soon as the server opens the level though

twilit heron
#

Hey guys, can someone help me understand, I am working on TP Multiplayer and I have my custom camera which is spawned as separate actor and then set as player camera with node SetViewTargetWithBlend, Camera is following player by it self. It works fine in single player mode but I have problem in multiplayer. I have situation where camera is ok on Host machine but on clients doesn't work. I was trying a lot of things, currently I am trying in Character Actor class on start to spawn camera if it is localyControlled it looks like it is there on both but for some reason unreal doesn't want to blend to the camera , I guess because actor has not authority over camera. I am confused how should I handle this situation.

#

Thanks in advance guys

random nymph
#

The problem was caused because of the bAllowJoinInProgress being false

peak star
#

@random nymph oh what is bAllowJoinInProgress about? I am looking for a way to stop people from joining the game while it is on certain levels, but allow them to join when it is in a Lobby level

random nymph
#

It is a boolean in online game session settings. If it is false and the game has started the game cannot be found or joined with SearchSessions

#

And I comped through engine code and it looked like gamemode StartPlay setted it true

peak star
#

Ok that might work for me. I also need to block join by people opening the IP address in a LAN game

#

(This is using online subsystem NULL)

#

Can I do all that from blueprint or will i need to expose some functions?

sand tusk
#

Why when i try to setup a multiplayer, it look like the 2 player plays on 2 different game? (if player 1 move, i can't see him moving on player2's screen) P.S and both of us move the same character

vague fractal
#

Where do you guys usually place this override ?

void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

Currently i feel like it belongs below the ctor

random nymph
vague fractal
#

Alright, just wanna know the usual case in case that i'll have to share my project with others.
Cuz i don't think ppl are used to have it somewhere in the middle or smth like that xD

#

Any chance that you can send the link without having much of an effort ? xD

#

Seems like it doesn't really show it there

vague fractal
#

Alright, i'll stuck to below the ctor then

halcyon totem
#

I dont get it why will my widget only show if I press a button, how do I get my widget to show on event begin play? I tried adding a delay but it still wont show

#

I have created a widget HUD in my player controller but it will only show up on a button press on my character, if I connect it to the begin play of my character it wont show up. does anyone know why?

marble gazelle
#

because you hide it

halcyon totem
#

yeah because I dont want that HUD going to every player

#

I just want it on 1 team, so everyone who joins that team will have that HUD. if I am doing it wrong how am I suppose to do it?

meager spade
#

Listen server or dedicated server @wheat magnet ?

summer tide
wheat magnet
#

dedicated server, but can you explain what is diff between dedicated and listen server in better words

#

i already compiled the dedicated server with source unreal

meager spade
#

if that run on server is on an actor owned by that client, sure

wheat magnet
#

and how i can build listen server?

meager spade
#

@summer tide

#

Listen server means one play is server and also player, dedicated server is what it says just a server with no player.

#

if you want matchmaking etc, you have Steam or EOS

#

but you will have to host the dedicated servers somewhere if you choose dedicated server, and that costs a lot of money

wheat magnet
#

so it mean that i don't need to host the game on gamelift or amazon servers etc in case of listen servers?

meager spade
#

correct, one player is the host

wheat magnet
#

how it could possible over internet

summer tide
#

? why did you ping me? I had diff question?

wheat magnet
#

i mean WAN

#

wide area network ( worldwide)

meager spade
#

you asked if that code will run right @summer tide and i said if that run on server is on an actor owned by that client, sure

#

forgot to ping you on the answer sorry

summer tide
#

So I've a character BP and a Boat BP. I posses the boat on interaction.

meager spade
#

and where is that run on server?

#

@wheat magnet use steam

wheat magnet
#

@meager spade Great, so can you explain how i can do stuff with listen server

meager spade
#

or EOS

#

they both handle nat punch through

summer tide
#

It has to work on hosted project, 2 clients and 1 host

wheat magnet
#

does EOS ready for production?

meager spade
#

@summer tide where is that run on server event?

wheat magnet
#

because it doesn't authenticate each client ( it only authenticate the user who have setup their EOS account details ), this is still experimental feature

summer tide
#

I'ts in the screenshot above the server event

meager spade
#

yes

#

but what Actor is that

#

@wheat magnet i would recommend steam, its simple to setup and does listen server just fine

wheat magnet
#

there are plugins for EOS, should i use the plugin ( like blueprint API ), or should i use pure EOS C++ SDK?

meager spade
#

and just one fee of $99 to register

#

EOS requires a lot of setup

#

and i have not used it

wheat magnet
#

can you post the reference link, from where i can start for steam

#

did you mean steam provide us listen server, or matchmaker?

summer tide
#

I've a player component attached to my player. It's being called from there via the Event Interact interface.

meager spade
#

so it should work fine

wheat magnet
#

@meager spade can you guide me from where i can start with steam 99$, so you can provide link and guide so i can setup

#

and what is the requirements for that, i mean does the project need to upload on steam as well?

#

like steam depots stuff

meager spade
#

yes it has to be on steam

wheat magnet
#

but steam need to approve the game before we test?

#

or we can do without steam verification

meager spade
#

you can test using the test app id

wheat magnet
#

because i think this is very long process to upload game on steam

meager spade
#

30days roughly

wheat magnet
#

they ask lot of requirements and information

#

but for testing purpose, can i start work immediately( without 30 days verifier )?

meager spade
#

yes you can test with the test app id

#

tho it's a pain cause other people use it

wheat magnet
#

what mean by other peoples use it?

#

i want to test my game like realtime game

summer tide
#

The player won't move with the boat in 2 clients setup, 1 host.

wheat magnet
#

like multiple users testing from different countries

meager spade
#

@summer tide and you verified that function is running?

#

and its possessing?

wheat magnet
#

i need the guide from where i can start

#

also should i need what kind of API

summer tide
#

The possess works since I can control the boat.

summer tide
gray tartan
#

Has anyone experimented with zerotier or nebula for multiplayer networking?

distant wave
#

Hey guys! I had a project in UE 4.20 and upgraded it to 4.25. I fixed the includes and some other API errors and now I realised that the multiplayer doesn't work anymore. Any idea on what's going on?

meager spade
#

nope

distant wave
#

Things I have tried:
-went to the bathroom
-did 10 pushups
-jumped in the air and tapped my hills 3 times

meager spade
#

🔮 shows nothing

distant wave
#

:)) I will shoot a video in a bit

#

I can tell u a little bit of a back story

meager spade
#

maybe should have asked the question once you have the details 😄

#

cause you asking what could be going on is a bit "wild"

distant wave
#

lol, I meant if there were any known issues or something

#

I can tell u that what I did was find and replace "Role" in every file with GetLocalRole()

#

if u have visual assist u can select the word "Role" in one of ur cpp files and then go to VA and select rename and I renamed it to GetLocalRole

#

anyway, there is no error or warning, it just broke

meager spade
#

renaming Role to GetLocalRole() in your code will not break anything

#

GetLocalRole just return Role

distant wave
#

Alright, the video is being uploaded to youtube

#

dude nothing is working right

#

i was playing an animation and after a few loops the editor crashes with no info

#

tf is going on hya

lost dune
#

I need help Please to Setup the OWS vplugin for openworld multiplayer dedicated server

#

has someone a tuto for 4.26.1?

#

I have alrdeady setup and launched the TestStart version but i don't know how to launch my own map

#

what file to edit and how to launch my own map on the dedicated server

slim matrix
#

so i wanna do sprinting but the current client prediction/correction prevents me from sprinting if there is any sort of packet lag this video explains what my issue it but his solution i cant get to work in 4.26 so how can i add sprinting and have it work with the network prediction

https://www.youtube.com/watch?v=RtQRMcupJs0

Many of you have requested a way to leave me a tip so I've created a PayPal and a Patreon.
PayPal: https://paypal.me/reidschannel?locale.x=en_US Patreon: https://www.patreon.com/reidschannel
Discord: https://discord.gg/PdvudWx
You asked for it so here it is! This is my Networked Character Movement Tutorial complete with a full download to the pr...

▶ Play video
dark edge
surreal plaza
#

In my PIE, multiplayer/listen server setup, I am seeing extra actors get spawned and am trying to track them down. However, when I select them (when ejected), they don't show up in the World Outlier. Is there a way from that view to see everything in play?

slim matrix
#

the easy way is to disable server correction but i would like to keep that on

lost dune
#

Anyone? please

meager spade
#

@lost dune might want to contact the author if you have an issue with a plugin

#

not sure many people here would have used it

lost dune
#

ok

meager spade
#

i know the author used to be on this server

lost dune
#

But many people does multiplayer dedicated server i think? what do you use for it?

meager spade
#

well dedicated server should load the game map by default

lost dune
#

The doc says i have to make my project BP to C++

meager spade
#

for dedicated server, you need Source engine

#

and yes you do

lost dune
#

could i use BP however? in a c++ project?

meager spade
#

ofc

lost dune
#

ok

#

What branch have i to clone? 4.26.1?

#

my project is 4.26.1

#

i have clones master

#

cloned

meager spade
#

not master

#

you want release/4.26.1

lost dune
#

ok

pallid mesa
#

why every single C++ tutorial is over 30 minutes

#

I don't get it hahahaha

bitter oriole
#

Because it's complex and you need time to go over the fine print

pallid mesa
#

In a way, I get what you are saying, but in terms of engagement I think it would be more convenient to divide the topic onto primitives

#

maybe the title is not the most convenient, because it goes over networking basic concepts all the way up to prediction/interpolation/compensation

#

So I guess that it's so technical that is hard to assume previous knowledge

#

right?

#

Because to be fair, I wouldn't explain what a sim proxy is in a net compensation tutorial

#

I'd just use the terminology

#

😄

bitter oriole
#

Yeah sure

lusty saddle
#

Is there any way to call a function on a replicated actor once it's spawned on the client? I have an actor that is replicated, that contains an array of "instructions". Once the actor is spawned and the instructions have been replicated I want to run a function to do stuff with the instructions

quasi kite
# slim matrix so i wanna do sprinting but the current client prediction/correction prevents me...

Have you tried looking at the character movement component in the Unreal Tournament code on Epics Github?
That along with this,
https://www.youtube.com/watch?v=Of8SGBa3WvU
Helped me out. Takes a little patience, though

In this video I show the proper way to make movement abilities for your characters. This is done by creating a Custom CharacterMovementComponent.

We start from scratch with a third person BP project, but here is the completed project you can copy code from: https://drive.google.com/open?id=1w9mMlKlcFhTrr8wsf1_76h_4v_k2ysei

▶ Play video
#

When you look through CMC examples on the net it seems like everyone is copy/pasting from the unreal tournament source code

#

Does anyone know what is going on here? I reckon it's a replication issue, but I don't understand how so.
I only have one directional light acting as the sun together with SkyAtmosphere.
Angle is correct for everyone, but the clients' version of the world seem almost unlit, whereas server/standalone is completely dark, as it should be.
It's only really visible at dark. At noon both Server and Client looks pretty much alike.

dark edge
#

you have a sky light right?

quasi kite
#

Yea, my constructor looks like this,

    SkyLight = CreateDefaultSubobject<USkyLightComponent>(TEXT("Sky Light"));
    SkyLight->SetIsReplicated(true);
    
    VolumetricClouds = CreateDefaultSubobject<UVolumetricCloudComponent>(TEXT("Volumetric Clouds"));

    Sun = CreateDefaultSubobject<UDirectionalLightComponent>(TEXT("Sun"));
    Sun->SetAtmosphereSunLight(true);
    Sun->SetIsReplicated(true);
    Sun->SetWorldRotation(FRotator{ 0, 0, 0 });
#

Didn't do SkyLight->SetIsReplicated(true); until you mentioned the sky light though

#

But other than that I don't touch the skylight whatsoever

slim matrix
quasi kite
#

You mean in their repo? Not specifically. I would simply search for CharacterMovementComponent

#

Are you connected to Epic Games on github?

slim matrix
#

yeah i use a source buid of UE on linux

quasi kite
#

Alright. I can't remember how it found it, but I'm pretty sure you'll be able to find it by simply searching for one of the functions SabreDart writes out in his vid as they are pretty much very alike - as I remember at least

#

The old wiki also had sample code from it

slim matrix
#

so i guess it should have some networked sprinting code

quasi kite
#

It's been a while, but as I remember it allows you to change movement speed over networked games, which is otherwise impaired on MP.
Nevertheless, I don't have any trouble over network myself anymore

#

These should be it

slim matrix
#

could i just drop these files into a unreal project

quasi kite
#

Probably not, there's a lot of functionality that you wouldn't use at least. I'd still recommend go through sabredarts video. The only thing I would be wary about is his check()'s, as I remember they don't really work with listen servers

charred wren
#

Hey guys, I am currently trying to figure out an issue with replication I am having. I just solved a separate issue where the aim rotation of the client wasn't being replicated. However, now I have an issue where my component's position is not being replicated client-side (isn't taking my aim rotation into account, as is seen in this image:

#

Does anyone have any idea why the server wouldn't replicate the positions of these objects with my aim rotation?

quasi kite
# slim matrix could i just drop these files into a unreal project

If I'm correct, his check in GetPredictionData_Client() was the issue.
I replaced his check with

    // Should only be called on client or listen server (for remote clients) in network games
    checkSlow(CharacterOwner != nullptr);
    checkSlow(CharacterOwner->GetLocalRole() < ROLE_Authority || (CharacterOwner->GetRemoteRole() == ROLE_AutonomousProxy && GetNetMode() == NM_ListenServer));
    checkSlow(GetNetMode() == NM_Client || GetNetMode() == NM_ListenServer);

Which is then again a copy/paste from what I think was the UT code

charred wren
#

My issue seems to be related to dedicated servers. Do dedicated servers ignore any logic run in the AnimGraph?

#

Ah! I found it

#

Skeletal mesh needed Always Tick Pose and Refresh Bones

azure hollow
#

Hey guys! I should start with implementing the multiplayer system. Could someone tell me which is the best between Aws and PlayFab? 🙂

halcyon totem
#

can someone tell me, what do I need to do to make a widget show up on different players in multiplayer? I made an created a widget , made a varible in the player controller now in the character blueprint I try to add to view port but it wont show up what am I missing?

potent token
#

im facing weird problem, i try to setactorrotation from server, but i dont know why it wont replicate on owning client, the other client have correct rotation, but not on the owning client

vivid seal
#

there is a plugin for Gamelift, Incognito, DynamoDB, etc. exposure to Blueprints but it is fairly expensive and not made by Amazon themselves

#

its not the plugin you linked, its a different one called multiplayer with blueprints, this one looks like it hasn't been updated for 4.26 (or even before that)

#

ah i see

vivid seal
#

if you dont want to go with the plugin but know c++, there's a 15+ hour tutorial on Flopperam's youtube channel on setting up GameLift without the plugin

#

it seems like a TON of work though

distant wave
# distant wave aight look: https://youtu.be/hY2EZPA7dwc

Anyone has any idea on what's going on here? I just updated the engine from 4
20 to 25, switched the "Role" with "GetLocalRole()" which is the same basically and fixed all the include issues, but I haven't changed anything multiplayer related.. Did anybody else experience this?

ancient bramble
#

is the Nakama Plugin available as blueprints, im not really familiar with cpp

#

is there any tutorial i can follow for learning Nakama throught cpp?

tranquil night
#

Why when a player joins the session every vars from server gamemode/game instance sets to none?

twin juniper
#

where should i persist my data once i connect or host a multiplayer session

#

*or to be more precise, before i host or connect a multiplayer session

surreal plaza
#

I am trying to wrap my head around authority with child objects. So my players are spawning at NetworkPlayerStart locations normally and they posses items they carry along with them. These are separate actors that are spawned, then attached at begin play. Where all do I need a hasauthority check for this? If I create it in the constructor should it be there when they are created and a separate check as they are attached at beginplay?

jolly crag
timid pulsar
#

does anyone have any recommended learning resources for aws connection

winged badger
#

much smoother

slim matrix
#

so ive followed this tutorial on getting sprinting and doing to work in multiplayer https://www.youtube.com/watch?v=Of8SGBa3WvU&t=1873s but a always end up with a ton of errors i cant seem to fix so is there any way to add custom movement to my character in multiplayer with out server correction interfering

In this video I show the proper way to make movement abilities for your characters. This is done by creating a Custom CharacterMovementComponent.

We start from scratch with a third person BP project, but here is the completed project you can copy code from: https://drive.google.com/open?id=1w9mMlKlcFhTrr8wsf1_76h_4v_k2ysei

▶ Play video
brazen sluice
#

Hello, I do something like this to pan the mesh to be at the bottom of the capsule (Since the capsule starts at -helfHeight instead of 0)

#

It works fine but on client, for some reason something (animations? IDK) seems to overwrite this value

#

Is there a better a way to do this ?

#

(or a way for this to work on client)

peak star
#

@twin juniper local data in GameInstance persists for the lifetime of the instance of the app running on your local machine, but it cannot be replicated over network, so I send it to the server to share with the other players by adding server RPCs to other classes that can own a network connection such as PlayerController. That actor tells the server and then the server can replicate to everyone.

#

Gameinstance is one of the few things that survive opening a level. If using c++ you can add to the list of things to carry over during travel.

Also playerstate has two event handlers in blueprint that carry info over info but only during seamless travel. You have to implement them to have any effect. I think they are called copyproperties and overrideproperties or something like that.

#

Game modes have a checkbox to tell them whether to use seamless travel. Before 4.24 i think that lived in the project settings.

harsh lintel
#

what would I call when a team wins the game?

#

like I just want to change map to the UI lobby

#

or does the steam plugin can handle lobbies?

#

I see that Epic Online Services could work for this case

bitter oriole
#

Steam/EOS are somewhat unrelated to lobbies

#

Both provide sessions, whether players in the sessions are connected to a server, playing on a lobby map or a main map, it doesn't matter

woven sinew
#

how do you replicate vehicle movement ?

bitter oriole
#

With immense difficulty

#

Assuming your vehicle has entirely custom movement with no physics at all, it's somewhat easy to implement rollback/replay - send the server your input, apply the input locally, have the server apply the input, send you the result with the timestamp of the inputs used, and reconcile the result accounting for lag

woven sinew
#

ok idk anything about the last two, where should I start ?

bitter oriole
woven sinew
#

thanks

bitter oriole
woven sinew
#

lol the price

bitter oriole
#

It's stupid good value for what it is, and it's on sale at 90% off half the time anyway

#

But I linked the code for a reason

woven sinew
#

yes yes I will dive in the code

#

is this still up to date ?

bitter oriole
#

Probably not

#

It's for 4.17 so lots of stuff will have changed

jolly crag
night tartan
#

I am using the above Udemy course, and I have a question: it appears that when I use World->ServerTravel("URL?listen"); and then join a session via GetResolvedConnectString() I am seeing the correct IP but "Port 0"

#

however, if I force the join on 127.0.0.1:7777 with command line, I can get in

#

I'm curious where this Port 0 is coming from

#

I just saw in the code that the third parameter GetResolvedConnectString() is expecting is the PortType, which is by default set to NAME_GamePort...wondering if that course is outdated, as apparently this FName macro has been set to 0 somewhere to append to my Address

#

hunting this macro down...

#

nevermind, this is not the problem; if someone could chime in on this, I would greatly appreciate it

sand dock
#

anyone have experience with ios/multiplayer? (made a very simple "join via open: ip" multiplayer, and it crashes on IOS only) last thing I see in logs on IOS is: [2021.04.01-18.05.28:422][169]LogOnlineSession: Display: OSS: FOnlineSessionIOS::RegisterPlayer - not implemented

wind wedge
#

My only experience with the engine so far is open world dedicated server. Not match joining. Ios just logs in like all the other clients. (app store is another story)

#

Sounds like you need to add code specific to iOS. Is it possible that you have checked the box to implement the GameCenter (player stats) and not written code to handle that?

sand dock
#

nope

#

using null subsystem

#

it joins, I see the player show up on the host, but then ios immediately crashes

wind wedge
#

Ok so, if not using subsystem=iOS, you need to tell the device that

#

I read about it but thats over my head

sand dock
#

im pretty sure its set to null already

#

[2021.04.01-19.33.38:356][117]LogIOS: FSocketSubsystemIOS::InternalBSDSocketFactory
[2021.04.01-19.33.38:363][117]LogOnline: OSS: Creating online subsystem instance for: NULL
[2021.04.01-19.33.38:364][117]LogOnlineSession: Display: OSS: FOnlineSessionIOS::RegisterPlayer - not implemented
[2021.04.01-19.33.38:364][117]LogOutputDevice: Warning:

Script Stack (1 frames):
PlayerState.OnRep_UniqueId

#

and frmo the ios ips dump

#

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 8

#

Thread 8 Crashed:
0 libsystem_kernel.dylib 0x00000001bfc8e414 0x1bfc66000 + 164884
1 libsystem_pthread.dylib 0x00000001dd7e8b50 0x1dd7e6000 + 11088
2 libsystem_c.dylib 0x000000019b167b74 0x19b0f1000 + 486260
3 UE4Game 0x0000000103ad7ee0 0x102a64000 + 17252064
4 UE4Game 0x0000000103bc7418 0x102a64000 + 18232344
5 UE4Game 0x0000000103c74220 0x102a64000 + 18940448

#

my next test is gonna be to try to launch via xcode so I can get more debug info

wind wedge
#

Its having trouble retrieving the device id (and/or) translating it to a valid player id.

#

This value on a windows computer is = the pc name

#

If you can find that part of the code on the iOS client it may point you in the right direction

#

Did you develop the server in windows and client on mac?

sand dock
#

no windows

#

this is what im seeing on the host side after a ios joins:

#

LogNet: NotifyAcceptingConnection accepted from: 192.168.1.1:60854
LogHandshake: SendConnectChallenge. Timestamp: 4.962889, Cookie: 176238079188013145192110152099205221159148152120045100226235
LogNet: NotifyAcceptingConnection accepted from: 192.168.1.1:60854
LogHandshake: SendChallengeAck. InCookie: 176238079188013145192110152099205221159148152120045100226235
LogNet: Server accepting post-challenge connection from: 192.168.1.1:60854
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogNet: NotifyAcceptedConnection: Name: FpsTest, TimeStamp: 04/01/21 15:54:12, [UNetConnection] RemoteAddr: 192.168.1.1:60854, Name: IpConnection_4, Driver: GameNetDriver IpNetDriver_4, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
LogNet: AddClientConnection: Added client connection: [UNetConnection] RemoteAddr: 192.168.1.1:60854, Name: IpConnection_4, Driver: GameNetDriver IpNetDriver_4, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
LogNet: NotifyAcceptingChannel Control 0 server World /Game/Maps/UEDPIE_0_FpsTest.FpsTest: Accepted
LogNet: Remote platform little endian=1
LogNet: This platform little endian=1
LogNet: Login request: ?Name=Unknown userId: UNKNOWN platform: IOS
LogNet: Client netspeed is 10000
LogNet: Join request: /Game/Maps/Menu?Name=Unknown?SplitscreenCount=1
LogBlueprintUserMessages: [LaserWeapon_GEN_VARIABLE_Laser_C_CAT_1] Server: WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
LogBlueprintUserMessages: [FirstPersonCharacter_C_1] Server: BEGINPLAY FIRSTPERSONCHARACTER
LogNet: Join succeeded: Unknown

wind wedge
#

Uniqueid=invalid

#

Thsts the device name

sand dock
#

so, how is that set?

wind wedge
#

On mac its hex full registry, on windows its ‘referenced’

#

But because of the memory incompatibility issues... it cannot translate the name. I’m not sure how many different options there may be, but i believe i have seen this name redirected from another memory that IS referenced. Such as the appld ID or GameCenter name

#

I’m not sure what my guys did to bypass that error, i think mine is logging the interface adapter (MAC)

#

MAC address or whatever

sand dock
#

just tested with android, and it also has UniqueId: INVALID

#

BUT it has a valid hostname

#

LogNet: Login request: ?Name=localhost-0005DE3508D8F4F3E70A88A2CC1EFAA7 userId: NULL:localhost-0005DE3508D8F4F3E70A88A2CC1EFAA7 platform: NULL

wind wedge
#

Are you logging in through the respective subsystem on each device?

sand dock
#

just done via open ip console command

wind wedge
#

A lot of that is auto detect by default

#

You may have to find that piece of code

#

Where its pulling in the device namr

sand dock
#

open {host}

wind wedge
#

Thats where the problem is. UE cant read it

sand dock
#

yea ill do some digging

#

this gives me a good place to start though, thanks!

wind wedge
#

Np!

twin juniper
#

i develop game for almost 3 years and never try make one multiplayer....can anyone introduce me different types (simple, hard, free or not ecc...)

night tartan
#

I wanna mention, I solved my own problem: it was a "Seamless Travel" enabled issue where the client was loading the wrong level (thus Port 0)

kindred widget
#

@twin juniper Different types of what? Games?

harsh lintel
#

If I have a widget component in an actor. And I only want it to be shown on certain clients, can I just set bHiddenInGame to false for the clients to which I want to show it to?

desert idol
#

can you have like a 3d text widget that everyone can interact with and use for chat for example?

faint pawn
#

new to multiplayer.is there something wrong with this code? right now the pawns are only rotating client side, not on the server.

dark edge
#

On tick, send rotation (calculate however you want) to server

faint pawn
#

yeah, i am not sure i quite understand that? why shouldn't i do this? and how do you mean send rotation to server? i think what i have now is mostly useless, because logic is actually running on client. but even if i set the event to run on server, clients still do not properly rotate. there must be something i am missing

rapid bronze
#

You want the sever to handle stuff like that cause you can't trust the client to
If you run it on client most likely the server will try to correct it making you go back to the initial state making you basically stutter while everyone else sees you doing nothing

Use a RepNotify on Rot
OnRep SetActorRotation

winged badger
#

and never replicate the rotation back to owning client

wind wedge
#

@harsh lintel so the best way i have found to do that was make a HUD bp for what you want to display, then on your interact event (either broadcast or direct cast) reference the player character, the hud, then create widget(whatever HUD you made for that).

winged badger
#

managing WidgetComponents from HUD is a bit unwieldy

#

especially since it needs more code to connect it to the HUD then what you usually need to manage it

harsh lintel
ocean geyser
#

@twin juniper your not really going to defend against ESP without also defending against other forms of cheating with anticheats like EAC/battleye that just make it a pain to write cheats for in general without emulating the anticheat or some other bypass which is no easy task. if you dont have a hard strong wall up to make it difficult for anyone to just grab the needed addresses and offsets and do whatever they want with them (think VAC), then it would be quite effortless for anyone to find and loop through your games entity list for coordinates, find their own view matrix, and draw to the screen the players locations. same goes for aimbot which is also on the same topic of you cant really prevent it without the above. you can make some very believable smoothing functions for your aimbot, heck mine lasted 700 hours in csgo with no one suspecting a thing because it acted more like an aim assist. people that are legit cheaters are the hardest to catch as often they try to just get subtle advantages which makes things like reviewing worthless for them. long story short, unless you invest in a good third party anticheat, theres not going to be much you can do against esp and aimbot, you can however prevent most other forms of cheating by how you handle them in game

ocean geyser
#

thats smart. ill end up looking into implementing some form of that for testing. did they say why they wouldnt let you use their anticheat? wouldnt they get paid all the same lol

signal lance
#

I solved esp by using the engine's occlusion culling system on the server side to decide when to send the player position information *to each player
Occlusion culling and most of the rendering pipeline is stripped away from the dedicated server build
Also it doesn't make much sense checking on the server, it would show what's culled from the server's (listen server) POV

This data can then be used to detect aim-bots at real time, there will always be false positives but if the system will be efficient enough and learn as the player base grows by retraining data from best players, testers and hackers themselves whom got caught on the process.

There is a reason no one does this, it would result in so many false positives, just look at some of the ESport players, it gets difficult for a human eye to recognize what's aimbot and what's a pro player

#

The occlusion idea could work with a custom built system, adding all obstacles into an octree grid and using it for fast lookup for example

ocean geyser
#

isnt that what vacnet (if thats what its called) is trying to do? thought they had some kind of neural net for something

#

referring to ai and aimbot detection

signal lance
#

I know there were some that tried that but all of the implementations ended up being utter garbage, either it will end up detecting legit players or it won't detect anything
If you actually try it you will see how flawed both the AI detection and occlusion ideas are
You need to understand first what occlusion culling is and how it works to understand that checking if something is visible from the server won't work, if it's not rendered by the server it's gonna see it as occluded

#

and any AI can easily be tricked by not having the aimbot be 100% perfect, it's easy to simulate human error to make it seem real

ocean geyser
#

^ like mine, just an aim assist on steroids that was never locked and still had some random movements that were not a smooth curve and not linear to whichever bone was targeted and that bone can easily be changed if the player moved their mouse along with when it overshoots the bone (goes to far past the bone). its just like normal mouse movement from a human, odds are AI wont be able to detect that and if you had very tight tolerances then theres alot more false positives that are going to be occuring. plus people who create cheats for sale will most likely spend alot more time trying to perfect this as well so it doesnt get picked up. i dont know much regarding this subject but thats just what seems correct in my head

#

depends on the aimbot. if its loose enough enemies can still walk out of it to where its no longer tracking, and the setup you trained on will most likely be different from the end result of the cheat maker as well. dont forget most of the time you wont be targeting the head anyways, an aimbot that just aims for the head is just asking to get caught and called out

signal lance
#

Any AI system will always be too unreliable, look at the pro players for example, their crosshair is 98% of the time on the enemy's head, that's instantly gonna get marked as false positive

#

I still found a way to do that somehow
Must be magic then 🤷‍♀️

ocean geyser
#

and their tracking skills are unbelievable as well

#
if (HasCheats())
{
  Ban();
}
#

where the $100

#

making one now

#

posting repo to git

#

this is reminding me of

#

and one final sarcasm

since you only know C#, heres the C++ version

if (HasCheats())
{
  Ban();
}

and heres your new C# version rewritten

if (HasCheats())
{
  Ban();
}
#

oooo well played sir, but to counteract that what about a version written in C to prove that im a low level dev

if (HasCheats())
{
  Ban();
}
fossil spoke
#

The Epic Coding standards does not recommend that.

lone forge
#

I have a "checkpoint" button players stand on that returns them to that location if they die, I want each client to have to step on their own versions of the checkpoints. I'm trying to use Instigator but that doesnt seem to be working as I expected

fossil spoke
#

It is not mandatory. Im just pointing out that its not recommended.

#

Also please move back ontopic.

lone forge
#

I guess I dont understand what instigator controller is

#

I think just checking if the Other Actor is currently overlapping will work after typing it out and thinking about it more

#

ya thats what Im trying to do, storing the transform on the controller

#

Im doing something wrong and still am now

ocean geyser
#

so a crap ton of UE_LOG lol

lone forge
#

huh now it works

#

not sure why though lol

#

well thanks

#

owe you one

#

so basically I had it right before and was really close but I was using Owning Client because Im new to this multiplayer thing and dont really understand it yet, but using Server was the answer

#

what do you mean by that

#

well this is just me expanding on some multiplayer tutorial I did, but I will be eventually be working on a listen server coop game

#

ya for sure, not going to be going for dedicated and only 4-6 players

#

I got steam working already, havent looked into EOS yet

#

ya I had an idea of what you meant, just wanted ot be sure

#

ya its pretty bad

signal lance
#

ue4 doesn't support p2p networking model, you are confusing it with a listen server, listen server is still a server and all the communication is routed through it the same way it is with a dedicated server

bitter oriole
#

Just so we're clear, neither Steam or EOS play any role in players acting as servers. That's an UE4 feature.

lone forge
#

alright so, once again I didn't actually get it working, but I did figure out why it isn't working. The respawning is being called on the server's version of the player controller because I'm using Event On Unpossess when the pawn gets destroyed. What would be a better way to call the respawn so that the client's version is calling the respawn?

#

I can only think of making it so you have to press a button to respawn and I can use that input to call a spawn and send a transform with that function

#

is there a more elegant solution?

bitter oriole
#

They don't have anything to do

#

You don't need to use Steam for listen servers (P2P doesn't exist in UE4)

#

Or EOS

#

It's just not a feature

signal lance
#

I don't know where you got that information from...

#

That's simply not true

#

Jesus christ 🤦

bitter oriole
#

So let's make it simple : you have listen server functionality without using Steam or EOS (or any other subsystem)

lone forge
#

p2p like torrents?

#

wouldnt that mean clients are sending info to each other

bitter oriole
#

Yeah, quite a few games do it really. Just not UE4

#

StarCraft2 does it for example IIRC

#

Most fighting games too ?

lone forge
#

I just assumed p2p meant listen

bitter oriole
#

Splatoon

#

etc

#

P2P is decentralized

#

Listen server has one hosting player

signal lance
#

You are sharing misleading information and presenting it as facts...

Ue4 doesn't support p2p networking, all of ue4 is built around server-client model, there is a dedicated server and a listen server which is at the same time a player, this is still server client model, there is 1 central server that's handling everything

#

P2p simply doesn't exist in UE4, doesn't matter which subsystem you use, authority concept ue4 is based on wouldn't work in p2p scenario

bitter oriole
#

The other misinformation there is the very common misconception that Steam or EOS are required to play an active role during gameplay, while in reality they just don't do that much past matchmaking.

#

Hell, IIRC the UT4 alpha still used an internal matchmaking system and didn't have any support for Steam ?

signal lance
#

This^

#

A networking subsystem is nothing else than a way to talk to you network backend, matchmaking and similar

bitter oriole
#

(Though in the particular case of Steam, most UE4 documentation have you enable the net driver that tunnels traffic through Steam's network)

#

(But AFAIK that's optional ?)

signal lance
#

But still doesn't affect gameplay and networking in ue4 in any way

faint pawn
#

do player controllers exist only on server, or is there always only the local player controller in each machine?

#

i cant make pawns rotate based on mouse and i think the problem is how i am writing logic

lone forge
#

is your pawn set to replicate

bitter oriole
#

Server + owning client

#

So yes, the local PC exists on each machine

lone forge
#

I guess pawns are default replicate

bitter oriole
#

The problem is likely something like the movement being done on the local client instead of on the server

faint pawn
#

the client is not does not rotate on client right now

lone forge
#

show graph

#

haha

faint pawn
#

in the player controlled, i set a target point running on tick. on the RepNotify i pass the target and set the pawn rotation

lone forge
#

pretty sure its that get hit result under cursor

#

on the server side its not getting a result

#

I dunno what the solution is, I just started doing multiplayer stuff

bitter oriole
# faint pawn

Replicated variables can only be set on the server.

faint pawn
#

if the server has all player controllers, does that mean that the mouse position on a client is the same as the mouse position on the server?

bitter oriole
#

The mouse position does not exist on the server

#

You need to tell the server the client's mouse position, through a server event

#

And that event is where you'll change the pawn state

twin juniper
bitter oriole
#

Gonna need to explain more than that

#

How you create a multiplayer game depends mostly on what kind of game you're doing

twin juniper
#

for example a third person multiplayer game

bitter oriole
#

Which kind of third person multiplayer game

twin juniper
#

it's a Attack on titan shooter

#

so the swing system is included

bitter oriole
#

Is it a competitive game, is it fast paced or turn based, is cheating a concern, how many players

twin juniper
#

max 20 players (team of 10)

#

it's not competitive

#

i tried the launch system for the players but i doesn't work on multiplayer

#

it*

faint pawn
#

with that many players, you shouldnt be using listen server so you need dedicated

#

imagine 1 single pc having to be the server for 20 players. yikes

bitter oriole
#

Yup

#

Listen is like 6 players max

kindred widget
#

The short answer is that the only thing you really need to learn to start doing Multiplayer is RPC and Replication, and the difference between the two of them.

The much more involved answer is that those two simple things are going to dramatically change the way you handle the simplest logics. Want a player to change their color? Single player game makes one call and boom. Multiplayer the client needs to RPC to server, server has to check if they can, save it, set it, then replicate that change to all clients, and then all clients set it. And this is just gameplay logic difference. Like Stranger was pointing out, your game style determines delivery. Competitive requires dedicated servers and a personal hosting solution. Otherwise you can do most things listenserver style if the server doesn't need to be dedicated for performance or uptime reasons.

#

That also depends on the game style. If the map isn't very big and there's not actually a lot of necessary replication, 20 players on a listenserver won't be that different than 4 in a large open world.

twin juniper
#

Thanks @kindred widget very clean explanation

bitter oriole
#

By the way you should stick to listen server and tone down the player count. Dedicated servers are hard.

faint pawn
#

3 players max with one server having to replicate players+AI seems already a bit taxing but doable

#

attack on titan is the one with the naked giant running around no?

twin juniper
#

so i have to create a host and join system...right?

#

max 6 players obv

bitter oriole
#

That's just a listen server + sessions

bitter oriole
#

Using Stean and the advanced sessions plugin for example

twin juniper
#

ok ok...but a dynamical ip can work? or it has to be static?

faint pawn
#

what do you mean?

rapid bronze
#

Doubt it matters

faint pawn
#

you use steam to connect

bitter oriole
#

It doesn't matter at all.

#

(when using Steam)

twin juniper
#

oh ok...thank you so much guys

faint pawn
#

how do i pass information from client to server?

rapid bronze
#

Run on Server?

faint pawn
#

the get hit result under cursor is returning false. how come?

rapid bronze
#

Cause Server doesn't know about your cursor

faint pawn
#

how do i properly tell the server to move me to a location i clicked to?

#

i thought the server had all player controllers in it? so why wouldn't it know about each mouse coords?

bitter oriole
#

Like I said earlier, mouse location is definitely not replicated. It's a local property of your client that the server has no business knowing.

#

So your code needs to 1) obtain that location on the client, 2) tell it to the server, using a "run on server" event and 3) have the server-side player controller do something about it

#

And then you'll probably find that the local player can observe latency in real conditions - you'll have a 50-100ms delay between mouse actions and their result, so you'll likely need to introduce more logic at that stage to process things locally, AND tell the server, AND (the hard part) detect when the server replicates back, which version to keep

#

Most multiplayer features in your game will look like that.

faint pawn
#

right, so now the client is able to move. i still dont know how to pass information from client to server thought. right now the V3 has a value of 0 on all axis, which means the server has no idea about the cursor position

winged badger
#

also, moving yourself using pathfollowing on client is a fun fun problem

#

you can get it to move you locally, and CMC interpreting pathfollowing as a move input

#

you do get the benefit of predictive movement and character reacting instantly

#

you can't do it in blueprints though, not even close

bitter oriole
winged badger
#

requires significant alterations to CMC, PlayerController and manually setting Roles

faint pawn
#

on tick, when i press left click, i get the impact point under the player controller's cursor, pass the vector to an event which runs on server(making all parameters replicate by default, correct?) then i run a simple move to Location with the location set as the goal. this works fine on the server, but on client the pawn only move to the location, without rotating to face the direction

bitter oriole
#

(This process should likely be done on an action event mapped to left click)

#

As to the rotation, don't know - like Zlo explained you're going to have larger issues with this approach anyway

rapid bronze
#

Tricky stuff indeed, seems like client doesn't know about its own rotation, not sure how you have that set up to rotate atm

plain torrent
#

Hey all, I'm having an issue when turning down this characters movement speed, it causes jitter on the camera. The movement is perfectly smooth to the other players in the lobby, but this characters cam behaves like this. It works completely fine at high speed

bitter oriole
#

You're probably only setting the new speed or the client or server

plain torrent
#

should i be multicasting when setting the movement speed?

#

It's definitely being set properly, all the movement replicates fine with sprinting speeds and dashes, it's just at very low speeds we get camera jitter

faint pawn
#

i've made some changes, and they seem to be working more or less. the only real problem is that since on left click being held, i call this event, and moveservercharacter uses an AI Move To function. that means that while i held down left mouse, the character stays still, and when i release he'll move along each individual mouse location

#

heres a video to better understand

quasi tide
#

That feeling when you're Shroud and you get banned for being the human aimbot 🤣 (regarding the anti-cheat stuff above)

twin juniper
#

How do i make this multiplayer? I try to Make a custom event (Run on server)...It works only for the first player but the second one nope

bitter oriole
#

You need to review whether that feature already support multiplayer replication, and if it doesn't, implement it yourself

twin juniper
#

How can i implement myself?

bitter oriole
#

In this case it's probably enough to simply call LaunchCharacter on server

#

Because I assume the feature supports multiplayer

#

If it doesn't it's likely C++ time and some weeks of work

twin juniper
#

oof

bitter oriole
#

Blueprint multiplayer is only really possible for as long as you use ACharacter features

#

At least as far as pawn stuff goes

twin juniper
#

ok thanks

winged badger
#

wasn't that like 4 digit number per platform for a license?

chrome bay
#

Oh haha, it's worded as if it's just part of the engine now, but that figures

winged badger
#

do you still need to cash out a license or not

#

pretty much only relevant thing about it

chrome bay
#

Judging by the last paragraph maybe you do indeed need to be a licensee:
If you’re an existing Oodle licensee, your workflow and support will remain the same. If you’re a new user who would like to try Oodle in your Unreal Engine project right away, you can turn it on by updating to 4.27 via Unreal Engine GitHub.

rich ridge
#

Does this mean that the game chunks created using chunk manager will be smaller now???

neat sky
#

Hello everyone, is there a way to create an invite system like pubg?

rich ridge
woven sinew
#

how do you deal with unowned actors that need to call server rpcs ?

neat sky
rich ridge
#

This is one of the OSS

neat sky
#

Oh

#

So how do I implement it?

#

Sorry I will ask it there

faint pawn
#

i mean. if you know how the setup a game to work up until that point, you'll know how to make invites work...also pretty sure the advanced sessions plugin comes with a invite friend event

neat sky
wary wyvern
#

Guys, is there any way to synchronise client instance of UObject or AActor with server one using replication?

What I'm looking is the opposite function to TearOff.

Such functionality exists for actors, which are on the level, but I need this for UObject, components and other actors.

lament sinew
#
PIE: Error: Only Local Player Controllers can be assigned to widgets. PlayerController_C_1 is not a Local Player Controller.

Who is the widget owner on a listen server if the host PlayerController is 'not local' ... ?

bitter oriole
#

Sounds like you're assigning a remote PC to a widget on your server

lone forge
# lone forge I have a "checkpoint" button players stand on that returns them to that location...

yay I figured it out, I was so close so many times, I just didn't combine all the right things together until now... on the checkpoint I had to check if the pawn was being locally controlled and then I had to update the server's version of the player controller's spawn transform variable and then call the respawn on the server also. I was trying to fight the server and trying to spawn from the client

carmine ember
#

Does anyone know if the OnRep/RepNotify gets called on joining a match? If not, how are you meant to setup state?

dark edge
bitter oriole
#

Basically what I'm saying is, if you want a non-character pawn in a MP game you can say goodbye to Blueprint

#

Sure, it's not impossible in Blueprint, but implementing rollback in Blueprint is not going to be any fun

#

Adding features to ACharacter makes it literally impossible

dark edge
#

Oh yeah as long as you need rollback or prediction, it's a bad idea. But anything a little bit more slower paces like a civilization or RTS or turn based game would be super easy.

bitter oriole
#

These hardly even need pawn anyway

dark edge
#

On the topic of prediction, does anyone here know if the upcoming NetworkPrediction plugin is movement-specific or more general? It seems like there would be a demand for a highly generalized prediction model. After all, any prediction is basically an effect, a context, and dependencies.

#

Position, movement, and collision are basically the same thing as health, healing, and maxhealth logically.

hollow eagle
#

I'd expect it to be more general... CMC already covers movement-specific stuff and I don't know why they'd rewrite it just to end up doing the exact same thing.
I wouldn't think about it too much though, no one knows when the plugin will be ready.

#

Github barely has any activity for it, I wouldn't expect it anytime soon

#

unless it's being held back for UE5

dark edge
#

Yeah I hope it's more general, imagine trying to integrate CMC movement, physics movement, and GAS prediction systems. It'd be a mess.

hollow eagle
#

from what's there you can tell it's meant to be a somewhat general framework - they even have a physics prediction component in the source tree iirc

#

but it's all built on top of that general framework

#

which of course isn't ready...

dark edge
#

I'm sort of waiting on it for one of my projects that's heavily physics driven, but I might end up just having to abandon prediction all together on it. It involves systems that are very chaotic and non-deterministic, so that might just be more trouble than it's worth.

sly kernel
#

let's say I want to make coop game on mobile phones with UE4

#

would there be any difference in performance whether it's going to be p2p vs client-server architecture ?

#

(mobile hardware would be top of the line, like Qualcomm XR2 SoC)

#

as a reference point the game would be something like Doom 3 (except with baked lighting)

#

2-10 players

dark edge
#

But yes, there will be a performance difference. How much of one there is depends on your game and other factors.

sly kernel
#

no, client-server can be listen or dedicated

#

p2p is p2p

dark edge
#

You are telling me you got Unreal engine to work in a P2P context?

sly kernel
#

nah, I am not into MP ... yet. Just trying to get the brad picture for future references

#

there are a ton of middleware for UE4 to do p2p multiplayer

#

(maybe not a ton, but some)

#

that's what I hear from some devs

dark edge
#

Yeah it would be a shitshow. Even if there is middleware, I guarantee you was not trivial. If you're having to ask the question, I would just do server client architecture. That's how the engine is built from the ground up.

sly kernel
#

I think Oculus offers p2p in their Platform SDK

dark edge
#

That looks like it's just peer-to-peer networking, there is still very much a host and clients.

#

But running a multiplayer game and Unreal engine with no one client acting as the authority, that sounds like quite the workload

sly kernel
#

are there any examples out in the wild of UE4 games with p2p (peer-2-peer) networking or all of UE4 games are client-server ?

wind wedge
#

The problem with using p2p, in Unreal’s case, one player also acts as the server for all the rest. This consumes a lot of that players resources and can only sustain a small number of linked clients. Simply running as listen server and trying it will teach you a lot.

#

@dark edge - yes it is quite a workload. Especially with very little helpful documentation.

dark edge
#

Well not strictly. That's just your plain old listen server which is doable but not a good idea for anything super competitive or large scale.

wind wedge
#

Dedicated server provides a much more reliable and consistent user experience. Imagine a large p2p group, and the 2 users on the far ends.

chrome bay
#

@gilded vapor vars for state, multicast for one-shot events.

gilded vapor
#

@chrome bay thanks, for states such as "is_sprinting" would you consider them 1-shot events?

#

For some reason I've been using multicasts for everything game related (due to legacy misunderstandings haha)

winged badger
#

@gilded vapor if you use multicasts for stateful changes

#

you'll find yourself in a situation where client walks into an area from otuside the relevancy range

#

sees open doors as closed, sees walls that have been destroyed in pristine condition

#

same thing applies to late joiners

#

someone that hopped into a game already in progress

gilded vapor
#

Yeah I read that somewhere and thats whats prompting my change

#

Time for the beeg ol refactor

winged badger
#

there is an approach that mixes multicasts with onreps

#

example of which would be you OnRep bool bEnemyDead

#

but you MC the PlayDyingMontage

#

prevents enemies to get up on their feet just to play you a dying montage if you walk into relevancy range

#

i personally prefer to have OnRep float EnemyTimeOfDeath

#

and synced network clock

#

-1,f meaning enemy is alive, > 0 meaning the second it died

#

and then play dying montages and effects only if the death was recent enough

gilded vapor
#

Ohh thats clever

#

I like that

meager spade
#

one thing with property replication is increases server cost

#

so the more replicated props, the more it costs to replicate so it can be a balancing act

#

Replicated properties should be stateful

gilded vapor
#

So multicasting is cheaper?

meager spade
#

Multicasts should be one off things

#

like explosion effects

#

but something being dead should be a replicated property

#

like monsters in our game, they play the dead animation via a replicated tag

#

once this tag is removed, any late joiners see them just in the dead state

#

Gameplay tags can reduce the amount of replicated properties aswell

#

like just replicating a single gameplay tag container, can handle 20 different bools, which you would need to replicate individually.

#

or you can go old school and use a single property and use bits

gilded vapor
#

Tag containers are bit-flags correct?

meager spade
#

no

#

its an array, but its compressed for networking

#

20 tags is 20bits

#

bytes*

#

same as 20 bools

#

but its a single replicated property and cheaper for server time

gilded vapor
#

I'm targeting my game for P2P but assuming all these principles still apply

meager spade
#

the biggest cost with property replication is the server needs to go over all actors, consider them for replication by checking if they have any changed properties, then replicate them

#

this costs time in ms

#

if your not running dedicated server, your listen server will feel a bit of a hit

#

as it has to do that work on the game thread

gilded vapor
#

If I have at most 8 players 8 AIs (all same character subclass) do you know a rough estimate on how many replicated variables I can support before eating away framerate

#

(assuming average hardware)

winged badger
#

we run 8 players 150 AI

#

still need to optimize a little

#

but generally it runs fine

gilded vapor
#

How many variables are you replicating though?

#

(Slash how big are your tag containers)

winged badger
#

can't say i've counted

#

but we do have a custom push model

#

around 2000 interactable actors are not replicated themselves, but instead replicated via network managers

gilded vapor
#

What kind of game are you making/working on?

quasi tide
#

Do variables in the AnimBP properly replicate? Running into an issue where client -> server works fine, but server -> client does not. I even set all variables in that deal with the scenario to be replicated.

meager spade
#

no

#

animbp is local only

gilded vapor
#

@winged badger just curious would you be willing to talk about what push model you use?

(I have a stack for pushing/popping states currently, was just curious if you have a better model)

#

Are there any callbacks to detect when an actor becomes network-relevant

meager spade
#

when an actor become relevant, it will run begin play on the client

#

any non relevant actors get destroyed

gilded vapor
#

Would updating the state when an actor becomes relevant (and multicasting out state) sound like a valid alternative to ReplicatingVariables or does that just sound like madness

quasi tide
#

So I'm not sure what else to do here. I'm trying to sync up my aim offset throughout my players. I have the pitch working, but looking left and right, doesn't appear to be working and I'm not sure where the issue exists.

I am currently using Get Base Aim Rotation to achieve this as I've read that it contains the values that are already replicated and was exposed back in 4.5 specifically for this. This does work locally still. This is from my AnimBP. I know it is local, but I thought that was the point of the Get Base Aim Rotation and it does work for up and down.

https://blueprintue.com/blueprint/fak77-kd/

#

Can anyone spot anything that I'm doing incorrectly? I've seen solutions that create a custom variable that replicates these values in tick, but I'm pretty sure there is a better solution, just not sure.

chrome bay
#

And almost definitely very error-prone.

gilded vapor
gilded vapor
quasi tide
chrome bay
#

RemoteViewPitch is around the 'Y' axis

#

And is automatically replicated already by the Pawn class.

#

X = Roll, Y = Pitch, Z = Yaw

gilded vapor
#

oh whoops my bad got confused

quasi tide
#

I was tryin' to find the remote view pitch - but I couldn't find it in BP.

chrome bay
#

GetBaseAimRotation will give you it

gilded vapor
#

Pitch isn't replicated not Z

chrome bay
#

GetBaseAimRotation will apply RemoteViewPitch to the pawns' rotation.

gilded vapor
#

which one isn't

chrome bay
#

Most of the time the characters' yaw and roll is the same direction they are aiming in, the only one that isn't is pitch.

quasi tide
#

I thought xyz were replicated through GetBaseAimRotation personally.

chrome bay
#

noop

gilded vapor
#

They're not

chrome bay
#

The actors' rotation is already replicated.

#

So all you need, most of the time, is the pitch offset - which GetBaseAimRotation() applies for you

gilded vapor
#

The solution I posted is a valid work around, I had to solve this same problem for my game

quasi tide
#

I'm trying to avoid doing C++ for this particular project.

gilded vapor
#

You can do it in blueprints too

chrome bay
#

That's an ask in Multiplayer tbh 😄

#

Start running into walls or less-than-optimal approaches to problems pretty quickly.

quasi tide
#

Yeah - I know. I'm just tryin' to do a super small MP game in BP

#

Non-commercial or anything like that.

chrome bay
#

So you have a Yaw offset as well as pitch? I would just replicate a yaw var too (skip owner), and create your own GetBaseAimRotation function that adds that value to yaw if Controller == null

gilded vapor
#

and than just set AimingRotation on tick to GetBaseAimRotation (if the actor is not Simulated)

quasi tide
#

Yeah - I was trying to avoid tick. I found some solutions on the interwebs that did just that and I was just looking to avoid it.

gilded vapor
#

I think this falls under one of those things you have to do on tick

quasi tide
#

Yeah - maybe. Probably won't be so bad. Only going to have like 2-3 players anyway.

gilded vapor
#

yeah you definitely don't have to worry than

meager spade
#

sigh everyone wants to avoid tick 😄

lost inlet
#

the dumb ue4memes twitter perpetuates the "avoid tick at all costs" thing, it's pretty much the only material they have

#

there are valid applications for it

rocky totem
#

what have i messed up here? I have health set as UPROPERTY(ReplicatedUsing=OnRepHealth) which is

void OnRepHealth(float InHealth){
  Health = InHealth;
}
#

@dull lance ok? so then do i have to call that if we are the autority to run onrep health?

dull lance
#

check cpp's answer

rocky totem
dull lance
#

No

#

Read the msg again

rocky totem
#

then what's the point of just using Replicated instead of ReplicatedUsing

#

why does the keyword exist if it doesn't just do the update for you

dull lance
#

ReplicatedUsing for cpp means that for server, you have to call onRep on server

#

the clients will get the update

#

but the server won't run that function

#

unless you run it yourself

#

if it's a blueprint replicated using variable, this happens automatically

rocky totem
#

ok what about just the default Replicated UPROPERTY() tag

#

without the using

dull lance
#

no function is ran on update

rocky totem
#

so then circle back

#

why does it exist if it just doesn't do anything when the value is updated

#

why would you ever use it?

dull lance
#

it does

#

you're misreading the convo

#

😛

vivid seal
#

Replicated will replicate the variable so that clients can see changes in its value.
ReplicatedUsing will also fire off an additional function on clients (the OnRep) if you want something to happen every time the value is updated.
If you want that OnRep function to fire on the Server, you have to call it manually in c++ (in Blueprints the OnRep will run on the server automatically).

#

the OnRepHealth function you wrote doesn't actually do anything

#

well, actually it sets the health value back to its previous value i think

#

the onrep parameter is the previous value of that variable (the new value is already set before the onrep is called)

dull lance
#

Lel

vivid seal
#

no, because in cpp setting the variable in the onrep wont call the onrep

#

if you did this in blueprints, yes

dull lance
#

ah, nvm; it'll just correct itself next net check

vivid seal
#

in blueprints OnRep will fire if you change a variable on the client

dull lance
#

Wait really

#

that's fu*** up

vivid seal
#

yeah, if you try to do client prediction it can be helpful if you know its going to do that

#

but its kind of a trap

#

like if you tie your "on variable changed" logic to the onrep, then you do client prediction of a variable changing, you'll get that logic to fire, but you have to know that since its predicted it might not be real

#

also i dont remember if onrep fires in BP if the previous and new value are the same

dull lance
#

it shouldn't?

vivid seal
#

so i always put in a check (if i already predicted this value, dont fire the logic again)

dull lance
#

at least in cpp it doesn't

vivid seal
#

well i mean, on the server the variable would change, but then the client would receive that change and his value would already reflect the new value

#

so i dunno if it calls the function in that case

#

either way its a mess, and if you wanna do something like that I usually just make a second variable (Health and DisplayHealth) where DisplayHealth is the one that can be predicted and is updated when Health replicates

rocky totem
#

so since i need to call OnRep on the server what should I be putting in an OnRep function?

vivid seal
#

OnRep is only if you need additional functionality

rocky totem
#

since the server RPC will handle the changing of the health anyway

vivid seal
#

like "every time my health drops i want a floating damage number to appear", you would put spawning the damage number widget in your OnRep

#

or if you want to update your health bar widget, you'd probably do that in the OnRep too

#

usually its stuff that the client needs like UI updates or effects

#

or just firing off a delegate of some kind

dull lance
#

I usually have/prefer to have local variables to keep track of onrep functions

#

and have the on rep Functions just be void Myfunction()

rocky totem
#

ok but usually you use it for cosmetic things that happen on the client

dull lance
#

Well at least in my cases, not necessarily ** (I can't type today)

vivid seal
#

you can do whatever you want in the OnRep, but yeah I think the most common use case is client visuals, which is probably why it doesnt auto-fire on the server

#

server doesnt care about UI/effects unless its a listen server

rocky totem
#

ok that makes sense

vivid seal
#

but yeah, moral of the story is the variable itself will be set behind the scenes if its set to replicate, OnRep is just for if you want to do ADDITIONAL stuff after the variable is replicated

rocky totem
#

ok so for example if I wanted to add scripting hooks so that someone else could extend this without needing to inherit from my class directly I could use OnRep to fire a delegate that could be listened to and would fire on all the clients but not the server by default

vivid seal
#

yeah i do that kind of thing a lot

#

where my OnRep will literally just fire a multicast delegate

rocky totem
#

do you also create a server delegate that only fires on the server too?

vivid seal
#

my stats system is set up that way

#

I usually manually fire the server delegate in the function that i use to set the variable

rocky totem
#

like a prechange and a postchange

vivid seal
#

so if I have a SetHealth function, it would also call HealthDelegate.Broadcast(), and then OnRep_Health would call HealthDelegate.Broadcast() as well for clients

#

and i'd have SetHealth not be callable without authority so it can only ever happen on the server

rocky totem
#

ahh ok and then in bound function you would just redo the authority check to see if it ran on the server?

vivid seal
#

yeah if you need to

rocky totem
#

ok

#

i mean as opposed to having a Server_HealthDelegate and a Client_HealthDelegate

vivid seal
#

yeah i would just use one delegate

rocky totem
#

ok

vivid seal
#

and you can always check if you're authority or not if you're trying to do something only the server or only the client wants

#

it gets a little confusing because really there's a ton of options for how to do stuff

#

but OnRep is a good tool if you know exactly where and when its going to fire

shy solstice
#

HALP! My brain is melting. 😱 I've created a Project based on this Epic tutorial https://www.youtube.com/watch?v=abmzWUWxy1U&list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ.
It works fine via internet. 🥳 MY QUESTION IS. Where (physically) list of created sessions is stored? 🤔 To be precise. Let's say I've shared my Project with 5 of my friends.
Everybody launched Project (or it could be even build version, but I'm pretty sure that doesn't matter) on their computers. 3 of them hosted game. So I may join 3 of them.
But from what place my GameInstance picked up this list? Is it from some Steam server? lol 🧐

In this video we take a look at the finished project and step through each of the features that will be covered in this series. We show our functional Main Menu and its options, a lobby where players can chat with one another and select their characters for the game, some server options such as changing the map or match time as well as the abili...

▶ Play video
severe widget
#

if you're using 480 to test you pretty much will have to use advanced sessions

#

you want to be able to filter by an attribute

night tartan
#

I've got a question concerning custom USTRUCTs and server-client functions with structs as parameters... Seems that they fall under the category of UObjects not replicating, so I get a null struct. This is correct, yes? Is there a decent up to date documentation on net serialization for custom structs if I wanted to be able to send them over RPCs? Or am I misunderstanding something.

Essentially, I have a struct containing the info of a server (name, current player count, etc) and want to send it from Game Mode to PlayerController so they can update their UI.

#

C++ I might add. Not Blueprints.

dark edge
night tartan
#

Well, same question, regardless of where it's stored. Structs seem to come up null when I'm trying to get the data over to the client to access for UI.

twin juniper
#

Hello, can I ask a quick question?

night tartan
#

The information is server side. I just want to get it to the client. And it seems that a custom struct is null when sent as a parameter in a function.

twin juniper
#

Any idea why Cross-Compiler isn't downloading for me?

kindred widget
#

@night tartan There's only two ways to send data. RPC or Replication. Only two things can do this by default. Actors or ActorComponents. They'll be sent by value either through RPC or Replication. Pointers sent need to point to a replicated object spawned by the server to not be null on clients. The only thing that structs change with this is the ability to set properties to NOT replicate specifically. Otherwise the entire struct should be the same from one side of the RPC or replication to the other.

night tartan
#

Hmmm

kindred widget
#

Name should probably go in PlayerState since it's directly player related.. PlayerCount should probably go in Gamestate since it's full game related.

vivid seal
#

Did you mark all the properties as UPROPERTY?

kindred widget
#

Simple replicated properties that server can set and all clients can just use.

night tartan
#

Yeah, I'm going to move these things to the States. My issue with PlayerState is that it doesn't seem to exist for a bit upon the joining of the game.

kindred widget
#

That won't matter for UI. UI shouldn't exist before the GameState.

night tartan
#

So in Blueprints when I was prototyping, I had to literally make a while delay loop to wait for it before proceeding. This felt nasty for me.

#

Okay

vivid seal
#

Regardless of whether this specific case is a good idea, there shouldn’t be issues replicating a struct or RPCing it

night tartan
#

Thanks so much for the advice. I will work through all of these and see if I can get it to send the data over.

vivid seal
#

If you want a struct property to replicate or be sent via RPC it needs to be UPROPERTY, you shouldn’t need to do anything on the serialization side unless you have something custom going on

night tartan
#

Okay, thanks. That makes sense.

kindred widget
#

Bear in mind that courses can be a bad way to learn in a shifting development environment. By the time that course is written, published, and followed, half of the stuff from it can be outdated. I personally find that you'll get a lot more milage by just doing and learning what you need in the moment.

night tartan
#

This Udemy course didn't have Super::Logout, for example, so I was banging my head against a wall for a while til I realized that.

#

Yeah, I don't follow step by step. I got off the tutorial treadmill. I use them to quickly Jumpstart stuff then I modify with the API.

kindred widget
#

Great example is people still using GENERATED_USTRUCT_BODY(), cause their two year old tutorial said to. Everything uses simple GENERATED_BODY() now.

night tartan
#

Yes, I don't do that haha

#

I read the source and avoid deprecated stuff. Thanks so much, guys. I will look further at the UPROPERTIES and move my variables to better locations and hopefully solve this Lobby UI headache :)

kindred widget
#

But yeah. If you have a struct of two integers for instance.

USTRUCT(BlueprintType)
struct FMyTwoIntStruct
{
    GENERATED_BODY()

    UPROPERTY(BlueprintReadWrite, EditAnywhere)
    int32 FirstInt = 0;
    UPROPERTY(BlueprintReadWrite, EditAnywhere)
    int32 SecondInt = 0;
    
};
#

This struct should automatically be able to be used in an RPC and Replication without issue in C++ or Blueprint.

night tartan
#

Not at my PC currently, but I'll make this fix later. I think you solved my headache. Much appreciated.

kindred widget
#

May want to add a constructor or two to the struct too, but yeah.

faint pawn
#

if i am playing the game as a listen server with 2 players(one being the server), who does the third player represent? this still confuses me.

meager spade
#

a bug in your logic

faint pawn
#

could it be related to how i spawn the players?

meager spade
#

more than likely yes

#

if you did it the non standard ue4 wa

#

way*

faint pawn
#

spawning on server. this runs inside the player controller

meager spade
#

that does not look right

#

you should be doing it via GameMode

#

client should also not spawn there own character

#

they should be replicated, and only spawned on server

winged badger
#

@faint pawn top pinned message on this channel contains a link to network compendium

#

i suggest you download and read it a few times

rocky totem
#
UFUNCTION(BlueprintPure, Category="Properties")
    float GetHealth() const { return Health; }
    UFUNCTION(BlueprintCallable, Category="Properties")
    void SetHealth(float inHealth);
    UFUNCTION(Server, Reliable, WithValidation, Category="Props")
    void Server_SetHealth(float inHealth);
    UFUNCTION()
    void OnRepHealth(float inHealth);

is there any reason to have SetHealth if the only thing it does is call the server's set health if it's not run on the server? couldn't I just remove it and make Server_SetHealth just SetHealth since it will run on the server anyway?

winged badger
#

i'll just call SetHealth on server, and also from OnRep

#

i'd never have a version of your Server_SetHealth function

#

as client has no business setting the health of anything directly

rocky totem
#

ok so your set health would be something like

UFUNCTION(Server, Reliable)
void SetHealth(float inHealth) {
  if(GetLocalRole() == Role_Authority) {
    Health = inHealth
  }
}
winged badger
#

no

#

i'd never have it as an RPC

#

if you're doing damage, it will be Server_ResolveShot(payload) which will cause the server to DealDamage then that will call SetHealth

#

if you're healing, it will be Server_ActivateAbility, which will call Heal, which will call SetHealth

rocky totem
#

ok so you would just have the check to make sure you are the authority but getting to the server would have to happen in some other function to prevent the client from changing their health directly

winged badger
#

client has no business setting that stuff directly

rocky totem
#

ok that makes sense

winged badger
#

so my SetHealth is basically at least 2 functions removed from server RPC

#

that causes health to be changed

gilded vapor
#

Are RPCs batched like replicated variables?

#

Or are they actually executed when called

faint pawn
#

sorry for the late reply. i am running logic on the client's player controller because its easier to get my references from there. should i switch to interfaces and handle it that way?

meager spade
#

@gilded vapor they are sent the next frame

night tartan
#

to further along a question from earlier...I am using GameState and PlayerState, and the PlayerArray on the GameState is spitting out 0 when I access it; shouldn't this be a replicated variable?

#

I am trying to print a current player count in the UI...and PlayerArray.Num() is returning 0

#

I know UMG is client-side only, but I was under the impression the GameState is the Server/Client object where this kind of information should be stored and accessed for networking

meager spade
#

yes but you need to wait for it to be set

#

you are likely trying to access it too early

night tartan
#

Yay...I did "delays" in Blueprints when prototyping for this problem

#

so in C++ what's the safe way to handle this?

#

I really don't like the idea of having to stick hiccups in my code

#

it isn't a delay issue, I just made another LAN client and added them

#

PlayerArray.Num() is returning 0 on all connections, no matter what

#

if it were a delay issue, I'd be 1 off as I join more clients

severe widget
#

@night tartan doing anything custom in the login flow?

night tartan
#

no

severe widget
#

then playerarray should populate

#

inspect your output log for any and all warnings

night tartan
#

no warnings