#multiplayer

1 messages · Page 375 of 1

gleaming bobcat
#

but this is very single player related

manic pine
#

maybe in the future it'll be easier to work with

gleaming bobcat
#

you can't slow time to other players 😃

#

Like in Matrix and all other ppl are affected by your pending skill 😃

manic pine
#

hmm do you know of any games where they use it extensively?

gleaming bobcat
#

basically this is typical for asia games

#

But check Lost Ark

#

its mmo arpg

manic pine
#

think this is root motion?

gleaming bobcat
#

they can't do this kind of things due to multiplayer but you can feel the style in animation

#

is it single player game ? If yes you don't have to care about replication and RootMotion > No root motion

manic pine
#

ye pure sp

gleaming bobcat
#

then its prety easy

#

everying looks fucking awesome

manic pine
#

yeah, no cheap animation blending or floatiness

#

like there's a weight to everything

gleaming bobcat
#

just play the animation created by animator that's it

#

I am not sure how effective could be play semi root motion based on animation flags and then using some interpolated movement

#

but it's still too clunky so basically in multiplayer we should avoid root motion (which looks cool) but use not root motion animation instead which can be semi-cool :0

hasty adder
#

Anyone ever do some kinda rcon admin type commands? Like maybe a parser for chat to allow admin to kick users or even allow console commands to be entered in ded server console@window

twin juniper
#

@hasty adder i have been working on this

#

it needs to be done using unreal's messaging system i believe

#

im planning on making a tool to manage large amounts of servers over the cloud

hasty adder
#

I see there skme@built in kick and ban functions never checked to see if they’re exposed to bp also they’re based on session. Not even sure my dedicated server is running a session tbh. Usually a client quick I always see a return no session to leave 😉

next falcon
#

This is Always Not Valid
can someone explain me why? and how could i fix that ?

magic helm
#

I don't think the game mode spawned the pawn yet when post login occurs, have you tried adding a delay loop just for test purposes

next falcon
magic helm
#

No I mean using the original image, after the print string. Add a delay and connect it back to the Is valid node

#

But again that's for testing, I don't recommend using this permanently

next falcon
#

that gives infiniteloop

#

still not working

magic helm
#

Did you remove the while loop?

next falcon
#

yes

magic helm
#

But it shouldn't have given an infinite loop error because of the delay

next falcon
#

okay works now
but is there a way to use something permanently?

magic helm
#

In the pawn there is a On possess and a OnUnpossess event you can use that occurs on the server. You can just create a dummy pawn as the default one and tell it to destory itself on possess, I'm assuming that's what you would want?

next falcon
#

well yea somthing like that

#

ill try it thanks buddy

magic helm
#

It might the spawn handling, where it's spawning inside of something so it's not gonna spawn... That sort thing

next falcon
#

the character is spawning but its ot possesing the character..

#

well with a little delay of 0.0000001 it works xD

candid fox
#

Could someone help me clear something up?

When i first start game my game state is: WaitingToStart
When i call Start Match on GameMode it will become: InProgress
When i then call EndMatch on GameMode it will become: WaitingPostMatch
And when i then ServerTravel to new match the game mode will have become None.

How do i transition from None to WaitingToStart?

Thanks for any pointers.(edited)
My goal is to be able to restart a match after it has ended.

winged badger
#

you can Handle one of the post match states

#

and server travel back to the same level from there

#

i don't think you can turn back the clock on MatchProgress tho

candid fox
#

ServerTravel is successful, all clients load a new level and spawn as spectators @ PlayerStart

#

But i can't call StartMatch after doing server travel.

#

I'm rather confused as how to solve this, i've spend a day googling and scanning forums and documentation.

agile crane
#

Hey! I'm sorry for ask help again but I have something that I really don't know if possible.

I know in multiplayer games the characters mesh are separate, there is like fps arm, and third person mesh, and in other people view they see our third person mesh, and so when you are in first person you can only see your arms and they cannot go through walls.

Is that possible in unreal engine? Cause I know in Unity its possible I believe.

winged badger
#

Why can't you call StartMatch? there is also a RestartLevel node that i never dared to use

#

@agile crane that just depends on where the player's camera is, and has nothing to do with multiplayer

agile crane
#

Hmmm no? How could I make two mesh? one for first person and one for third person, and in the other people views they see my third person mesh

winged badger
#

its the same set of meshes viewed from a different angle

agile crane
#

nope

#

In a multiplayer game, you actually setup two mesh, one for the first person camera and one for the third person view

#

If you play multiplayer games like real games you will see what I mean.

winged badger
#

shrug if you want to do it

#

check if Pawn is LocallyControlled

#

if it is, spawn the first person mesh

#

if it isn't spawn the third person one

#

