#multiplayer

1 messages · Page 620 of 1

vivid seal
#

for example, my basic UseAbility() function in the child class (PlayerAbilityHandler) checks right off the bat if I am the server. If so, it just calls Super::UseAbility() and that's it, sending the result back to the owning client in an RPC. If not, I check for AutonomousProxy, and if that's true then I do all of the client prediction and end up sending a Server RPC to call UseAbility() on the server.

covert garnet
#

@vivid seal In GAS there is only one class(AbilitySystemComponent), client-predict call and server call are different functions

winged badger
#

@vivid seal compose

#

make 2 UObjects with those functions, and instantiate one depending on authority or not

azure hollow
#

of course dude! 😄 Would be too much otherwise I agree, so setting up dedicated servers seems to be the best choice?

hybrid zodiac
#

Hi all, I have a problem which is driving me crazy. In my game mode, the match state is somehow being set to InProgress without me calling SetMatchState and I cannot figure out which part of the code is calling it (I did a ctrl-shift-F and searched the entire project for instances of SetMatchState and there are none I don't know about)

#

I noticed in SetMatchState within AGameMode there is a log to LogGameMode every time it's changed, how do I view the output from LogGameMode?

finite kettle
hybrid zodiac
#

@finite kettle Ah good shout, thanks, I'll remember that next time! I actually found the cause of the issue, which makes it all the more baffling that the problem only just popped up now, years after development started. It's in HandleNewPlayerStarting

#

Just had to override it to do nothing since I'm handling player joining logic

finite kettle
hybrid zodiac
#

@finite kettle Ah that might explain why the problem only just occurred now then, I might have removed the bDelayedStart flag by accident or on purpose without realising what it did

#

Thank you for the help 🙂

pine bobcat
#

Hey guys, I got a weird problem for my character movement in multiplayer.
Server looking at client character is having a smooth movement, while Client looking at server character moves with jitters (shown as the videos).
I put the AddMovementInput node in EventTick as the image shown. I had the character replicated and movement replicated.

#

Does anyone got an idea how to fix this?😫

potent cradle
#

Hmm, is it right that pressing F8 to detach from PC during PIE with 2 clients (play as client), would be the server view? Or am I mistaken and is it still client side? I saw some behaviour that led me to think this, but I might be totally off base.

(pawn seems to disappear totally for some fun reason 😄 )

chrome yoke
#

hi, so i wanted to implement multiplayer feature for my mobile game, i wanted to make it with unreal engine online subsystem itself but i dont have much multiplayer knowledge so i wanted it to be like someone hosts the match and the client dont have to put the ip but like he clicks on join and then he automatically joins a randomly hosted match so is this possible and how without a dedicated server or any other solution? please help

worn lodge
#

@winged badger Thank you for the answer, I had seen a few post on Answerhub mentioning that OnPostLogin was safe for that logic, but I see the intended way is as your stating. I will be looking into this today and hit you up with results. Thanks a lot.

candid escarp
#

Hello people! Does someone know how to correctly interpolate positions for clients via blueprints? I am doing the stuff in the picture for clients and it seems to work, but I am too much of a noob to know and it may get imprecise later. Thank you!

bitter stirrup
#

Hey, I'm currently working on a 1v1 online game using listen-server architecture that will be released on steam (therefore, using Online subsystem steam).
I was wondering if there is a way for me to have a queue-like matchmaking system ?
I know how to create a session, find other players sessions, display them and join one of them but i would like something easier to use as a player. Just click on a search button and wait.
I could just look for sessions and if nothing is found after a few seconds make the player create his own but that seems a little simplistic.
Is there a function that i missed that would help me achieve that ? Or is it not possible to do it cleanly using a listen-server ?
Thanks in advance !

winged badger
#

@candid escarp that will choke your network for no benefit

#

you just need to replicate a single Vector in this case, DesiredLocation

#

and you let the client interpolate it itself on Tick

candid escarp
#

ah okay that means the tick thingy should be executed on the client only?

winged badger
#

if everyone has an Actor on same location

#

and that Actor is travelling with same speed to another location

#

everything is synced

#

server just shares the initial state

#

and each client does the same thing on TIck - interpolate to target

#

logic you used above wouldn't work for single player, btw

candid escarp
#

I want to make players see same ball positions

#

it's an online-only game so that's okay

winged badger
#

if you have a vector speed then FinalLocation += Speed * DeltaTime

#

there is no interpolation required in that scenario

candid escarp
#

oh okay

#

i will try that, does that mean, that I have to create a custom event that runs on clients only and is called by event tick?

winged badger
#

@bitter stirrup its pretty much if game not found, host a game scenario

dark edge
#

You could also have everyone host while searching, then quit hosting when they join a hosted game.

#

That way you don't have 10 people looking for a game with none of them hosting at that moment.

candid escarp
#

I am not replicating movement btw.

winged badger
#

replicating the object will cause the client to spawn it

#

if its relevant

bitter stirrup
#

@winged badger So there's no way to handle it using steam to match 2 players and tell one of them to create the server ?

winged badger
#

without a custom server doing matchmaking, not sure there is

finite kettle
#

Hello!
I would like to ask a question about component replication. I need to have one persistent instance of component over multiple actor's respawns (destroy and spawn again).
Is it possible to detach component and attach it to the another instance of the actor? Would the net channels pair?

Thanks for any advice 🙂

winged badger
#

they would not

#

is that component in any way related to the player pawn?

finite kettle
#

It is AbilitySystemComponent

winged badger
#

it can probably sit on the PlayerState

#

not that familiar with GAS

finite kettle
#

Yea, but i need multiple ASC's

bitter oriole
#

@bitter stirrup Since it's 1v1, either player will need to host the game, so you can build your own matchmaking with average framerate for example as a parameter and have the highest performing player host once two players are matchmade together

finite kettle
#

Player has multiple pawns

winged badger
#

but you would just need to redirect the GetASC function

finite kettle
#

Is there any way how to pair them? Or it is a suicide mission?

winged badger
#

via playerstate, sure

#

copying a replicated component onto another actor... that won't work so well

#

its technically possible, but... yikes

candid escarp
finite kettle
winged badger
#

however many pawns you have

#

you still have the same PlayerState

#

and i have done a lot of stuff getting the engine to network the way its not meant to

#

i would not go down that particular rabbithole

bitter stirrup
#

@bitter oriole Yeah that's exactly what i want ! My problem is matching the players together. Currently my only way to do it is for a player to create a session and for the other one too look for it using find sessions but at that point one of them is already the server

winged badger
#

i am pretty sure the NetGUIDs will break

#

if you move it to another actor

#

which means you need to assign a new one.. .somehow

dark edge
winged badger
#

which in turn means altering the engine

dark edge
#

Make being dead a state, not the destruction of the actor.

winged badger
dark edge
#

I'm guessing this is something like an RTS with characters that can have persistent stat changes or upgrades to abilities?

finite kettle
winged badger
#

i am still very unsure why transfer the ASC if you have multiple ones

finite kettle
#

So I promised them I will try to find another solution 😄

winged badger
#

then make a struct that your ASC can initialize from

#

and just copy that over

#

its like 1 struct and 2 functions at bare minimum

dark edge
#

Is this for like the main characters in the moba or subcharacters like summons or minions?

dark edge
#

Destroying those seems icky but if you must do it, then you can figure out some way to save their stats etc to a struct and then reinitialize on creation

#

You are going to want that struck anyway for things like rejoining from disconnections or saving a game or whatever

finite kettle
#

😦

dark edge
#

Yeah, 100%, should not be destroying the characters. Being dead should be a tag

#

And resurrection/respawning can just be a gameplay effect then

#

And buffs can persist

finite kettle
#

thank you very much for the advice @dark edge @winged badger

candid escarp
# winged badger replicating the object will cause the client to spawn it

One last thing I wanted to ask: does all that mean, that I have to do all force and impulse calculations myself or can I still use Add Force etc.? I don't know how to get the velocity and rotation other than using get component velocity for the velocity and get world rotation for the rotation

winged badger
#

physics is not deterministic, so good luck keeping that in sync

candid escarp
#

As an example I would take a game like rocket league, the position and rotation of the ball for example. I don't know how much the network will get DDoSed if I update the positions for the clients at each tick

dark edge
candid escarp
#

Okay that sounds alright. Thanks to all, I am still learning about multiplayer syncing and this channel helps a lot

winged badger
#

problem is

#

you sending an update each tick

#

doesnt mean they will arrive each tick

#

or in order they are sent

dark edge
#

Yeah you need some way of smoothing the fire hose of data on the other end no matter what. Whatever you do, don't try to out engineer the built-in replication stuff unless you really know what you're doing.

winged badger
#

or that you have same tickrate

candid escarp
#

Okay I guess I have to read stuff about that, I haven't tried stuff like package losses etc.

#

If I do the same calculations on every clients side I should get the exact same results for each client right? But isn't there still a problem, if a client gets disconnected, the positions on the server and on that client would be different

dense ocean
#

Anybody know why my clients cannot see any other client or the server pawn's movement until about 10 seconds, at which point everyone snaps to their actual (server) location and from then on its good?

#

There's just about a 10 second period after each startup where the client can't see any replicated movement

kindred widget
#

Ignoring per second rates and whatnot for middle of gameplay. What kind of download size is generally acceptable for a decent game size as far as initial download when connecting to a server? All of the state variables and whatnot. Possibly considering something the size of ARK in scope, but with much lower player count per server. Are there any statistics on what kind of average connection a player might have for coop style games?

#

I'm mostly concerned with the ten minute load screen that games like that tend to have. I'm not close to that yet, but I really don't want to just deal with it when I get there, so I'm just looking for some general figure. More or less wondering if there is like a percentage of people who don't at least have like a 5megabit connection.

potent cradle
mortal zealot
#

Anyone got experience with Steam sessions? I am having a bit of a problem with getting a Steam dedicated server working. I can create a session and join via LAN across my network, but it doesn't work online. I don't have "Use LAN" checked. When I search for my online sessions in-game I find 3-4 sessions, none of which is my session (according to Steam ID). I can find my server in the Steam server browser in both "Internet" and "LAN" tab. Any ideas?

clear sand
#

Hey lads, back to dedicated server question. How do I prevent dedicated server from launching when I PIE as a client? I have it running standalone with specific map, so I don't need to run with PIE

chrome bay
#

play in standalone in editor, then open IP to the standalone instance you have running

#

Not certain you can join other standalone instances outside of the editor when using PIE though

clear sand
#

standalone does not provide info whether its server or not(its actually counts as server)

chrome bay
#

Not sure what you mean. Standalone instance needs to open a map with ?listen if it wants to act as a server

#

Standalone is it's own NetMode

#

To run PIE as a client, it needs a server to connect too

clear sand
#

Right, but macros like/#if WITH_SERVER_CODE always returns true on standalone

chrome bay
#

They will always return true anyway unless you do an actual Server build. They're eval'd at compile time not runtime

clear sand
#

Arent running UE from VS actually compiles code?

chrome bay
#

Sure, but WITH_SERVER_CODE is going to be true unless you did a Client build

#

Which you aren't doing if you're launching the editor

clear sand
#

Alright, but GetNetMode() should return correct values, right?

#

Ok, looks like its the way I needed. While its not connected to server - it stays as Authority, once I connected to remote dedicated server - all works as I expect

grave notch
#

Hi guys, is there any deep guides/tutorials about multiplayer in UE4? I need something advanced for lets say something like AAA quality project. How to properly build multiplayer architecture and make perfect synchronization between players (not FPS genre tho).

limber gyro
#

can some one give me a hand on how to craft a https request with unreal?

#

any one that has done that before?

lost inlet
kindred widget
#

@grave notch Not really sure that a guide or tutorial like that really exists. If it does, someone should probably give it to quite a few AAA game companies. You don't usually get quality without a decent amount of iteration. You don't usually get experience without it either. It's worth noting that AAA doesn't necessarily mean quality either, just a bigger budget. On a side note, any guide promising perfect synchronization between all clients probably should be avoided. PTT means that something will be out of sync for someone or someone will see things before someone else, etc.

grave notch
#

Well by "perfect" i meant optimized realization. For lockstep and predictive types.

primal peak
#

Sooo I'm trying to use ClientTravel to join a server that I hosted on my local ipv4 address... But can't seem to and I get this error

#

void UOneGun_GameInstance::Host() {

    UEngine* Engine = GetEngine();

    if (!ensure(Engine != nullptr)) return;

    UWorld* World = GetWorld();

    if (!ensure(World != nullptr)) return;

    World->ServerTravel("/Game/CPP_BR/TestMap?listen");

    Engine->AddOnScreenDebugMessage(0, 5, FColor::Purple, "Hosted xD!!");
}
void UOneGun_GameInstance::Join(const FString& Address) {

    UEngine* Engine = GetEngine();
    if (!ensure(Engine != nullptr)) return;

    Engine->AddOnScreenDebugMessage(0, 2, FColor::Green, FString::Printf(TEXT("Joining!! %s"),*Address));

    APlayerController* PlayerController = GetFirstLocalPlayerController();
    if (!ensure(PlayerController != nullptr)) return;

    PlayerController->ClientTravel(Address, ETravelType::TRAVEL_Absolute);

}
#

These are Exec functions

#

I open these as standalone games using powershell btw

tranquil yoke
#

Is it possible to stream Level , when we join to server, I want to reduce my Level loading time to as minimum i can have, if possible seamless.

Right now it take 6 to 7 seconds.

#

On Android though.

winged badger
#

if you know what level are you loading into in advance

#

and you have an asset with weak pointers to the major assets in your levels

#

you can start preloading assets

#

before you call open level

#

we do that from our lobby, as soon as the map is selected, the game starts preloading the level's prefabs off thread

#

and it shaved a couple of seconds from PC loading times

tranquil yoke
#

you mean weak pointer to an Object and that Object will have all the Hard References to the Level Items.
and do AsyncLoad for that Object Class / or something.

#

Does soft Reference works the same , if i keep asycn Load that asset.

meager spade
#

SoftObjectPtrs

twilit badger
#

Hello, Im wondering if anyone can help me convert an actor so it replicated (Actor is a vehicle), I have the physics and i have it replicating but its laggy and does do what i want it to do. Please PM as i dont usually come here and i probably wont see it here

winged badger
#

if your skeletal mesh component is set to replicate

#

turn it off

pine bobcat
#

No, the skeletal mesh is not set to replicate 😦

drowsy arch
#

any tutorials on making c++ 3rd person controllers

#

for multiplayer

twin juniper
#

GAS Shooter has first-person/3rd person switch, you can just disable the switch, and always keep in third person... It's not a tutorial per se, but it's primed and ready for multiplayer following Epic standards 🙂

winged badger
#

there is an extensive Deadalic blog about TPS camera though

#

interesting read

drowsy arch
#

can you link?

granite badge
#

@pine bobcat You could try changing the minimum frequency of updates on the actor

steel fox
#

IsLocallyControlled() returns always false in my pawn in BeginPlay() or PostInitializeComponents() after calling ServerRestartPlayer() from the pawn's controller, what do I have to do?

chrome bay
#

Both of those will be way too early

#

You can look at the possess functions, or the controllers 'SetPawn' function

steel fox
#

I suppose that GetWorldTimerManager().SetTimerForNextTick(...) requires tick to be enabled right?

#

With that function I got it working...

chrome bay
#

Doesn't need to have tick enabled, but in multiplayer that's asking for trouble still

#

no garauntee the possession will be received by the next tick

#

usually will in this case, but delays/timers to get around network issues is asking for hard-to-find bugs later

pine kernel
#

hello someone is good at making local multiplayer inputs ? im trying to make a fighting game where you can control second player with controller but when i open my level blueprint and create player node , the second character doesnt move when i use controller..

twin sable
#

how do you guys sync attack animations between the client and server? do you use a rpc and play a montage? or change a value to transition to a different state?

winged badger
#

RPC a montage here

#

or a state that starts a montage

#

depending on the use case really

twin sable
#

ok I'll try that. getting timing issues with players spamming attacks meaning the state is stuck on attack

#

and if I set the animation to loop it will start looping as its transitioning out which looks weird

#

I'll try playing montages instead

winged badger
#

you can arrange all the attacks in a montage sequence

#

then just change which sequence the montage is playing

#

and RPC that

#

less payload if you can make it work

#

1 byte is sufficient

twin sable
#

@winged badger do you know if theres a simple way to only play a section of a montage?

#

I've set the attacks with their own sections like this. but playing a montage and skipping to a section always plays the entire montage from that point

#

maybe I should just have separate montages for each attack

hybrid zodiac
#

Hi everyone, I have a challenge I can't quite figure the answer to. I have an admin panel that server admins can use to modify the map cycle for the server. The map cycle is held in in a TArray of a custom struct called FMapCycleEntry within the Game Instance, so I need to somehow send the map cycle to a client, but only if they open up the admin panel and want to look at the map cycle. I don't want to replicate it to everyone as it's quite a bit of information and likely a waste of bandwidth since only 1 or 2 players will have admin privileges

#

I thought about having a client function which passes in the TArray, like Client_SendMapCycleData_Implementation(TArray<FMapCycleEntry> MapCycle); but it doesn't like that

winged badger
#

@twin sable we have synced network clocks and all our networked montages come with a timestamp

#

so we adjust the start time or the play rate, depending

hybrid zodiac
#

@pine kernel Make sure the player controller owns the second character. You cannot execute server commands like movement input unless you own the character (you'll get a warning in the log saying something about "no owning connection for actor"

steel fox
#

Is there a good tutorial about HUD in multiplayer games? I'm getting crazy trying to add widgets to my HUD at Character spawn, I'm not even sure abouth what should I do, adding widgets from actors BeginPlay or PostInitializeComponents doesn't always work, so I'm assuming that I have to tick my HUD and get from my character if the HUD can display a certain widget or should Hide/change it with a different one, but I'm not sure, I'm getting very confused about them, any hint?

bitter oriole
#

Use the built-in HUD class

#

it will work exactly as needed in multiplayer

#

Add widgets in beginplay and you're done

steel fox
#

My issue is that trying to add specific widgets for each player from BeginPlay() is that IsLocallyControlled () doesn't always work as intended from there, so I can't know to who I'm exactly adding the widget, yeah by checking the role or HasAuthority I can know who is the server but nothing more

bitter oriole
#

Hud is client only.

steel fox
#

So trying to acess it in begin play will return nullptr for non owners? Ty a lot

bitter oriole
#

Beginplay will only fire on the owning client since it only exists there

steel fox
#

What about replicated actors? I Am having it fired both on server and clients, so am I doing something wrong?

bitter oriole
#

Hud class does not exist on sever

#

Are you sure you are using that class for BeginPlay

steel fox
steel fox
#

This are spawned by GameMode

bitter oriole
#

Look

#

You asked about HUD widgets

#

You should be using the BeginPlay event of your HUD class - as in, inheriting AHUD in the engine

#

Spawn your widgets there and you're just done, no RPC or replication needed

#

I'm not sure what you're asking about replicated actors

steel fox
bitter oriole
#

Alright so

#

I'm getting crazy trying to add widgets to my HUD at Character spawn, I'm not even sure abouth what should I do

#

My answer is to use BeginPlay of your AHUD-derived HUD class

#

If you need character-specific widgets based on whether the character is there, you'll indeed need to tick and decide what to display

peak notch
#

how can i get the playernames from a session

#

is it possible?

#

after doing a Find Session

chrome bay
#

it's not no

#

You can only get the information that the session is "advertising" - which is usually as little as possible

bitter oriole
#

Though, you can get the player name from Steamworks based on the player ID in the session info, right ?

chrome bay
#

I think it depends on the OSS... I wonder if steam let's you retrieve all user id's for a given session id

peak notch
#

so basically googleplay will come in play

bitter oriole
#

Not familiar with that, but you can try looking into the OSS code

peak notch
#

Sorry but OSS?

#

Oh online subsystem

#

But how can one look at the google play subsystem code

bitter oriole
#

Not that, but the UE4 OSS implementation for Android, see if you can find stuff

#

Though I guess the first step is to check how you can get the information in the Android SDK

#

Second step would be to expose it in OSS

peak notch
#

Ok

#

Let's search ig

upbeat basin
#

Is it possible to replicate dynamic textures somehow? I'm trying to download avatar image of players to server and set a replicated Texture variable but although the server successfully downloads and sets the variable client value is always null

bitter oriole
#

You can definitely replicate textures but you'll need to handle it yourself

#

Compressing the raw pixels to PNG or JPG and replicating that in a custom NetSerialize method

twin sable
#

figuring out how to balance client side prediction and server authority is a bit difficult though

peak sentinel
#

Reading Tim Sweeney's UT2004 article about replication, are these values still usable in UE4 too?

winged badger
#

its out of date a little

#

when server picks actors to replicate, if will replicate them in order of net priority, it has nothing to do with bandwidth

#

actors that get skipped for replication panic, increasing their net priority over time

#

until they get replicated

peak sentinel
#

I see, thanks Zlo

winged badger
#

also its 3 for pawns/controllers, 1 for actors nowdays

peak sentinel
#

What do you use for Characters?

winged badger
#

tahts engine default

#

and character is a pawn

jolly siren
#

lol why are we replicating fish

peak sentinel
#

Right, okay, thanks 👌

winged badger
#

we left that on a default pretty much

#

but we incrased shot lived actors like grenades to 2,3 i think

#

@jolly siren to create the worlds first accurate network fish simulator?

meager spade
#

we are doing another network optimization pass soon 😄

winged badger
#

@upbeat basin if your network infrastructure allows for it, would be simpler to have a public server store and redistribute those

clear sand
#

hey lads, so I have dedicated server running standalone, however #if UE_SERVER returns false. What am I doing wrong?

#

I'm running it like Engine/Binaries/Win64/UE4Editor.exe MyProject.uproject ?GameMode -Port=myPort -server -log -nosteam

winged badger
#

running standalone from PIE?

#

because that checks if build target is server

clear sand
#

no, manually

winged badger
#

won't return true for editor binaries

clear sand
#

well I dont want to start it right with PIE client, because it automatically connects to server. I need to start it unconnected do some auth stuff and when it succeeded - connect to my dedicated server

winged badger
#

by the time you finish compiling

clear sand
#

I didnt find solution to skip initial connection to dedicated server

winged badger
#

the code was compiled... or not based on what that check returned at compile time

#

with editor binaries, it just won't work

#

it doesn't check that code at runtime

#

you can try, if you want a runtime check

#

if (GetWorld()->GetNetMode() != ENetMode::DedicatedServer)

#

(actors have GetNetMode of their own and don't need to call GetWorld)

clear sand
#

Hm, thats good idea, thx, I'll try

#

but is it better to replace it with #IF UE_SERVER when shipping game or I can keep this runtime check?

winged badger
#

whatever is inside #if UE_SERVER

#

won't even exist

#

if the build target is not server

#

code won't be compiled for the binaries, as if it was never there

severe widget
#

it's a great idea to keep as much stuff wrapped in #if UE_SERVER as possible

harsh lintel
#

are uobjects replicated by default or do I have to set a variable

limber gyro
#

Does PlayerArray exist in the gameMode?

#

nvm that question was dumb

young spoke
#

So I have shooting in a montage
When the play click shoots it calls this multicast event so other clients can see the animation
In the timeline there is a trigger which calls an event called shoot
In the shoot event there is a hitscan function that draws a line trace
Works fine for the server

#

But for a client 2 line traces are produced
But only 1 ammo is used

#

Any ideas why>?

celest sleet
#

I am trying to make a fireball explode upon impact replicate correctly. I have the server determine when the collision happens and its effects, but also sends to the clients where it exploded so they can spawn the visual effect in the correct location, to compensate for potential physics mismatch of the fireball projectile. according to my tests the code is being run on the client but there is no explosion. the visuals are working fine for the host player.

cosmic trail
#

@celest sleet show code on client, and how do you know it's getting hit? Sounds more like a visual spawn problem if you know the client code is actually hit, not so much a multiplayer problem

wise zephyr
#

guys i am using eos core is there a way to change the server name?

winged badger
#

@celest sleet you destroying that fireball actor in the same tick you MC the explosion maybe?

#

as the actor destroyed tends to beat the multicast then, and when MC lands, there is no longer an actor to execute the code

wise zephyr
#

is there a way to name the server with eos core in blueprints?

winged badger
#

if it works anything like other services

#

the session can hold data

#

and you can choose to interpret one of those data fields as a name when you display it

wise zephyr
#

nvm found it

dark edge
celest sleet
meager spade
#

i handle my explosions in EndPlay of the projectile

#

it works well 😄

odd sundial
#

There is no FRotator equivalent to an FVector_NetQuantize is there?

meager spade
#

Rotator is just floats

#

so just quantize the parts, and convert back

odd sundial
#

Yeah I figured I'd attempt for the lazy-man route. I'll just do it that way.

kindred widget
#

@odd sundial It's worth noting that FRotators are compressed by default. At least I'm fairly sure you get the same thing in C++, can't see why it would be different. At least in blueprint, simply creating an FRotator property that is replicated and netprofiling it, shows it not sending a full 12 bytes. Which is consistent with the fact that it gets unwound and arrives on client with 0 to 360 rather than -180 to 180.

odd sundial
#

That's awesome

kindred widget
#

Most rotators should only send with 4-6 bytes rather than 12. They all get compressed to shorts or bytes. I suppose they figured that 0.005 precision per angle was always more than enough for a simple direction.

peak sentinel
#

But Quats doesnt, right?

upbeat basin
winged badger
#

if the texture is packaged, then you just need to replicate the asset pointer

#

nothing else

upbeat basin
# winged badger <@!157557086950129664> if your network infrastructure allows for it, would be si...

Well not exactly but I guess we're doing something similar by storing player avatar URLs on our database (since there are players from multiple platforms that have different APIs for profile data). Currently it's the URL that is replicated and each player downloads every other ones images upon connecting the server. I wanted to download the image once on server to reduce our webservice usage and replicate the texture itself, so each image will be downloaded once on server (from our webservice) and will be distributed to the other players

#

It's dynamic textures that I download from web, so they're not packaged I suppose

winged badger
#

replicating URL and letting players download the texture from the webserver is way simpler then getting unreal to replicate the texture imported at runtime

#

add a sensible cap to the size of the texture they can upload, and it should all run smoothly

upbeat basin
#

I see, thanks for the headsup

weary badge
#

Can the GameMode in an online multiplayer call an event on PlayerControllers through an event dispatcher ?

pallid mesa
weary badge
#

Thanks !

grave notch
#

How to handle ping if you want to make actions feels like it was done without ping? For example i click to move to specific position, i send that action to server with 50ms ping, and also i instantly start to do it locally (so you cant feel ping), so now server start to move me 50ms later and i have desync. I want server to understand that i had 50ms ping when i did that action so my position in server should be reached faster. Is it possible to do?

chrome bay
#

It's complicated

#

Character Movement has a whole prediction/reconcile system as part of it's movement

#

In a game where you are moving a character by clicking different position, you will likely just have to live with the latency

#

I presume you're moving it with AI, which means only the Server can really move it properly anyway

grave notch
#

Well actually its more simple, no pathfinding systems, just move to where mouse position was when you clicked (or holding, its probably harder that way). Actions come directly from player. Basically i want to move character forward by exactly player ping so it should be similar position on server and client (small difference in position can be handled automatically by character movement sync if i understand correctly). So main idea just to sync huge difference in position when you start moving. Not sure about what gonna happen if player starts to change moving very often.

chrome bay
#

Are you possessing the character?

#

If so, just use AddMovementInput to handle movement (client only) - and this will be handled automatically

grave notch
#

ye its your own character

chrome bay
#

Movement prediction is a lot more complicated than that

#

If you can leverage the existing system UE has, just try to use that

grave notch
#

you mean i need to move my character client only and server will do everything automatically?

chrome bay
#

If you move the character client-side only via the AddMovementInput functions, then yes it will be handled automatically

#

Assumes you have "possessed" the character pawn

#

And that will come with all the prediction logic the character already has

thin stratus
#

Terms and Conditions apply

grave notch
#

interesting, okay i will try

rotund quarry
#

Hey, so, I have an issue that Im unsure how to solve regarding movement jitter. While testing the game as standalone game with clients and server on same PC it all works fine, but when testing over Steam there is jitter most of the time, but not always. It all leads me to believe that its network's fault. Is there a way to see if its network problem, seeing how the ms is in the low 40s?

viscid monolith
#

I have 2 functions.

    UFUNCTION(Server, Reliable)
        void SetPlayerTeam(int _team);
    UFUNCTION(BlueprintCallable)
        int GetPlayerTeam();

If i will call SetPlayerTeam(), and then i would want to know team i specified from other client, will GetPlayerTeam() return team i specified?

grizzled stirrup
rotund quarry
chrome bay
#

It's just that you haven't tested what you've made with latency yet

#

So the flaws will be showing through now

#

For MP you want to get into a habit of packaging up and testing stuff outside the editor in a "real" environment, but also testing in-editor with simulated lag and such

rotund quarry
#

Thank you, Ill give it a go. Probably a lot of stuff added up too that I havent considered

chrome bay
#

The editor has some built in stuff for it (look at Network Emulation Settings under Advanced Play Options) - can recommend using Clumsy.io too, that's a handy app

silent valley
#

This is good advice, we tend to always run/dev with bad network latency emulation on, then when we play online for real it's a joy to play 😄

languid ruin
#

Hi everyone, i'm having an error every time a server travel occurs, i guess the error comes from the highlighted line but don't really know how to deal with it.
Maybe it is because i moved the map and it's past location is still linked somehow but how can i fix it?

kindred widget
#

Question about C++ OnRep. Since it doesn't get called on the server. How do people normally handle that when you're looping over an array? So for instance you change five values. You wouldn't want to call the onrep five times locally. But calling it regardless of whether you changed the array or not also feels kind of dumb.

#

Do I just need to implement some bool checks and toggle them if I change the array and then if statement that before calling the OnRep or something?

leaden atlas
#

whats a good, easy way of doing a constantly degrading hunger meter with network prediction?

winged badger
#

@kindred widget typically server would do its stuff while setting elements on the array

#

client would ideally reuse that (per element) function during its OnReps

leaden atlas
#

I was thinking like maybe using a replicated timeline or roll my own implementation that just replicates network timestamps + hunger rate + hunger level or something

#

But idunno

winged badger
#

@leaden atlas sync network clocks, timestamp the state when you update it, and let each machine simulate the... degradation

#

only update from server if something forces an update outside the ticker

kindred widget
#

Nah. I literally just need to call a dispatch when the array changes at all to update some UI. I just don't want to call it five times in one function, or bother calling it if nothing changed.

winged badger
#

this leads to introducing a 2nd variable - lets call it SimulatedDelte

#

that you tick up/down w/e

#

and your GetHunger returns the (Hunger + SimulatedDelta)

#

that way everyone can tick their stuff without affecting the replicated variable

leaden atlas
#

kk

winged badger
#

when server chooses to update, client uses OnRep to set its value to server's and zeroes its SimulatedDelta

#

in its most basic form, that is the cheapest accurate way

marble gazelle
#

I'd think of using an RPC to sync the time instead of a replicated variable, since you never really know when this is getting replicated, but for RPCs you know they are sent

leaden atlas
#

🤔

limber gyro
#

the playerState constructor should runbefore a post login right?

leaden atlas
#

i dont think so but also i cant confirm

red salmon
#

Does anyone know how to set up multi user with hamachi cause I heard its possible but when I tried it but failed for me to create the server due to this error LogUdpMessaging: Error: StartTransport failed to create unicast socket on (btw I dont know where to put this question like in what room so I am gonna place it here since it has some correlation with it I guess)

viscid monolith
#

How to get other client's Player Character?

dark edge
viscid monolith
#

From one character to other

dark edge
#

What if there are three clients? How do you know which one you want

#

Anyway call me you should be able to go into game state, get the players array, then for each player, get their possessed Pawn

viscid monolith
#

Right question, im doing it for debug purpose, as im only learning multiplayer

#

Oh, i got it, thanks!

worldly ore
#

Hello guys

#

I've created a blueprint for handle websocket connections

#

This blueprint is an actor and create connection to backend server (node.JS) by adding this component into "PlayerController".

#

Now, I would push an event from UE to Node.JS server when player press a button inside a widget. But I can't access into Socket Blueprint ...

clear sand
severe widget
#

Editor builds and such include the server, and you can also decide at any time to enable server code in your client binaries.

#

in other words yes UE_SERVER works as you would expect

clear sand
#

Cool thanks

#

Another question - I want to persist player's location every few second to remote server. And since I want to prevent any kind of location hacking, it should be persisting from dedicated server. I've implemented this using FRunnanble, but I'm not sure how will it impact server performance, since if I get ~250ppl running on same server, and every player will generate GRPC request every few seconds - thats probably literally bury my dedicated server

#

What approach are ppl using to persist player's location to remote server?

blazing bloom
#

Sorry for repeating the question asked in #cpp but I realized this might be a better forum for it:

As far as you know, is UE4 capable of correctly replicating circular object references? I'm working through a bug caused by references replicated to nullptr to clients and the only unusual way about these references is that they are circular (Object A references object B and vice versa). The reference from A->B is valid but not the other way around.

dawn ledge
#

I don't think it would know or care about circular references, as long as both objects are replicated, both pointers are replicated, and the pointers are assigned by the server, I imagine it would just work

blazing bloom
#

I guess I should set up a minimal project and try it out. It's one way of ruling this out.

steel vault
#

This is a great practice when trying to reproduce possible glitches like that.

graceful shard
#

anyone happen to know off the top of their head if actors which are marked as owned by a player are automatically destroyed when that player disconnects? Or do I need to do that myself?

muted nest
#

Hi all, I have placed an actor into the map that acts sorta like a controller to remove placeholder actors in the world and adds them to a instanced static mesh component. The issue im having is i want to get all the transforms of these actors and do the work on the server then send all the transforms to the client to sync the server and client up my issue is that my transform array isn't getting sent to the client via RPC event only gets sent to the server.

Im running a dedicated server setup and reading online they say to set the owner to the player pawn or player controller but what if there is no player online? should i set this to another actor and what should that actor be?

sharp rapids
#

hiya everyone. what's the difference between "Play Offline" "Play As Listen Server" and "Play As Client" ? play as client seems obvious - the editor spawns a client and a server and connects them. play as listen server seems like it just spawns one process that is both client and server? but then what's play offline?

#

maybe it's that with listenserver it opens network sockets so multiple players can play but is otherwise the same as offline?

steel vault
#

Optimization question: If you have a replicated struct full of boolean values to toggle things on or off, and OnRep you want to perform an action based on if one of those booleans changed, what is the best way to optimize this? Is it more effective to replicate an array of booleans that have been set to true and compare previous to new state and take action based on if it is missing or added to the array? Or is it more effective to replicate the struct itself and somehow do a comparison to see which booleans have changed? I feel like if the struct had a ton of booleans, then iterating through them all would be less effective.

#

Have a sneaking suspicion I'm going to be told to finally have to use FFastArray

versed socket
#

Do you guys ever find that AGameMode::ServerTravel doesn't work in the packaged distributable? The command is disabled in PIE, but when trying it out with friends with the packaged Shipping build it doesn't seem to actually do anything, which is strange. Looking at the source implementations in the method, it's pretty clear that it should move it and all clients to the new map... but I don't see it happening in reality. I'm sure I'm not the first person to encounter this.

chrome bay
#

@steel vault depends how many you have, but you could just use a bitmask instead for up to 64 discrete values

steel vault
#

Would love to know if anyone has a solid bit diffing algorithm

chrome bay
#

Can just use a simple for loop

steel vault
#

Ok, was just going to manually do it that way, but wasn't sure if there was any slick way to get away with not iterating each bit knowing if one hadn't changed.

#

I guess since it's only on rep and I can set it up so it's not running too often that it won't be much of a performance hit regardless.

chrome bay
#

Cost will be negligible next to everthing else tbh

grizzled stirrup
#

Can you call an OnRep function on the client as a regular function?

steel vault
#

I think so, but you should separate the action to its own function which is simply called from OnRep. That way you aren’t conflating things.

grizzled stirrup
#

Yeah I have been doing this but for listen server it can make things inconsistent as when an OnRep property is set I usually call it on the server right after rather than making a separate function that is called both here and via the OnRep

#

Just one less function call and less error prone in cases where you change what is called in the OnRep but forget to update the function called after one of the instances where the property is set on the server

#

Would be a no brainer on dedicated servers though

steel vault
#

I would argue it’s less error prone to be explicit with function names rather than calling a random OnRep function name. That means nothing until you see what is happening inside whereas an explicit function name makes sense.

jaunty glen
#

Does anyone known of an up to date user login tutorial for unreal? The ones I find are out of date enough where they don't work anymore. I have one which works great on the website portal but no longer seems to function inside of UE4 itself.

grizzled stirrup
#

So if whatever is being called in the OnRep changes, it automatically updates for the server too

#

Without having to track down where you set the OnRep and manually change serverside function calls which can lead to errors

steel vault
#

I know some senior devs in here who would encourage you not to do this, but I will let them chime in if they want. If anything is supposed to change a server side variable then you have an explicit function that does that and you call that where needed. I know it seems like an additional step, but imo it’s best practice.

grizzled stirrup
#

Yep it is best practice and especially makes sense on dedicated servers

#

I just have had trouble updating things and it is a bit less clear when I'm looking at code to see what is being run where

steel vault
#

Well it is your code base in the end so do whatever works for you 🙂

#

But yes you can call it

grizzled stirrup
#

One other check for listen servers that I'm unsure of: is calling a ServerRPC as the host also fine to call like a normal function?

#

Take this example

#
// If the host this will call an OnRep function on clients
TimesFired++;

// If a client, tell the host to increment this int for other clients to see
if (Role < ROLE_Authority)
{
  ServerIncrementTimesFired();
}
#

Could I replace this with

ServerIncrementTimesFired();
#

And get the same result?

#

Since if host it'll call the RPC function "for free" and replicate the int and if client it'll do a server RPC which will replicate

steel vault
#

Im not at my computer so I don’t have the link but I believe that if it is calling from where it is already supposed to be it falls through and just executes without making a network call so that should be fine, but again, there is nothing wrong with being explicit.

#

Make things operate how they should without fudging things just because they work.

grizzled stirrup
#

So you'd go with the first option in this case?

steel vault
#

I personally make a separate function and call it from within the server ufunction. Logic goes in functions and the server function is obviously reserved for executing logic on the server.

#

But I believe you can still just call the server function even if you are the server

grizzled stirrup
#

So it'd be like:

// If the host this will call an OnRep function on clients
if (GetLocalRole() == ROLE_Authority)
{
  IncrementTimesFired();
}
else
{
  // Calls IncrementTimesFired() on the Server
  ServerIncrementTimesFired();
}
steel vault
#

Yes 👍🏻

grizzled stirrup
#

Thanks!

steel vault
#

If you want an argument in favor of that method it would be because if the client functionality varies slightly and something server specific happens in the server function that doesnt effect the core increment functionality then they are separate. Compartmentalizing functionality future proofs things better.

#

Also I think there is a better check for the server. GetNetMode == ENetMode::ListenServer etc.

terse prawn
#

Can the server set a client's control rotation via a reference to the controller? or does the client have to update that themselves?

versed socket
#

Reposting from earlier:

Do you guys ever find that AGameMode::ServerTravel doesn't work in the packaged distributable? The command is disabled in PIE, but when trying it out with friends with the packaged Shipping build it doesn't seem to actually do anything, which is strange. Looking at the source implementations in the method, it's pretty clear that it should move it and all clients to the new map... but I don't see it happening in reality. I'm sure I'm not the first person to encounter this.

#

The documentation says that we should just call ServerTravel and it will "work", though that's not reality for me. I even have Level Streaming disabled, so that it doesn't get short circuited in the implementation.

winged badger
#

steam sockets won't really work with hard travel

#

you have to toggle seamless

rustic adder
#

hey there, Im using advanced steam sessions. Ive successfully hosted a dedi server
I try to connect to the server using the command open 127.0.0.1 and this is the result. Will not connect
also, find advanced sessions gives me nothing

chrome pagoda
#

For character respawning do people typically destroy and create actors or just try to reset and reposition a player's actor?

twin juniper
#

Depends on setup, generally you can destroy the pawn and you keep things specific to the player but not the player character elsewhere, eg in the player state.

#

Destroying pawn is a bit less messy if theres loads of variables you need to reset as if you create a new one they will automatically return to default.

#

Just be sure when you destroy it you have nothing running that depends on on it being alive or you will get 'pending kill' error.

languid ruin
#

Gotta repost guys i'm hard stuck, and i really don't know why: anytime i try a server travel (with seamless travel unabled in gamemode) on standalone or via launch game, the game crashes rightaway

winged badger
#

@rustic adder steam API limitation: you won't be able to see a server hosted from a same machine you're searching from

#

@languid ruin i'd expect a callstack attached to that problem

#

most likely scenario, your UI should had been cleaned up prior to travel, but wasn't

#

and if you're expecting a fine control of seamless travel from blueprints, you're out of luck really

#

rudimentary use of c++ can help tons

languid ruin
#

you mean i have to remove any widgets from viewport before doing so? also is it possible to quickly provide my blueprint with a c++ server travel equivalent?

winged badger
#

not all

#

some can survive travel and be visible on the other side

#

but ones that depend on say LobbyController or LobbyHUD being there

#

when your game switches to PlayController or PlayHUD

#

those will crash

#

depends on the widget really

#

UE crash reporter told you exactly where the problem is

#

(provided you have debugging symbols installed)

languid ruin
#

no i'll donwload it in a few hours

winged badger
#

try reposting when you do, because 1000 different things could had crashed

#

and without that callstack, everything else is just guessing

#

UI not cleaned is just the most common scenario, far from only one

languid ruin
#

i see, thank you really for the help, i just have one more question: do PControllers persist after a server travel?

winged badger
#

they do if you're setup correctly for it

#

its best to have the travel map run the same GameMode as the departing map

languid ruin
#

Okay, first I'll try to get the Server Travel working on Bluerprint and then maybe i'll try C++ if I have the time

winged badger
#

problem with blueprints is you don't have hooks like

#
void APlayerController::PreClientTravel( const FString& PendingURL, ETravelType TravelType, bool bIsSeamlessTravel )
{
    UGameInstance* GameInstance = GetGameInstance();
    if (GameInstance)
    {
        GameInstance->NotifyPreClientTravel(PendingURL, TravelType, bIsSeamlessTravel);
    }
}

#

which is typically used to clean up everything that shouldn't come along for the ride

#

UI is the most common offender because it is not tied into World

#

but into Viewport, which is tied to LocalPlayer, which is tied to GameInstance

#

so it usually doesn't get autodestroyed with the departing world

languid ruin
#

Alright, thank you again for all the intel, I'll get some sleep before trying this

winged badger
#

good luck

forest sage
#

My steam dedicated server is not listed in the client server browser. Though if i add it manually it is shown as active, with ping and player count. Using python-valve i get it's address from the steam master server. Is it not listed by default because the game is not released yet? Or did i miss anything else?

mortal kernel
#

Hey there... I'm not sure what I do wrong but I'm trying to have every connected player inside a Box... but it just won't work out... not sure how to do it

winged badger
#

@forest sage same machine running the dedi and client?

forest sage
#

@winged badger Nope, dedicated is running on a dedicated machine in the Internet.

surreal plaza
#

How does UE handle replication when components are attached? Does it just replicate all child object transforms separately?

chrome bay
#

yeah. the component itself has the be replicated though.

#

See USceneComponent::GetLifetimeReplicatedProps

potent furnace
#

Hi! 🙂
I'm making a multiplayer game and I have problem with replicating movement with GetCharacterMovement()->AddForce(). When I use AddMovementInput() replication is working properly.

When I set my function like this - UFUNCTION(Server, Reliable), when server player moves, all client players are moving with him. When I play for client, everything works fine.

When I set my function like this - UFUNCTION(Client, Reliable), server player is still moving with all players but clients players can't moving themselfes anymore.

After few days of googling and trying to solve it I found only one solution (you can see it in screenshot), but I don't think this is the best practice. Guys, can you please help me out?

surreal plaza
surreal plaza
# chrome bay See USceneComponent::GetLifetimeReplicatedProps

Let me give you better context. I am working on a battlebot type game, where characters, on the fly, can design new robots, each of which could contain up to say 50 individual components. And these are made on the fly, so characters can have multiple in play at the same time. I am trying to minimize the bandwidth damage from that. If you think of most of the child components of a given bot, they are just following the parent around until they activate in some form (fire, flip over, etc).

surreal plaza
winged badger
#

@potent furnace you want a IsLocallyControlled check in combination with a server function

#

also, never ignore the log warnings of "no owning player for connection..." that you have tons of right now

woeful ferry
#

Is OnRep exceptionally buggy in 4.26 or is it multiplayer in PIE that is? I have one component that is incredible messy in certain actors in terms of not firing OnRep, and I haven't changed any logic related to the component.

I heard from Zlo yesterday that there's a bug regarding OnRep. That if you only have one replicated variable, it won't fire OnRep.

winged badger
#

c++ only

woeful ferry
#

Yes, this is in c++

winged badger
#

and i doubt they extra broke OnReps in 4.26

#

even if i have heard 4.26 described as "critical bug package"

chrome bay
#

@surreal plaza On an actor, if you replicate movement then that is handled separately via AttachmentReplication

#

Unless you are changing the component's attachments from their defaults then you shouldn't need to replicate anything else

#

child actors for components are just going to have even more overhead tbh, because that's a totally separate channel then

winged badger
#

child actors are likely to break in more ways then one

#

not really MP friendly

surreal plaza
surreal plaza
chrome bay
#

Ultimately if you want to attach components to other components then yeah you need to replicate their individual attachements

#

the "easy" way is just mark the component itself as replicated and the default properties will handle it

#

But tbh, you could probably build something more bespoke that handles your case better

surreal plaza
chrome bay
#

well only properties you mark as replicated will be replicated

surreal plaza
chrome bay
#

Are your different robot "pieces" actors or components?

#

In the Unreal sense

surreal plaza
chrome bay
#

Right

#

So if you want the easy way, just check "bReplicateMovement"

#

and whatever you attach the actor too server-side will replicate and be handled by the client

potent furnace
# winged badger <@!698199086293188670> you want a IsLocallyControlled check in combination with ...

Ok, could you maybe say a little more about a solution, I'm sorry, but I'm still new to multiplayer in UE4. So I would define my movement function like this?
UFUNCTION(Server, Reliable) PlayerMovement(float value);

When I set PlayerMovement like server function and when I add if condition to PlayerMovement (you can see it in screesnot) server player is moving all players, clients are moving themselfes and only server player is "true" for my if (IsLocallyControlled()) condition.

winged badger
#

always paste the function header

#

cant say where that is

#

i suspect you're doing something unspeakable, along the lines of checking on Tick from each Character if Controller[0] has a key pressed and applying force

chrome bay
#

@surreal plaza each actor will replicate it's attach parent individually, if that's what you're asking

#

Then assuming it's relative transform doesn't change, it won't replicate anything else - but the properties will still be checked server side.

surreal plaza
# chrome bay and whatever you attach the actor too server-side will replicate and be handled ...

So, I have TorsoActor (brep = true) and GunActor(brep=true) and attach GunActor to TorsoActor. Is that right? That sounds like it works, but maybe the most expensive bandwidth wise. The other direction I was considering was that

TorsoActor(brep = true)
GunActor (brep = false) <--- but still instantiate this on all clients
Attach GunActor to TorsoActor.

But! Now GunActor isn't replicated! But maybe I don't care if it is just a visual indicator but the ultimate actions (flipping, firing, etc) are still spawned and managed server side. Does that make sense?

chrome bay
#

that's just asking for trouble tbh

#

because you won't be able to do anything involving GunActor and the network then, you won't even be able to reference it

surreal plaza
chrome bay
#

The easy way to answer it is just look at AActor::GatherMovement and see what it does

#

if it's attached to something, it uses AttachmentReplication

#

if it's not, it uses ReplicatedMovement

surreal plaza
chrome bay
#

AttachmentReplication is presumed to be relative

surreal plaza
chrome bay
#

So if after attaching the relative location/rotation etc. doesn't change, then no other data will be sent - just the root actor's transform will be the thing replicating

#

At the same time though, the Server is still going to be testing those actors' properties each network frame

#

So if you wanted to claw some of that back, you could make your own attachment hierarchy that only replicates once at startup for example stored on the base actor

#

Lots of ways of doing it I guess

surreal plaza
#

Right. That is where I was prematurely optimizing. I was working on encoding/serializing the robot description into a string and then synchronizing that, but like you mentioned before, that leaves me with disconnected actors. I am not sure that I am following where in our discussed scenarios that 'my own attachment hierarchy' would fall. Wouldn't rolling my own hierarchy just not take advantage of attachment replication ignoring relative stillness?

surreal plaza
chrome bay
#

Nothing will replicate if it's attached, it's attached so it will just move with it's parent

surreal plaza
surreal plaza
surreal plaza
chrome bay
#

You're overthinking it. No transform is replicating on the child if you move the base

#

The base transform change is the only thing that replicates any data

#

Things that are attached to it just naturally updated like any regular attachment would

surreal plaza
surreal plaza
chrome bay
#

Yeah that's it

grave notch
#

Anyone tried network prediction plugin? (its official plugin)

#

v0.1 beta

eternal canyon
#

yes

#

I have

grave notch
#

is it useful?

eternal canyon
#

not for my use case

#

tho from what i can see

#

it looked as if in the examples that it would smooth the movement on otehr clients (interp) and showed off replicating pawn flying movement component

#

and replicated physics

#

that were smooth

#

tho I could be wrong about some stuff

grave notch
#

okay, ty

potent cradle
#

There's certain times when I want to make sure that a multicast hits every single connected instance of an actor, in which case I set to always relevant before the MC, and then turn it back off after.

Should I wait for a duration in between? Or is Unreal smart enough to notice that the MC happened in the span when it was set to always relevant?

#

(Granted, maybe I should rethink this entire strategy, but would like to understand how it behaves with the above steps)

silent valley
#

I doubt that would work, the Actor won't even exist for some clients when you call the RPC. It takes time for the Actor to replicate to all clients.

potent cradle
#

That's a good point 🤔

#

I think I'll go with a repnotify instead, rethink the flow a bit

chrome bay
#

always vars for state

west condor
#

Has anyone done volume based game session merging?

#

Wanting to create a single/multi player hybrid based on that

woeful ferry
#

@winged badger I found the issue for the OnRep function.

Apparently I had set the resize of the inventory array outside a HasAuthority check on BeginPlay. Still don't understand why the OnRep would fire on some actors and some not though, that is outside of my knowledge of how networking is being handled

sick yew
#

Is there another way to go about replicating whole skill lines like this or do I have to essentially just have the skill twice with the replicated components? Just want to make sure I am doing it the most efficient way.

vocal cargo
#

hey guys, does anyone know what's a good way of handling characters on top of replicated pawns?

#

I have some very visible jitter

#

Is attaching OnLanded the way to go in these situations?

weary badge
#

Is there a way for the Game Mode to call an event on all the player controllers simultaneously ?
If I use for each loop, it creates a delay, that I'd like to avoid
(the project is blueprint only)

languid ruin
leaden atlas
#

is there a way to do replication outside of AActor?

#

i want to do a simple chat system that's outside of the game logic classes

#

and i was wondering if its possible to put it into like a game instance subsystem or something. some sorta global

steel vault
leaden atlas
#

hmmm i see stuff with UChannel

languid ruin
#

I guess there is no way to find out in which blueprint the error comes from?

floral crow
#

Has anyone used Unreal Insights and, more specifically, Network Insights successfully? Is it reliable enough to replace the Network Profiler tool?

#

Can it cause any sort of corruption in my project if I use it?

meager spade
#

it works, its better than network profiler, and why would it cause corruptions?

halcyon pilot
#

If everything in the Anim BP is inherently replicated why not put all the animations in the anim BP that you can and then call them from the character BP/PC?

floral crow
#

I finally got it to work, I'll ask any questions if I need so. Thanks @meager spade

wheat magnet
#

emitter is not spawning and showing in client side, what cause the issue?

#

i already doing RPC, but why this happens?

thin stratus
#

Why are both the Emitter and Template replicated if you already multicast?
And where is that code located in? Is it even client owned? Otherwise it won't execute the ServerRPC

wheat magnet
#

it working now without doing anything, i think making these functions reliable fixed the issue

dark edge
meager spade
#

^

#

then again i always send a reliable client rpc back on sucessful hits, like what this is for, but its never multicasted reliable, them sort of things are unreliable. but the important stuff back to the client is always via a reliable rpc, unless it was a failed hit, that comes back via a unreliable rpc, cause not bothered if client does not get that.

dawn glen
#

If i set up a game with basic multiplayer where the client is also the server, then want to build out a dedicated server, will all the stuff the server client uses get automatically disabled or do i have to check for dedicated server everywhere i deal with UI and player movement and such to bypass it myself?

kindred widget
#

@dawn glen If you do your programming correctly, there won't really be a difference between a ListenServer or Dedicated Server. I've been working under the pretense of Listenserver uses, but kept in mind that I may one day change to a dedicated setup. You can very easily separate your server logic from the hosting client's client logic so that when you do change to dedicated, nothing should change except that one client will no longer also be host.

leaden atlas
#

is it possible to predict uobject or aactor creation?

#

like do it on the client before it happens on the server

finite kettle
#

It is, but you gonna have "good" times with net pairing client side's actor and server side's actor (to get replication working)

meager spade
#

no

#

you can't predict what the server is going to do, prediction can only happen if the client tells the server its going to do X

finite kettle
#

I'd say he means exactly the case you're describing, at least that's how I understood it

meager spade
#

yeah cause the client could never know what the server was intending without the server telling it, and that is not really prediction 😄

dawn glen
#

@kindred widget I thought it would cause errors and such if you launched a Dedicated when it was designed as a client server when it would try and run the Widget stuff or cast to player controllers. So i know you can kinda easily put in branch checks for dedicated server and bypass all of that but i guess my question was do i have to?

leaden atlas
#

im doing an inventory system using uobjects

#

and i want to predict item pickup/creation or whatever

meager spade
#

oh that is one thing i never predict in a multiplayer game

#

nor have i seen many games do that

#

even big games like Fortnite don't predict pickups

#

nothing is going to be more frustrating than thinking you have an item, and server nabs it away from you

leaden atlas
#

hmm okay

#

i guess i really dont need this sorta feature

meager spade
#

imagine like the best item in the game on the floor, 3 people interact with it as soon as they see it, only 1 person is going to get it but all 3 people think they have it

#

till server rejects 2 of them, that would be bad for those players

leaden atlas
#

good point

meager spade
#

i always have in my mind, predict as little as possible to make the game feel responsive

#

you can play the pickup animation/act like your picking it up locally

#

(which is what big games do)

dawn glen
#

Thats one thing i havent thought about yet is "duping" If an item is on the ground and you dont handle it right, the 3 people will pick it up at the same time and all 3 get it.

#

And how should one best handle that? I suppose i would hit the pickup button and then send my look vector to the server to do the trace to the object?

leaden atlas
#

I think you should just let the client tell you what it hit

#

And then just perform checks to make sure it's not too far away or behind a wall or w/e

plain torrent
#

Is it possible to connect to my teammates on a simulated project with steam appid 480? Or do I need to purchase our application before we can really start integrating steam functionality like connecting VIA steam friendslist?

stuck acorn
#

Hello everyone... I have a problem with creating a simple multiplayer game for mobile devices. Like Multiplayer Shootout project sample i made a menu for hosting and joining game. Hosting section works good and session created successfully with Use LAN enabled and level opened with listen option and everything is good. but problem is here when other device wants to find session, i made a menu for that and i know Find Sessions node run On Success but there is not any sessions found !!

grave notch
#

Why ue4 doesnt have sql/any db support by default, isnt it common thing? Im not sure should i use rest api through https to work with db, or make db access in ur4 server side (for dedicated server)?

marble gazelle
winged badger
#

@plain torrent i'd advise buying the steam ID, its 100$

plain torrent
winged badger
#

it just provides too many conveniences to screw around with appid 480

#

you can add the teammates as devs

plain torrent
#

I don't suppose there's any alternatives to the 100$ license?

winged badger
#

then they can upload and deploy builds themselves

plain torrent
#

Such as education etc?

winged badger
#

and they automatically "own" the game

#

i have no idea, my project is commercial

plain torrent
#

If this is just an early working title, can I buy a single appid and re-use it if this project get scrapped?

winged badger
#

but just being able to deploy a packaged version via steam is already significantly improving the workflow

#

i don't see why not

#

and you do get that money back if you sell few hundred bucks worth of game

plain torrent
#

Oh interesting, i wasn't aware of that

#

I'll definitely have to get that application going I suppose. How long does it take to get an app id?

winged badger
#

few days i think

plain torrent
#

And the prime reason we want this is to be able to start debugging steam p2p. Is this the best solution for that, or is there something else you may be able to suggest? I really appreciate your help!

winged badger
#

with your own app Id you can deploy multiple builds, packaged DebugGame configuration is pretty good for debugging

#

as you get to use the cheat manager, set console variables, slow down the game, use GameplayDebugger, "eject" into a debug camera.... etc

plain torrent
#

I'll add that to the budget request! thanks for your help 🙂

dawn nova
#

Does anyone know if TSet supports replication in 4.23?

chrome bay
#

Only TArray

dawn nova
#

Alright, thanks for the quick answer

plain torrent
#

@winged badger May be me being really silly, but I can't find the page to begin the application for our App ID? 😆

unkempt wind
#

Hi everyone! I'm developing a strategy game and I'm looking for a strategic advice. Currently I'm leveraging Linux cross-compilation to build the dedicated server, then I dockerize and deploy it on Google Cloud. It works like a charm, anything that works on Windows works on Linux as well. So much that I didn't even have to set up a dev environment on Linux.
But I know that at some point I might get into trouble. So I'd like to know what is the common practice in the industry and the most traveled path. Are dedicated server most commonly built on Windows or Linux?
I have little experience with UE and I don't know the behind-the-scene and the quality of Linux support. What do you suggest?

dark edge
plain torrent
#

Hey everyone sorry to bother again.. We use Digital Ocean to host our Perforce, has anyone used Digital Ocean to host a UE Dedicated Server, and if so, how hard was it to get that setup?

unkempt wind
#

For example, it might be helpful to know which OS Epic chose for its own games

dark edge
#

I'm not sure but I would bet million bucks that they are running their dedicated servers on Linux.

dark edge
#

I host my perforce, ue4 test server, and valheim server all on the same machine cuz YOLO

plain torrent
#

Ahh I see, so I just go through the steps of compiling the source code and uploading it to a linux server?

dark edge
#

For testing I just have a compiled engine on the Linux box and it just fires up the project as a headless server, so no building anything every time the project changes.

plain torrent
#

I'm saving up old parts to build a Frankenstein server system, not long now

#

Do I need to pull the full release build from git if we're working on 4.26.1?

dark edge
#

I don't know if 4.26.1 is currently released but if it is, that should work. Just make sure you're on the same version. I'm not sure if there's any problems between devving on the launcher version and running the Linux side on the built version

plain torrent
#

thanks, I'm downloading 4.26 now. fingers crossed all goes well

twin juniper
#

In what blueprint should I handle win conditions for an online multiplayer game?

#

Should I create a custom game state (child of AGameStateBase) and use that, so it's exposed to BP?

#

reading about it looks like game mode better for that

meager spade
#

Win condition is in GameMode

#

GameMode should control the game flow (its server only and secure)

twin juniper
#

Thanks, but why use game state at all then?

#

I'm looking at documentation, it says to use Game State for stuff relevant to all players because it's replicated I guess, so maybe if player A scores a point, it gets updated in the game mode, then a variable is also updated in game state mirroring the game mode variable (but not determining win/loss), then the player HUD accesses game state or something for score display? I guess that would also stop players cheating by setting their own scores but couldn't they also 'cheat' by adjusting their displayed score, confusing other players, even if it doesn't help them win?

meager spade
#

GameState is for things that all players should know about the state of the current game

#

GameMode should update the GameState when conditions are met

twin juniper
#

Well I want players to know the scores of every other player. I guess I should have two copies of the scores of each player: one in the game mode and one in the game state. They are the same except the game mode one ends the game when certain conditions on the score are met.

kindred widget
#

@twin juniper That's a lot of upkeep, and prone to bugs if you forget to update one or the other. Just make your GameMode get variables from the server's GameState.

eternal citrus
#

guys I have screen space widget that acts as nameplate for my character

#

but in multiplayer

#

clients sometimes don't see it

#

well actually most of the time

#

but when I switch it from screen space to world space it does not disappear

#

why is that?

#

and how can I fix it?

twin juniper
#

Is 'playerID' different from 'controllerID'?

surreal plaza
#

I am getting started with network profiling in UE. Is the network profiler still relevant or has everything moved to Insights?

dense ocean
#

My client can't see replicated movement until about 10 seconds after starting my standalone game, for the first 10 seconds he can only see client events, then all replicated movement of other players snaps to where it should be after that 10 seconds. Anyone know how i can fix this?

#

I'm opening my unreal project twice on my PC to represent each client, can that be causing the issue?

kindred widget
#

@dense ocean How large is the project? How much is being replicated at the start of game?

dense ocean
#

It's very small, been happening since I just started it

rich ridge
dense ocean
#

If there is a way to do this from one instance of the editor it would be a life changer for me lol

kindred widget
#

Hmm. not sure then. Might not fix your issue, but I had a similar problem when I started replicating foliage stuff. Even if it doesn't fix it, you might want to make it a habit to drop this into your Project's DefaultEngine.ini when starting a new multiplayer project if you don't already.

ConfiguredInternetSpeed=1000000
ConfiguredLanSpeed=1000000

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000
MaxInternetClientRate=1000000```
rich ridge
dense ocean
#

It was a long time ago, i never looked deeper into it after that @rich ridge but I am very open and ready to do some testing as I believe it's probably just a setting i need to change regarding seamless travel, or maybe something in my config. I doubt unreal would ever require you to open multiple editors to test multiplayer

rich ridge
#

set players as 2 or 3 or 10...

#

so editor will launch those many clients

dense ocean
#

Thank you @rich ridge Ill give it a shot soon

rich ridge
#

and also one more point to remeber, when testing multiplayer in editor for multiple clients.. always uncheck this option

dense ocean
#

Thanks very much ill do that

#

my settings look different

#

I don't have net mode

rich ridge
#

@dense ocean By default all clients will run under one process and will share memory and most of the RPC and replication logic will work fine, when you actually try to test stand alone things wont work

dense ocean
#

using 4.24

rich ridge
#

i think 4.24 is pretty same to 4.26 in terms of multiple clients within editor

dense ocean
#

Hmmm im unsure why I can't run standalone with multiple clients

#

I set my num players to 2 as you can see, but when i launch Standalone only one standalone window opens

#

Instead of 2

rich ridge
#

it should open two

dense ocean
#

Then i guess there is my problem

rich ridge
#

try to do in fresh Third person project

dense ocean
#

Okay i will now

#

It works, in 4.25

#

I'll try in 4.24

#

I'm having trouble launching ue4 in 4.24, it seems i just need to update

#

I'm going to run to the store while i install 4.26, ill let you both know if my issues resolve after, thank you for your help

twin juniper
#

how do I end match properly in multiplayer? My print string is firing at the end of the round (when a player wins the multiplayer vs game) when I want but apparently the 'end match' node (I know its not connected lol) just puts 'MatchState' into 'Waiting::PostMatch', how do I proceed, do I need C++?

finite goblet
#

What is the reason behind having game mode not replicated? Is it a design only decision to keep rules and data separate or is there some more serious underlying technical reason?

unkempt tiger
#

it's a design choice, there shouldn't be any technical reason

#

it also works a lot with players through refs to their player controllers which arent replicated to other clients

#

If I want to net-quantize my float (to make sure it matches the net-serialized version, precision wise) can I do something like this?

#

It seems like this should work, albeit a hack, wondering if there's a better way to net quantize floats?

finite goblet
#

Why though?

bronze arch
#

Fellas, who will take owner of that object by destroying an object on the map from the server authority? Is it to an entire separate client or a single client?

chrome pagoda
#

If it's replicated won't destroying it on the server destroy it everywhere?

bronze arch
#

no isnt replicated(as replicated its expected but this non-replicated)

#

just have on the map, so server and clients will load it, when i put the begin play in to authority test, the servers has authority and clients are remote. So when destroying on server, then who will take the authority?

chrome pagoda
#

That's a good question. You could test it by interacting with it after being destroyed on the server.

bronze arch
#

i tried, but still the "switch has authority" says clients are remote. no one authority. like it falls in to space

#

im atm:

chrome pagoda
#

lol

#

I guess it's technically correct as the thing wasn't created by the clients. When deleting it you would probably want to run it as a multicast event so clients delete it locally too.

bronze arch
#

well the grasses only no needed on the server, so i dont wanna delete on the clients as they can see grass

#

i was just avoididng cpu usage on grass BP on server

#

more weirdly, those client functions work as like authority even they are remote

chrome pagoda
#

Are you trying to set the server up as a dedicated server?

potent cradle
#

Is there a logical reason why a RepNotify within the PlayerState would not be run on the client?

#

It runs fine on the server, though. But I don't see it trigger on the client

EDIT: Probably because there was no actual change in the variable's value. Cleared it properly first, fixed 🙂

chrome pagoda
#

You should be able to set up your dedicated server to run with no actual graphic output.

bronze arch
round star
#

It's my understanding that a dedicated server can also help with performance because any number of calculations that need to be done are on the server, and the result is only replicated to clients

chrome pagoda
bronze arch
chrome pagoda
#

Easiest way would probably be level streaming, but there are probably others I'm not thinking of.

bronze arch
#

Well, i've already changed my mind way to go. So now i have no trouble about this for now.

round star
#

Can I change the net update frequency of actors on a per player basis

#

depending on how close they are to something

#

In some cases I don't want to turn it off completely..it still needs to be replicated from afar, but I don't want to send nearly as many updates

peak sentinel
#

Anyone analyzed UT source code before? I am trying to solve why they are created a new FRepUTMovement and doubled the OnRep. In the comments it says its more effective but I couldnt understand why it would be

#

Also same for every UT copy of usual engine functions

#

GatherUTMovement (calls GatherCurrentMovement() inside) etc

peak sentinel
#

From what I understand from this I should not mess with default engine functions for movement replication

plain torrent
#

Can anyone recommend a cheap VPS host for a dedicated server that's got an intuitive setup with UE?

dawn nova
#

For a cheap (but good) VPS host I can recommend Namecheap, I don't think it has integrated setup with UE though

plain torrent
#

Thanks! Do you know if the 2cpu cores and 2gb ram would be enough for a headless server, hosting 4 people max concurrent for play testing?

lament sinew
#

there's also playfab and gamelift. They provide trials right ?

plain torrent
#

My teams testing on appid 480, we're finding eachothers sessions when launching VIA steam, it's pulling his server name and when we try to join, we're getting through on success on our Join Session node, but it then doesn't connect to the server. Everything works fine on LAN. Does anyone know what could be causing this? Our default subsystems are set to steam etc

kindred widget
#

I'm under the presumption that all of these do the same thing. At least I understand that the actor component version of GetNetMode more or less gets it's actor and calls it's GetNetMode. But what is the difference with AActor and UWorld's GetNetMode? Why doesn't AActor's InternalGetNetMode function just call GetNetMode on World? It already gets world before doing the net driver thing anyhow?

#

Just mostly wondering if there's a reason for this to behave differently somewhere or if they'll act identical.

winged badger
#

im not convinced they behave differencly @kindred widget

#

Actor can get the NetMode via World or via its ActorChannel

#

i think

#

but different implementation might just be epic being sloppy

#

plenty of that going around in GameFramework

kindred widget
#

Kay. I'll just treat them the same way. Just wanted a sanity check. I'm a lazy person. I'd have just made AActor call UWorld's GetNetMode and been done with it. 🤷‍♂️

dawn nova
#

Hey guys, is it possible to replicate UPROPERTYs on interfaces on the interface itself? Or would I have to add it to the DoRepLifeTimes of the child actors?

kindred widget
#

I don't think you're supposed to do networking with interfaces. They're just a way for actors to communicate without casting per machine.

dawn nova
#

Yeah true, traditionally interfaces are not meant to have properties on them, just checking that maybe since they are artificial interfaces they had support for that

kindred widget
#

Out of my area there. Haven't used them past the basics.

marble gazelle
#

Shouldn't UHT complain if you add UPROPERTYs to an Interface?

chrome bay
#

It will, can't have 'em

steel vault
# plain torrent My teams testing on appid 480, we're finding eachothers sessions when launching ...

Please let me know if/when you figure this out. I haven't been able to properly server travel a steam client to the steam listen server for a long time and I have gotten exactly to the point you have. It succeeds the join after finding the host session in a search using app id 480, but doesn't server travel when doing the join. I saw examples that prove you can just run the join session and it travels automatically, but this hasn't been working for me. It just stays in the lobby until it times out.

chrome pagoda
#

From what I understand it's best practice to handle respawn stuff in a gamemode bp. How exactly do you communicate to it that it's time to respawn a client? Am I able to create an event dispatcher for that?

rich ridge
kindred widget
#

Eh? Why not just call RestartPlayer?

#

Called on GameMode, takes a PlayerController object input. You can call that when you're ready to spawn the player's pawn for respawning.

#

@chrome pagoda You are just trying to basically be able to kill off the player's character, and then respawn it as if when you open a new game?

chrome pagoda
oak hill
#

Hi guys, what would be the correct approach to replicate a variable only to specific clients? None of the lifetime conditions seems good for my case and I'm trying to avoid multicast

chrome bay
#

You can't do selective replication of variables

#

The only solution for a variable would be a different actor which is only relevant to those clients.

winged badger
#

you can replicate actor only to some clients though @oak hill @chrome bay

#

yeah, sorry, you kinda said that 😄

kindred widget
#

How do you do that, by the way? I know PlayerController does it. Never got intrigued enough to look into it.

winged badger
#

player controller is only relevant to owner

#

basically, override IsNetRelevantFor

#

or put it into some buckets in replication graph only

kindred widget
#

Ah. Neat. I assume that a good way to handle this is like.. returning a bool based on the controllers the actor should be relevant for? I might mess around with that sometime.

oak hill
#

I think I need some more control than the IsNetRelevantFor function

winged badger
#

i have no idea, there are probably some sparse docs, some semi-useful youtube videos and a blog or two about it

oak hill
#

Basically I need a specific actor to be replicated the normaly way, but only some variable need to be replicated to specific clients

winged badger
#

we went to custom push model before repgraph came in

#

so never went around implementing the thing

#

no

#

entire actor or no actor

#

repgraph or not

oak hill
#

are you talking about unreal push model?

winged badger
#

you can't pick and choose what variables inside 1 actor go to which client

#

you can just pick which actors in their entirety go to which clients

oak hill
winged badger
#

only way you can do it is by rewriting 80% of the low level networking in the engine

#

do not recommend that

oak hill
#

definitely not XD

winged badger
#

literally, idea goes against the core structure of the unreal networking

oak hill
#

so I think the only way is to rewrite my logic in another way

kindred widget
#

Only semi manageable way I could see handling that is a terrible reroute through controllers. Set the value on the server, and in the set function, use the desired client's controller to RPC that change to the client. I feel dirty even mentioning that idea though.

winged badger
#

you can spawn another actor

#

to carry that data

#

and make it relevant only to some

#

its less messy

kindred widget
#

Why do you need only one client to have said info, but for the actor to exist on all?

oak hill
winged badger
#

btw, @oak hill good part of pvp team setups

#

will have a single team actor per team

#

that replicates only to their team

#

it will override IsNetRElevantFor

#

to cast rel viewer to controller, pull the team ID from the controller and return false if the controllers team ID does not match its own

#

im guessing you want something like that

oak hill
#

not really

#

basically I need a generic actor that is visible to anyone, but only some players can use and receive its data

#

but players aren't part of any team

#

maybe a solution could be to store an array of these players in the actor itself and use client RPC, but I was asking to know if there was some method that works in this situation by using replicated variables

winged badger
#

nope, unreal replication will send the entire replicated actor to all relevant clients at the same time

oak hill
#

ok, thank you for the clarifications

signal lance
#

Pretty sure ue4 replication sees what has changed since last replication, serializes it into a package and and sends it to all relevant players
So it would be pretty much impossible with the current system to do partial replication for specific players, maybe with custom net serializers you could have the client discard the data when it receives if it's not the correct one but that's a workaround and not sure how useful would be for your use case since the server is still sending it to the client but the client discards it

crystal crag
#

When you are building the DevelopmentClient, are you forced to automatically connect to a server?

#

I only ask because in my client entry map, the map loads and my UI gets created and put on the screen, then after about 30 seconds, its like the client resets.

#

Everytime this happens, I see this error pop into the log:
[2021.03.01-01.47.57:896][460]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionTimeout, ErrorString = UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.01, Real: 20.01, Good: 20.01, DriverTime: 20.04, Threshold: 20.00, [UNetConnection] RemoteAddr: 127.0.0.1:7777, Name: IpConnection_2147482037, Driver: PendingNetDriver IpNetDriver_2147482038, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Driver = PendingNetDriver IpNetDriver_2147482038
[2021.03.01-01.47.57:897][460]LogNet: Warning: Network Failure: PendingNetDriver[ConnectionTimeout]: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.01, Real: 20.01, Good: 20.01, DriverTime: 20.04, Threshold: 20.00, [UNetConnection] RemoteAddr: 127.0.0.1:7777, Name: IpConnection_2147482037, Driver: PendingNetDriver IpNetDriver_2147482038, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID

dark edge
#

@oak hill what's the gameplay feature you're trying to implement with this?

pallid canyon
#

Does anyone know of a reason why a delegate would hang? Sometimes Oculus CreateSession will call success delegate, other times it will not succeed or fail, just hang on a middle step.

Particularly using the Oculus OSS it calls:
OculusSubsystem.AddRequestDelegate( ovr_Matchmaking_CreateAndEnqueueRoom2(TCHAR_TO_ANSI(*Pool), MatchmakingOptions), FOculusMessageOnCompleteDelegate::CreateRaw(this, &FOnlineSessionOculus::OnCreateRoomComplete, Session.SessionName));

but doesn't end up calling the OnCreateRoomComplete delegate. I've run this several times and it has only succeeded once so far as I can see, in the third or fourth try

tawny talon
#

Hi nice people, a quick question about the replicate variables. Say I have a class derived from UObject (Let's say it's called UClass1), and I make it as a variable reference in my HUD widget. When I try to call from my HUD to my player controller's "Run on Server" function which requires a UClass1 argument, would it be successful?

#

I know that if the parameter is not of type UObject, but of a value type (say int, boolean), it works

#

seems that passing a reference as parameters on server RPC will cause missing object?

#

if that is the case, does that mean we'd better keep the data in our player controller owned actors and left HUD focus on communicating with those actors?

chrome pagoda
#

I'd like to notify GameState or GameMode of a player's death and do something depending on what GameMode is loaded. Preferably without relying on DestroyActor to call the event.

tawny talon
#

So you can pass array of value type variables from client to server using RPC, but you can't pass a set/dictionary, right?

#

by "pass ... using RPC" I mean pass that as an argument

tranquil beacon
#

Hi everyone. I'm very new to creating multiplayer functionality but I'm interested in learning how to incorporate this into my games. Very limited coding background. I want players to be able to connect across the internet (hosting lobbies, finding matches, etc). I know two possible options are Steam Online Subsystem and Epic Online Services--are there any others that would work here? Which would be the easiest to implement with my background?

twilit stump
chrome quest
#

Hello, people. So I need to confirm something. You can only call RPCs from actors, right?
So, if I mark a function as multicast, server or client in a component class, and I call the same function within the Component class it doesn't treat it as a RPC unless I call the function in an actor class. From a function defined in the actor class.

Please I need clarity on this.

peak sentinel
chrome quest
soft shell
#

I have a variable that's RepNotify set to "owner only"; the server set's til variable and the owning client (of the actor) calls the RepNotify, but on the listening server the RepNotify is also called - why would it be running the RepNotify, if set to "Owner Only" - should the remote client (i.e. actor owner) not be the only place it's executed?

chrome quest
peak sentinel
#

In components you dont need that, that blog post is only for UObjects

chrome quest
#

Oh? That's nice

#

Thanks again

peak sentinel
#

👌 No problem

thin stratus
rich ridge
oak hill
# dark edge <@243455303826276352> what's the gameplay feature you're trying to implement wit...

I need an actor that could be a container, a pickup, or something with which every player can interact, but I want it to replicate its content only to the relevant players. So I need two different replication conditions, one for the visual aspect and the other one only for the interacting players. In the end I created an actor component in this actor and wrote a check in ReplicateSubobjects to replicate the data of this component only to the interacting players. @winged badger @signal lance

winged badger
#

ReplicateSubobjects doens't have parameters to distinguish who its replicating to

#

ActorChannel is the channel of its Actor Owner

oak hill
#

I'm not sure, through ActorChannel from what I've seen I can reach the controller of the players

#

In fact I'm doing a check based on PlayerController/StoredPlayerControllers inside this actor

winged badger
#

you can reach it with a static function, does't really matter how you get the PC

#

the check will at best, make it so that the ActorComponent doesn't replicate unless there is at least one player it should replicate to around

#

then it will replicate to everyone

#

it doesn't run that function per NetConnection

oak hill
#

But I've seen that ReplicateSubobject gets called once per player if I'm right

#

Like IsNetRelevantFor

winged badger
#

it doesn't

oak hill
#

So my guess is that there is one ActorChannel per NetConnection

#

oh

winged badger
#

it gets called when the ActorReplicates

#

once

#

and server will map the Actor for replication once, then replicate it to everyone to whom that actor is relevant for

#

2 approaches here - send the data to everyone and discard it client side if they are not supposed to know it

#

or - use another ActorChannel just for that data

#

note that if there is a repeating pattern on who should receive the data

#

you can run network manager actors that does that extra replication for dozens of other actors

#

instead of each actor spawning an extra of its own

oak hill
#

But I'm pretty sure it was working... I can see that if I play with two or more clients, the ReplicateSubobject function gets called for every player controller

#

And I use this to do the relevancy check

chrome bay
#

I'm willing to bet that if the relevancy changes on the players' side, it won't replicate the destruction of the subobject though.

#

Be an interesting test to try though

#

What I mean is essentially once it has already replicated to a given connection, it will probably always do that - even if it just gets left with redundant data, since nothing is going to destroy it or clean it up presumably.

lilac raven
#

Hi, my client build that is built through my CI (Jenkins) returns a client outdated error when trying to join the server, its the same build, in our version control, I am thinking I have a file in gitignore causing the issue, where does a build check the build version?

#

just so i can include that file

chrome bay
#

FNetworkVersion::IsNetworkCompatible

oak hill
#

@chrome bay shouldn't the subobject lifetime be managed by its owning actor?

chrome bay
#

When an actor isn't relevant the server closes the actor channel which destroys it for that client. The sub-object replication method you have currently likely isn't going to handle that for those sub-objects

#

So if a client changes in a way where that sub-object is no longer "relevant" to them, it's not going to be destroyed - it'll just hang around there with the old data

#

That's what I'd expect anyway

#

E.g. say you've made it so that sub-object only replicates to a given team, what happens when the controller changes team?

#

Unlike an actor, it won't be destroyed most likely - it'll still be there on the client, it just won't get anymore property updates

lilac raven
oak hill
#

@chrome bay so the relevancy is checked both on server and client if I understood?

lilac raven
#

Yeah, so, its kinda strange, basically my build sever (different pc, same engine version, project gets pulled from git repository before building, same project version) and it builds it via CMD using automation tool. When i use the build from the build sever and open up a dedicated sever I built from my desktop, the build sever build won't connect. My thoughts are that i have a file in our projects gitignore that has the version in it

chrome bay
#

But what I mean is, the Server will clean up the actor channel when it's not relevant. It won't do that for sub-objects.

kindred widget
#

Ugh. This discussion reminds me that I need to attempt something similar to Ark's AI system. Only difference is I need to put the XRebirth spin on it and also simulate that data when the actual actor isn't loaded.

frank birch
#

Sorry, A slight confusion on the roles of the gamemode and the gamestate. I understand that gamemode has the rules of this match (for example, "first to 10 kills wins") howeeever... who does the check? the gamemode itself or the gamestate? 🤔
If the gamemode does the check... does it then call a multicast gamestate to let everybody know the game ended? 🤔

meager spade
#

it can do anything to update the GameState

#

like setting a replicated property (bGameFinished)

#

or have some kinda state system (which GameMode and GameState has) excluding the Base versions

winged badger
#

@chrome bay @oak hill if the actor that replicates the subobject becomes not relevant it will destroy the Actor, unless it was loaded from package

#

even if you shove the UObject somewhere else from OnSubobjectCreatedFromReplication, it will still lose the Outer

#

basically, even if you were to manage to hack your way into a solution

#

it will be fragile, and that is the last thing you want from your networking code

chrome bay
#

Yeah, I can't see a solution where it works properly tbh

#

Separate actor is really the only way if you just don't want that data to replicate at all

#

Or some sort of "info" class that contains data for a bunch of containers like you said

tawny talon
#

Hi nice people today i got very confused by the magic of player controller. I have a custom class derived from actor(of course checked replicate), lets say its called Config. I used my pc to spawn this config class and set the owner of the newly generated object to be the pc, hoping the rpc(client to server) would work. NO. My hud successfully runned, but it didnt fire the run on server evenr from config class.

#

I tried the same setup for player controller, and magically it works

kindred widget
#

@tawny talon If I understood correctly. You're wondering why when you spawn this actor from HUD, it won't have server rpc capabilities, but when you spawn it from PlayerController, it does?

#

No. Just reread.

#

If the server version of your player controller spawns this config actor, then sets itself as the owner of that config actor, then it should replicate to all clients. Then if that one client that is the owner uses their HUD to get that Config actor on their machine after it's replicated to them, they should be able to use it to RPC to server through the Config actor.

#

So, if you cannot RPC through the config actor, then the most likely scenario is that you're getting the wrong config actor that the particular client does not own.

#

Not sure how you're getting the correct ref from the hud class, but you could store a replicated pointer in your player controller. Spawn the replicated actor, set it's owner to the player controller, and then set a replicated pointer to the replicated actor. Then you can get the local controller in the HUD class, and use that replicated pointer for the correct Config actor.

kindred widget
#

Whew. Finally getting comfortable with FastArrays and WeakPointers. Finally have both my replicated gatherable foliage and replicated building placement all in place. Both using subclassed foliage and HISM components for better draw calls. At least it's all working great in editor. I need to throw together a quick lobby system and try it out on multiple machines. But now I can actually design stuff again! Need to start working on the building placement system.

light smelt
#

how do you handle multiple levels in multiplayer?

#

like a modular world with portals between the levels

#

(a bit like pokemon)

#

lets say in coop player A is in one level

#

and player B moves into another level

#

then player A's computer would have to load the other level and simulate it too

#

how would i handle that?

lucid vault
#

In my game, when a character gets tased, he ragdolls.

Problem is, bones aren't replicated, so if a client tries to shoot someone tased in ragdoll, the collision usually won't match up.

I can use death animations. My problem with death animations is that if you get tased on a stair case, for instance, half of your body will go through the stair case, as animations don't have collision.

Another solution is client authoritative shooting. This is a worst case scenario

#

Anyone have any ideas?

chrome bay
#

Common approach is to ignore ragdolls for bullet collision

lucid vault
#

I would prefer the players to be kill-able when tased

#

I was thinking that maybe it would be possible with a death animation + control rig to prevent going through floor, but I'm not experienced enough in control rig to know if that would work

#

Else, maybe client-side shooting authority for ragdolls

chrome bay
#

Use a physics constraint to ensure the ragdoll stays reasonably close to the capsule on all ends, and accept the clients hit if the hit is within a tolerance distance (when ragdolled)

#

If you're on dedicated servers then usually you wouldn't run any animation server-side

chrome quest
#

Hello, I created an actor component and discovered that ticking the checkbox for component replicates does not actually replicate the Component. I had to explicitly call SetIsReplicated() in the begin play of the actor component. Just wondering if this is a bug in the Engine or I'm doing something wrong. I googled and found this problem in 4.8 I expected it to have been fixed by now.
Any thoughts on this, please?

#

Also, do I have to do this for every custom component I make?

chrome bay
#

Not had this issue myself

#

The actor itself also has to be replicated ofc

chrome quest
#

The owning actor is set to replicate. It's a character infact

#

The main reason I'm concerned with the Component replicating is that I have some variables in the Component set to replicate but they were not replicating until I did the above.

eternal canyon
#

thats how components work

dense ocean
#

if i call a non replicated event from the gamemode, and it is also defined in the gamemode, is it the same as Run on Server?

thin stratus
#

You seem to be mixing up things

#

GameMode only exists on the Server. So when you have access to the GameMode to call events on it, then all of it will run on the Server.
Even you access other Objects/Actors from the GameMode, you are most likely still on the Server.
That has nothing to do with a RunOnServer RPC.

buoyant crag
#

hey, I'm trying to save the player's data on the server, and load it every time the player joins it. any ways how to do that? maybe a Database that stores each player's state (for example, a variable for coins).
thanks for the help!

bitter oriole
#

Need a centralized database server, that your dedicated servers connect to, update and download the player's state

buoyant crag
bitter oriole
#

The database server can just connect directly like any web server to a mysql db

buoyant crag
#

alright, ill look into it, thanks!

gritty pelican
#

can i replicate variable only for one player? Who interact with object

open quail
#

yes, if you are on bp check the replication conditions on the variable

gritty pelican
#

for example with COND_Custom or COND_OwnerOnly?

#

on server side i will make SetOwner for Actor

#

and SetOwner(nullptr) for stop replication, right?

open quail
#

DOREPLIFETIME_CONDITION(AMyCharacter, myVariable, COND_AutonomousOnly);

kindred widget
#

Can someone point me into the direction of why this is warning me about something? I get this log spam ONLY when a player is standing on top of a locally spawned HISM component, which all clients locally spawn.
LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: BuildingHISMComponent /Game/OWV/Maps/UEDPIE_1_GameMap.GameMap:PersistentLevel.CWorldBuildingManager_0.BuildingHISMComponent_0 NOT Supported.

chrome bay
#

Character Movement can't reconcile it for the movement base most likely

#

Since it's spawned locally

kindred widget
#

Hm. Do I ignore it, or? Semi annoying to test around the log spam. Would replicating the component holding that HISM instance work?

chrome bay
#

The actual HISM Component itself needs to be replicated from the Server in order to reconcile it properly

#

That or characters shouldn't be able to walk on it

kindred widget
#

More or less I was attempting a building system. Simple manager replicated and spawned from GameMode. Actor has a fast array. On post replication, it locally determines if the client needs a new component for that static mesh type and spawns it if needed before adding the instance at the desired location. Works fine, except for that problem. I'm not certain how to refactor that if I need to replicate the component. Cause each client would still need to locally add their instances and I wouldn't know if the component was locally replicated when the fast array replicates.

chrome bay
#

Ultimately you need to be able to reference whatever the character is standing on over the network, so locally spawned stuff doesn't really work for that

#

The alternative would be to spawn it deterministically and trick the network system to treat it as a "map startup" actor

#

Which @winged badger has done for some procedural generation stuff IIRC

kindred widget
#

Can components hold fast arrays?

chrome bay
#

for sure, anything can

kindred widget
#

I might just move the fast array to the components then. Then the component can do it's own stuff and it would for sure have the component there when the fast array replicates.

strong vapor
#

[Help] anyone know a simple way to replicate what time a sound cue is playing on the server when its replicated

chrome bay
#

Oh another thing you can do, I forgot

#

Is mark the HISM as "static" or stationary

#

I seem to recall it doesn't send the base then

kindred widget
#

Hmm. Can try that.

chrome bay
#

But that said, don't think you can make changes to certain properties then

kindred widget
#

Mostly, the instance just needs to be there, or not be there. Past that it doesn't matter for this. If that doesn't work, it won't be that hard to move the array to the component and just rewrite some functions in the manager.

#

@chrome bay Whew. That one line just saved me a few hours work. 😮 Thanks man.
NewComponent->SetMobility(EComponentMobility::Static);

#

Probably better for lighting that it's static anyhow.

chrome bay
#

It's a good habit to get into tbh. Landscapes being "Movable" by default is still stupid.

kindred widget
#

Haha. I was doing an AI test a little over a month ago... Had a directional light that doesn't move. Read somewhere on a forum randomly about lighting and characters and such that the lighting's mobility mattered. Changed the directional light to static and with 250 AI, my framerate went up from 45 to about 65. Insane how one setting can kill you.

peak sentinel
#

If I am only going to replicate AI controlled pawns, I dont need to implement prediction, right? Smoothing / interpolation on simulated proxies will be fine?

kindred widget
#

Trying to understand FVector's NetQuantize. If I understood correctly. NetQuantize100 allows two decimal points. So... 4.15274 would be turned into 4.15? And this at the very least would trim off 2 bits. Since each float normally is 32bits, 4bytes*8. But NetQuantize can also lower that number even more than just the extra 2 bits?

winged badger
#

compressing a float makes it lose precision, as you discard the data that held the decimals past the 2nd

#

but its just a normal vector with overriden NEtSerialize

kindred widget
#

How far can Netquantize100 compress though? If it's like an average of 20-26 bits, that might be worth it, but two bits doesn't feel like it's worth the effort.

winged badger
#

NetQuantize10 is significanly smaller

kindred widget
#

It may very well be enough precision. Just building placement. I can't imagine that I need more than a tenth of a centimetre's precision for that.

lilac raven
#

Hello, is there a way to set my own server / client version for builds? Getting compatibility errors even on the same git repo

sleek elk
#

Somone here uses Advances Sessions Plugin and can explain how to create a Session only friends can find?
The "Create Advanced Session" Node has a option calles "Allow join via presence friends only". I thought this option is what I am looking for, but when set it to true then nobody see the created session. Also not friends.
How do I open a Session (and find it) which only Steam friends can find?

crystal crag
#

@tranquil beacon You're in for a rough journey if you have limited coding experience. Between Epic Online Services and Steam, you are probably best off using steam, since Epic Online Services doesn't have a ready to use plugin for UE4 yet (outside of third party / some init work on dedicated UE4 branch)

#

@tranquil beacon you are probably better off buying a course on sale on udemy that covers UE4 and multiplayer games

sleek elk
#

I don't get it. I think it can't be so hard to make a session which is only visible to steam friends. Or do I misunderstand "Allow join via presence friends only" and there is not even a possibility from steam and online subsystem to male sessions only friends see?