#multiplayer

1 messages ยท Page 610 of 1

sinful tree
#

The instructions in the video I've sent you are specifically for Steam. The Steam Session Ticket is unique to Steam's system. If the function provided in the video returns "0" that means the computer the player is on is not logged into Steam.

vital heron
#

Quick Question: This is mainly curiosity but computers that host your game's server, is it all just one big server that is cut up into 12 player lobbies or are they are all individual servers.

#

This is a very stupid question I know but curiosity is a powerful thing ๐Ÿ˜…

hollow eagle
#

A single server process is usually just one lobby, doing more than that makes things way more complicated.
For the actual hardware, most servers these days are virtualized - one physical host will be running multiple virtual machines (or sometimes containers, though I'm unsure how common that specific bit of tech is for games). Whether a single VM runs multiple server processes is highly dependent on the game.

vital heron
#

Oh so a more complicated game will usually host less server processes on a single VM?

hollow eagle
#

no

#

It's a cost thing - how much can you divide up a single VM before impacting performance

vital heron
#

Oh

hollow eagle
#

it's not as simple as just adjusting the number of processes running either

#

because you have multiple VM sizes

#

I'd say it's probably more common to run a single server per VM as it's easier to guarantee resources that way

#

but it's complicated

vital heron
#

Why do they use VMs though? If it is all run on a single hardware device why not just run multiple services on the PC itself.

hollow eagle
#

because no one wants to build out a datacenter (or buy out sections of one/colocate) these days because that's expensive and not scaleable

#

why buy the physical hardware when you can rent VMs on a cloud

#

or if you do happen to own the datacenter, why build out hardware for one specific game when you could support any number of your games (because you're big enough to have multiple if you have a datacenter)

#

and scale them automatically

vital heron
#

Oh I see

#

That does make way more sense

hollow eagle
#

If you're an "independent" AAA you probably don't have the capital to build out the infrastructure worldwide so cloud is basically the only real option that will scale no matter how many (or few) players you have. If you're a large AAA like EA then you probably use a hybrid approach but most stuff is probably still virtualized. If you're microsoft... you own the cloud, why not use it.
And if you're an indie you're definitely not building out your own infrastructure.

vital heron
#

This clears up a lot of confusion thank you!

sinful tree
# vital heron Why do they use VMs though? If it is all run on a single hardware device why not...

Usually when you're dealing with hosted VMs there are really beefy physical servers behind them, so beefy that it's probably already running instances of other VMs on it - and what happens is you just get to use a slice of the computer power available on whatever physical server your VM runs on. If you went with AWS for example, you pick between different sizes of instances, which have different CPU & RAM availability, and whenever you activate it, it then starts running on whatever hardware is available at the time for your instance size to use.

Even if you request a VM host somewhere for a really powerful VM, with tons of RAM, there's still a good likelyhood that other processes will also be running on the same physical server. It's only if you get dedicated hosting (they have server hardware you're effectively renting + it's dedicated for your use only), or co-hosting (you own the physical server, they're just a place for your server to be plugged in with redundant power, proper cooling & extremely high-speed internet access) that you're guaranteed you're the only thing running on the server hardware.

hollow eagle
#

Yep, this is also important to know about VMs

vital heron
#

This will be really helpful for looking for cloud server hosting!

vital heron
rain quest
#

Im new to multiplayer, why is all the clients swapping weapons fine and seen by everyone but the host only swaps their weapons on their own screen but sees everyone else's fine.

dark edge
#

@rain quest can't really read your screenshot my phone, but for swapping weapons, the input should just trigger a run-on server event that swaps the weapons around. The current weapon should be replicated and in the rep notify, that is where you would play your animations etc.

#

You shouldn't even need a switch has authority, the flow will be the same whether you are hosting or not.

soft shell
#

QQ; let says I have a replicated variable.. can I set that on the server to give it an init value (and never touch it again) but then let the client work out it without worrying about the server touching it again?

bitter oriole
#

Why does it need to be replicated if the server won't change it ?

soft shell
#

Because only the server has the initial value it should be set to

#

My concern with using a multicast is that this is set during the spawning of the actor; and as far as I know events can be problematic / missed if issued on an actor that has just spawned (correct me if I'm wrong)

winged badger
#

never use multicasts for stateful changes

#

only for fire and forget stuff

#

your variable should be replicated with InitialOnly condition

soft shell
#

Ah! thanks

#

but just for the record, if the server never touches it again the client would be free to use?

winged badger
#

note that you need to set it on server before it replicates, like immediately after spawning an Actor

#

or clients would have the wrong value

soft shell
#

Rite, so anything initialOnly needs to be set immediately ๐Ÿ‘

winged badger
#

it is bad practice for clients to operate on replicated variables

#

so best have 2 of them, 1 replicated, one not, but set from OnRep_FirstVariable

soft shell
#

Thanks for the clarification, I'll do that

atomic acorn
#

Does anyone know if itโ€™s possible to replicate a render target, or the data in it and rewrite to a render target?

#

Or would I be better off using scene capture?

chrome bay
#

You can read the data back and replicate it, but it's extremely expensive

atomic acorn
#

I thought that might be the case

meager spade
#

best bet is to let client also generate it

chrome bay
#

Yeah definitely

atomic acorn
#

this is what i'm working with essentially

#

ah okay, thank you

meager spade
#

what is that?

atomic acorn
#

it's just a whiteboard kind of set up

#

using UV's

#

I'm wondering if I send where to write to everytime someone writes might be the way to go

chrome bay
#

Sending deltas is probably a better way indeed

atomic acorn
#

cheers for the help guys! I will try that instead

chrome bay
#

For players that join late you'll still need to send the initial state ofc

atomic acorn
#

so send the whole rendertarget data on joining basically?

#

I'll start with the replication first but I'll try get that working also

glossy veldt
#

Hello, i have the following problem: When creating a widget from my Character BP (After being possessed by a player controller) the widget gets added to every clients viewport and not just the one that owns the character

whole urchin
#

how do i possess a vehicle in multiplayer ?

dark edge
#

@whole urchin call possess on it.

whole urchin
#

are you serious ?

#

i did that, it doesn't work, hence my question here

chrome bay
#

Controller->Possess(TheVehiclePawn);

#

Assuming you are using the engines' vehicles, and not your own approach

#

You only call Possess Server-Side, btw

whole urchin
#

i did that, it doesnt work

chrome bay
#

Probably something project specific then

whole urchin
#

in blueprint please

chrome bay
#

Same deal

dark edge
#

Is the vehicle a pawn?

whole urchin
#

yes

dark edge
#

Are you calling possess from the server or client side?

whole urchin
#

server side

dark edge
#

Screenshot your blueprint so we can take a look at it

whole urchin
#

does it make a difference if i do it in controller blueprint or in some other BP ?

dark edge
#

Your options are the controller or your currently possessed Pawn pretty much

chrome bay
#

The only thing that matters is whether you are calling it on the Server

#

If you are, and it doesn't work, then it's going to be something project specific

whole urchin
#

this is controller BP

chrome bay
#

Looks fine

whole urchin
#

when i play on server, i possess

#

when i play on clients, it doesn't possess

chrome bay
#

Check the values of the variables

whole urchin
#

i will

chrome bay
#

Vehicle being replicated is a strange choice for example, usually you'd pass the vehicle pointer with the Server RPC

#

Since presumably the Client is the one who decides what they want to possess

whole urchin
#

it returns nothing, why

chrome bay
#

you mean Vehicle is null?

whole urchin
whole urchin
chrome bay
#

There ya go then ๐Ÿ˜„

whole urchin
#

but why

chrome bay
#

Well obviously you haven't set it

whole urchin
#

i have set it

chrome bay
#

If it's null, you haven't set it (on the Server)

#

Again though, why the Vehicle variable is replicated and not being passed via the RPC I don't understand. The setup is odd.

whole urchin
#

i did it at BeginPlay

#

ignore the variable replication, it was a stupid test

dark edge
#

@whole urchin show where you are setting that vehicle reference

whole urchin
#

so you're telling me to get the reference for the vehicle in the server RPC ?

dark edge
#

Does the spaceship exist on the map already?

whole urchin
#

ya

dark edge
#

Try get all actors of class and print the length of that array. Should be one right?

#

I've never seen that node get actor of class

whole urchin
#

i got the vehicle reference in server RPC, and it possessed

#

succeess

#

but i can't move it

#

any suggestions ?

chrome bay
#

By default vehicles have no network functionality, it's worth pointing that out

#

I think the engines' Wheeled Vehicle Movement has some very basic code, but otherwise nothing else does (e.g, floating pawns etc.)

whole urchin
#

but isn't FloatingMovementComponent (or any move component ) already replicated ?

pallid mesa
#

no, a shape of that will come soon with Dave Ratti's net prediction plugin

pearl pollen
#

Hi everyone! Quick question. I want to add a component to my character that is only relevant on the server and I'd like for it to not exist on the client. HasAuthority somehow wrecks everything because the non-existant component's BeginPlay gets called anyway. Is this approach wrong all together or am I doing something wrong?

pallid mesa
#

I am uncapable of understanding your question

#

where are you adding this component?

chrome bay
#

Relevancy is done at the actor level, components can't have different relevancy from their owning actor

pallid mesa
#

yeah you should use owner's relevancy

chrome bay
#

I mean you could add a (non-replicated) component at runtime on the Authority only, but that's probably not the most resilient design

pearl pollen
#

Okay so if I want the component on the actor, I add it anyway and just block it from being used on the client, is that right

#

?

chrome bay
#

If you want it as a default component then yeah, you don't have a choice really

pearl pollen
#

Yeah I want it in there by default

#

Okay thanks. I'll figure out a way to do that.

pallid mesa
#

maybe you can dance a bit using with_editor pragmas xD

pearl pollen
#

I wouldn't want to mess with that ๐Ÿ˜› Too many unexpected crashes

gritty pelican
#

hello, how i can serialize float?

glossy veldt
#

When adding my Widget through the Character it gets added to every players viewport - when there are 2 players there are also 2 widgets on top of each other
Any help?

empty axle
#

@glossy veldt check for IsLocallyControlled before adding the widget to the screen

glossy veldt
#

@thomson so before add to viewport?

empty axle
#

After BeginPlay before GameplayPCRef

glossy veldt
#

Alright will try

#

now the client only has his hud but the listen server has no Hud

#

@empty axle Any idea why?

glossy veldt
#

Nevermind - fixed it by adding a small delay after begin play because for some reason the listen server takes a bit of time to register that he is controlling a pawn

marble gazelle
#

never use delays for these cases!!!!

silent valley
#

Can I add a replicated Actor to a Level?
How does the ownership/replication work?

#

actually I already KNOW that I can ๐Ÿ™‚
I guess what I'm wondering is, if an Actor is loaded as part of the world on a Client, is it possible to know when it has been initially replicated?

marble gazelle
silent valley
#

Thank you Sir!

winged badger
#

the Pre/PostNetReceive seems a less intrusive way to go about it

lament sinew
#

@chrome bay in your blog post (https://jambax.co.uk/replicating-uobjects/) you mentioned that subobjects are always created client-side using the Actor as the Outer.
So replication that way is client -> server?
I mean the client would create the object just fine but it would get replaced by the server object.
The one the client allocated would eventually be garbage collected right?

thin stratus
#

Replication always goes from Server to Client, despite ServerRPCs.

winged badger
#

@lament sinew when client instantiates a subobject from replication (AActor::OnSubobjectCreatedFromReplication() callback)

#

those subobjects always have that Actor as the Outer

#

no matter what the Outer actually is on server

covert anchor
#

So I've been following tutorials on building a multiplayer server, I wanted to dive deeper into how things work does anyone have any good learning resources?

steel fox
#

I'm making a fps game and the whole "weapon fire" process runs on server, how can I update players hud ammo in clip information? Should I get my weapon ammo amount at each draw?

rich ridge
#

@steel fox is your gameplay Logic coupled with GAS?

lament sinew
#

@winged badger yeah it should be constructed with the GUID from the replicated data, but i thought i needed to create it again on client-side lol

winged badger
#

the point was

rich ridge
#

if no then you need to have one variable like UPROPERTY(ReplicatedUsing = onRep_AmmoCountCallback) AmmoCount;

winged badger
#

if your say, ActorComponent on server instantiated a replicated UObject with itself as Outer

steel fox
winged badger
#

when that UObject replicated, its Outer would be the Actor that replicated if over its channel

winged badger
#

not the ActorComponent

rich ridge
#

and whenever AmmoCount is updated by server, client will get callback in that function

lucid vault
#

I have an ADS camera attached to my gun. I use set view target with blend when pressing / releasing the aim key.

The blend works nicely if you let it complete fully. The problem is that, if you stop aiming during the transition to the ADS camera, which sets the view target back to the original camera, it snaps instead of blending

#

I guess you can't blend to the current view target. Is there any solution to this problem that doesn't involve manually moving my camera for ADS?

#

bLockOutgoing won't work, because the camera will get offset by player movement

wise bridge
#

Hello everyone, I still have an issue with my aim offset replication, so here's a few questions to help me fix this one time for all :
-What value should I use to replicate the pitch accross the network? Control Rotation?
-What variable should keep this value? Default camera?
-After that, I just use my Default camera rotation for the AimOffset right?

#

Here's a picture of my BP_character. And last question : to trace a line, I just have to use my default camera location for the starting point, and my default camera getForwardVector multiplied by a value for the end point right?

steel fox
#

Does anyone know how to replicate a variable in animinstance to all players? I know it's a UObject, but I have that integer variable that changes the animation pose and I was trying to set it when I need to instead of getting it at each anim update, using UPROPERTY(Replicated) and setting it on Server or Multicast changes the value only on the server and not on the other clients(on listen server the new pose is visible while on clients it isn't)

dark edge
#

@steel fox why does the state need to be replicated inside the anim instance?

#

@wise bridge control rotation is owned by the controller.

steel fox
#

I can just get it from the player pawn, but I was curious to know if it's possible to replicate it, I need it to know wich animation pose to play(AnimationBlendspace)

wise bridge
meager spade
#

@steel fox animinstance is local only. No replication at all. not even RPC's.

steel fox
meager spade
#

no

#

its cause its local only

#

UObjects can replicate just fine

#

if setup properly

#

but animinstance should and is local only

pure frigate
#

@twin juniper That's not a bug, that's just latency. If something is spawned on server, it has to replicate back to the client which takes time. Once it replicates, it has already traveled X distance on server. You need to spawn a local projectile on the client that doesn't have damage authority, and does what the server's projectile does.

unkempt wing
#

Anybody know how to make certain components of actors only visible to certain players?

paper lava
#

hey guys, I really need some help.. I've been at this the entire day - no joke..

I can't figure it out. I have a custom replication graph and when it is active, I can't do multicasts anymore.

The problem is also there in ShooterGame.. I created a custom player controller and added this: https://i.imgur.com/iJfCpFJ.png

As soon as that multicast hits, the player controller dies.

This is my output:

LogBlueprintUserMessages: [BP_PlayerController_C_0] Server: MULTI! ---------------------------------------------------------------------
LogBlueprintUserMessages: [BP_PlayerController_C_0] Client 1: MULTI! ---------------------------------------------------------------------
LogBlueprintUserMessages: [BP_PlayerController_C_1] Client 2: MULTI! ---------------------------------------------------------------------
LogNet: Received invalid swap message with child index -1
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_PlayerController_C_0. Function Servertest will not be processed.
LogBlueprintUserMessages: [BP_PlayerController_C_1] Client 2: PC got destroyed

LogNet: Received invalid swap message with child index -1 this line appears, soon as I do the multicast and later, the PC has no owning connection anymore.

It seems to me for some reason there is a swap in player controllers and that fails because INDEX_NONE is sent. ( https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/NetConnection.cpp#L3708 )

I've tried to have PlayerController replicated in every which way I could come up with but it doesn't change anything.

I really need this to continue with my project. Help would be highly appreciated

lethal oracle
paper lava
#

oh man, damn

#

@lethal oracle thanks so much

#

it's weird though, I don't have these problems when the replication graph is not active

lost inlet
#

you wouldn't use multicast on a player controller though

paper lava
#

@lost inlet yea, I got that part now.

#

I'm relaying over the GameState now

lost inlet
#

that or player state are likely the appropriate places for whatever you're doing. only the owning client knows of their player controller, you don't know about anyone else's

paper lava
#

right, yea, that makes sense.. somewhat

ivory lintel
#

Hello Friends,
I have some question about MP in UE4. Games like Fortnite have dedicated server hosted on the Epic Games. They handle with multiple matches at the same time. When X player check ready to play, the master server group they and setup a new sub server and/or session to this players. Each match have X clients at start playing the same game with the same level with the game mode and game state of the specific match.The questions:

1 - Each match have a dedicated server process (.exe) running to control the game or the same dedicated server process can handle multiples sessions of the same level at different times?
2 - What is the best way to develop this solution to control and handle multiples matches of the same level?
3 - Any tutorial or documentation of how to do this?

#

I'm glad if someone can help me to understand the logic flow and give a tip of how to replicate this
^^

hollow eagle
#
  1. A single process usually only handles one game, there are lots of additional complications that likely aren't worth it if you want to handle multiple games.
  2. It's completely up to you to develop something like that, or you can use a service like gamelift or playfab.
  3. You're on your own for that unless you're using a service as mentioned above.
ivory lintel
#

ty for your answers๐Ÿ˜†

#

so...I'm trying to create a solution of master and sub server

#

when the master server / lobby got X players ready to play, him create another process of dedicated server running the level and travel all players...it's right?

hollow eagle
#

You definitely do not want a "master" server to be a real dedicated server instance. There's no way that can scale up for the number of players.

#

Any lobby or matchmaking system will involve a number of web services that the game calls out to in order to find out where to connect

#

this is an area unto itself, no one here is going to be able to tell you how to make all that because it's a massive undertaking

#

I suggest looking at the services I mentioned first. If you still really want to build something yourself then at least read up on how those services work.

ivory lintel
#

understand

#

ty any way^^

quick flint
#

Does OnRep call on other players clients

lost inlet
#

I'm not sure what you mean, an OnRep or what?

#

a Blueprint OnRep will call on the server and each client the actor is relevant to

#

in C++, you have to manually call an OnRep function after changing a variable on the server (if desired)

lost inlet
quick flint
#

Oh sorry I mean a ReplicatedUsing function

quick flint
lost inlet
#

the replication system calls it on every client where the actor exists

#

ie "is relevant to"

#

if the actor is dormant, you won't get it until the actor is awake or you force a net update but that's getting more advance than what you're looking at

lost inlet
quick flint
#

oh

vivid seal
#

how do u guys typically handle race conditions between replicated objects and the pointers to those objects inside the things that own them? for example i have a component with an array of uobjects, it replicates all of those objects. However in the callback from changing that array (adding a new object on the server), the object will sometimes not be replicated when the array says it has a new item, or vice versa, the object might check something and see it is not yet in the component's array of objects.

#

is there a BeginPlay equivalent in UObject that I could use to just tell the owning component that the object is ready to go when it's actually done replicating

winged badger
#

fastarrays will fire changed when the object is resolved if its null during add

#

and typically its not a race condition - same array always fails or always succeeds

vivid seal
#

so in postreplicatedadd I can check if the pointer is null, and if so do nothing, then in postreplicatedchange check if its valid and then actually add it to the owner's array if it hasn't been?

#

er, it'd already be in the array, but i'd know i can use it

#

i feel like every time i have a multiplayer question in here its just you popping in and telling me how fastarrays are here to solve all the problems lol

winged badger
#

you can also swap the position of Super in ReplicateSubobjects

#

make the array replicate after the subobjects

oblique coyote
#

Hello I am having an issue in my VR project I'd like to ask for advice, here's my forum post of the issue https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1854196-issue-with-possession-and-setting-vr-hand-owner

#

the gist of it is that I am trying to take ownership of som VR hands but on the client side, I've only found success by running the setup on tick which is bad

#

I'd love to hear any ideas about what is going on

silent valley
#

I am making a multiplayer test class and I need All my clients to be able to send information back to server. However I dont want to modify the Pawn. Any ideas for this?
I'm currently thinking spawn an Actor for each client, owned by the client that can RPC to the server, but is there any nicer ways?

winged badger
#

if its a test class

#

can be just an ActorComponent

#

RPCs work just fine, as long as they are on owned Actor @silent valley

silent valley
#

yes this is the problem ๐Ÿ™‚
there is 1 test class owned by server, but how do each of the clients report back to the server?

#

I have decided to create a client owned Actor for each client, and use that

winged badger
#

replicated ActorComponents on owned Actors can RPC

#

standalone Actor works too, as long as its spawned and had SetOwner called on it server-side

minor jackal
#

Hi all for multiplayer, in which class i should implement spawn item logic. I have created logic in game mode and used multicast event for spawn. But i can not see items on each client. I believed spawning should be done only by server so i used game mode BP

wise bridge
silent valley
minor jackal
#

@silent valley Thank you, I have item actor class with mesh. Then in game mode i am looping for all target points and spawn actor at target location. So why items are not visible on clients?

#

Is this normal?

silent valley
#

possibly in BeginPlay the clients are not yet connected

minor jackal
#

how would i check if clients are connected in game mode?

silent valley
#

oh and also GameMode only exists on Server not clients

#

so NetMulticast will not send anything to any clients anyway

minor jackal
#

i see, so this means, i cant spawn items to all clients in game mode?

silent valley
#

hmm I think you're missing something fundamental here

minor jackal
#

i am sure, need to learn

silent valley
#

generally, only Server should create Actors, and any replicated actors created on Server will also be created on all clients

#

so if you use SpawnActor in GameMode (server) to spawn a Replicated item actor, then it should also be created on clients too

minor jackal
#

i see so i need to tick "Replicated" checkbox inside actor itself

silent valley
#

yes, inside your item actor I guess

minor jackal
silent valley
#

is the item definitely visible on server? and it's just not appearing on client? you using Listen mode?

minor jackal
#

yes 100%

silent valley
#

idk, it should be working based on what you've told me ๐Ÿคท

#

I'd put some more logging in and try and narrow it down that way

#

but I've not really used BP

minor jackal
#

I am going to test it on a fresh game, let me see if i can grasp some understanding. I hope you dont mind if i ping you with DM.

silent valley
#

just ask in this channel please

minor jackal
#

ok, thanks

ember osprey
#

Would the GameState be the best place for AIs to generate random patrol points so every AI on clients will sync their patrol or is there a better place for that?

meager spade
#

AI is server only

#

so why would clients need to know?

ember osprey
meager spade
#

well AI is server only, so you don't need to replicate anything to do with its path

#

just generate it on the AI or make an AI director if you need predefined random paths or w/e

ember osprey
#

AIC is server only but not the pawn correct?

#

rn each AI creates its own random location on each client version.

#

so putting random locale on the pawn is not working rn.

#

This is on the pawn:

//We get a random direction, then set a location based on that and finally we clamp it to the navigation zone
FVector AAI_Bot_Pawn::GetRandomLocationInNavigableZone()
{
    return ClampLocationToNavigableZone((UKismetMathLibrary::RandomUnitVector() * MovingRange + GetActorLocation()));
}
meager spade
#

why would the pawn handle that?

ember osprey
#

and each client does its own version of it

meager spade
#

ai controller should handle all movement

ember osprey
meager spade
#

why cant you

ember osprey
#

I think thats the framework.

#

I tried to do it and it wouldn't let me obtain the AIC from the controlled pawn in multiplayer.

#

pawn on client and AIC only on server.

#

the server pawn could get it I believe, but the client pawns could not.

#

wouldn't*

#

not would

meager spade
#

ofc

#

why would the clients need it?

#

clients should never access a controller

ember osprey
#

my pawn navigates and then collides and then generates random location to go to.

#

I tried to get the AIC from the AI pawn to tell it to generate a new patrol point, but I cannot get the AIC from the pawn.

meager spade
#

but that is all server only

#

so why does clients need to access it?

ember osprey
#

I think I may be spawning the AI in the wrong place.

#

So its not all server.

meager spade
#

AI should be spawned server only

#

dont forget, pawn overlaps will fire on client and server

ember osprey
meager spade
#

you just need to gate it with HasAuthority

#

or some server check.

ember osprey
#

ok

#

So you saying...

#

When collision, use hasauthority check to get new control point. right?

#

in the AIC

#

I'm spawning AI in a spawn manager that is in the level already and not spawned.

#

So I think it exists on the client and server when AI is spawned.

ember osprey
meager spade
#

yes

#

your ai should only spawn on server

#

and be replicated

#

so your spawn manager needs to make sure its only running spawns on the server

ember osprey
meager spade
#

yes, and overlaps on pawn run on both client and server, so those will need to be gated

ember osprey
#

the pawns will replicate automatically?

meager spade
#

if they are ACharacter based

#

yes

#

or APawn

#

and your movement comp is replicated

ember osprey
#

ok, thanks I'll get on it. I appreciate it. BTW, I'm not using the movement comp Im using the Network Prediction plugin.

#

for movement.

polar wing
#

Woah, just started upgrading my project to 4.26. They really rewrote the CMC's RPC system! Not sure if this was mentioned here already? Probably ๐Ÿคฃ .
"// Use newer RPCs and RPC parameter serialization that allow variable length data without changing engine APIs."
To see the changes, you can run the UCharacterMovementComponent from 4.25 against the 4.26 variant in a diff checker. Same thing goes for the accompanying stuff in ACharacter.
I had to rewrite some parts of the engine API (but managed to get it done in child classes) to make up for the severely-limited compressed flags before, due to a large amount of custom move data. Looks like I'm going to have to do another big refactor to use the new API while I wait for Network Prediction to mature. Just wondering if that's really the best use of my time right now, without knowing when Network Prediction will hit production-ready (I'm still playing around with it, but not in my production project).

chrome bay
#

They have already started on a Net-Prediction driven character movement setup IIRC

#

There's early parts of that in the Master branch already

wise bridge
#

Hello everyone, I still have an issue with my aim offset replication, so here's a few questions to help me fix this one time for all :
-What value should I use to replicate the pitch accross the network? Control Rotation?
-What variable should keep this value? Default camera?
-After that, I just use my Default camera rotation for the AimOffset right?
Here's a picture of my BP_character. And last question : to trace a line, I just have to use my default camera location for the starting point, and my default camera getForwardVector multiplied by a value for the end point right?

ember osprey
rich ridge
#

with GAS? as per my understanding it isn't compatible with GAS at the moment. @ember osprey

ember osprey
rich ridge
#

but the RootMotion tasks are coupled with MovementComponent?

#

so how does it work?

meager spade
#

@polar wing don't expect network prediction to be stable for at least a year

chrome bay
#

I don't think they've checked anything into that plugin for ~3 months now

#

Probs busy with UE5

ember osprey
#

I have to port all my AI navigation code over to the Network Prediction code.

#

I only had my player movement setup through NPP.

ember osprey
chrome bay
#

Shouldn't have to, the point of network prediction is to write the simulation code only

#

And not have to think about the networking side (as much), let alone AI side

ember osprey
#

I used GAS to set movement parameters on my player's movement that is setup using NPP.

polar wing
chrome bay
#

Nah, 8ball

ember osprey
#

the same way you would with CMC but with NPP

ember osprey
chrome bay
#

I'd be careful writing any code based on the NPP right now, it's going to change a lot still

rich ridge
meager spade
#

Dave said the core is pretty much set though

ember osprey
#

I tried to update to 426 and its different.

#

i'm using 4254 rn.

meager spade
#

in 4.26

ember osprey
#

too late

rich ridge
ember osprey
#

I would have to refactor everything to work with 426 NPP

meager spade
#

i assume that is what he means

chrome bay
#

Not going to bet the stability of my project on that though ๐Ÿ˜„

#

Not until they go full official anyway

meager spade
#

though, virtual FVector ComputeVelocity(float DeltaSeconds, const FVector& InitialVelocity, const TNetSimInput<CharacterMotionStateTypes>& Input, const TNetSimOutput<CharacterMotionStateTypes>& Output, const FVector& LocalSpaceMovementInput) const;

#

specifically const TNetSimInput<CharacterMotionStateTypes>& Input, const TNetSimOutput<CharacterMotionStateTypes>& Output

ember osprey
#

CMC doesn't work well with flying.

meager spade
#

this is used in a lot of functions

#

suprised its not a Templated wrapper

chrome bay
#

๐Ÿคข

meager spade
#

for both of them

ember osprey
#

yeah lot of that in there.

meager spade
#

as they are the same, and require the same type

#

just one is input and one is output

#

so it could have been one variable/param

#

```using CharacterMotionStateTypes = TNetworkPredictionStateTypes<FCharacterMotionInputCmd, FCharacterMotionSyncState, FCharacterMotionAuxState>;````

#

hmm

ember osprey
#

Well I get to implement the AI navigation manually using NPP this time. I love doing movement network replication. lol. jk it shouldn't be too hard SweatBlobAnim

#

@meager spade btw, I had to wrap everything in the Role Authority if, that makes the pawns sync ,but now the since everything is on the server movement is not replicated and I have to implement it myself because i'm using the CMC. Thanks for the help.

rich ridge
#

I m going to explore NPP, so anyone can point to the branch which contains latest NPP commits.

rich ridge
#

thanks, I already have master built on my machine.

ember osprey
#

๐Ÿ‘

ivory lintel
#

Hey Friends,

#

i'm trying to test the shortcut to run dedicated server from .ink with -server -log parameters but dont work...the console lock on this image below...

distant talon
#

So, it seems like an initial only replicated variable will act as intended and withold from spamming replications if you call a force net update... unless you set your actor dormant. because of course a dormant actor is what you want spamming your big initial only replicated struct.... UE, why....

ivory lintel
#

trying to use: "C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\Leandro\Documents\Unreal Projects\MyProject\MyProject.uproject" -server -log

chrome bay
#

@distant talon Dormancy closes the actor channel, so when you wake it up again it's treated as a new actor

potent token
#

hi guys,
i have 2 maps (Lobby and InGame)

distant talon
#

That's so confusing, but thank you for the explanation

potent token
#

i set dedicated server with default server map InGame

ivory lintel
potent token
#

then i try to open level

#

but the log says
"LogNet: Browse: 127.0.0.1/Game/Maps/Lobby"

#

when i open level from client

ivory lintel
#

bind 0.0.0.0 on 7777 port???

potent token
#

i dont know why it browse the wrong map

potent token
ivory lintel
#

how to fix?

potent token
#

sorry i respon to wrong message

#

i have question too regarding dedicated server

winged badger
#

@distant talon Dormancy is tricky to use properly

#

as Actor becoming relevant for some client won't wake it up from dormancy

#

meaning that client will have the wrong state

ivory lintel
#

Hey Friends,

Trying to test my project as dedicated server using the shortcut method like "C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\Leandro\Documents\Unreal Projects\MyProject\MyProject.uproject" -server -log

the console open but freeze on [2021.01.19-14.42.24:803][ 0]LogInit: First time updating LLM stats...players cannot connect...like image above...

This does not work anymore? How to fix? Have a new way to do this?

#

i'm using 4.26.0 UE version from launcher

twin juniper
pure frigate
#

Client-side prediction is a network programming technique used in video games intended to conceal negative effects of high latency connections. The technique attempts to make the player's input feel more instantaneous while governing the player's actions on a remote server.
The process of client-side prediction refers to having the client locall...

jaunty plank
#

hello guy i cannot get the defualt online subsystem to connect over the internet im using this code to find the first server for now and join, if there no server then it will just create a new one . it works in edditor but when over the internet it just cant find any sessions

meager spade
#

SubSystemNull is kinda not built for internet

#

its for LAN

jaunty plank
#

oh is there any way to do it without using steam i want to keep away from steam for this project

atomic acorn
#

is there a way to get the local player controller?

winged badger
#

don't create widgets for client controllers on listen server

atomic acorn
#

where do I create the widget?

#

oh

#

can I do if(!Authority) to stop that?

#

or whatever it is

winged badger
#

no

#

you should create widgets only for controller that IsLocalPlayerController()

#

and you should be creating them from a AHUD derived class

#

which would eliminate the problem, since HUD is always local only

atomic acorn
#

oh right

#

I've bollocks'd it up then, cheers

dark edge
winged badger
#

Controller doesn't have anything to do with making widgets

#

except being pushed around as Owner

#

in my game

#

its not hard to access the HUD directly and request a widget on screen, from anywhere

chrome bay
#

+1 for using HUD class as a widget manager

#

Works very well

woeful ferry
#

Hi,

I stumbled upon this in the documentation: "FNames are not generally compressed, so when you are using them as parameters to RPCs, keep in mind that they will generally send the string each call. This can be a lot of overhead."

What should I use instead FString, FText?

chrome bay
#

FName / FString are fine over network

#

So really it depends what you're sending / using the RPC for

#

Definitely don't use FText

woeful ferry
#

I have a huge replicated array of available recipes that the players on the server can use, in the game state. It consists of the RowName and a bool to check if that recipe is unlocked.

marble gazelle
#

You could use GameplayTags and enable to use indices to replicate them. this requires that data on all peers is the same

chrome bay
#

If it's a huge array, don't use a data table

marble gazelle
#

or FGuid, 128bit

chrome bay
#

Use a data asset and a big array, access elements by indices instead

#

Commonly-used FNames such as NAME_None will serialize as an integer, but these names are hardcoded. All other names will serialize as strings.

woeful ferry
#

I'll look into them, never used them.

chrome bay
#

A data table is just a glorified TMap<FName, SomeData>

marble gazelle
#

can't you add such hardcoded names?

chrome bay
#

Yeah you can modify UnrealNames.inl and add more

#

Less useful for a data table though IMO

marble gazelle
#

yeah

chrome bay
#

GameplayTags FTW though, where it makes sense anyway

wise bridge
#

Hello everyone, I still have an issue with my aim offset replication, so here's a few questions to help me fix this one time for all :
-What value should I use to replicate the pitch accross the network? Control Rotation?
-What variable should keep this value? Default camera?
-After that, I just use my Default camera rotation for the AimOffset right?
Here's a picture of my BP_character. And last question : to trace a line, I just have to use my default camera location for the starting point, and my default camera getForwardVector multiplied by a value for the end point right?

jaunty plank
#

i hav emovced to using the steam subsystem and am still having the same issues as befor eothers cannot connect

jaunty plank
#

from my debuging the find sessions is sucseeding

#

but anything after the for loop dosent get called

#

at this point im really consused to whats wrong

dark edge
jaunty plank
dark edge
#

You for sure won't want that loop

jaunty plank
#

would i just use a get

#

copy

dark edge
#

check if array size is 1 then get if it's size 1

#

if it's size 0, create

jaunty plank
#

ok

jaunty plank
jaunty plank
dark edge
#

Start with 1 button to create and 1 button to find, and see where it's failing

#

don't start with trying to make 1 button do everything when you haven't tested the individual parts

jaunty plank
#

i have fixed it it was somehting with the shole system

opaque flicker
#

hey we are using UE 4.22.3 , trying to save player EXP in steam leaderboards
using two blueprint nodes "Write Leaderboard Integer" and "Read Leaderboard Integer"
We have a stat on Steam 'PlayerEXP_PlayerEXP" and a leaderboard "PlayerEXP"
After launching the game so that steam kicks in, then create a steam session, "Read leaderboard value" always return 0 and "write leaderboard value" always return true.
however values never save in the leaderboard on steam what so ever
any clue ?!

shadow arch
#

hey guys, any idea why the local client running a simple move to would see the character "hopping" or skipping around all glitch like

#

whereas the non local client would see him moving just fine?

#

i have a feeling it's a replication issue on the player character but not too sure how to sort that

dark edge
#

@shadow arch where is the move to being called from?

cosmic trail
#

Is there a decent way to sync ragdoll physics between client and server when the ragdoll is cut into pieces and blown up? Or is there just going to be too much variation there between client and server?

pallid mesa
#

Is it essential for your game?

cosmic trail
#

I would really like it to be, basically tanks explode and mechs explode leaving corpses

#

and the corpses take space and provide cover

pallid mesa
#

interesting, physics replication is challenging but if you do this thing server authorative and you just smooth out server results in the clients you could get around that

cosmic trail
#

I'm not sure how to smooth out the entire pose of the skeleton I guess, it's a lot of info..

shadow arch
#

@dark edge the move was being called on the client instigated by the server. But in the end i solved it. It turned out that there was a setting to enable clientside navMesh. With that setting off the server was moving the character but the client couldn't so that resulted in the client/server synch just teleporting the client character constantly

pallid mesa
#

Usually these limbs are separated objects you can replicate @cosmic trail

cosmic trail
#

@vo oh hmm I guess I've been using the physics assets' constraints breaking ability, which splits the limbs but keeps it as part of the skeleton

pallid mesa
#

let me explain you a real example: Headshots and flying limbs.

#

take a look at robo recall

#

usually what you do is you reduce the scale of the bone in the skeleton, and you spawn a limb actor

#

copying rotation and location of the original arm/head/etc

#

that way you can apply impulses to separated physics bodies

shadow arch
#

yeah so say you want to rip off a head you shrink the head of the original to 0, create a clone of the original actor and shrink everything except the head

pallid mesa
#

not exactly because it doesn't need to be a skeletal mesh

#

it can just be a mesh

#

of just the head, or the arm, or whatever

cosmic trail
#

ah ic, that's the way to replicate it more easily?

shadow arch
#

yeah but the mesh of the arm/head etc needs to be made . I'm assuming the quick and dirty way of i don't have models for those ;P

#

the good old GTA san andreas method lol

pallid mesa
#

that solves the problem of being able to treat limbs separately

#

however, physics replication is still challenging

winged badger
#

@cosmic trail i think Halo GDC touched that topic

pallid mesa
#

hello zlo!

winged badger
#

hey vorixo

pallid mesa
#

๐Ÿ˜„

cosmic trail
#

@winged badger recent GDC?

winged badger
#

fairly recent

cosmic trail
#

@vo thanks for the info, seems like I got a bit of work to do

winged badger
#

watched it a year ago or so, all the stuff was still relevant

#

good watch

pallid mesa
#

if it's a year old

#

then it's definitively state of the art in limbs replication XD

winged badger
#

i think they replicated the initial state of ragdoll

#

then let the clients handle the rest on their own

#

that would be your post-explosion state

cosmic trail
#

ah, I need them to be in sync afterwards too, I got them already in sync pre-ragdoll

pallid mesa
#

yeah... that will bring some errors between clients

#

yeah you can sync them twice

#

once initially

winged badger
#

they did talk about it for a couple of minutes

#

so more then i remember rn

cosmic trail
#

cool, which Halo btw if you still remember?

winged badger
#

think it was that one

cosmic trail
#

@winged badger Thanks!

winged badger
#

not 100%

#

but if its not, its well worth a watch ๐Ÿ˜„

cosmic trail
#

yeah, looks good. need to keep learning more about networking

#

Be nice if unreal could supply a deterministic physics setting in the future... ๐Ÿ˜„

pallid mesa
#

timestamped it @cosmic trail

winged badger
#

watch the whole thing ๐Ÿ™‚

cosmic trail
#

haha thanks @pallid mesa

pallid mesa
#

I was looking for it as well haahaha

meager spade
#

In this 2011 GDC session, Bungie's David Aldridge discusses the programming that drove Halo: Reach's online networking.

#

๐Ÿ˜„

cosmic trail
#

Is there a way to force an RPC to go through to the server from the client when the server is the one that is authoratative on the client actor?

#

@wise bridge u need to keep the variable in whatever actor is shooting, not default camera, and replicate that actor

wise bridge
#

What should take the value of the control rotation?

cosmic trail
#

@wise bridge are you replicating to the server or to the client?

wise bridge
#

Client

#

Not replicated > Server > Multicast

#

And I want the pitch of my actors to replicate correctly

cosmic trail
#

so there's a pitch variable on the server, and you want to replicate that to the client?

wise bridge
#

Not exactly on the server

#

Evey client got his pitch, and replicate it to everyone

cosmic trail
#

pitch is on one client? and u want it replicated to other clients

wise bridge
#

Yes

#

And also, there's no specific variable created by myself, just control rotation and the rotation of my default camera

cosmic trail
#

ok do it this way: Update the pitch to the server via the player controller, then on the server, update each actor's pitch via that player controller's update, set the actor's pitch variable to replicate to other clients. Set it to NoOwner replication

#

you can update the pitch using an RPC from the client to the server, Unreliable Server RPC

#

then after you update the actual Server's actors, who all have a pitch variable, u replicate that down using NoOwner

#

so that the original client does not re-update itself, but it's client authoratitive

wise bridge
#

Ok thanks, I'm not on my PC right now, I gonna check this tomorrow, I might ping you again if I got any issue. Thanks a lot again dude :D

steep flame
#

The Cheat manager exists on the client and I want to call an RPC to the server but at the same time, I want to exclude the function from the shipping build.
I tried using the preprocessor !UE_Build_Shipping but I can't wrap RPC's with it. This Error happens when I try it.
Error: UFUNCTION must not be inside preprocessor blocks, except for WITH_EDITORONLY_DATA

What can I do to exclude cheat functions properly?

acoustic marten
#

Anyone know if it is possible to do a server travel in unreal in a way that the player do not notice?

Scenario: Say the player is on one server just doing their thing and then the server decides the player needs to be transported to another server (same map, same position just a different instance with other players) and the new server accepts that without the player in question noticing (as long as there are no npcs or players around ofc), doable? If you have any advice then please do @acoustic marten

meager spade
#

@steep flame put them in CheatManager class

#

they wont be in shipping builds

hot robin
#

There is no way to push the ccu to more then 100players in one spot even with 10-15k poly Models simple skeletons and changing anything will most likely end up with breaking the replication system right?

bitter oriole
#

The polycount is irrelevant here, problem with 100 users is more the CPU performance, bandwidth, game design, etc

hot robin
#

The Main Problem ist that replication is often used in bp and there is not much when it comes to controll so i have to do it in cpp

#

unless I would do everything in cpp only then would I do more work than necessary

bitter oriole
#

You can do replication either in BP or C++, same thing really

hot robin
#

yes but without control if I were to run a console application that sends back and forth to the client with tcp and udp

bitter oriole
#

Replication is meant to interact with other UE4 instances

#

If you're not doing that, don't use replication

hot robin
#

That's what I mean, there is nothing left but to bypass the entire system

bitter oriole
#

There is nothing to bypass really, if you don't want to use UE4 for your server, just run UE4 as single player and ignore all UE4 multiplayer

#

And then build your own multiplayer system

hot robin
#

I just wonder if it's worth it, do you have any experience with it

bitter oriole
#

Depends what you're trying to do, but for the most part, it's probably a terrible idea

#

There aren't many scenarios where the UE4 replication model is the weak link of your project

#

Not to mention a non-UE4 server is incredibly tough since you need to duplicate the entire gameplay code in different frameworks or languages

plush wave
#

Does the steam multiplayer test ID actually work?

#

Like can you test multiplayer between two devices with it?

bitter oriole
#

Yes

#

Haven't been using anything else yet myself

plush wave
#

Hmm

#

Wonder why I can't see the other computer's session

#

Surely there is more setup required?

#

Otherwise everyone is using the same id... right?

bitter oriole
#

No more setup required, and no

#

I guess the UE OSS filters by game name

#

The only setup needed is enabling the Steam network layer and setting your appid in defaultengine

#

And having two Steam accounts running their own UE instance of course

plush wave
#

Right right

#

Did all of that

#

Must be missing something else

#

Thanks for the help

#

Do I need to add more than this?

#

`
[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
Achievement_0_Id=""

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
`

bitter oriole
#

No, that looks like the usual stuff

plush wave
#

Hmm

#

No additional config steps?

bitter oriole
#

Nope

plush wave
#

Do I need to have "OnlineSubsystem", "OnlineSubsystemSteam" as public dependancies?

#

Right now I'm just dynamically loading OnlineSubsystemSteam

bitter oriole
#

If it compiles it's fine

#

Do you see the Steam overlay in both instances

random nymph
#

I'm currently thinking about safest way to handle player progression in our multiplayer game. We are using playfab and aws services. What I initially thought about using is just the unreal playfab plugin, but in that case the playfab developer secret key is embedded somewhere in the project even though the pak files get encrypted?

What I then thought is to include a text file with a custom secret key only on server build and then use that key to authenticate http calls to aws lambda functions to alter player data. Would this be a fine solution?

bitter oriole
#

Clearly you never want a secret key on clients

#

Only dedicated servers you control should have it

random nymph
#

Yeah but in playfab plugin the secret key is setted in the project settings

bitter oriole
#

Just don't use the plugin on the client then

random nymph
#

Hmm maybe I can just leave it out from the settings and read it to the requests from a file on server.

chrome bay
#

Pretty much anything you put on a client machine, someone will find a way to access. Safest way is to ensure they never get it

bitter oriole
#

Assume anything ever stored, downloaded, streamed, seen by a client, is now public forever

pallid mesa
#

client authorative models are easy at the begining, not that easy when you need to implement an a.c. ๐Ÿ˜„

steep flame
meager spade
#

CheatManager can call RPC's also btw

#

have RPC's sorry

#

so why not move that RPC to cheat manager?

marble gazelle
#

the cheat manager is replicated?

meager spade
#

does not need to be replicated for RPC's

marble gazelle
#

so just needs a network name stable path? I see

silent valley
#

but it needs to be owned by Client to call server RPC right?

marble gazelle
#

since the PlayerController is "owned" by the client this is given I'd say

silent valley
#

yeah, I was talking about the CheatManager

meager spade
#

yeah you have to implement a function, ProccessRemoteFunction

#

err CallRemoteFunction

#

in the cheat manager

#
{
    if (GetOuterAPlayerController())
    {
        UNetDriver* NetDriver = GetOuterAPlayerController()->GetNetDriver();
        if (NetDriver)
        {
            NetDriver->ProcessRemoteFunction(GetOuterAPlayerController(), Function, Parameters, OutParams, Stack, this);
            return true;
        }
    }
    return false;
}

int32 UKaosCheatManager::GetFunctionCallspace(UFunction* Function, FFrame* Stack)
{
    return GetOuterAPlayerController() ? GetOuterAPlayerController()->GetFunctionCallspace(Function, Stack) : FunctionCallspace::Local;
}```
#

this can also be applied to any UObject to allow RPC's, as long as you can get an actor that ends up with the owner as PlayerController

twin juniper
#

Hi, I have a question related to client correction. When it is replaying saved movements (from UCharacterMovementComponent::ClientUpdatePositionAfterServerUpdate), apparently it is not using the stored movement mode, so UCharacterMovementComponent::PerformMovement will replay saved movement using current movement mode (that can not be the same as the one when saved move was done initially). Is that correct?

meager spade
#

it should pass in the movement mode no?

#

if not that seems like an oversight

twin juniper
#

apparently not, or at least I didn't see it. I've seen that the client is replying saved movements with the wrong movement mode, so I guess it is not being passed

jaunty plank
#

hello, what would be the best way to reload a level in multiplayer to get the level back to how it was originally, but still keeping all the same players connected

bitter oriole
#

ServerTravel + seamless travel

jaunty plank
#

would that reload everything i tried to just spawn all the players in reposses them again but some of them they wont become posessed

bitter oriole
#

It would fully reload the entire level and restart

jaunty plank
#

ok thanks for your help mate new to multiplayer trying to learn it

ivory lintel
#

i trying to do a replication of collision response on only players

#

how i replicate this to players that connect on game later?

#

how i can replicate this modify state to another player that connect in the future?

#

using variables?

bitter oriole
#

By replicating the state through UPROPERTY

ivory lintel
#

if i change a variable on the server...when future player connect this will sync automatic to all future players?

#

need to use repnotify?

bitter oriole
#

Yes

#

No need to use repnotify

#

This is regular replication

pallid mesa
ivory lintel
ivory lintel
#

ok will try

ivory lintel
#

beginplay?

ivory lintel
winged badger
#

not 100% controller has a function for it, Pawn does

#

but it comes to return PlayerState && !PlayerState->bIsBot;

#

Pawn function is called IsPlayerControlled

ivory lintel
#

ok ty

winged badger
#

for PC it should be obvious its not AI

ivory lintel
#

trying to check if get player state is valid

winged badger
#

AI can have a PS

#

ours do

#

its not there by default though

ivory lintel
#

on my project thay have because attributes are on PS

#

need to check if is a bot

acoustic marten
meager spade
#

beginplay is to early @ivory lintel

#

would need a small delay

winged badger
#

that should go into override of OnRep_PlayerState

ivory lintel
#

ok

meager spade
#

that is not possible in BP

bitter oriole
#

@acoustic marten Replication won't work with anything but an UE4 instance , no

#

You would typically use an HTTP connection for that

#

Or a plain TCP socket

#

Replication is a real-time multiplayer system meant for gameplay

ivory lintel
#

replication in ue4 is so confuse

#

when u learn something you dont know anything^^

bitter oriole
#

Replication is a very simple mechanism tbh

#

It just copies the server state to clients

#

There are settings and options but that's basically it

acoustic marten
jaunty plank
# bitter oriole It would fully reload the entire level and restart

i have added server travel it works however the client who is the server will stay in spectator mode and wont be assigned a character im using event handle stating new player but it seems to skip whoever is playing as the server but all other connected clients will be spawned

#

is there some sort of event whcih fires on the server

rich ridge
#

@jaunty plank Does President of UK do game development?

jaunty plank
#

sadly not would be some intresting games lol @rich ridge

bitter oriole
#

Traveling simply restarts the entire game, so the logic should work out the same as when the host player originally launched

jaunty plank
atomic acorn
#

How do I make it so every client has a version of an actor, so when they overlap a UI pops up for them and only them

#

Atm it keeps popping up for all clients

#

And I donโ€™t really care for the server handling the overlap either since cheating isnโ€™t likely to happen in this case

cinder quartz
#

When the overlap fires, check if it overlapped with player, then check if the player is locallyControlled, then pop ui?

atomic acorn
#

Ahh I knew I was missing an if, cheers

peak sentinel
#

Am I* missing something or is it normal that GetOwner()->GetActorTransform() not working on OnRep functions (when playing as client)? In tick, or in non-replicated functions giving correct values but whenever I use it on an OnRep function its returning my old state and server teleports me back to that old state instead of updating my location

meager spade
#

its possible the transform has not updated yet

peak sentinel
#

NetUpdateFrequency is set to 0.9 to demonstrate the movement update

#

This is my logs, printing location on each function I am using GetOwner()->GetLoc -- Tick Location is not called with OnRep but others are Server RPC or OnRep functions, they dont read the correct value

fathom fog
#

hello guys i've been looking for a course for multiplayer production over unreal engine 4 for a long time, does anyone know a good course for it
I prefer to be from youtube

meager spade
#

@fathom fog

#

has some free Udemy tutorials

#

some are multiplayer

jaunty plank
#

dose anyone have any idea why the server travel feature dosent take the person playing as the listen server out of spectator mode?

keen grove
#

anybody tried using GGPO netcode with Unreal before?

oak hill
#

hey guys, I was wondering if is possible to extend the OnlineSubsystemSteam without having to modify the original classes. Like a plugin or similar

#

really I need to extend the session interface only

meager spade
#

not that i know off

oak hill
#

oh ok

#

I've added some Steam functionalities outside of the OSS, but I'm not sure it's a good idea

meager spade
#

iirc its not exposed, so you can't derive from it, also i think you would have to change a lot of stuff

#

if you are on about FOnlineSessionSteam ?

oak hill
#

oh my god XD

#

yes, the FOnlineSessionSteam

meager spade
#

yeah it seems like that is not possible i could be wrong, but from my quick 2min look, it does not look promising

oak hill
#

I think you're right, all the classes are private

#

So I think I've no options but leave my addictional functions outside the OSS

#

and to write another OSS seems like a nightmare

hollow eagle
#

could probably copy the plugin source and modify it if you want to go that route

oak hill
#

it could work, maybe I'll give a try when I've some spare time

#

thanks for the suggestion

cosmic trail
#

about 60 FVectors per sync tick( every .5 seconds)

#

think that's ok?

fossil spoke
#

Wouldnt you want to just sync its overall location and let the sim handle all the floppy bits?

#

Way cheaper, would probably end up looking the same.

cosmic trail
#

similar but doesn't end up the same. I add an impulse on death too, the higher the impulse, the more divergent

#

I need it the same since I use it to generate cover points and path finding

meager spade
#

does the ragdoll need to look the same? i mean the mesh should not really block stuff

cosmic trail
#

I want to make big corpses and be able to take cover on them, not for smaller ragdolls

fossil spoke
#

Id lerp them to their final resting place once it comes to rest honestly, not during its time simulating.

cosmic trail
#

like ATATs going down

fossil spoke
#

Or try something like that to resolve it to the same place.

meager spade
#

yeah that is a good idea

cosmic trail
#

yeah I did try the lerping final resting place, when it's too divergent it looks quite off

meager spade
#

a lot of people don't ragdoll big things tho, they have death animations

fossil spoke
#

Yep

cosmic trail
#

but its so fun looking? well is 60 fvectors a big load? probably 5x60 over 2.5 seconds

meager spade
#

as long as they are unreliable

#

you only really care for the final resting vector

#

and interp the rest

cosmic trail
#

yeah unreliable

meager spade
#

i personally would not do it, but that is personal choice

fossil spoke
#

If its a hero piece and your not expecting to do this X many SMs at the same time, might be a reasonable cost.

#

But yeah i wouldnt do that either

cosmic trail
#

yeah, I don't expect there to be that many big mechs, but the game revolves around cover. The tanks do this but it's a lot easier with tanks because they don't ragdoll, just one box

meager spade
#

i like to treat my network bandwidth as a precious thing ๐Ÿ˜„

fossil spoke
#

As you should lol

cosmic trail
#

ok, I'll keep an eye out on it then, will change to quantized too

#

seems at the border of what you would allow

meager spade
#

yeah, but the best optimization is a death animation, could have multiple based on how it died

fossil spoke
#

Yeah, let the impulse on the Server decide which Anim to choose

cosmic trail
#

be nice if I had more animators to help ๐Ÿ˜„

fossil spoke
#

๐Ÿคทโ€โ™‚๏ธ

hollow eagle
#

another option... don't constantly send updates for all bones. Update a few at a time and let client sim handle stuff in-between updates.
Might work well, might not. Probably worth trying.

cosmic trail
#

@hollow eagle yeah, can do, I can change the update frequency too, it smooths to the new positions every sync

peak sentinel
#

I create a collision from bounds of the actor and simulate ragdoll locally on each connection, it has some problems and not giving what you want (exact same simulation) but it works when you need close results

cosmic trail
#

@peak sentinel that's a good idea!

#

might change to that and see since that's so cheap

#

thanks

dark edge
#

Have you tried actually looking at how much bandwidth it draws?

peak sentinel
#

Glad to helped ๐Ÿ™‚

cosmic trail
#

@dark edge no, but I have the packet size and frequency so just going off that

meager spade
#

@peak sentinel that works fine, but the bounds will be a square

#

meaning little gaps will not be passable

#

which might provide cover

cosmic trail
#

yeah I figure I can make a temporary weird bounds box

#

the cover points have a grid width apart, so they're not 100% accurate

#

not FPS accurate, it's more for RTS pathing

dark edge
#

I'd just send it unreliable and make sure you settle into the authoritative resting place and call it a day. The stock physics replication error correction can be pretty smooth if you tinker with it.

grizzled stirrup
#

Is it possible to send a TArray<FMyStruct> in an RPC without it being const?

#

Reason being if I want to do something to that array on the server I have to make a new copy of the struct array there which feels wasteful

hollow eagle
#

yes

#

just don't put const on it

grizzled stirrup
#

Oh so I can just send TArray<MyStruct> ?

#

I think the & was my problem

#

I was trying to send TArray<MyStruct>&

meager spade
#

no you cant

#

it has to be a const ref in a RPC, it throws an error otherwise

hollow eagle
#

ah does it?

meager spade
#

yeah

hollow eagle
#

been a while since i tried

#

removing the & would make a copy anyway lol

grizzled stirrup
#

So only solution is to make a copy on the server then?

#

True!

meager spade
#

yep

grizzled stirrup
#

Thanks

meager spade
#

i forgot const once on a RPC param

#

and i had issues, been a while tho, would like to re-check to make sure i am not crazy

grizzled stirrup
#

Man it feels so wasteful though ๐Ÿ˜ฆ

#

Copying a big array

#

Even though it's already there

pallid mesa
meager spade
#

i really should put that on my blog

#

its really useful

pallid mesa
#

it is

peak sentinel
#

You have a blog? Can you send it?

meager spade
#

yeah but i have nothing on it atm

#

i moved server, never set it back up

#

might do that the weekend

peak sentinel
#

๐Ÿ‘

pallid mesa
#

appreciate it Matt

limber lodge
#

Anyone here do a good referral? I am looking for somebody to integrate EOS or AWS for my project. Paid gig.

fossil spoke
#

Use the Job Board

meager spade
#

When i get my blog post, ill ask for that pin to be changed to the link, as i can provide more details

limber lodge
#

In here? OK will go there

pallid mesa
fossil spoke
limber lodge
#

Yeah cant post there.

steel vault
#

I'm reading through the FVector_NetQuantize stuff and they say it's only 20 bits per component. Is that saying each quantized vector only takes 20 bits of information to communicate across the network? I would think you would need at least 24 for 3 values, no?

meager spade
peak sentinel
#

When bReplicateMovement disabled I cant use GetOwner()->GetActorTransform() on server RPCs because server is not aware of the updated transform, even while I set bReplicates(true); on my actor and movement component. I am not missing something right, thats how its should be?

meager spade
#

it tells you that you need to message the bot

grizzled stirrup
limber lodge
#

yeah I cant follow the instructions lol:) It wont let me do the command to create a post.

#

Well thanks for the help. I will just run over to monster or some job site.

steel vault
grizzled stirrup
#

Ah true!

#

Huge savings

steel vault
#

I was just saying that me personally, I would make a uint8 quantize with all 3 parts to cut down. I was thinking about trying to help the guy replicate vectors cheaper but even epic was able to do 20 bits which is less than I could come up with. So I was curious how they did that.

grizzled stirrup
#

Likely by shaving decimals off the ends of the floats and combining that data somehow- magic indeed! You can see how they did it in the source I'm sure

steel vault
#

Yea, I'm going through the source as we speak but it I am indeed failing to see the how they did it. Either way, it seems like using their solution is best. So 60 vectors at 20 bits a piece will give you an idea of your network overhead.

#

I wanted to help him out by simplifying that even more. I was thinking maybe you convert the bone locations to local space which would limit your float values to maybe the hundreds? Then you could get away with even smaller bit representations.

#

Then you could combine multiple values into one byte possibly

#

It would be incredibly complex but might cut down a ton on network traffic

meager spade
#

uint8 is only 1 byte tho?

steel vault
#

Right, so I was thinking if you can limit the range of the float you can split one uint8 in two for two values.

#

Or 3 even

meager spade
#

you cant really use uint8

#

cause that would not allow negative

#

@steel vault did you look at WritePackedVector ?

steel vault
#

Haha yea I'm literally on it right now

meager spade
#

its really clever

#

but you cant use uint8 even if your doing this

#

unless you divide by a set number and can guarentee it will be less that 255

#

so you can multiply on the unpacking

steel vault
#

Yea that's something I was thinking of doing

#

But also a uint8 is 8 bits, no? How the hell do they pack 3 floats into 20 bits lol

pallid mesa
#

20 bits per component

meager spade
#

splitting the float values into components

#

^

steel vault
#

Ohhhhhh

cosmic trail
#

Ah packing more because local space is smaller. Maybe able to squeeze a bit there. Does unreal do compression per packet?

steel vault
#

I was thinking one vector was a component

meager spade
#

60bits per vector

#

err sorry

steel vault
#

Thanks that makes way more sense

cosmic trail
#

Iโ€™m wondering if the bigger the packet, the more can be compressed per send

pallid mesa
#

it depends on the entropy

meager spade
#
 *        -Scaling factor (usually 10, 100, etc)
 *        -Max number of bits per component (this is maximum, not a constant)
 *
 *        The format is <num of bits per component> <N bits for X> <N bits for Y> <N bits for Z>```
pallid mesa
#

in fp you just sacrifice precision

meager spade
#

what precision in floating points trollface

pallid mesa
#

kekw

steel vault
#

Sacking precision for floating points for bone locations to get a better ragdoll simulation sounds worth it

#

I was just saying marv that you could do your own form of quantization and pack more info in instead of using FVector_NetQuantize.

cosmic trail
#

Does the scaling factor allow u to do that in the quantized already maybe?

steel vault
#

They appear to use int32

#

What I was saying is you could use local bone space locations and try to get away with like int8

cosmic trail
#

Yeah that sounds good

pallid mesa
#

you could even do smarty pants things and do your own fixed point arithmetic

#

to do even a smarter packing

#

just take a look on how IEEE 754 defines floating point

#

and do a minor version of it

steel vault
#

Yea I have yet to enter into the realm of optimizing my data structures like this, I was just spitballing. At some point though, I will probably end up trying to do some tricky stuff like this because I too have a lot of transforms to be replicated and will eventually want to ultra optimize.

cosmic trail
#

A little afraid if bit representation on different cpus at that point. Feel like just losing precision is ok, and probably donโ€™t need accurate rotations or velocities either, everything is pretty well constrained. I had to pack physics body velocities

pallid mesa
#

that's called micro-optimising, and it adds tons of noise to the source code

#

"what the fuck is this" certified moments

steel vault
#

Yea, I would have them off in their own files to prevent that type of stuff or comment it well, but it can be worth it depending on your scenario.

cosmic trail
#

Lol

pallid mesa
#

so you would choose your endianness

#

the problem would be reading the content of types, but if you are writing directly on bits there is nothing to worry about

cosmic trail
#

Ah ic, but doesnโ€™t sometimes low bit mean high bit when u are using instructions to access?

pallid mesa
#

yes, but your most significative bit will be always in the same place in your interpretation

#

you aren't re-implementing int

#

mainly because it is "your" interpretation

#

you decide where to write the bits

#

however the standard output will print differently depending the endianness of your final system - based on the container type

#

but since you are reading bits within positions you are fine

cosmic trail
#

I think I get it. Going to make that a later resort though or maybe find an implementation of โ€˜small floatโ€™ somewhere

pallid mesa
#

k, been working recently in some compression algorithms for the CCSDS (Consultative Committee for Space Data Systems) standards, so I know this stuff ๐Ÿ˜„

steel vault
#

If your local bone space floats go above 255 try int16

#

Yea you are going to be the person I come to when I have to work on this stuff myself in the future ๐Ÿ˜‰

pallid mesa
#

NOW... for the context of your game marvg

#

I would just recommed you replicating the first and the last stance within your ragdoll simulation

#

using net-quantize

cosmic trail
#

I did try that vo, it doesnโ€™t work well, interpolating looks funky when it diverges too much in the middle

pallid mesa
#

then 3 snaps

cosmic trail
#

3 is probably ok, Iโ€™m doing 5 right now

pallid mesa
#

I wouldn't expect that much divergence when replicating the first stance :(

#

but it happens... reeeee

cosmic trail
#

First thing I did was set it up exactly the same so thatโ€™s the first. Then I apply the same impulse to all the clients, then sync in between to keep the divergence in check

#

I think itโ€™s not a lot most the time, but sometimes itโ€™s very odd

#

Like maybe something got touched at a particular angle and caused a huge angular velocity

steel vault
#

Yea that's why I wanted to cut down on his vector traffic so he could have the same amount of precision with less traffic.

pallid mesa
#

have you tried different interpolation methods?

cosmic trail
#

I can also clamp angular velocities of the body instances to help

pallid mesa
#

I suppose you did

cosmic trail
#

Yeah I tried a bunch even using blending with animation to the sync poses

#

It felt very non-simulated when u do that. I wanted the physics feel of things falling and bouncing

pallid mesa
#

๐Ÿ‘

#

you could also skip certain joints if you think replicating those is just unnecesary

peak sentinel
#

Just a random question, are you replicating all bones or some of them? @cosmic trail

cosmic trail
#

Gonna try clamping my velocities too, I feel thatโ€™s when things can really diverge when it hits a joint in the right way to cause it to float off far

#

@peak sentinel all right now since joints can break off

peak sentinel
#

๐Ÿ‘

steel vault
#

I assume you are also replicating rotations?

cosmic trail
#

Yes

steel vault
#

Yea so I do think you really need to optimize those structures so you can try to get as many updates as possible in.

cosmic trail
#

Yeah will see what I can squeeze out. Thanks

#

There's a netquantizeNormal, 16 bits per component

meager spade
#

only for normals

#

๐Ÿ˜„

#

-1 to 1

cosmic trail
#

yeah true, rotations only

meager spade
#

no things like impact normals, normalized vectors

cosmic trail
#

yeah but they mostly describe an orientation?

cosmic trail
#

nvm, realize this as I'm actually trying to convert it

#

it can describe an orientation but not a directional rotation, since u can have many ways to arrive at that orientation

#

I wonder if it's enough for bone transforms tho, will have to see

scenic horizon
#

Hi all, probably a nooby question but learning unreal (and how networking is done in unreal) right now, not new to networking in general. Question that's confusing me as to whether I have something set up incorrectly - is the "Print String" screen log shared by all connected clients? I'm playing in the editor as a listen server with one additional client. Have a "Switch Has Auth" on BeginPlay in the ThirdPersonCharacter blueprint (testing in the demo project) that just prints out "We have auth of objectname" or "We don't have auth of objectname" for each spawned player but instead I'm getting more entries in the log than I'd expect.

#

I'd assume that the game starts up, listen server client spawns in, prints out "We have auth of [character he just spawned] (167)", then the second client is launched, spawns in and the server should print out "We have auth of [client character (C_0)]", and THATS it as we have two characters, so EventBeginPlay should be fired (and prints out) twice. But the server is also displaying TWO additional logs, the print strings from Client 1? If this is how it works and logs are "replicated" (or just writing to the same log file on disk maybe?), is there a way to turn it off to just display the logs called locally?

meager spade
#

@scenic horizon those logs are correct

#

Server and client both run beginplay, so client is going to print it twice (one for server client and one for himself), server will do the same.

#

so 4 prints there is 100 percent correct.

scenic horizon
#

@meager spade Thanks for the reply. I'm a bit confused then, because what you said seems contradictory in my mind. If the client is printing it twice, why does the client show 4 logs?

meager spade
#

it doesn't

#

it shows 2 in that screenshot

#

and server shows 2

scenic horizon
#

Why does the clients window show logs printed from the server?

meager spade
#

cause printscreen prints to all screens

#

its just the way PIE is

#

single process

scenic horizon
#

Interesting. I guess that clears it up, just I wasn't expecting the client to show logs that were exectued from a server. Do you know if this is just a debug thing in the editor?

meager spade
#

yes it is

scenic horizon
#

Like if I was to test on an actual network, it would only show the logs executed from that launched instance of the game (and not from all connected clients?)

meager spade
#

correct

scenic horizon
#

Cool cool, thanks so much. For a moment there I thought I somehow had twice as many players being spawned and didn't know why! ๐Ÿ˜†

meager spade
#

np, happy developing ๐Ÿ˜„

thin jacinth
#

I've been looking at aws gamelift. I've got few questions: should I use spot or on-demand instances.

Should I use Windows or Linux pricing? What is the main difference between them. (MAIN QUESTION)

thanks and please make sure to @ me if you reply or help me. ๐Ÿ˜Š

thin jacinth
#

Thanks I'll check the link out soon, is there a down side if using a Linux based server instead of a window? @hollow eagle

hollow eagle
#

it's not an upside or downside, it's dependent on what platform you're familiar with

#

no one here is going to answer which is better, because the answer depends on you.

#

windows is more expensive due to licencing costs and higher resource usage, but may be "easier" to work with. Linux is... linux.

thin jacinth
#

Ah ok got ya, thanks for the huge help. @hollow eagle

chrome quest
#

Question please. If I want to store really persistent data about a player beyond each game session. Is there a class I can use?
I know PlayerState allows for data persistence beyond the lifetime of a pawn but is there any that exists beyond the lifetime of the PlayerState. e.g I want to store player level, achievements, skins unlocked e.t.c.
And if I'm using external solution like cloud storage, is there any that can store unreal data types?

bitter oriole
#

You're asking in #multiplayer so I'm guessing this is for a multiplayer game where progress matters and you don't want player levels to be changed by players

#

If that's the case, you need the UE4 dedicated server (and never the client) to tell a central server (that you will develop) about the player's progress, and I guess that server (using Python or something like that) will store the progress to a database

#

You won't be able to store Unreal types directly but UE4 can serialize to json, for example, which is easily processed in Python through an HTTP socket

chrome quest
#

@bitter oriole . Thanks. I see what you mean. It's the serialization to json that I was missing

silent valley
#

@chrome quest An easier way that might work for you is to use Dedicated server, but use the built in Unreal savegame code.
I create a savegame per player and load it when they connect, and save it when they leave.
This way the native type serialization works just fine.

bitter oriole
#

But then you need to always connect to the same dedicated server, which is a bit dumb

silent valley
#

true, but my savegame system also reads/writes to s3 directly

#

so it's not tied to a server

chrome quest
#

@silent valley, I was considering that also but then I didn't know what class will hold the save game for each player and how to recognize each individual player. Also, you'll need a save game to hold the save games and I don't think save games can store classes

bitter oriole
#

Works too I guess. I usually advise against binary serialization, json is built-in for all UE4 types and is a lot more reliable and debuggable.

silent valley
#

it's not perfect but it works for my game design which is more like Rust - persistent world where player progress IS tied to a specific server instance

#

fair enough, didn't realise json was an option tbh!

silent valley
#

we mainly store inventory in there, so the items are all serialized into the savegame

#

savegame name is tied to SteamID

#

I'm sure Strangers solution is more robust and better for more gametypes, but we're a small team and it was quick to implement savegames

chrome quest
#

Wow. I didn't know that. Someone, somewhere told me otherwise

#

That they only hold primitive data types

silent valley
#

not at all, to save entire player for instance:

FMemoryWriter MemoryWriter(PropertyData, true);
FSBSaveGameArchive MyArchive(MemoryWriter);
playerCharacter->Serialize(MyArchive);
#

there's lots of examples for how to do it

bitter oriole
#

Though this means you serialize the entire player - any update adding UPROPERTY field is likely to break saves entirely

#

Very much not how I would attempt this

#

Like, this will also serialize basic replicated Pawn properties, for example

#

Or the components

silent valley
#

no

#

only properties tagged with Savegame

chrome quest
#

@bitter oriole , @silent valley , thanks I think I can see a solution forming up. I'll bother you with more questions when they come up. ๐Ÿ˜๐Ÿ˜

bitter oriole
#

Alright then

silent valley
#

all other properties we recreate if necessary in the Serialize function

#

works fine, but I get your point about compatibility

paper lava
#

Hey, what are you all using for server browsing? Is there something prebuilt to query the server for player info and such?

fading smelt
#

How to get rid of UGamestatistic:GetPlayerPawn(0) and GetPlayerController in My Map and Minimap manager which lives on the level as Actor?

#

This manager changes a texture of your map/minimap when you go to another location.

winged badger
#

if you have some c++ involved

#

just make better accessors

#

a static function returning local player controller via GetGameInstance()->GetFirstLocalPlayerController()

floral zephyr
#

hi, I just tried setting up a dedicated server for UE4 without having much knowledge about networking in the first place.
whenever I run the test_server.exe and open a game-client and type in "open 127.0.0.1" the server log says: "NotifyAcceptingConnection accepted from: 127.0.0.1:49191" etc.
and if I try to open another game-client and type "open 127.0.0.1" in that I get the same accepted message in the server, but from another port, and I don't see the 2 characters within the same game / server.
did I do something horribly wrong or am I just mistaken?

fading smelt
winged badger
#

it will return null on dedi

#

as there is no local PC

fading smelt
#

ok

winged badger
#
APlayerController* USolsticeObjectLibrary::GetLocalPlayerController(const UObject* WorldContextObject)
{
    UGameInstance* GI = UGameplayStatics::GetGameInstance(WorldContextObject);

    return GI ? GI->GetFirstLocalPlayerController() : nullptr;
}
#

basicaly that

#
    UFUNCTION(BlueprintPure, Meta = (WorldContext = "WorldContextObject", CompactNodeTitle = "LocalPlayerController"), Category = "Local Player")
    static APlayerController* GetLocalPlayerController(const UObject* WorldContextObject);
fading smelt
winged badger
#

acess pawns via playerstates in playerarray

#

minimap requires no replication whatsoever

#

more effective pattern is

#

make an MinimapComponent

#

add it to the Actors that need to be shown on minimap

#

have the component register the Actor with the minimap system on BeginPlay

#

and then minimap system just displays Actors that registered

#

that way adding a say MissionObjective on the minimap is as simple as adding that same component on MissionObjectiveActor (just sitting on the objective location) and changing the icon on the component so it doesn't look like Pawns