(from construct or beginplay, otherwise the approach won't work)

agile crane
#

I mean, the two meshes are already in my pawn, I just need to check like, when in fps camera you can see the fps mesh and when outside and not using the fps camera you can't see it, or like, only the first person camera can see the first person mesh.

I don't really know how to explain tho sorry

#

and also the first person mesh is also supposed to be seen through walls, since its only visible with the first person camera with the first person camera you're supposed to see the mesh even through walls

#

so when you walk into a wall you'll always see the mesh

winged badger
#

in that case, say on Tick, again only if Pawn is LocallyControlled, check which camera the player is using and hide/show the meshes

agile crane
#

Ohhhhh

#

got it

winged badger
#

there is a small problem

#

if your server is listen server

agile crane
#

how could I see my first person mesh through walls also?

winged badger
#

since listen server doing show/hide the meshes will affect everyone

#

with dedicated you don't have that problem

agile crane
#

I don't use listen server nor anything, I only use hamachi and I make a premium hamachi server where when people can join it you could find my game servers

winged badger
#

i think its custom stencil something, outside of my expertise

#

depth

agile crane
#

What depth? Custom depth thing can only be with colors sadly, like green or something

winged badger
#

i did say outside of my expertise, so you got my best guess, i don't swear its accurate

agile crane
#

Okay, thanks also, what node should I use to check I'm in place for see my first person mesh?

#

last question

winged badger
#

you have to have some form of input that allows switching from first to third person view

agile crane
#

I have one already

winged badger
#

it should keep a state, enumeration or some such

agile crane
#

hmm

winged badger
#

so you just check the value of that state

agile crane
#

I don't really got it tho.

winged badger
#

can be a bolean if there are only 2 states

agile crane
#

I'm using tree cameras in my pawn, one for first person and one for third person behind and front view

winged badger
#

ok, so you make an enumeration

#

with 3 members

#

and when your player wants to switch to say, third person front view, you set the value of enum variable to ThirdPersonFront

#

and when you're checking if you are in first person mode you just check if your enum value == FirstPerson

agile crane
#

but, will it replicates to others? I don't want people to see my first person mesh, only third person

winged badger
#

you do the check only if the Pawn is LocallyControlled, remember?

#

there is no replication involved here

thin stratus
#

Well, OwnerOnlySee and OwnerNoSee

agile crane
#

Oh

winged badger
#

so the entire tracking of state is local for each player

#

and replication works only server -> client direction

#

not the other way around

agile crane
#

That OwnerOnlySee node... I never heard of that thanks

thin stratus
#

It's not a node

agile crane
#

Thanks ZLO and Cedric

#

I meant

#

button or smth

thin stratus
#

It's a setting on a Component

agile crane
#

Yeah

thin stratus
#

Your First Person Mesh would be OwnerOnlySee

agile crane
#

Yes!

thin stratus
#

While the Third Person Stays for all

#

But is indivually hidden for the Local Player

agile crane
#

yeah

#

Thanks for the help! Multiplayer is really hard for me

#

I don't really know how to make a multiplayer so its why

winged badger
#

takes some time to get used to at first

agile crane
#

True, but there are 3 things I don't understand and cannot fix

#

its 1; making an infection game type, 2 making a player list, its working but on others player info I see mine, 3, chat system

thin stratus
#
  1. PlayerArray in the GameState
agile crane
#

Yeah I know, when there are 4 people I see 4 in the list and 3 its 3, but their info are the same as mine

#

like name and kills

winged badger
#

name is usually provided by local player

#

so you have t be on client-side execution when you GetName() for it to work

thin stratus
#

PlayerName variable

#

On the PlayerState

agile crane
#

I watched the Unreal engine 4 channels multiplayer tutorial for make my names save and variable

#

I don't know if its cause its outdated or what

winged badger
#

its not

thin stratus
#

It's shit

#

:P

winged badger
#

nothing significant changed, except for DefaultEngine.ini configuraton

#

since then

agile crane
#

Oh okay

#

I did the same thing with chat system

#

I watched their tutorial, doesn't work

thin stratus
#

It's a bad tutorial :P

agile crane
#

so.... its not working in my opinion

#

Sure thing

winged badger
#

the naming conventions in that thing made my remaining few hairs fall out

thin stratus
#

Replicated Variables in Widgets

#

GameModes

#

Etc.

#

RPCs in GameMode

agile crane
#

is there any good player name or list tutorial out there?

thin stratus
#

Random stuff ticked reliable

#

This tutorial is bad. Just that. It teaches wrong information

winged badger
#

there are some resources pinned on this page

agile crane
#

Got it.

thin stratus
#

Read my compendium

#

And do one thing at a time

winged badger
#

Cedric's compendium

thin stratus
#

Get the Player list working first

#

Then try to do the chat

agile crane
#

Yeah for make sure the save is working and name etc

#

but is there any good tutorial or marketplace things for that kind of stuff?

winged badger
#

you blunder thru it long enough and it starts to sink in, was how it went for me

thin stratus
#

I wouldn'T suggest marketplace if you haven o idea how things work

#

You'd just be overwhelmed

agile crane
#

Probably

thin stratus
#

As said

#

If you ahve no idea how that works, don't buy it

#

No one needs to give you support for their marketplace pack if you can't program

#

Got that a few times with my lobby

#

If you don't understand how to properly RPC, don't buy my stuff ,cause I can't help you with that

#

So rather learn it first

#

And see the marketplace as a shortcut in time

#

Not a shortcut in learning

agile crane
#

True. But I know UE4 a bit, I have 3 years of experience (not in multiplayer tho)

thin stratus
#

Multiplayer is a second layer

agile crane
#

Indeed.

thin stratus
#

Takes a few months to learn

#

Or weeks*

agile crane
#

Well yeah.

#

Also... did I asked you once how do I make an infection game mode or no? Cause my game will be a horror game and its kind of the main thing I want to make

#

If I asked you already I won't bother ask again, just saying

#

hmm

thin stratus
#

Infection?

#

I mean the question is totally vague, that's like asking "How to make a Battle Royal" game mode

#

There are tons of things to do for it

#

If you need help, start on what ever you want to do and come back if you run into a problem

agile crane
#

Its a game mode where two people get choosen randomly or 1 at start of each round, all the rest I know how to do it

#

the people who get choosen randomly are infected

thin stratus
#

Well, just grab a random person from an array

#

Either the PlayerArray

agile crane
#

how...?

thin stratus
#

Or fill your own Array

agile crane
#

its what I never understand about array, which node should I get from array?

thin stratus
#

I thought you have 3 years of experience

agile crane
#

but I never did multiplayer things

#

but I know what is array kinda

thin stratus
#

Arrays aren't multiplayer

#

In your GameMode

winged badger
#

or from server perspective: GetGameMode->GetNumPlayers->RandomIntegerInRange->GetPlayerCharacter(randomresult)

thin stratus
#

You can store PlayerControllers when they connect

#

OnPostLogin for example

#

Or HandleStartingNewPlayer

#

And remove them when they leave

#

OnLogout*

#

And from that Array of PlayerControllers

#

You grab a random entry

#

And spawn the infected pawn

#

And the rest gets the normal ones

agile crane
#

is it normal?

thin stratus
#

Well yeah, that's totally wrong :D

agile crane
#

Can you explain something like ZLo did? like using > and say the node. Please, it will help me so much 😄

thin stratus
#
  1. GetPlayerCharacter (as well as PlayerController) should always use index 0. This index is for LOCAL Players, not online*.
  2. Second, you are using "GetPlayerController0" there, which, depending on what Side you are, is always the same person. E.g. if on Server, always the Server.
  3. What BeginPlay is that? You need to use your GameMode Blueprint and setup an Array of PlayerControllers using OnLogout and OnPostLogin (or HandleStartingNewPlayer)
    You'd then delay the start and only start when everyone is connected. And when you then start, you grab an random entry from that Array of PlayerControllers and spawn a Pawn for them
candid fox
#

Hi, i'm sorry for double posting but i'm rather desperate.

Could someone help me clear something up?

When i first start game my game state is: WaitingToStart
When i call Start Match on GameMode it will become: InProgress
When i then call EndMatch on GameMode it will become: WaitingPostMatch
And when i then ServerTravel to new match the game mode will have become None.

How do i transition from None to WaitingToStart so that i could start match again after doing ServerTravel.

thin stratus
#

Usually you don't modify them by hand I'd say.

#

Using "ReadyToStartMatch" as well as "ReadyToEndMatch" is better

#

State going to NONE is not really good :/ Haven't heard of that yet

#

Or at least not that it's not going back

#

Usually when you ServerTravel you have WaitingToStart again after the map is loaded

candid fox
#

Gotcha.

#

I'm using Steam sessions and seamless travel.

thin stratus
#

Yeah, you aren't forced to use the GameState

#

I usually only use ReadyToStartMatch

#

To delay spawning

#

And have my own State for the overall game

candid fox
#

Right, thanks for input.

agile crane
#

What is the node I need to find for a random choose and how do I make a cast to infected and posses and how could it work for the choosen only? Cause if I do that posses everyone become infected

#

I'm waiting..... please help... thanks

#

Its the 3e part I really don't understand, could you help me more?

winged badger
#

you get an element from the array at random index

#

(random being from 0 to length - 1 ofc)

agile crane
#

I don't understand

hidden thorn
#

To me it looks like you don't understand how blueprints work rather than the system itself.

#

Looking at the picture I don't understand how to add a new element in the array (but in c++ I know)

agile crane
#

Oh ok, so I suck anyway

hidden thorn
#

Just find out how to make a dynamic array using blueprints

agile crane
#

mk

worn nymph
#

hello can anyone help i have a strange bug. im trying to add controller support to my game. everything works fine in editor but when i join a packaged game the controller controls both people yet if i use the mouse it only controls one person?

pallid mesa
#

Split screen?

#

Or...

worn nymph
#

no

#

and it is just standard inputs

#

here is video in beggining im using mouse and wasd . then soon as i use my controller they both move and attack at same time

mild hull
#

could be that ue4 does only distinct between active window for mouse/keyboard and controller will be send to all, did you try on 2 pcs?

pallid mesa
#

Thats curious though I suppose you are not doing anything funky on your input system on the character

worn nymph
#

no none of my testers are online atm so cant test from 2 pcs

mild hull
#

VM? laptop?

pallid mesa
#

So should be about the input stack not refreshing appropiatedly for the local player on a controller situation

mild hull
#

i think ue4 simply reads controller input all the time while key/mouse gets only send to the active window

worn nymph
#

if that was the case though would be the same in the editor

mild hull
#

no there the editor manages the input and gives it to sub window

pallid mesa
#

If you want to test this appropiatedly open your controller class

#

And override InputKey

worn nymph
#

oh so hopefully 2 pcs and issue wont happend

pallid mesa
#

And check what key is being captured for each local controller

#

You can try aswell adding a IsLocalController on the input function

#

So you make sure that it is indeed an unreal bug

#
if(IsLocallyControlled()){ 
addMovementInputVector(...) 
}```
worn nymph
#

like that?

pallid mesa
#

Ayee

#

Now execute the code

worn nymph
#

ok ill repackage and try quickly

pallid mesa
#

👍 btw thats something dumb to do in this case, but that would make sure that only the local controller gets that input executed. So if you can still move the two dudes the problem is with input capturing internally on the engine

worn nymph
#

yep still doing it 😦

next falcon
#

Guys I have a replicated variable classarray in my playerstate
i want to access that variable in a widget but there is a error
i can get the length of the array but not the classes inside..
whats the problem?

(Markerd doesn't work)

pallid mesa
#

@worn nymph it wont probably happen on two different computers :P still a bug worth to report!

worn nymph
#

i hope so lol

thin stratus
#

@next falcon Can you print the Class name and also check if they are valid?

#

Don't know if class variables can be replicated

#

Would think they can though

next falcon
#

ill try it wait

#

no can't print class name

thin stratus
#

Hm

next falcon
#

and if that can't replicated how can i do something like that ?

thin stratus
#

Why is the class important on the client?

#

You'd usually save that stuff (item data) in a DataTable

#

And just replicate the Name of the row

next falcon
#

its a Researched items Array and i need it to display Widgets for them in a widget

manic pine
#

youre making a new class for every research item you have in the game?

next falcon
#

no i have Items as classes and they are in array and need to be displayed so i can craft them

thin stratus
#

Nope

#

@next falcon That's not the way to do it here though

#

Put the info and the class into a DataTable

#

adn replicate the row name

next falcon
#

Oh

#

okay ill change my full project now xD

thin stratus
#

:P

#

Good luck!

next falcon
#

xD thanks but i guess it will make my game not that laggy ^^

thin stratus
#

Well, Name Type variables are pretty optimized when replicating

#

And storing your item info in a look up datatable is handy :D

next falcon
#

what is a look up datatable ?

thin stratus
#

Just a datatable

next falcon
#

is there a good and performant way to safe actors ?
i mean if i save all that data and spawn it at begin it take a while until the array finished

thin stratus
#

:P Make sure the player sees a loading screen until that

next falcon
#

well that is the easy way 😄 other ways ?

ripe raptor
#

Is the owner of an actor replicated? Because it doesn't seem that it is

#

hm, it is

jolly siren
#

I have an actor with bReplicates = true. And in another class I have a pointer to that actor. If I replicate this pointer does it actually have to send the FNetworkGUID over the network? Or is the FNetworkGUID sent when the actor itself is replicated? I'm trying to understand if replicating the pointer actually sends anything over the network.

manic pine
#

i dont know, but i always thought it seemed logical that it sent a replicated object Id and that the client then translated that into a pointer to its version of the object

#

it has to send something

jolly siren
#

Right, I'm wondering if the id replication happens when the actor is replicated or when the pointer property is replicated. If it happens when the actor is replicated then there would be no additional overhead for replicating the pointer.

manic pine
#

yeah thats what i mean, that the pointer replication should just be 4/8 bytes or some such, i.e. a simple id

#

that references the clients version of the object

jolly siren
#

Right, it's a uint32 so 4 bytes

manic pine
#

yeah, thats all that should be necessary to replicate a pointer

#

anything else seems redundant and silly

#

but that also means we're limited to replicating 4 billion objects

#

;||

jolly siren
#

yeah, I'm optimizing projectile replication. So it's a pretty hot bit of code. Just wanted to get an understanding to which way that worked. I assumed it was replicated with the pointer instead of actor, but wanted to be sure.

manic pine
#

would need to be both yeah, server needs to tell client what Id to use for it on initial replication of the actor

#

then replicated pointer just uses the value

#

if i may ask, how are you doing prediction for clients/server(if at all)? all i see are problems

#

with projectiles

#

im doing an explosive force mechanic for the projectiles, but i just cant figure out a way that it ends up well for all parties

jolly siren
#

I have various conditions that can trigger a projectile (hitting player, hitting actor, player input, duration, etc.). I replicate a bool when it is triggered and then do logic on server and client depending on what type of logic is needed.

#

Right now I'm replicating a int32 for the count of projectiles instead of the pointers because I was worried about instances where a ton of projectiles are spawning at the same time. Which is why I was asking about the Network guid stuff

manic pine
#

right, but lets say someone shoots a projectile at you

#

with a naive approach, no prediction, you are already hit on the server by the time you see it hit you on the client

#

if you forward predict the client's replicated version by ping/2, you will see the server's location of the projectile, but any dodge movement you perform wont reach server before another ping/2 passes, so you'll be hit even though it looked like you dodged

#

if you forward predict by the full ping, you will see the projectile ahead of the server and can dodge it... but it could lead to all sorts of weird stuff in terms of that projectile hitting someone else

jolly siren
#

Are you using projectile movement?

manic pine
#

i am, but its more the principle im talking about

mild hull
#

how do you want to predict the projectile before the server tells you?

manic pine
#

in my case the projectiles all have a constant velocity vector, so predicting forward in time is as simple as doing movecomp->tickcomponent(predictiontime)

mild hull
#

why not have game time and base its position based on that?

manic pine
#

that would be the non-prediction approach

#

while prediction is gametime+predictiontime

#

my original approach was to have shooter fire, then server receives command and does tick(shooterping/2) to match shooter's location for projectile

#

then other clients did another tick(nonshooterping)

#

that works great for dodging and, in my case, shooting down projectiles... but it fails in terms of the other simulated clients

#

forward-predicted rockets end up hitting(but not server-hitting) not-predicted simulated actors

#

with no forward prediction on server, shooters aim will be ping dependent... with no prediction on other clients, they'll be hit on server despite dodging client-wise

#

sad

jolly siren
#

I guess I just don't understand why the ID would need to be sent again when replicating the reference. The actor and ID must already exists since they have already been replicated. I'll do some digging and testing

manic pine
#

that is whats replicated, afaik

#

a single 4byte value to identify the object... obviously it cant send the pointer value itself, since that refers to memory on the server

jolly siren
#

Right, but when the actor is created. It is replicated to the clients and created on them. So I don't see why replicating a pointer would need to send anything additional.

manic pine
#

you need to tell the client what the value of the var is right

#

imagine the pointer starts out as nullptr... so when the object that has the pointer is replicated, nullptr will be replicated initially

#

then, server sets the pointer

#

now, client needs to know what server set it to

#

but it cant send the memory address, because memory layout is different for server and client

#

so it resolves the pointer, finds object id, sends that

jolly siren
#
ActiveProjectiles.Add(Projectile);
ActiveProjectilesCount++;```

This is what I am doing currently. ActiveProjectiles is an array of projectile pointers and isn't replicated. But the projectile actors themselves are replicated.
And ActiveProjectilesCount is a replicated int32 which is the number of projectiles currently spawned.

I was trying to avoid replicating a separate ID (int32) for every single projectile. Because in cases where a ton are spawning at the same time that is pretty heavy vs a single int32 that just represents the count.
manic pine
#

what exactly would oyu need the ID for?

#

and the count

#

i dont quite see what youre using it for, which is why i struggle seeing the problem i think

#

are you trying to match them to client-made fake projectiles?

#

depending on your exact mechanics, that count could be highly unreliable when replicated

jolly siren
#

Yeah, it looks like I'm not really using the count much anymore. It's only used for checking to see if certain abilities have any projectiles in the world. For example, I have an ability that triggers a c4. I check whether the player has spawned any c4 projectiles. And if not then I disable the ability icon for that trigger.

#

But yeah I know it's not really reliable. That is really the main reason I went with it because I wanted to be lighter on the network. I guess I'll look into just replicating the pointers and killing that property.

manic pine
#

it should work fine for that usage, though if its only use is as a boolean, it would be much cheaper if defined as that

#

its arguably something that could be kept entirely client side though

jolly siren
#

Right, yeah that's how it is used for now. I think I was planning ahead and trying to be flexible when I designed it. But it has been refactored several times and I didn't realize that is all I was using it for still.

#

Ahh so increment a count when you toss a c4 clientside. Yeah I would agree with that

manic pine
#

yeah, in e.g. beginplay on client it adds to counter, and in endplay it detracts, or osmething like that

#

what were you planning on using the IDs for though?

gleaming bobcat
#

Anybody know how I can fix root motion of my Montage with high latency (250+) when the server is correcting final position of player on Autonomous_Proxy side ?

jolly siren
#

Well more the pointer than the ID. There are various times where it would be nice to have the pointer clientside. I need to study my code some more tho and decide the best way to handle these. It's been a while since I wrote this code 😛

manic pine
#

keep in mind, beginplay fires for replicated projectiles/items too

#

so if you do a if(!HasAuthority()){add projectile to some kind of projectile container on client}

jolly siren
#

Right, yeah that makes sense. That might be all I need. I'll look into it and might ping you some time once I have a better understanding of my own code haha

manic pine
#

yeah, just remember in those cases that if/when that projectile is destroyed by server

#

the pointer in the container will become null (if container is UPROPERTY)

#

so you'll have to go through it and remove null references now and then

#

maybe remove projectile from that container on projectile's endplay

#

managing references is a mess eh

winged badger
#

that !HasAuthority would break the host playing on ListenServer

manic pine
#

yeah, if doing listenserver it might be more suitable with if(!HasAuthority() || !IsRunningDedicatedServer())

winged badger
#

IsLocalController / IsLocallyControlled

#

is my preferred solution for Tick and BeginPlay when i want something only on local machine

manic pine
#

right, but that only works if it has a player owner

#

which may not be the case

winged badger
#

checking PlayerController(0) usually does work

#

well, strike that

manic pine
#

yah, it need not have an owner at all

winged badger
#

Controller(0) tends to be a local controller always

#

except on dedicated server

manic pine
#

but if the actor doesnt have an owner, then it also has no controller

winged badger
#

true

#

managed to confuse myself just now 😄

manic pine
#

haha yeah, all this ownership and networking stuff goes in circles

gleaming vector
#

The 0th player controller is always the local controller on the client

opaque seal
#

And should typically be 0 as well on the server, for the server, if it's a listen.

#

If you're spawning actors from other actors (etc) and lose ownership along the way, you can always use the Owner/Instigator pins on spawnactors.

#

Specifically, at times I need to pass along the playercontroller between blurprints till it's fed into my spawnactor nodes. Depends how you're going about your code.

magic crest
#

Hey guys, can someone help me out a bit with steam online subsystem?

#

I've set it up and I can host and join sessions. All works well when using the null system. However, on steam, once a client joins a session, no other client can get that session in the find sessions results.

#

Problem is, I never called StartSession() - so I see no reason why the session would not appear in the search results.

magic crest
#

Noone? Anyone?

ripe raptor
#

There's a 50/50 chance my clients will play my montage animations

#

and I can't for the life of me figure out why

light grove
#

Try calling it with a reliable client function?

#

@ripe raptor

ripe raptor
#

I do that already, but I think I've found the culprit

lost inlet
#

is there some trick in having an actor that exists in the map to only be clientside?

#

i'm disabling replication and tearing off, but it gets removed from clients when i destroy it serverside

light grove
#

Are you trying to set replication to false during runtime?

lost inlet
#

in OnConstruction it's setting bReplicates, the same actor is designed is designed so that both can be supported

manic pine
#

disabling replication before tearing off?

lost inlet
#

tearoff + setlifespan(0.5f) in beginplay seemed to work

manic pine
#

shouldnt it be the other way around, so that client is notified of tearoff?

#

i believe tearoff takes care of disabling replication anyway

tall grove
#

@magic crest same issue for me with steam

worthy wasp
#

is there a valid difference between Deactivate() and DeactivateSystem() for UParticleSystemComponent in terms of NetMulticast functionality?

#

i cant get LOCAL veresion of this to DeactivateSystem() - keeps going but the NMulticast works fine

sterile silo
#

Hi! Is there any good tutorials or resources out there for using steam with C++. Currently I am just trying to start off by getting the players name from steam and displaying it in the UI.

fossil spoke
#

The name property on the PlayerState is filled with the users Steam name.

sterile silo
#

I guess I am more confused on how to exactly begin access that.

#

From within C++, I've tried Googling but everything seems either outdated or just not what I'm looking for. @fossil spoke

fossil spoke
#

The Steam subsystem already populates the PlayerState with the users Steam name, all im saying is that you dont have to do that yourself.

#

There are some free community projects like the AdvancedSessions plugin that you can download which use Steam

#

I recommend you grab those and analyse the code to see how they are using Steam.

#

This is better than trying to find tutorials as there is probably no good ones around.

magic crest
#

@tall grove Hey. I'm trying to get to the bottom of the problem. Trying out various scenarios...

zinc loom
#

is there anything bad replication wise about putting health and inventory in PlayerController instead of the pawn? I'm using shootergame as a base, and destroy my pawn when it enters a vehicle, but want to retain health when I spawn a new pawn on exit

fossil spoke
#

@zinc loom Nothing bad no, just unorthodox. It would probably serve you better to have it in the PlayerState instead, that way if needed other players have access to the Health of an Player in order to be able to display on Screen or some such

ripe raptor
#

hm, if I want to kick any player that joined the match after it went from Pending to InProgress, easiest place is to override ApproveLogin() in a custom gamesession class, yes?

zinc loom
#

cool, i'll put it there instead, cheers @fossil spoke

#

might re-evaluate my sanity and look at using gameplay attributes for it

fossil spoke
#

@ripe raptor Sure, just make sure to return an none empty string

#

AGameModeBase::Login() uses the ApproveLogin() return value to determine whether or not to Spawn an PC for the incoming player.

ripe raptor
#

Yeah it's what I'm trying to do... but stupidly enough I can't seem to find a way to get the current session state from AGameSession

fossil spoke
#

Session state is held on the GameMode from memory?

#

AGameSession is just an wrapper for the session interface

ripe raptor
#

It's the EOnlineSessionState::Type in FOnlineSession

fossil spoke
#

Ah

#

Oh my bad i was thinking of MatchState

#

haha

ripe raptor
#

I could go through the ISessionInterface but that seems wrong when I'm already in AGameSession

#

IOnlineSession*

#

actually I'm being silly, that's exactly what the session does

magic crest
#

Does anyone know why a session would not appear in search results after 1 client joining?

#

I have a session that has 4 public connections. I host it with 1 client. have another client connect. After that happens, no other client can see the session in search. Note: StartSession() was not called.

#

also, works fine with null system. problems arise on steam

hasty adder
#

so blue print open level seems to keep the same gamemode instead of using the map ovveride?

#

wait maybe wrong looking at this wrong

magic crest
#

I never had an issue that the game mode override was ignored

hasty adder
#

chasing dragons. trying to figure out why my ai isn't runing when i go from main menu to level select and load the level.. trying stand alone

#

must have somethign to do with how i open level

hasty adder
#

i see its not generating the navmesh on load.

raven holly
#

anyone know why the landed event wouldnt be called in this instance?

#

The movement controller gets stuck 'in air' 🤔

thin stratus
#

@magic crest StartSession wouldn't cause that anyway

#

It's even called by default when you create a session via epics code

magic crest
#

Thanks. So, gathering information from various sources (this Maksim Voitkevics dude from facebook group is awesome) revealed that in order to use traveling properly, we need to use the ?listen parameter, which in turn makes the session InProgress on creation (still don't know why the session is initially visible to clients, until one joins). So, what I have to do is make it AllowJoinInProgress true and then update the session once the host player decides, ok - no more connections, we go play

magic crest
#

Alright. Apparently, ?listen parameter of the Travel function makes Steam online subsystem implementation implicitly calls StartSession when someone joins, putting it in a state of InProgress, which in turns makes it invisible in the search results if it's set to bAllowJoinInProgress = false;

#

Using UpdateSession, we can change the allowJoin and truly make the game InProgress for the rest of the world

magic crest
#

Finally got it working. My client can now join, leave and re-join. Other clients see the session in results. Life is good.
One minor thing though, the session is not updating number of players that have joined.

nova sky
#

vlePa Do you have empty project with created steam dedicated server? I have problem that i can't find my servers if subsystem steam = false; and after it set true i can't join to server using ip. Who can help?

jolly siren
#

That isn't a problem. That is expected.

nova sky
#

Now i have this Error

jolly siren
#

And that one is just a warning

nova sky
#

Ok start with disable steam subsystem

#

Am i right, that without steam subsystem i can't find my session from another pc?

jolly siren
#

With null you can connect via IP

#

With steam you connect via sessions

nova sky
#

Yes

#

But with stream enable

#

i can't find session + can't connect using ip

#

i tried i local net and on hosting with opened ports

jolly siren
#

Yeah you shouldn't be able to connect via IP. But you can find sessions if you set it up correctly.

nova sky
#

I can't

jolly siren
#

right, you haven't set it up correctly

nova sky
#

And i need in help

#

))

jolly siren
#

what does your RegisterServer function look like?

nova sky
#

I am using Find BP to find session

jolly siren
#

that looks fine

#

does the Find BP node take params?

#

I'll need to dig into that. I use c++ for that

nova sky
#

No

open gazelle
#

I everyone! Dont know if I am in the right channel, but anyway 😃

I am working on a multiplayer game which will hold around 20 players per game.
I am currently trying to figure out what the smartest way would be to orchestrate the "dedicated unreal servers". Is there anyone who has any experience putting the unreal servers into containers and orchestrate them with e.g. kubernetes? Drawbacks?

nova sky
#

How can i search it using c++

#

?

#

Can u send me examples link or pic

#

?

jolly siren
#
void AFPSGameSession::FindSessions(TSharedPtr<const FUniqueNetId> UserId, FName InSessionName, bool bIsLAN, bool bIsPresence)
{
    // Get the OnlineSubsystem
    IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();

    if (OnlineSub)
    {
        // Get the SessionInterface from our OnlineSubsystem
        IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();

        if (Sessions.IsValid() && UserId.IsValid())
        {
            /*
            Fill in all the SearchSettings, like if we are searching for a LAN game and how many results we want to have!
            */
            SessionSearch = MakeShareable(new FOnlineSessionSearch());

            SessionSearch->bIsLanQuery = bIsLAN;
            SessionSearch->MaxSearchResults = 20;
            SessionSearch->PingBucketSize = 50;

            // We only want to set this Query Setting if "bIsPresence" is true
            if (bIsPresence)
            {
                SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, bIsPresence, EOnlineComparisonOp::Equals);
            }

            TSharedRef<FOnlineSessionSearch> SearchSettingsRef = SessionSearch.ToSharedRef();

            // Set the Delegate to the Delegate Handle of the FindSession function
            OnFindSessionsCompleteDelegateHandle = Sessions->AddOnFindSessionsCompleteDelegate_Handle(OnFindSessionsCompleteDelegate);

            // Finally call the SessionInterface function. The Delegate gets called once this is finished
            Sessions->FindSessions(*UserId, SearchSettingsRef);
        }
    }
    else
    {
        // If something goes wrong, just call the Delegate Function directly with "false".
        OnFindSessionsComplete(false);
    }
}```
nova sky
#

It's should be in my session class?

jolly siren
#

yeah

#

I would follow that wiki

nova sky
#

Ok

#

I try to do it on c++

jolly siren
#

okay, just make sure to use false for isLan and isPresence stuff obviously.

#

good luck

nova sky
#

I remembered that in one guide man added code

#

Super::RegisterServer();

#

In RegisterServer

#

And it started finding his session in Lan

#

but he didn't use steam api

#

what does this code do?

jolly siren
#

yeah I don't call super there

#

so you don't need that

nova sky
#

I am compiling server and try to find it in lan

#

But on weekends it didn't help me on hosting

#

In config or code?

#

void UNWGameInstance::OnCreateSessionComplete(FName SessionName, bool bWasSuccessful)

#

is it necessarily to use

#

this func?

#

I see here used Session->StartSession(..);

nova sky
#

What can mean this warning ?

#

LogOnline: Warning: STEAM: Server setting ,SESSIONFLAGS:523 overflows Steam SetGameTags call

jolly siren
#

How do you guys handle lag spikes with character movement? It's pretty easy to reproduce times where you jerk forward on the client. All I have to do is net pktlag=50 and net pktlagvariance=200 to simulate spikes and then sprint around the map and you will jerk forward certain times when it spikes. I thought character movement did smoothing? I can reproduce this in shootergame as well.

#

@winged badger we were talking about this a week ago. I looked into it a bit more and it's definitely not my service provider because I can reproduce it locally with pktlagvariance. With both my project and shootergame.

twin juniper
#

Is 200 a realistic value for ping to suddenly change?

#

Does it happen with netpktlag = 200 and lag variance to 10?

jolly siren
#

Spikes are definitely happening in my real world tests. Somewhere between 5 - 10 per match.

twin juniper
#

Also does it only happen when sprinting or even regular walking (if you put up the default max walk speed in the CMC)?

jolly siren
#

It happens with normal walking too. Seemingly less frequent, but it still happens.

twin juniper
#

And you aren’t bumping into anything / interacting in any way, just running on flat ground?

#

I had issues before but haven’t tested lag variance that high

jolly siren
#

I'll try and reproduce on flat ground.

twin juniper
#

Any bumping / falling etc always has some error for me

#

Should be silky smooth on flat ground though

manic pine
#

the problem is that the original CharMoveComp is not deterministic

jolly siren
#

Just tested and it's not. I walked (without sprinting) and away from any objects with lagvariance set to 200 and it is very jerky

manic pine
#

it has several issues that makes client and server simulate a move differently

jolly siren
#

I ran those tests on shootergame, just to make sure it's not anything with my project.

#

no idea how reliable this test is but according to it, large spikes are realistic

bitter oriole
#

Yes this is realistic

jolly siren
#

Okay, that's what I thought, because I am experiencing them a handful of times throughout matches. And the jump in movement is pretty disorienting.

bitter oriole
#

No perfect solution, you can modify your player movement so that server resets are smoother

#

If you used to get rep updates every 50ms and you suddenly have a 200ms hole, then when the next event comes and reset you to a new state, interpolate over the next 200ms toward that state

#

It gets complicated quickly, but there isn't a simple prediction model that works really well :/

jolly siren
#

Right, yeah something that at least smooths it out should be good enough. Movement is just way to jerky atm when spikes happen.

#

I'll take a look at UT and see if they handle this somewhere.

#

@rough iron have you coded solutions for this?

quartz vector
#

How does Ownership work with an Actor that is placed and not spawned into a level?

twin juniper
#

@jolly siren also would be interested in solutions!

quartz vector
#

if Server owns that Actor.... the only way to call server RPCs then would be through something that has an open channel for replication correct?

bitter oriole
#

@jolly siren I've done something that works well but I'm doing slow vehicle movement with a custom movement component, so it works with less complexity overall - though I ended up with three separate movement code paths

#

I expect the character movement to be good, but it's pretty huge and hard to tweak

twin juniper
#

I find tweaking the smooth time / distance does pretty much nothing, it always jerks back

#

I guess that is used more for very small adjustments

bitter oriole
#

To be honest I suspect you can't make something that doesn't

#

You just can make it smooth and rare

jolly siren
#

It's rare enough where smoothing is fine with me. It just can't stay as is.

bitter oriole
#

Is it a character based game ?

jolly siren
#

yes

#

Character based fp shooter. So it's pretty jarring when it happens.

bitter oriole
#

So using the Character class from UE4 with the Epic movement component

jolly siren
#

yes

bitter oriole
#

Yeah, I'm not familiar with it

bitter oriole
#

Uh, it looks like UT has a brand new movement class

jolly siren
#

well they inherit on top of Epics

bitter oriole
#

Yeah, but I see lots of networking stuff in here that also exist in a different form in the parent class

jolly siren
#

damn

bitter oriole
#

Looks like there is a system for sending movement frames & ack etc

#
void UUTCharacterMovement::SimulateMovement_Internal(float DeltaSeconds)```
#

^ basically that reads like "fuck UCharacterMovementComponent, let's do it ourselves"

#

Though it keeps the state machine

jolly siren
#

lol wonder why they didn't just fix UCharacterMovementComponent

bitter oriole
#

I don't

#

Wouldn't be surprised if PUBG uses UCharacterMovementComponent with zero change

#

Or half UE4 games for that matter

#

Improvements for UT might just be an annoying change elsewhere

jolly siren
#

Yeah, I'm fine with most of it. I don't really notice simulated clients jerking. It's probably not as noticeable because it's not from your perspective. It's mostly just the local client I'm worried about.

nova sky
#

Ok i didn't fix problem with session finding

#

can somebody check

jolly siren
#

why aren't you forwarding port 7777?

#

@nova sky

gleaming bobcat
#

Hello, How I can effectively change a speed of character when the latency does not affect the delay on Autonomous_Proxy side ?

twin juniper
hazy haven
#

@twin juniper that depends how good at coding you are

#

@gleaming bobcat inherit from the CharacterMovementComponent class, and use some of the spare flags to set movement speed

versed rock
#

Hello Everyone, I'm trying to get multiplayer movement working, pretty much, my character is a pawn (sphere) with physics. You click space you get pushed the way you are looking.

Player1 = server
player2 = client

Player1 moves around and player2 can see it
player2 moves around and player1 cant see that they have moved, still in origional spawn
if player1 hits player2, player2 cant move.

I can't see, to wrap my head around replication

fossil spoke
#

@Stewie#0986 The rules seem relatively simple, depending on your skills it shouldnt take to long.

versed rock
versed socket
#

@twin juniper That's a really good idea, dude! Players in 1st person view and Spectators in Top-Down 3rd person view. Sounds like a great game jam or portfolio project.

#

It's a little bit like that Friday the 13th game but with fewer gameplay mechanics and features. Still a very fun idea regardless!

versed rock
#

Anyone have any idea what im doing wrong?

versed socket
#

@versed rock The reason is because the physics stuff is running only on the client that presses the Spacebar. What you need to do is make the Spacebar ask the server to do the physics push for it instead.

#

What that means is you gotta make a new custom event, set it to "Run on Server", call it on Spacebar, and then make your new custom event do the physics thing.

versed rock
#

Would i do the custom event in the player still?

versed socket
#

Yeah you do it all right there in that picture you posted

#

Just hook up that physics thing to a new custom event, and make the spacebar actually call it. The important part is that the custom event is set to Run on Server.

#

If that still doesn't work then it means that for whatever reason your Pawn's physics are not being replicated, in which case you probably have to add that Pawn Movement Component and then instead of doing the physics thing you just add movement input or whatever to the component instead of doing it through the built-in physics thing.

versed rock
#

Ahh i see

#

only problem im having now is on client when you click SPACE it will go only at angle 0,0,0 not where you look

#

So its related to the get control rotation

versed socket
#

So probably you haven't replicated the pawn's rotation stuff somehow, which is the new problem.

#

Since it's a Pawn, maybe try doing Get Pawn Rotation instead of Get Control Rotation nevermind that won't work if you want to have that free third person camera, which it seems like you're trying to do.

versed rock
#

That should be okay to do the get rotation etc on client and then send it to server then server just runs the push pawn?

#

That works ingame but just want to make sure that it isnt a bad way to do it

versed socket
#

Not a bad way at all -- normally you just need to check a box or something somewhere to replicate the control rotation but w/e you're doing it manually so who cares.

#

In general, if it works don't question it until you're done with everything else in the project and you want to start polishing everything. That's when you can start to worry about whether something was done in a "good" way.

versed rock
#

Okay Thankyou so much, just started learning unreal about 3 weeks ago

gleaming bobcat
#

@hazy haven You mean to use FSavedMove_Character something similar lke DoJump() is implemented ? I need to change dynamically character movement based on Curve asset. Is the FSavedMove_Characeter way to go then ?

gleaming bobcat
magic crest
#

Hey! I have a multiplayer scenario where an actor spawns his weapon on begin play. This is done by the authority. All is well, until it goes to steam. What happens is that the 3rd joining player, on his machine, seems to control the gun animations of the 2nd player.
Where should I start digging for the problem?

stiff field
#

hi, all!! I have question, when i try restart game by call method GameMode->RestartGame() other player is disconnected. i just try it in editor without online subsystem.

nova sky
#

is it necessary?

fossil spoke
#

Port 7777 is the default port that UE4 uses for network communication

bitter oriole
#

Though you shouldn't need to open ports if you're using Steam, right ? Nat punch and all that

ripe raptor
#

Hey, quick question

#

In my player pawn, when I leave the game, I called Destroy Session followed by this:

#

To remove the player from the server as well

#

but that doesn't seem to quite work as it apparently destroys the entire server session, making it cease to appear in the server browser and stops other players from playing

#

Am I missing something or is that not the correct approach?

thin stratus
#

Call DestroySession in the MainMenu

#

So each client handles that themselves

ripe raptor
#

I don't have to call DestroySession server-side for the controller?

#

Talk about a misconception

magic crest
#

I was told to (on client) trigger a leave game function where I call DestroySession and when the delegate fires, PlayerController->ClientTravel() back to main menu

#

works fine

ripe raptor
#

does it make a difference whether you first destroy session and then travel or travel then destroy session?

magic crest
#

I was told to first destroy, then travel. But, I'm guessing you can travel and when new map is open, destroy. However, do not attempt to do the other before the first thing completes

#

it failed for me if i wanted to destroy, then immediately travel and then receive the destroy callback

#

the documentation explicitly says, wait for the delegate first before attempting anything else, because there are some other stuff the engine has to do before continuing with your new requests

jolly siren
#

@I am Bodya#4511 yes it is necessary

twin juniper
#

@versed socket i have a lot easy to make games with a lot of revenue as a result, problem: i aint game dev

nova sky
#

ok I will try than I will arrive home

twin juniper
#

@Kai#5929 Kai - Today at 3:06 AM
@twin juniper that depends how good at coding you are - i am bad at logic.
regarding: Stewie - Today at 1:17 AM
stupid question: how long will I need to make this online game?

magic crest
#

Hi. I'm having a problem in multiplayer. The 3rd client that joins appears to control the animation of the 2nd player's gun. Where might I start to investigate. Note: Happens in standalone on steam, not in PIE

bitter oriole
#

@twin juniper Basically multiplayer doubles the amount of work

magic crest
#

@bitter oriole maybe even triples

graceful cave
#

ive been having an issue for a while and stil cant find a solution -
the listen server's framerate becomes the tickrate for network communication and having my framerate capped at 144 or higher will cause a lot of issues for clients, dropping a lot of non reliable rpc calls and lagging movement

#

capping at 60 solves the issue but obviously isnt a good solution

#

i have NetServerMaxTickRate set to 60 in the engine ini but it doesnt change anything

#

currently using online subsystem NULL, not sure if that would cause that setting not to work

twin juniper
#

@bitter oriole this is not good, because i don't have singleplayer game ideas

#

not a single one for which I would give my life

magic crest
#

satan: welcome to hell of online subsystems 😃

bitter oriole
#

@twin juniper It's not good or bad, it's just how it is

twin juniper
#

so what should i do

bitter oriole
#

The reality of being a single developer is that your ideas should adapt to what you can do

twin juniper
#

my life would be empty regarding your answer

magic crest
#

@graceful cave I myself am having a problem with improper replication when on steam. works fine in NULL, but on steam stuff gets swapped. I'm not sure whether it's due to packet loss or what. Don't even know where to start digging.

graceful cave
#

i havent actually tried steam yet because enabling seamless traveling prevents even the host from loading the next map

bitter oriole
#

Design your game according to what you can do @twin juniper . Not saying I do this well myself, since I'm on my 4th year working on my game and it took more than three to get on Steam... But it's what we all have to do

#

A huge majority of game projects are never finished

#

Like, 95%

#

We all pick something way too hard as a first game project

#

I even picked something too hard for my second 😃

#

You can do a multiplayer game alone but be sure to make it incredibly simple

#

Like, not a shooter

graceful cave
#

cant say picking something "too hard" is a bad thing considering itll force you to learn

twin juniper
#

but as you see the maze game is everything but not hard.... can't compare this to HEY I WANNA MAKE GTA STYLE GAME

bitter oriole
#

@graceful cave So, would you start building a space shuttle ?

magic crest
#

Yeah. ought to make wow as my first project

graceful cave
#

programming and engineering arent quite the same lol

#

but resources are easy to come by for programming

#

im making a multiplayer arena fps as my first game and its about 90% done

#

if i started over from scratch some things would look different but most of the early stuff has been overhauled

magic crest
#

@graceful cave Did you start with a template or blank?

graceful cave
#

actually i bought exi's lobby system

#

which during the development process i had to either modify or understand the majority of the classes provided

#

so it helped me learn a lot

magic crest
#

as usual 😃

graceful cave
#

i could remake something similar now if i had to

magic crest
#

I'm just wondering. Whether people tend to go blank or start with a template.
How's your knowledge on replication?

graceful cave
#

good enough ig uess

twin juniper
#

people who start bblank... are crazy

magic crest
#

I'm having a strange issue and can't seem to get to the bottom of it

graceful cave
#

i can make things happen that need to happen

magic crest
#

Stewie, I disagree... There is a LOT of things setup on a template, 80% of what you dont even really need, or is simply implemented wrong (for the sake of example simplicity)

graceful cave
#

yeah i think blank project is the way to go once youve learned enough

magic crest
#

@graceful cave here's a quick scenario. An actor spawns a weapon on beginPlay (authority). It all replicates fine when NULL system. On steam, when 3rd player joins, he seems to control the 2nd players gun. Like, when I sprint, I see 2nd player's gun animated as if he is sprinting

graceful cave
#

not sure about any issues steam would introduce because i havent included it yet

#

so if you test in PIE with 3 clients it wont happen?

magic crest
#

Exactly.

graceful cave
#

my only guess is that someone is loading in slower and the beginplay isnt properly running on the owning client

#

try replacing some beginplay functions with a possessed event

#

and start it with a DoOnce that doesnt reset

#

in case the actor is unpossessed and possessed again

#

at a later point

magic crest
#

The owning client doesn't really do much in begin play. He waits for the weapon to get replicated and attaches it to his body.

graceful cave
#

right but the server might be running that function before the client possesses the actor which can cause certain things to get weird

magic crest
#

aha

#

Would explain why pie works, as there is no network data travel (correct)

#

?

#

since, all the instances are the same computer

twin juniper
#

@graceful cave since when are you programming. since when are you working games in general. since when do you work on this 90% done online game?

graceful cave
#

they would all load in at the same time in PIE

magic crest
#

ALso, I receive OnRep before BeginPlay on the joining client.

graceful cave
#

@twin juniper i started with ue4 in january but i have a lot of map making experience for all UT games so i already knew how to navigate the engine

twin juniper
#

but not how to make logic ;D

graceful cave
#

my only real programming experience was warcraft 3 mapping and a little c++ in high school

#

but warcraft 3 mapping is the same as programming

#

just simplified

#

btw if youre making multiplayer game

#

thatll help you a lot

#

it can simulate ping for clients to help you optimize your netcode

twin juniper
#

doint need that now XD

graceful cave
#

that was for @magic crest lol

twin juniper
#

i am also making one 😮

magic crest
#

@Satan what's that?

#

aaah. a simulator. right

graceful cave
#

yeah because the editor only allows you to see IF things replicate between clients

#

but any real online scenario will involve ping

#

so it allows you to tweak your RPCs to optimize the game for actual net play

magic crest
#

I see. thanks. Ill go look at that possess event

#

So, basically what you're saying is that once I receive the possess event on the client, I RPC SpawnWeapon instead of Spawning it the moment the server spawns the pawn

#

Which is, in my case, as per design. Since, our characters enter the game with no gun.

#

I'll just make an action 'Equip/Unequip Weapon' and see if that makes any progress

jolly siren
#

Anyone with a good CMC understanding know what all this smoothing code is supposed to be doing? And all these smoothing properties? Because it doesn't look smooth at all for local client when dealing with lag spikes.

twin juniper
#

@jolly siren no matter how high I increase the max / no Smooth distance and increase the smooth location times to unrealistic amounts, I still get instant pops

jolly siren
#

Yeah, digging through the code I think that this smoothing might only be for simulated proxies or listen servers

twin juniper
#

Ohhh interesting

#

That would make sense as I remember doing a lot of testing and seeing no change

#

Never looked at the simulated proxies

#

And always had it on dedicated server mode

zinc loom
#

It's midnight and I have hazy memory, but from what I remember smoothing only happens on simulated proxies and if you're getting popping on a local client it's because the server thinks the actor has moved too far since it's last recieved update so it tells it to move back

jolly siren
#

Right, yeah it looks like smoothing isn't there for local client with dedicated servers 🙁

#

So spikes like this look horrible from the local client's perspective

#

Easily reproduced in shootergame with net pktlag=50 and net pktlagvariance=200 and dedicated server checked

zinc loom
#

Heh... The more I hack on Shootergame the more I want to just start again from scratch using blueprints

jolly siren
#

Blueprints wouldn't help this at all. It's an issue with the character movement component

zinc loom
#

Yeah I know. I also wish all of the smoothing was done at a higher level instead of in CMC so it could be used by regular pawns :/

twin juniper
#

@jolly siren damn good finds. So you'd have to implement your own smoothing logic based on the CMC then?

jolly siren
#

That's what it looks like

#

Although I just tested with listen server and I'm still getting the movement jumps

#

so debugging that

hazy haven
#

@gleaming bobcat ahh yeah the savedmove flags are only good for an event like jump prone crouch walljump etc, I did try and do dynamic move altering with CmC a way back but never ended up with satisfactory results, my skills were lacking

twin juniper
#

You are getting these freqent pops even in real life scenarios (i.e. on a dedicated sever playtesting)? @jolly siren

jolly siren
#

yes

twin juniper
#

I would assume many games don't touch the CMC but have smooth movement 99% of the time

jolly siren
#

They aren't super frequent. Probably 10-20 per match but I have really good internet. Other testers get it a lot more frequent than that on midgrade net.

#

But even 10-20 is really jarring

#

I would definitely not consider it good enough as-is

zinc loom
#

Just went thru my bookmarks, found this from when I was digging at doing something outside of CMC

jolly siren
#

That is for physics tho

#

I'm just talking about CMC

twin juniper
#

@jolly siren and you are debugging with the show net corrections visualiser to make sure it's only happening at those times? (I know it may seem stupid but I had an issue where my client and server had slightly different speeds and they were constantly a bit out of sync leading to more corrections than necessary)

#

Also checking to see if it's happening at specific times like when colliding or doing a certain action

jolly siren
#

Yeah the movement speed is the same between server and client. It only happens when I get a ping spike. I can see my ping and have watched it spike when I get the jerky teleporting. Also like I said it's easily reproducible with shootergame when setting a high lag variance

#

And no I'm not colliding with anything

#

just walking on a straight flag plane

#

CMC just doesn't handle lag spikes

twin juniper
#

If the ping is moving +200 ms then it's probably unavoidable to some degree

#

IF it can't get new info for 200ms there will be a gap

jolly siren
#

That is realistic tho

#

ping spikes in real life

twin juniper
#

I guess I don't encounter them very often as the ping usually stays pretty consistent for me

#

maybe +- 30ms max

jolly siren
#

so when you run something like this for say 100 packets you don't get ping spikes?

twin juniper
#

Well testing playing shootergame or whatever over the network I notice no corrections

#

I'll test this out

jolly siren
#

Over the internet or lan? With dedicated server?

twin juniper
#

Dedicated server

jolly siren
#

You would have to play for a bit to notice them. Idk how often you play or the length of time

twin juniper
#

Also something to consider is that if you do smoothly interpolate, depending on the distance it may be more jarring than a pop

#

If the player feels that they are sliding across the floor when they didn't want to move

#

Ok after 150 sends there was indeed a 200ms lagspike

jolly siren
#

Right, yeah that would be a jerky movement with CMC

twin juniper
#

The vast majority stayed low though, but I think if you have pktlagvariance set high, that constantly simulates lag spikes, wouldn't it?

#

like every second your ping could be anywhere between 0 -200

jolly siren
#

Right, that is what I was simulating

#

and it reproduces the issue I see in real life

#

exaggerated to happen all the time, but it reproduces it still

#

I have tested my game for 300+ hours. And also compared to shootergame and they both behave the same. And both use CMC

twin juniper
#

what pktlag variance value do you use?

#

I'll test in my game now

jolly siren
#

net pktlag=50 and net pktlagvariance=200 is what I was using

#

300 will give them even more frequently obviously. but 200 reproduces it fine.

twin juniper
#

Ok just tested with 100ms pktlag and 200ms variance and got no corrections walking or sprinting around

#

Corrections 100% of the time when jumping though

jolly siren
#

yeah I'm not talking about jumping. Just walking around. Do you have a super low movement speed or something?

twin juniper
#

450 walk, 750 sprint

gleaming bobcat
#

Ah you are talking about dynamic character movement speed ?

jolly siren
#

Should be fine for reproducing. Are you on listen or dedicated?

twin juniper
#

Not necessarily

#

Dedicated

#

PIE dedicated though

#

But that usually works fine

jolly siren
#

Yeah that's fine. That is how I'm reproducing in shootergame and my game.

twin juniper
#

I can also test in shootergame

jolly siren
#

what version are you on?

twin juniper
#

4.18.3

jolly siren
#

okay, same here

#

can you try 50ms and 200ms? It's a larger spike. But I'm opening shootergame to try 100 and 200 now

twin juniper
#

Ok will do

#

Tested again with 50ms on my project and nothing, opening SG now

#

Btw does this happen when you simply have your netpktlag = 250 or similar with no variance?

#

Or only when it is varying?

jolly siren
#

yeah I can still reproduce it easily with 100 lag and 200 variance in shootergame

twin juniper
#

And without variance but just constant lag?

jolly siren
#

no, it doesn't happen then

#

it's the variance that is causing it

#

the spikes in ping

#

Same in real life conditions

twin juniper
#

Ok tested in shootergame and nothing but one thing I noticed when debugging the ping is that it's not exactly moving much for me

#

With 200ms variance, I don't seem to be getting that range

jolly siren
#

how are you viewing the ping?

twin juniper
#

Well in my own project I have a lagcomp ping debugger that overrides the PS one but updates much more frequently

#

And in SG just printing exact ping * 4

#

I guess it does work it just stays around the 180 - 220 range

#

Anyway it still doesn't cause any problems for me

#

Only seeing corrections in SG when jumping

#

What is the netupdatefreq for your character?

nova sky
#

@jolly siren

#

port 27015 uses automatic

#

should i add GameServerQueryPort=7777 to DeafultEngine.ini?

jolly siren
#

@twin juniper it's default

twin juniper
#

Default is super low

#

It goes down to like 2

jolly siren
#

@nova sky what? no you should leave that the same. You need to port forward 27015 and 7777

nova sky
#

How can i do it?

twin juniper
#

I bumped the lag up loads in SG and still only noticed any corrections around stairs when sprinting, any other walking or flat surface movement ways fine

#

Try testing your project with max and min netupdatefreq to 100 and see if it changes anything

nova sky
#

Server just use 27015 if i don't add config

#

or 7777 if i will add it

jolly siren
#

You need to port forward both...that's it. No config changes

nova sky
#

Maybe i understand

#

if forward port mean to open it, i already have opened both ports

jolly siren
#

yeah, I tried upping min net update frequency to 100 and it's still the same

twin juniper
#

I'm very confused as to why we are getting different results on vanilla shootergame

#

just to double verify

#

You are entering these commands on start

#
Net PktLag= 50 
Net PktLagVariance= 200 

#

?

nova sky
jolly siren
#

I am entering them via the console after I click play

twin juniper
#

Yeah me too

#

I also have p.NetShowCorrections 1

#

To see when it happens

#

Can you also debug the ping and verify you are getting around the 180 - 220 range average?

jolly siren
#

Are you focusing too much on that? I'm not rendering the corrections. It is super obvious just by watching the viewport

twin juniper
#

I'm not focusing on it but I don't feel any other smoothness interruptions

jolly siren
#

I'm downloading shootergame on my other computer now so I can record what I am doing

twin juniper
#

And it's so subtle when corrected that I have to double check that the correction happened

jolly siren
#

And yeah ping isn't printing correctly for me either

twin juniper
#

It's not obvious

jolly siren
#

It's very obvious here. I will record so you can see exactly what I'm doing.

twin juniper
#

Ok great

jolly siren
#

@nova sky yeah that looks fine

nova sky
#

i don't uderstand how i can fix it.

jolly siren
#

have you port forwarded them in your router tho?

#

or only opened in windows firewall?

nova sky
#

I can't forward them because i use hosting to host server

#

and i don't have router log and pass

#

i check ports

#

they are opened

#
  • telnet are connecting to ports from my pc
jolly siren
#

okay, that is setup correctly then

nova sky
#

Can i find in net or forums ready clear dedicated server with steam api to download and check?

#

i found this giud

#

guid

#

and i didn't understand there can i find

#

CustomCreateSession.h

#

library

twin juniper
#

@jolly siren just ran around shootergame for 5 minutes both sprinting and walking and experienced 1 pop

jolly siren
#

That is a class they create there in the guide

twin juniper
#

Honestly though with lag variance that high for that long, that doesn't seem unordinary

jolly siren
#

Yeah you should be getting a lot more than that

twin juniper
#

Send on the video when you can and I'll check it out

jolly siren
#

okay opening shootergame on other computer now. sorry had to download

twin juniper
#

Np

nova sky
#

here using ucustom.... class

#

Ok i will try to use this code

#

Is it child class of GameSession?

#
  • there i should create SteamBridge class
jolly siren
#

It shows the child class right there

#

read the guide

nova sky
#
  • int64bits
#

like class in vs

#

or in engine

#

?

jolly siren
#

I think you need to get some more basic unreal & c++ knowledge before trying this

#

john, give me a few minutes have to wait for shaders to compile

twin juniper
#

No worries I'm here all day

gloomy tiger
#

Hey guys! Question.

I'm creating a TopDown Multiplayer game, and my character replicates its movement. It works fine, but when I'm in the Standalone Game, the rotation is not smooth anymore. It stutter when changing the rotation. There's a perceptible... lag (?).

Do you have an idea of how I can fix this problem?

Thanks.

nova sky
#

Am i right that CreateCustomSessionDedicated is a child class which i should use?

#

Or it can be my old class with this name

#

yes

#

It's was my old class

#

I did a mistake

#

And visual studio

#

can't find this includes

#

Mb i shouldn't create it

#

Is't because i forgot enable steam subsystem plugin in new project?

jolly siren
#

@twin juniper For some reason it does happen a lot less frequently on this computer than my other. But I reproduced it 3 times in a 2 minute video with lag variance of 200. See :49, 1:13, 2:08 in the video. And then I increase the variance to 300 at 2:15 and that causes it to happen much more frequently. https://youtu.be/xzZV3MYEaX4

#

2:15 and beyond is how it behaves at 200 variance on my other computer, which is why I was telling you to use that number

twin juniper
#

Says this video is unavailable

#

Still processing?

#

Nvm working now

jolly siren
#

forgot to hit publish

twin juniper
#

I see what you mean

#

Tested with 300ms here and get the same results

#

But still very infrequent

#

Could we perhaps throw shootergame onto a US dedicated server and see if this issue pops up when playing in a real network scenario as it does for you?

#

I definitely see what you mean but haven't personally had many of those kind of corrections in real tests other than the very occasional acceptable spikes that happen with any game from time to time

#

I'm just wondering if the 300ms variance command is just above what any regular player might experience or not

#

It's hard to tell with the faulty ping indicators

#

It feels like the server just didn't get input from the player for 300 ms so it finishes the current move and stops moving, then it gets the players current move when connection is regained and it snaps it back

jolly siren
#

Yeah they are infrequent in my real network testing. But they do happen like 10 times a match for me and more for my other tester that has more mid grade internet

twin juniper
#

I know Fortnite isn't a good example to compare due to the low tickrate and greatly higher bandwidth, but I notice pops like that at least 5-10 times per match there

#

And I can definitely recall COD and other games having similar pops now and then

#

May just be a side effect to ping spikes if you aren't extrapolating on the CMC

jolly siren
#

Ahh I have only played a little Fortnite and never played PUBG. I don't remember any pops like this on Halo

#

Right, yeah I feel like some smoothing would help it. Fortnite is pretty slow paced, so it's probably not that big of deal there.

twin juniper
#

When quickly building and rapidly moving it can be very annoying

#

You think you have ran around a corner but you pop back in view and get shot

jolly siren
#

That might be lag compensation with the shooting too tho. Favor the shooter stuff

twin juniper
#

I had just kind of accepted it as a side effect of online multiplayer. I'll definitely keep an eye out for it on my tests but when playing at reasonable pings, I've not had any noticeable drops other than very rare cases

#

For sure, but the pop in movement is very jarring

#

AS you have to readjust and moving to get back into cover gets you killed a lot of thetime

jolly siren
#

Right, yeah that's what we are running into too. Cases where it is jarring. In my game there are places in the environment that can kill you and a lot of the time a movement spike will hit and you will end up getting killed by the environment because of it

twin juniper
#

That sucks, it really feels annoying as a player for something out of your control like that to happen

#

Really makes you just not want to continue playing if it happens frequently

nova sky
#

I tried to buils

#

build

#

Create custom dedicated session

#

and i have this error

#

error MSB3075: The command "C:\Users\crewd\Documents\UnrealEngine-release\Engine\Build\BatchFiles\Build.bat SteamServerEditor Win64 Development "C:\Users\crewd\Documents\Unreal Projects\SteamServer\SteamServer.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
2>

#

What did i miss?

#

fixed

#

I have new error

#

fatal error C1083: Cannot open include file: 'OnlineSubsystemUtils.h':

#

What should i add?

icy nacelle
#

Hey! Could someone please briefly explain to me how I can program something like Pickpocketing in a multiplayer game? How can I get a variable of the targeted player?

jolly siren
#

I haven't noticed any movement jerks in Fortnite so far. It probably matches me up with a server that I have really good ping with tho.

winged badger
#

@nova sky you are probably didn't declare the online subsystem module in your build.cs file as a dependency

twin juniper
#

anyone seen bullshit like this?

#

It works fine on my main server, but im trying to setup a separate server

#

im not sure why it says "killed"

#

i didnt press Ctrl + C

#

lol

#

ooh nvm

#

it was just the kernel killing the process lmao

#

not enough memory

#

checked /var/logs

graceful cave
#

i have a pawn that generates overlap events and the controlling client will print when the overlap event is called

#

but after possessing another pawn and then repossessing the original, only the server will print when he overlaps

#

is there any fix for this?

#

can potentially break things

ripe raptor
#

Hey folks, has anyone here had issues with UMG widgets / UWidgetComponents persisting on clients after a servertravel?

#

It is driving me insane I don't know what to do with them

thin stratus
#

On what actor do you have them

ripe raptor
#

on my player pawn

#

Who gets destroyed and the game mode on my new map re-creates them

#

and I can see the old widgets still on the screen, even find them with GetAllWidgetsOfClass but I can't call RemoveFromParent() on them because they don't have a UMG parent

winged badger
#

the HUD is not owned by the pawn, but by the controller

#

if you're using the HUD

#

for them to persist tho, something must have a reference to them

ripe raptor
#

Nothing explicitly. THere have been several reports about it on UDN without proper solutions

#

Was hoping someone might've stumbled on it

winged badger
#

you could move them to the HUD and keep control over them that way

ripe raptor
#

I need them to be on my player characters in world space

thin stratus
#

Hm, weird that they survive

#

Is it a Seamless travel?

#

Are you keeping the pawn alive?

#

Tried destroying the component when the pawn calls destroy? (should already happen though)

#

Also tried to wait 30-60 seconds im case garbage collection didn't pick it yet?

#

@ripe raptor

stable kindle
#

guys is there an inbuilt way to have actor tags to replicate?

ripe raptor
#

@thin stratus - Just calling ServerTravel on the server, seamless is turned on. Pawn is being destroyed, I tried destroying the widgets before that, yes.

#

(Sorry for the late reply I've been messing with the code)

gleaming bobcat
#

Morning. What is the highest ping what you are supporting in your game ? In terms of whether the game is still nicely playable no choppy position corrections etc. Because I still care about latency 300+

manic pine
#

id say 200 max for fast paced shooters, maybe even 150... too many compromises you have to make in regards to lag compensation, so with players with higher ping the game gets worse for everyone

#

that stuff doesnt matter much for slower games and mmos though, accurate simulation there seems more coincidental than designed

#

so i guess you could go with 300-400

burnt meteor
#

wow i am back

#

no 300-400 is bad, 100-300 should be good

#

the best value would be 1ms lol

gleaming bobcat
#

ARPG. Tried D3 on Asia server with 300 latency. Amazingly smooth experience still. But for example in UE Root motion of semi fast movement on ping 200+ causes some position correction at the and of the animation. which looks horrible

burnt meteor
#

hey guys i am trying to make a kick system in my game but all my player controller id's are returning the value of 0.

#

here's a screenshot:

thin stratus
#

Controller ID is not for multiplayer

burnt meteor
thin stratus
#

Or rather not online

burnt meteor
#

ok

thin stratus
#

It's the local player id

burnt meteor
#

then how should i debug?

#

ok

thin stratus
#

What do you want to debug there?

burnt meteor
#

i made an array in the GM and