#multiplayer

1 messages Β· Page 356 of 1

worthy wasp
#

1 sec

#

uh - one member should spawn @ A - the other @ B

#

my desired logic

#

ultimately i'll have many A's and many B's

#

you can see - 1 is true - the other false

#

ok it is fixed now

#

this vid i was watching - the guy had the matching to the playerstate... here:

#

for (TActorIterator<ATeamStart> StartItr(GetWorld()); StartItr; ++StartItr)
{
if (StartItr->TeamB)
TeamStartsB.Add(*StartItr);
else
TeamStartsA.Add(*StartItr);
}

#

it USED to read:

#

if (StartItr->TeamB == PState->TeamB)

#

taking that out - it works fine

gusty raptor
#

Hi, anyone knows how to setup ownership for network.

#

currently none of my characters have no owner, how do i manually spawn the characters and set owners?

thin stratus
#

Possessing a Pawn gives the Player ownership

#

Possession needs to happen on the Server

#

If you need to manually override ownership of a ServerOwned Actor, then you need to call "SetOwner" on the Server for that actor and provide it with an Actor (best would be PlayerController) of the Player who should get ownership

distant wave
#

@severe widget Those things with ForEachLoop and GetPlayerController have been changed before you replied. @thin stratus told me about them. And now the event tick shouldn’t be reliable. Will fix that and let you know guys if something has changed. πŸ˜ƒ

gusty raptor
#

@thin stratus Okay. What is prosessing a pawn? how to do that?

thin stratus
#

It's calling "Possess" on a Pawn with a PlayerController

#

You might want to read my Compendium first

#

And also study the GameFramework of UE4

#

as that is very basic :x

gusty raptor
#

hhm, so basically my characters already are owned?

#

as i can controll them..

thin stratus
#

Well yes, if they are possessed

#

GameMode has a Default Pawn Variable. That one is spawned and possessed by default

#

So if you don't remove that and spawn a Pawn by yourself, you should already be fine

gusty raptor
#

indeed, i use the default pawn

#

however, when i log HasNetOwner() its false for all players..

twin juniper
#

when the server crashes and shuts down, is there a way to do something like OnShutdown?
particularly when this happens in the log:

[2017.11.30-22.09.19:267][440]LogExit: Executing StaticShutdownAfterError
gusty raptor
#

@thin stratus so using the default pawn variable, but why is HasNetOwner() always false?

thin stratus
#

Hm, shouldn't actually

#

HasNetOwner cycles to the TopOwner

#

Which for your Character is the PlayerController

#

That one returns true for HasNetOwner

#

Are you maybe calling that on the Server or so?

#

Also for what do you need that

gusty raptor
#

im trying to implement RPC

#

but its sometimes telling me the actor has no owner

#

but indeed, i thought so it shouldnt be :S

thin stratus
#

@twin juniper Welly ou already kinda posted it

#

virtual void ShutdownAfterError() {}

#

In an Object

#

You can override that

#

@gusty raptor Well, when are you calling the RPC?

#

On BeginPlay in the Character might be too early

#

You have to see that the PlayerController possess after the Character is spawned and probably already called BeginPlay

gusty raptor
#

hhm right..

#

indeed, the log with HasNetOwner is inside onBeginPlay

thin stratus
#

You can use "OnPossessed" for that

gusty raptor
#

great

twin juniper
#

@thin stratus thanks

distant wave
#

Hey!

#

How would I make my own movement replication for a character?

gusty raptor
#

Midsoft Games, you could create a custom movement mode

manic pine
#

is there some part of the charmovecomp replication system you dont like?

#

i'd imagine it would be a lot less work to adjust the existing system to your needs than starting from scratch

twin juniper
#

@thin stratus whenever u write ur new version of ur network doc... Idk if you already mentioned this... but if a object was spawned in by gamemode on boot, all "Client" rpc's are then called on the server as it is the "Owning client" you should add this, because it actually gets annoying as many of the client rpc's i have are widget stuff... and because of this, the widget information just gets a bit... error prone? It gives a ton of access none errors on the server console on boot because things like beginplay are called which then access a widgetw hich doesnt exist... coz its a Server

#

but once the player possesses it its fine then

#

but its still an annoying error lol

thin stratus
#

That's not an error

#

Sounds more like an design issue on your end :P

twin juniper
#

im not saying write the error

#

im saying let people know that if a object is spawned on server... all "Client" rpcs are now essentially server rpcs

#

until SetOwner() is called

gusty raptor
#

@thin stratus so i not log HasNetOwner() inside ACharacter::PossessedBy . however still all my characters are not owned

#

now log* ^

thin stratus
#

@twin juniper But i do that already

#

That's what the whole ownership is about

#

There is even a table showing how it works

#

@gusty raptor no idea right now. Haven't had an issue with this yet

gusty raptor
#

seems to be wierd:S

#

have to look more into it, atleast input driven RPC's do work, while the log says it has no owner!

twin juniper
#

@thin stratus okay yeah i just wanted to make sure

twin juniper
#

@thin stratus Do you know the "Epicer" (Epic employee) who could tell me more about Net dormancy?

#

Like who developed the feature?

#

I can't find any information on it other than info about it being used heavily in Fortnite.

#

I j ust wanna see if I can send them a message on forums or email lol

frozen fog
#

Hey guys, i want to make a project with the ability of sharing pictures and save files trough the internet. I'm using the Gamesparks plugin right now but i was reading that Unreal Engine has an online subsystem module and i was wondering if i could use that module instead (the less dependencies, the better). But the documentation about sharing files using the module (if it's even possible) is scarce and i was wondering if you could point me in the right direction. Can i use the built-in online subsystem to connect me to a service and share files in-game? Or, do you recommend me another solution?

worthy wasp
#

@frozen fog - you would have to transfer files via TCP Socket connections from host IP (The one with the file) to destination IP (the one that is requesting trade). There is no automatic file transfer function to my knowledge and if there was i dont think it would be part of hte Online Subsystem module - as this is a straight up file.io function with TCP functionalities for the transfer.

frozen fog
#

If i want to share files in the cloud using a service provided by a host (gamesparks, amazon, google drive, etc.) i suppose it's very similar, right?

worthy wasp
#

you would simply retrieve the file from the storage location then - no transfer from owner -> requestor at that point

#

simply server -> Requesstor

frozen fog
#

Thanks, i was watching some tutorials about gamesparks but i don't have too much knowledge about the subject. I would like to use only UE4 functionality but i will probably end up using a plug-in like gamesparks. I basically want to share files trought the network so anyone can download it. In a very similar way to Mario Maker where everyone can share and download levels.

worthy wasp
#

meh - i used gamesparks over 2 years ago

#

gave up after a few months due to their lack of API & Documentation

#

hopefully over 2 years its changed πŸ˜ƒ

frozen fog
#

Oh, i hope hahaha i don't want to spend weeks figuring out how to do basic stuff xD.

worthy wasp
#

good luck to you. check out SpatialOS too - great service - again - very new and a stiff learning curve.... but theyre aggressive towards UE4 implementation.

#

@frozen fog

worthy wasp
#

Question guys - i'm trying to do logic to build TEAMS in my MP game (LISTEN SERVER)..... While this is working - its also addign my server 2x to the same team. I tried to build logic around this .... but i cant seem to get it right.

How can i stop my server from being added 2x to the same team?

{
    Super::PostLogin(NewPlayer);

    if (NewPlayer)
    {
        AAvantGardeGameState* MyGameState = Cast<AAvantGardeGameState>(GameState);
        AAvantGardePlayerState* PState = Cast<AAvantGardePlayerState>(NewPlayer->PlayerState);
        if (PState && MyGameState)
        {
            uint8 NumTeamA = 0;
            uint8 NumTeamB = 0;

            for (APlayerState* It : MyGameState->PlayerArray)
            {
                AAvantGardePlayerState* OtherPState = Cast<AAvantGardePlayerState>(It);
                if (OtherPState && (!MyGameState->TeamB.Contains(OtherPState) || !MyGameState->TeamA.Contains(OtherPState)))
                {
                    if (OtherPState->TeamB)
                    {
                        MyGameState->TeamB.Add(OtherPState);
                        NumTeamB++;
                    }
                    else
                    {
                        MyGameState->TeamA.Add(OtherPState);
                        NumTeamA++;
                    }

                    if (NumTeamA > NumTeamB)
                    {
                        OtherPState->TeamB = true;
                        MyGameState->TeamA.Remove(OtherPState);
                        MyGameState->TeamB.Add(OtherPState);
                    }
                }
            }


            APController_Game* PController = Cast<APController_Game>(NewPlayer);
            if (NewPlayer)
                PController->Respawn();
        }
    }
}
manic pine
#

what exactly is the point of this line: (!MyGameState->TeamB.Contains(OtherPState) || !MyGameState->TeamA.Contains(OtherPState)) ?

thin stratus
#

He basically checks if the PlayerState in the Loop is in a team or not

#

Kinda weird

#

You know that the new one isn't in a team yet

#

So just add him to one

#

If you want to know which one of the two it should be added to (based on filling them equally), just check which of the two Arrays (TeamA or TeamB) has less items

#

@worthy wasp

#

The Server should never end in a team if you simply only handle the new PlayerState

#

Remove the loop

worthy wasp
#

but the problem is - the listen server is added 2x to the same team

thin stratus
#

Yeah, cause of your loop probably

manic pine
#

but it returns true if the player is not in either team

worthy wasp
#

ok so instead of looping - just add them to the array

#

and handle ht array logic the same - just without the loop

manic pine
#

switch the || with &&

#

but yeah, the loop is unnecessary in general, unless the rest of your code is very different from what one would expect

worthy wasp
#

ok thanks - tryin this out πŸ˜ƒ

thin stratus
#
void AAvantGardeGameMode::PostLogin(APlayerController* NewPlayer)
{
    Super::PostLogin(NewPlayer);

    if (NewPlayer)
    {
        AAvantGardeGameState* MyGameState = Cast<AAvantGardeGameState>(GameState);
        AAvantGardePlayerState* PState = Cast<AAvantGardePlayerState>(NewPlayer->PlayerState);
        if (PState && MyGameState)
        {
            uint8 NumTeamA = MyGameState->TeamA.Num();
            uint8 NumTeamB = MyGameState->TeamB.Num();

            if (NumTeamA > NumTeamB)
            {
                PState->TeamB = true;
                MyGameState->TeamB.Add(PState);
            }
            else
            {
                PState->TeamB = false;
                MyGameState->TeamA.Add(PState);
            }

            APController_Game* PController = Cast<APController_Game>(NewPlayer);
            if (NewPlayer)
                PController->Respawn();
        }
    }
}
#

@worthy wasp

#

I would also remove the boolean "TeamB" and use an Enum

manic pine
#

make sure to remove players from teams once they exit server too

thin stratus
#

Yus, Logout function

manic pine
#

or rejoining players will have trouble

worthy wasp
#

for what purpose @thin stratus ?

thin stratus
#

Well, easier to maintain

worthy wasp
#

i guess if i were to have more than 2 teams

thin stratus
#

PState->Team == ETeam::TeamB

worthy wasp
#

eitehrway - its cleaner yes

thin stratus
#
  • switch
manic pine
#

overall though it would probably be nicer to just make one big 'teambalance' function that you run whenever someone joins/leaves server

worthy wasp
#

yes - i can see the case for switches use

#

❀

#

@thin stratus - works great - taking out the for loop i understand. Thanks bud!

modern dome
#

@thin stratus did you just assume that a Team can't have more than 256 team members!???

#

TRIGGERED

thin stratus
#

Of course it can

#

But there are only 256 different teams kappa

manic pine
#

youre loading player count into uint8 ;|

elder sable
#

if i use SetPawn to know when my PC posses a pawn, it's only server side and i have to use a RPC to notify the client ?

worthy wasp
#

@elder sable - i'm working that EXACT method right now o- i'm doing a function directly after possession in the controller's RESPAWN code

#

if (GameMode) { if (GetPawn()) GetPawn()->Destroy(); APawn* NewPawn = GameMode->SpawnDefaultPawnFor(this, GameMode->ChoosePlayerStart(this)); Possess(NewPawn); BeginPlayingState(); }

#

BeginPlayState - is a local function in the playercontroller that handles A: Building up the UI and B: running a custom BeginPlay in the PAWN class

elder sable
#

so BeginPlayingState is a RPC called from server and executed on client ?

worthy wasp
#

no RPC

elder sable
#

the posses is server side no ?

worthy wasp
#

it should only happen server side yes

#

this is coming from GameMode call to the playercontroller

#

it will only happen SERVER auth

elder sable
#

so how you call a client function from server ?

worthy wasp
#

its not an RPC

#

its a local function - it'll be in AUTH mode

#

if you need to go back to CLIENT - simply run a Client RPC in the controller

#

to handle anything locally

elder sable
#

ah ok

#

thanks !

worthy wasp
#

FYI - Server has ZERO to do with widgets

#

so anythign widgets wise - make sure to RPC back down to CLIENT

elder sable
#

yep

worthy wasp
#

otherwise you'll get warnings/errors

distant wave
#

I need to replicate an event that is called from the tick
can it be reliable?

worthy wasp
#

@distant wave - Tick & BeginPlay are ran as both HasAuthority & !HasAuthority - if you need to do something on server you dont need to RPC it (unless of course youneed to NetMulticast it)

#

just use th appropriate lockout - if(HasAuthority() or ! if you need local

thin stratus
#

Or you just tell him "No, don't do reliable on tick"

twin juniper
#

@distant wave dont do reliable on tick

distant wave
#

I made my IK system

#

it looks like it doesnt need replication

#

@thin stratus You are really good with multiplayer. It looks like you are a very very experienced programmer as well. Why don’t you get hired at Epic Games?

jolly siren
#

awesome, yeah IK shouldn't rely on networking

acoustic aspen
#

When I jion a steam lobby the map is the main menu and its black screen

#

[2017.12.01-22.03.43:233][776]LogTemp: Warning: steam.76561198309012868:7777
[2017.12.01-22.03.43:235][776]LogNet: Browse: steam.76561198309012868//Game/Maps/Menu
[2017.12.01-22.03.43:236][776]LogTemp: Display: ParseSettings for GameNetDriver
[2017.12.01-22.03.43:236][776]LogTemp: Display: ParseSettings for SteamNetDriver_0
[2017.12.01-22.03.43:236][776]LogTemp: Display: ParseSettings for PendingNetDriver
[2017.12.01-22.03.43:237][776]LogNet: Display: SteamNetDriver_0 bound to port 7777
[2017.12.01-22.03.43:237][776]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2017.12.01-22.03.43:238][776]LogNet: Game client on port 7777, rate 10000

normal girder
#

Hekko

#

hello

#

could i use UE4 with the google matchmaking system ??

thin stratus
#

You can use UE4 with everything, given you have the skill to implement it

gusty raptor
#

anyone ( @jolly siren ) why is a reliable on Tick not good?

jolly siren
#

bandwidth killer. There aren't many cases where you would actually need to replicate something on tick. In most cases it is just bad design

gusty raptor
#

so im trying to 'snap' the character to surface

#

(like setting rotation) in tick

#

how would i replicate that hhm?

manic pine
#

if you need to call an rpc every tick, then youve probably made an awkward design

#

reliable or not

gusty raptor
#

yeah

#

sow any advice on replicating the rotation?

manic pine
#

is this for the player or for other objects in the world

gusty raptor
#

its for the character

manic pine
#

can the player control his character's rotation directly?

gusty raptor
#

yeah its pretty like the thirdperson

manic pine
#

so player moves mouse/camera, sends that input to server, then receives the char response many milliseconds later?

gusty raptor
#

the movementcomponent is just replicated

#

like it should

#

after that i just rotate the character to surface by its normal

manic pine
#

movement components are generally not replicated, at least not directly

#

but how is the server informed that the player is trying to move rotate?

gusty raptor
#

hhm well i havnt implemented any server logic to be able to have two working players πŸ˜ƒ

#

actually i make a linetrace on both server and client

#

getting the impact normal and then rotate the character to the surface

#

but the basic character movement is already replicated because the movement component was set to replicate (by default)

manic pine
#

youre using the ACharacter and UCharacterMovementComponent classes?

gusty raptor
#

indeed

#

just like anyone else would do probably

manic pine
#

why do you need to snap the char to a surface? wall running or some such?

#

i mean, the base classes already do floor movement

gusty raptor
#

yeah indeed

#

ive been investigating it

#

actually i have both character and movement in c++

#

indeed i could work like the floor stuff

#

its just like

#

imagine a not horizontal surface

#

like a ramp

manic pine
#

right, so you'd like to rotate the char along with the surface, so hes always orthogonal to it

gusty raptor
#

exactly πŸ˜‰

#

i mean, i already have it

#

(the rotation calculations )

#

just need a way to replicate it

manic pine
#

hmm the basic replication system in ucharmovement only looks at position and velocity i believe, not rotation

#

so you'd need to extent it to include rotation

gusty raptor
#

yeah

#

how is the mouse rotation done actually

#

it has atleast have 'some' rotation implemented ?

#

i can rotate the character with mouse or movement keys, these are replicated to..

manic pine
#

careful when using the term replication; it refers to the server sending information to the client, not the other way around

gusty raptor
#

yeah:D

manic pine
#

rotation is not replicated

#

client sends rotation to server, but the server doesnt replicate rotation to client

gusty raptor
#

its calculated just on the client with positions? hhm

thin stratus
#

It's not direclty bad to replicate on tick

#

Depending on what you replicate

gusty raptor
#

yeah:)

thin stratus
#

There can always be things that make sense there

#

The important part is to NEVER make them reliable

gusty raptor
#

its like a thing to think about, really

manic pine
#

the client sends acceleration and location to server, along with the 'view'(which does include rotation)

thin stratus
#

But in a lot of cases it's being lazy

#

As you could setup simulation on the client

#

One example is the replication of a timer

#

Can easily start timer on Client and sync that up with server using UTC Now, instead of replicating the seconds/float

gusty raptor
#

@manic pine so well, what do u think its the best way ?

manic pine
#

its a kind of complex feature, but i think id start by looking into a custom movement mode

#

alternatively altering the default walking movement mode

#

if you have a look in the WalkingPhysics function of ucharmovecomp, you can see how they've done it there

#

you could copy paste it into your own custom 'wallwalking' mode and make necessary adjustments

gusty raptor
#

yeah, ive been doing that.. i have a custom mode ready

#

i can start moving the rotation stuff to the movement component, its in the actor right now

#

so ill see whats next

#

thanks so far..

manic pine
#

oh, yeah thats a good start

#

you'll be changing a lot of stuff though, including client correction functions, replaying moves, etc.

#

otherwise the server wont be able to tell the client when/how to correct its position based on the wall walking system

haughty star
#

Hello using the Steam Session is a good idea to list all dedicaced servers online ?

twin juniper
#

can "Get Lifespan" not be called

#

on client side?

#

it seems like its returning 0

#

but initial lifespan is right

jolly siren
#

the lifespan timer only happens on the server if you are using SetLifeSpan. So you will only get valid values on the server..

worthy wasp
#

looking at a best practice for as little as possible network traffic (Listen Server setup)

I am going to implement a GameTimer and a RespawnTimer functionality. My question is - should i have each timer happen on the server - and say every N# of seconds (inverval) i would broadcast a sync update to the connected clients (i'm looking at a maximum of 10v10 so 19 players total bandwitch usage) to sync their LOCAL timers to the gamestates variable?

I just think it would be alot of traffic for a simple float variable every second from 19 different IP's to one (HOST SERVER) IP & back out no?

#

at MatchState-BeginPlay .... i would start the timer locally to all players , as well teh server timer. and say every 5 or 10 seconds - sync between server + clients? I dont know how outa sync they would get?

distant wave
#

Hey!

#

How can I replicate root motion movement?

worthy wasp
#

AnimMontages - set the rootmotion to true in the animation

#

when you play an animmontage - play it both locally AND on server

distant wave
#

yea, but I have a blendspace

#

all the anims in the bs

#

should be montages? can montages be included in blendspaces?

worthy wasp
#

are you using root motion for simple locomotion?

#

IE: Walking/running

distant wave
#

walking/running/crouching

#

so yea

#

but also

#

walk left

#

right

#

fwd

#

bwd

#

crouch walk fwd bwd rt lt

worthy wasp
#

i'm in no means saying your doing it wrong - by why root motion for these?

#

root motion is more intended for: Lunge attacks, Jump Attacks, Dodges

twin juniper
#

Has anyone tried level streaming with Multiplayer? Is such a thing even possible? NVM I realized it works but it loads eveyone even if not in the new streaming level

distant wave
#

because i am using the movement animset pro

worthy wasp
#

walk/run/etc ... all tehse are tied (should be tied) to INPUT AXIS

distant wave
#

it is a realistic effect

worthy wasp
#

hmmm

#

i've never done them as RootMotion for locomotions

worthy wasp
#

reading

distant wave
#

ok

manic pine
#

how long do you expect your games to be walldiv

worthy wasp
#

@manic pine anywhere from 20 (min) to about 1 hour

#

@distant wave - go private message

#

we dont clutter here

distant wave
#

ok

manic pine
#

no rounds or anything like that?

worthy wasp
#

nope they would be static 1time matches

#

lobby -> MatchStart -> MatchEnd on win

manic pine
#

its hard to predict how inaccurate client timers will be, since it'll depend on fps/deltatime and whatnot, but unless youre using it for actual gameplay

#

then a long update period probably wont be bad

#

i assume in this case its as a visual aid for the player accurate to e.g. a second?

worthy wasp
#

well the gametime doesnt need to be pinpoint on to the second... but i dont want it to get out of sync too bad

#

nothing CRITICAL happens at the gametime....

#

but the respawn timer - yes

manic pine
#

yeah but respawn timer will just run on server

worthy wasp
#

every 45 seconds - the respawn timer resets PlayerStarts to allow players to be REBORN basically

#

yes

#

but heres the thing

#

say 10 people from a team die

#

that means 10 people are waiting the respawn timer to hit 0

#

so they can be reborn

#

now

#

i dont want to ping the server client 10x every second

#

from 10 different IP's

#

so my thoughts were

#

OnDeath - get the current RespawnTimer

#

do a LOCAL TIMER for the current RespawnTImer and increment down to 0

#

when the LOCAL hits 0

#

sync up with the server

#

or...

#

every 5/10 seconds... w/e

#

that way - it sonly a few times that the dead players hit the server with a SYNC request

#

but also

#

when the SERVERS respawn timer hits 0

#

it'll broadcast a delegate

#

the LOCAL side is simply for UI purposes

#

so i can display ot the LOCAL client - how much time they have left

#

till rebirth

manic pine
#

right, but i dont see a need for the client to contact server at all here

#

player dies, server sends rpc to client with time until respawn

#

timer reaches 0, server sends respawn to client

#

client doesnt need to do anything

worthy wasp
#

i guess i was just looking for a sync

#

was the best way to describe it

#

i dont want a client to be able to show 0 time remaining until respawn

#

when the server actually has 4 seconds left

#

and i do see a desync happening on every client... i just dont know how much

manic pine
#

hmm even so, that could be handled purely server-side... i.e. when server reads 5 seconds until client should respawn, send an unreliable client rpc with 5 sec

worthy wasp
#

why unreliable?

manic pine
#

because if its reliable, it'll resend it if the package is lost... but that takes extra time, so the timer is already out of date

worthy wasp
#

i understand that

manic pine
#

right, so having it reliable will just cause more problems than it solves

worthy wasp
#

that makes total sense

#

thanks!

manic pine
#

no problem

brittle sinew
#

Just another thought, if you are looking to sync things up closely you might be able to make use of AGameStateBase::ReplicatedWorldTimeSeconds

#

That gives you the current time on the server, so if you send a timestamp of the timer start along with the RPC you'll be able to know exactly how much longer you have on the client

#

It should allow you to mitigate both the effects of ping and delayed RPC sends

manic pine
#

yeah, if youre using gamestate then that pretty much solves this problem

worthy wasp
#

i'll def look into that Lethal

manic pine
#

though of course, gamestate does update the timer regularly(at 'high' bandiwdth cost)

worthy wasp
#

yes i am using AGameState (NOT BASE)

#

but in previous projects... i've always done the timer in GameMode - and send this information to GameeState class

#

that way - theres 1 sync point - GameMode - which exists on one entity (SERVER)

#

and the GameState is a replicated value of this to all clients

manic pine
#

yeah, a timer is fine in the game mode, the gamestate just gives the client a reference to the world time on the server

#

so you can tell clients that " i started a timer that runs out at 11' o clock", then they cal just do 11 - gamestatetimer to find remaining time

worthy wasp
#

i should say too - i STILL dont understand the full purpose/intention of GameModeBASE and GameStateBASE

#

i've only recently (in the past 6 months) been on projects above 4.14

manic pine
#

way i understand it, they original just had gamemode and gamestate, then in a recent version added a more basic verison of those two classes

#

so games wouldnt have to use unnecessary functionality

#

i.e. maybe a game doesn't need to use "MatchState" which is implemented in AGameMode

#

so better to use AGameModeBase, which doesnt have it

worthy wasp
#

but if you dont use it... does it hinder things?

#

thats where i dont understand hte logic

#

other than - the BASE IMPLEMENTATION of AGameMode

#

which uses MatchStates natively i guess i udnerstand that the more ti talk it

brittle sinew
#

If you use AGameMode and AGameState, you need to follow a stricter match flow.

#

Not all games use that, and it can get in the way of what they're trying to accomplish

manic pine
#

agamemodebase does fundamental things like allowing players to join/quit etc., agamemode does more by also keeping the 'state' of the match, which isnt necessarily relevant for all game types

grand kestrel
#

What does the match state actually include?

#

And since we're on the topic, what does game state do that game state base doesn't?

#

Same thing?

haughty star
#

If I want to send a RPC Multicast when someone connecting to tell to everybody, I can detect the PostLogin in the GameMode but I can't send RPC from GameMode? So how should I do?

#

I guess I have to get the GameState and call my RPC Multicast?

thin stratus
#

Yop

#

Or you save an array of playcontrollers

#

In the gamemode

#

Loop over them and call client rpcs

#

No idea how that counts in terms of performance vs a multicast

haughty star
#

alright, and can you explain me what's exactly the gameinstance? i understand gamemode, gamestate, playerstate, playercontroller

mild geyser
#

If I have online subsystem enabled and DefaultPlatformService is set to null, do the session find queries find only lan sessions?

thin stratus
#

Yeah, NULL doesn't have a Master Server

#

@mild geyser

#

@haughty star GameInstance is a singleton (so exists once only) that describes the complete game. So not only the stuff that happens in one round or map, but everything around the game.
It only exists ONCE per player, is not replicated and should technically not contain any gameplay logic

#

It survives map changes and only gets destroyed when the game gets closed

mild geyser
#

@thin stratus Thx, so if I connect with MyGame.exe <ip-address> is that same as calling ClientTravel with the ip string?

thin stratus
#

Yeah, direct IP connection still works

#

given you have ports setup properly

mild geyser
#

Ok, thx

distant wave
#

hey

#

I am having a strange issue with crouching and multiplayer
they can both crouch
(the server and the client)
the server can see the client crouching, but when the server crouches, the client sees the server going into the floor, but still crouching
the crouching blendspace contains root motion animations
the anim bp is set the root motion from everything
any idea on how to fix this issue?

haughty star
#

@thin stratus alright so do you have an exemple of use? I see someone who use it for exec command or other stuff like that

thin stratus
#

Γ–hm, i put everything in there that is match irrelevant. GameState. UI Handling for MainMenu. Objects for outside databases

haughty star
#

alright

twin juniper
#

Is there a way to completely remove an actor from the network, but still keep it on clients so that we can re-activate it as needed?

#

really need to know so i can save bandwidth

#

if i cant do this... i cant get the number of AI i want on my map

brittle sinew
#

I believe the term you're looking for is net dormancy

#

I don't know specifics of implementing it, but that's the general mechanic

manic pine
#

saving which bandwidth exactly

#

you can do a simple rpc to order client to spawn it

twin juniper
#

@brittle sinew definitely but i have been unable to find any documentation for it

twin juniper
#

@brittle sinew this is literally the only information ive found

brittle sinew
#

You'll want to either use AActor::SetNetDormancy if you'd like to make an actor dormant for all connections or override AActor::GetNetDormancy if you only want to make it dormant based on certain conditions on different clients

#

Took about 60 seconds of looking on the actor docs and repo to find that :p

#

@twin juniper

ionic comet
#

nice!

#

I had no idea that was even a thing

twin juniper
#

@brittle sinew yeah but what about this tho...

#

If a Actor is dormant... can yoiu still do things like SphereTrace?

#

so i can say... check every 5 seconds, if a client is near us, wake up again?

brittle sinew
#

You wouldn't do a manual check for something like that; you would probably just override GetNetDormancy

#

Unless you want to change dormancy for all clients, in which case dormancy only applies to replication

#

AFAIK, it has no effect on the server version of the object

twin juniper
#

Yeah essentially i just want my actors to go into dormancy when no player is there

#

@brittle sinew is there nothing which can make an actor just not do anything on the network

#

if a client isnt nearby

brittle sinew
#

...isn't that what we're discussing?

#

I don't believe there's anything that does it automatically, no

twin juniper
#

yeah but u said ```AFAIK, it has no effect on the server version of the object

#

if it has no effect on the server version... wouldnt it still be running that code

#

on the serverr?

#

like AI stufdf...etc

brittle sinew
#

Yes.

#

But that's not on the network.

twin juniper
#

but wouldnt it still slow things down

#

lol

#

becausse the server is still running it?

#

just not "replicating" it

fossil spoke
#

You could stop it from ticking if its not actively replicating?

brittle sinew
#

"Is there a way to completely remove an actor from the network"

#

"really need to know so i can save bandwidth"

#

The premise of your question was about replication, not running code on the server.

fossil spoke
#

He did answer your question pretty well @twin juniper

twin juniper
#

yes

#

but im just wondering if it would still effect anything

#

like... if its still running?

#

on the server

#

wouldl it slow anything else down?

brittle sinew
#

The actor is still running on the server, yes.

#

"Slow down" is entirely based on what you're doing

#

Like @fossil spoke suggested, perhaps you can also make more optimizations like disabling tick when an actor is dormant

twin juniper
#

hm

#

bool GetNetDormancy(const FVector& ViewPos, const FVector& ViewDir, class AActor* Viewer, AActor* ViewTarget, UActorChannel* InChannel, float Time, bool bLowBandwidth)

#

what is ViewPos? the viewpos of the player?

#

nvm ima look it up on docs

fossil spoke
#

πŸ‘

#

Your best documentation is the code itself. Take an look at how Epic use it.

twin juniper
#

Lol

fossil spoke
#

Thats just AActors version of it

#

Im quite sure that any derivative objects would override it

twin juniper
#

yeah i was looking for an example

#

lol

brittle sinew
#

Yeah ^, that's the whole point of it

#

The function gets called by the engine, and you define the functionality

twin juniper
#

Just not sure what the params mean

fossil spoke
#

I would assume that ViewDirection and ViewPosition are just helpers derived from the Viewer and ViewTarget if i was to take an guess

brittle sinew
#

Check that out, it's a struct that defines a "viewer" over the network

#

Yeah, @fossil spoke is right, it really is what the parameter name describes

twin juniper
#

yeah but what is a "Viewer"

#

lol

#

@brittle sinew

#

oh

#

the player controller

#
    UPROPERTY()
    class AActor* InViewer;```
#
    /** The actor that is being directly viewed, usually a pawn.  Could also be the net actor of consequence */
    UPROPERTY()
    class AActor* ViewTarget;
#

And I'm guessing "ViewTarget" is what the controller is possessing?

brittle sinew
#

It literally tells you in the comment

#

No, it's not necessarily what it's possessing

#

It's what is being viewed

twin juniper
#

yeah idk what that means

#

"viewed"

#

when i hear that word

#

im thinking of a window

#

I "view" a window to look outside of my house.

brittle sinew
#

I'd suggest looking further into the source and looking at the role of FNetViewer in replication

#

I'm not just going to sit here and dig through the source for everything :p

#

I don't know all of this stuff by heart; for a lot of it I'm just using the resources provided to me.

twin juniper
#

mhm

fossil spoke
#

@twin juniper You really need to start researching it yourself. Following the code isnt that hard, it just takes time.

twin juniper
#

@brittle sinew i ended up just printing ther name of "VIewer"

#

viewer is just the player controller

#

lol

#

so yeah

livid aspen
#

Hey guys, is there a specific reason why you're supposed to create a session before opening a level?

#

Let's assume that my lobby for people joining the match is hosted in the level itself.

#

When my player clicks on host a session, I would think that opening the level first and then hosting the session from within that level would make more sense

#

Unless you need to be in a session before opening a level in order for it to sync properly

elder sable
#

the replicatedusing function, is a server function ?

cursive shard
#

Can I ask if Unreal Engine 4 has handlled client side rotation blend/smoothing? From what I see, the movement on client side is smooth but rotation is not.

fossil spoke
#

@cursive shard The CharacterMovementComponent handles network smoothing for movement, but it doesnt handle control rotation smoothing no.

cursive shard
#

Thank you very much, so it means we need to write our own code to deal with the rotation smoothing on client side. Do you have any suggestions about it?

fossil spoke
#

Networked smoothing conceptually is usually the same all round.

#

Smoothing the rotation of the Character on simulated pawns shouldnt be to difficult. Take an look at the CMC and see how Epic does their smoothing you maybe able to get an good idea.

#

Be warned though its not for the faint of heart πŸ˜ƒ

cursive shard
#

@fossil spoke Thanks, I'll take a look at the movement component and see if I can figure out something. πŸ˜€

fossil spoke
#

πŸ‘

tough gyro
#

wouldn't it be better to handle rotation smoothing in animations?

#

that way you could do in place turn animations and such and handle all that in a single place

#

like, the rotation received over network would be the "current desired rotation" and then in the animation you'd interpolate towards that desired rotation from the current rotation of the character mesh

manic pine
#

does the existing replay saved move/client correction system in ucharmovecomp handle externally applied forces at all?

twin juniper
#

@fossil spoke if u think im bad

#

look at some of these customers i work with

#

i send them an API guide with all api methods

#

they email back saying "i cant find it"

#

its literally on ppage 23

ornate meadow
#

Hello

#

can someone help me with replication?

#

I have StaticMeshes that can be picked up by players in game, I am trying to replicate the changes in all the clients but I am not able to

night jay
#

What is your setup?

#

If you have a replicated class with the static mesh, it should automatically update all clients as it's destroyed

twin juniper
#

@brittle sinew btw that reminds me

#

GetNetDormancy() once this returns true it no longer is called... ever

#

so you have to set it back to Dormant_Partial somewhere like in your Tick() function

#

Otherwise it will never call that again

#

it essentially closes the connection

#

which makes sense

short whale
#

On a scale of 1 which is "I don't care" to 10 "Are you completely retarded to ignore it?", how important is this warning:
LogScriptCore: Warning: Script Msg: FindSessionsCallback - Invalid player state
I have problems seeing my lan hosted session

twin juniper
#

Also I found out that you can make an actor come out of dormancy via AIPerception, and I believe just walking into it makes it wake up

#

it may just be one or the other... not sure yet

#

Yeah it looks like its just the AIPerception component

#

but thats actually really useful to know lol

#

@brittle sinew

merry hemlock
#

Epic has a livestream for local coop splitscreen, does anyone know if they have a simple LAN one...I'm trying to have some extremely simple interaction between a VR player and a spectator.....there is no spectator screen interaction implemented currently, so someone recommended using multiplayer to get the functionality I needed... I couldn't find any videos describing the cross VR and non-VR but that should be a simple player controller change and different pawn. Does anyone have a go-to video they recommend to all LAN multiplayer beginniners in Unreal?

thin stratus
#

It works the same way as normal multiplayer

#

You have to check which is the VR player or make sure that always the VR player hosts

#

Then you can simply decide in PostLogin what pawn to spawn

merry hemlock
#

I'm completely new to multiplayer in general, I'm about to go experiment but is it as simple as opening up the same project in the editor on two different computers on the same network? (and start the VR one first?)

#

I'm going to scour for some more video I just wanted to check to make sure that is the general principle

thin stratus
#

Well you want to maybe package the project

#

Or at least run as standalone

#

Two editors don't connect (well)

merry hemlock
#

that makes sense....all I literally want is to be able to click a button on the 2nd client and get one piece of data from the first, which should already be present if I replicate it through the game mode

thin stratus
#

GameMode doesn't replicate

merry hemlock
#

GameInstance?

thin stratus
#

Neither

#

GameState

merry hemlock
#

That's the one...THANK YOU'

twin juniper
#

@thin stratus ive finally implemented network dormancy

#

πŸ˜„

#

@thin stratus i think im gonna implement it on not only my NPCs now

#

but also on my structures

#

Lol.

#

I might make a few videos on this

#

because this is honestly a really under-explained feature

shy nymph
#

@thin stratus just found your 'Unreal Engine 4' Network Compendium πŸ˜„ the website doesn't exist anymore, can you find the mentioned "blogposts" anywhere?^^

shy nymph
#

oh lol.. sry ^^#

twin juniper
#

Network Dormancy if anyone wants to know how to implement it

pallid mesa
#

xD

#

the doritos and the taco

twin juniper
#

lol thats from my twitch stream ha ha

shy nymph
#

@thin stratus lol dude i just now realised that your from NRW germany, me too man ^^

wary willow
#

Stalker alert

shy nymph
#

just looked at the about me page man xDD

distant wave
#

@wary willow Who is that guy?

#

I can remember that face

#

but not the name

manic pine
#

what exactly is the purpose of the bNetForce parameter in Actor::Destroy() ?

wary willow
#

@manic pine Ignored unless called during play. Default is false. says the wise dev

manic pine
#

yeah, i didnt feel the description cleared it up so much

thin stratus
#

@shy nymph :P actually not living in NRW atm

#

Not even Germany

shy nymph
#

livin the dream ^^

ripe raptor
#

Quick question - is it possible to have a mix of local and online multiplayer, meaning that say, two people are playing on a shared screen while connected to another 2 people via internet?

#

so effectively 4 players on 2 clients?

wary willow
#

@ripe raptor Yes

#

Rocket League

#

ggwp

ripe raptor
#

Ah :p

#

thanks

merry hemlock
#

I following along some Epic streams on multiplayer and blueprint replication.... he connected basically two clients on the same machine...is there more to making it work when you have two separate machines on the same network? for the client machine, how do I enter the local ip address, or does the engine just magically know to connect to the right one (seems unlikely but multiplayer is new to me )

merry hemlock
#

fucking windows 10, I know it is fucking with me

#

I can't see the computer on the network even though I have a goddamn ethernet going from one to the other

severe widget
#

welcome to windows

merry hemlock
#

fuck you SOOOOO much Windows 10

#

I can ping the other computer all night

#

and vice versa

#

but nothing in the explorer

fossil spoke
#

Did you allow it to be shared on the network?

#

@merry hemlock You have to enable network sharing for it to be visible

merry hemlock
#

@fossil spoke Do you mean network discovery? it's turned on both

fossil spoke
#

Yeah

merry hemlock
#

I'm still not sure if it is more of a windows problem

#

I can ping both IP addresses

thin stratus
#

@merry hemlock Why even looking at that?

#

Just start the two games and enter "open MapName?listen" into the console on the host and "open IPADDRESS" on the client

#

Or setup Sessions, as they work for LAN even with Subsystem NULL

#

And no, it doesn't know the IP magically

#

Might be that OpenLevel node also works for the IP Address

#

In general you canexpose that to UMG then and have the player enter the IP

compact gulch
#

hey guys.. i'm wondering what's the path going forward for a project going steam dedicated server

#

what options do I have?

shy nymph
#

@compact gulch man don't eeeeven get me started xDD been working on that the past two weeks...

#

so i managed to get the dedicated server registered in the steam subsystem but so far i can't get the clients to find the session

#

basically you just need to have an unreal source build to build your dedicated server with steam subsystem activated and modify some c++ code

compact gulch
#

@shy nymph what's your implementation you are choosing for

#

i'll look into that thanks

#

I'm a bit lost on a few things ( let me know if those things are covered int he guide, i'm reading them as i type ) :

  1. if we use something like Gamelift , is OSSteam still valid? h ow do you authenticate
  2. I've used something like gamespark ( currently stilll using ) , how woudl I get it to launch dedicated server from there? . I saw ryanjon2040 using node.js as an intermediary , is there an alternative
thin stratus
#

Well no, non the guides cover GameLift or GameSparks

#

That's also non-documented in general as it's a pretty specific setup

#

GameLift and GameSparks each alone have documentation on their end that you can follow

compact gulch
#

Gamesparks as far as I know provide no option to communicate to hosting server

#

hosting service*

thin stratus
#

It does, HTTP Request

compact gulch
#

GameLift on the other hand have no way to do steamAuth

thin stratus
#

GameLift is not meant for ServerLists

#

So Steam ServerLists aren't really a thing for it

compact gulch
#

when you say serverlists are you talking about master browser?

#

sorry a bit unfamiliar with the terms

thin stratus
#

Yeah

compact gulch
#

i'm intending to do matchmaking type only hosting where instances are host and specific players are pulled in

#

i beleive that would not need server list yes?

thin stratus
#

Correct

#

SteamAuth is to make sure the connecting client is owning the game on Steam

#

Doesn't have a lot to do with GameLift

compact gulch
#

how do we uniquely idneity user then?

#

if not via their steam id

#

i'm using gamespark now and i use that

#

*identify

thin stratus
#

GameSparks can use Steam to authenticate a Player

compact gulch
#

you're suggesting to use gamespark + Gamelift?

#

@gentle drum

thin stratus
#

Well, what is your idea?

compact gulch
#

i thought to use either one

thin stratus
#

They are two different services

#

Not in the slightest the same

compact gulch
#

let me ponder my ignorance for a moment

#

so far i'm using DB, Auth and cloud on gamespark.. ... hmm.
right... Gamelift is for hosting

#

ahh okay okay .... i see how using both could work.. gamepsark would then need to communicate with gamelift to host it and enter in parameter for which player this is being hosted for

#

all via http request

#

@thin stratus typically when you host dedicated server that uses steamsession. does this mean the Dedicated instance would have a steam login ( and a steam user ) as well? I can't quite imagine how it would work without

thin stratus
#

Dedicated Servers for Steam are a bit annoying using UE4.

#

The default implementation by Epic doesn't use any Auth

#

Means everyone can connect, even with pirated games etc

compact gulch
#

right

#

i see. this is where you need your own WebAPI to steam to auth with service like gamespark right?

thin stratus
#

Doubt that. You would rather need to implement the Auth stuff to the Server

#

So that, on connection, it checks

#

And kicks the client if it's not valid

compact gulch
#

you're referring here to using Steamworks to manually auth?

#

<-- in the server

thin stratus
#

Yeah

compact gulch
#

something like that

#

wouldn't be able to use steam out of the box

thin stratus
#

I would not say it's a GameLift or GameSparks thing

#

GameLift is just there to boot up sessions

#

GameSparks for Data and Matchmaking

#

The Server needs to work with Steam even without GameLift

compact gulch
#

right..... are you implementing something like this yourself?

#

mind to share high level overview of your architecture?

thin stratus
#

I did set this up for clients. Can't share, sorry

compact gulch
#

ah ic alright

inner iris
#

Are there any ways other than delay nodes to offset the timing of things slightly? I find that certain initialize functions won't fire off unless I put at least a .1 second delay before them- happens especially with On Possessed / Begin Play events

#

Problem is it starts to get messy having delays around- eg Gamemode has a delay before spawning AI characters to ensure all human characters are spawned/ fully initialized first

thin stratus
#

Ehm, usually you code it the way that you are sure that what ever you need to access actually exist

#

eg Gamemode has a delay before spawning AI characters to ensure all human characters are spawned/ fully initialized first

inner iris
#

Well in this case simply setting team colors could be an example- if you spawn and immediately set team colors, they don't get set

thin stratus
#

Call the AI Spawning stuff after all player joined

#

On my end they do

#

I set Team from Controller to Character on possess

#

That replicates to Clients as it's repnotify

#

and sets the color

inner iris
#

Might be due to the fact that I have net pkt lag at 200ms and the team colors are set from the server

thin stratus
#

Could be

#

However I haven't used a single delay in my games

#

If at all, then a Timer, but only for actually time things, not for delaying a call

inner iris
#

If that is the case then how would it work in a real life scenario- server thinks players have spawned but they haven't initialized yet- it spawns too many AI

thin stratus
#

Well, "not for delaying a call that would fail otherwise" might be better

inner iris
#

Due to latency

thin stratus
#

You spawn the AI only after everyone connected

#

Or you kick an AI for a new player

inner iris
#

Good points!

#

Still not sure about the init player with latency, I just tested without any simulated latency and it worked fine

#

With latency it won't fire off on time

#

I think it just fires off on server before the client has actually possessed- perhaps changing my architecture a bit so that all properties will be replicated down anyway will work fine

#

@thin stratus Do you just have a bool like "bSetTeamColors"? Which then fires off the RepNotify event?

thin stratus
#

Enum, but yeah

inner iris
#

Oh so I can do it while setting my actual team int variable- so like set int "Team" - that will fire the repnotify event which will check if colors are set

#

Smart! 2 birds with one stone!

#

Thanks for the help- will feel so good to not have hidden delays all over the place

thin stratus
#

TextField->SetText("")?

#

or at least wrap it into three ` in front and behind the code

twin juniper
#

ok thanks

#

i gonna edit the i put in pastbeen sorry

#

i post in pastbean

#

sorry is not textfield but UEditableTextBox

#

i find the soluction for the empty text

#

now i have find a away the change the menu by switcher when login is sucess

manic pine
#

i have a laser weapon which is fired by a client connected to a dedicated server. when the client's fire command reaches the server, the server does a multicast to the other clients telling them to spawn a beam emitter to simulate the shot. the first time client#1 shoots after loading map, client#2 can see the shot immediately. every time thereafter, there appears to be a seemingly random(0-500ms) delay between client#1 shooting and client#2 seeing the effect. any ideas what could cause this? its all run locally, so there's no noticeable latency involved.

twin juniper
#

i canΒ΄t put to work

#

the problem its my var is non static the function i want call its static function

#

can someone help-me

finite raft
#

@twin juniper You could use a lambda with this capture like this:

authRequest.Send([this](GameSparks::Core::GS gs&, const GameSparks::Api::Responses::AuthenticationResponse& response){
    AuthenticationRequest_Response(gs, response);
    this->Sucesso();
});
shy nymph
#

Is a question about MakeShareable in a context of Multiplayer code appropriate here?

twin juniper
#

i cant put it work

#

its onther away

#

the problem it is non statick var in static functionj

finite raft
#

yes, I understand. Using a lambda you can capture the this pointer into a static callback. You need to move all non-static code from AuthenticationRequest_Response into the body of the lambda.

#

I assume you want to call Sucesso() from the static callback AuthenticationRequest_Response ?

twin juniper
#

yes

#

and AuthenticationRequest_Response its static

#

the sucess

#

its not static one

finite raft
#

@twin juniper Whats the error you are getting when you use the code I posted above instead of:

authRequest.Send(AuthenticationRequest_Response);
twin juniper
#

Severity Code Description Project File Line Suppression State
Error (active) identifier "response" is undefined TheLegendsOfArthur f:\Unreal ProjectsServer\TheLegendsOfArthur\Source\TheLegendsOfArthur\Widgets\Login.cpp 79
Error (active) expected a ')' TheLegendsOfArthur f:\Unreal ProjectsServer\TheLegendsOfArthur\Source\TheLegendsOfArthur\Widgets\Login.cpp 78
Error (active) no instance of overloaded function "GameSparks::Api::Requests::AuthenticationRequest::Send" matches the argument list TheLegendsOfArthur f:\Unreal ProjectsServer\TheLegendsOfArthur\Source\TheLegendsOfArthur\Widgets\Login.cpp 78

finite raft
#
authRequest.Send([this](GameSparks::Core::GS& gs, const GameSparks::Api::Responses::AuthenticationResponse& response){
    AuthenticationRequest_Response(gs, response);
    this->Sucesso();
});
#

had a typo, the & was at the wrong location

#

sorry, did not compile it by myself

finite raft
#

you now have two calls to authRequest.Send(). Remove the first one. And since you copied all the code from AuthenticationRequest_Response into the body of the lambda, it is no longer necessary to call the function from inside the lamda.

twin juniper
#

ok

#

So.... how again, do I check to see if an Actor is relavant to any ACharacter?

#

Is there a way to see if it is active to ANY?

#

IsActorRelavantToAnyone()?

#

Lol

#

Is that possible?

finite raft
#

looks good from here, (you don't need to call the empty function in line 77 though). Does it do what you wanted to achieve?

twin juniper
#

thanks its working now

finite raft
#

glad to help

twin juniper
#

do know i reatrive a scriptdata from gamespark

#

@finite raft do know

finite raft
#

I don't know gamespark, sorry

blissful thorn
twin juniper
#

@finite raft thanks

#

ok

nova thistle
#

I want to assign a color to each player that joins based on what 'player slot' they're in, but I have no idea how to determine that value

cerulean rapids
#

Hey guys, im trying to make a cheeky check for all players being loaded in and ready to work. I have this setup here, which im pretty damn sure worked last week, even got a build of it working, but now a week later, and a possible ungine update it is no longer happy.

#

im trying to get the clients to rep notify the server that they are receiving replication and ready to go

#

the rep notify does not appear to run for any client now it seems

#

just the whole whom is the guy who gets his value set alrdy

#

just the host*

twin vault
#

@cerulean rapids your clients cant execute test1 because the gamemode only exists on the server

#

if i understood correctly

cerulean rapids
#

test1 runs on server, it then casts to the host controller and sets his IsReady to true

#

then their repnotify should trigger and turn their own other bool to true on the server

#

but their rep notify wont even trigger so idk :/

twin vault
#

but if its running on server, and you are only getting the first player controller, wont it always be the server itself?

manic pine
#

could the cast to archerycontroller be failing?

cerulean rapids
#

no the cast is working :/

twin vault
cerulean rapids
#

yes

#

grab the host controller

manic pine
#

index 0 of th eplayer controller would be either the first client, or the listenserver client

#

either way it should be enough to trigger it

cerulean rapids
#

aye, it works and it sets the hosts IsReady to true

#

thing is, clients repnotify isnt triggering off of that

twin vault
#

ah

brittle sinew
#

How do you expect it to?

cerulean rapids
#

wait

#

i think i just fucking woke up to my own retardation

brittle sinew
#

The host's PlayerController only exists on the server; the clients don't know about it

twin vault
#

lol

#

yeah only the server have all the player controllers right

manic pine
#

hes calling it from the server on the first player controller, which is either the listenserver or the first client

cerulean rapids
#

anyway, with that scrapped, and lets all just ingore the fact that it somehow worked in this state last week

#

whats the best way for me to notify the server when all clients are ready to recieve replication and go baby go

brittle sinew
#

Sure, but the RepNotify would only occur on that controller, which doesn't exist on the clients @manic pine

manic pine
#

it exists on the client that owns it

brittle sinew
#

Which is only one client, at most.

#

Most likely it'd be the server's PlayerController

manic pine
#

right, presumably hes planning on looping through it

brittle sinew
#

Well, that's not what was shown :p

manic pine
#

either way there should be one call going through

#

i.e. one notify going through, in turn causing one server rpc

cerulean rapids
#

would the best way here, be to set all controllers to ready, and have them repnotify to set their own serverready bool on server?

manic pine
#

if the server controls when a client is ready, why do you need to send it forth then back again?

cerulean rapids
#

i simply want to know when all players have loaded in, so i can go through the game setup/possess process

manic pine
#

you have a PostLogin function you can override in gamemode

cerulean rapids
#

im not the most experienced in unreal, so im probably trying in my own butchered pig-breed methods

manic pine
#

you can check there whether i.e. numberplayers >= minimum players

twin vault
#

in my game im just sending a RPC saying 'im ready', when everyone sends it the game starts

#

from pc

cerulean rapids
#

can u explain that in a little more detail for me takain? it sounds perfect

twin vault
#

sec

cerulean rapids
#

all the time you need πŸ˜ƒ

#

also, isnt the post-login a little iffy?

manic pine
#

how so?

#

its all about whta you want

#

if you want e.g. the game to start once a certain number of players have joined the game, postlogin is great

twin vault
#

it works if you start when everyone connect, but i need a delay to choose the character

cerulean rapids
#

i can remember it not doing what i want, i played with it a lot last week, like it triggers too early or something

manic pine
#

if you want to wait until a certain number of players have pressed "join game"(after having joined server), then takains suggestion is great

#

well, you could use the postlogin to start a timer which in turn triggers start of match

twin vault
#

its CPP but you get the idea:

PlayerController:

Declaration:
    UFUNCTION(Server, reliable, WithValidation)
        void SetPlayerReady();

Implementation:
    Ready = true;

Gamemode: 

Declaration:
    UFUNCTION()
        bool CheckEveryoneReady();

Implementation:

    bool bEveryoneReady = true;

    for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
    {
        bEveryoneReady = bEveryoneReady && Cast<ALobbyPlayerController>(Iterator->Get())->Ready;
    }

    return bEveryoneReady;

#

i wont tell its the best way, im using ue4 for six months only

cerulean rapids
#

ah wait, im using seamless travel, is that why postlogin wont work

manic pine
#

havent used seamless travel myself, but that should be separate from postlogin entirely

cerulean rapids
#

it means my controllers never leave, they simply change

#

so i use Event OnSwapPlayerControllers, which triggers for all of them before the level is loaded

twin vault
#

yeah it wont fire

cerulean rapids
#

now takain it has been a while since i touched an actual language

twin vault
#

it simple does that "set variable Ready of playercontroller to true > Execute on server, reliable, with validation"

#

all players controller will have Ready after everyone clicked my button

#

on the server i just check if all player controllers Ready's are true

#

(i didnt have a way to unready)

cerulean rapids
#

so if i did something along the lines of beginplay -> run on client custom -> run on client custom[set var rdy] ? or is this stupid and redundant

#

run on client --> run o server

#

i cocked that a bit

twin vault
#

yeah in my case the players decided when to be ready, so i called from client to execute on server

#

could be the other way around if needed

cerulean rapids
#

but wait, server has a copy of all controllers right

twin vault
#

yeap

cerulean rapids
#

even if i do a run on client command, it will run on all the controllers from the server right away

twin vault
#

run on client works like that > tells everyone that object X must execute code Y, if the object X doesnt exist on the client, it cant execute the code

#

it executes locally, on the persons computer

cerulean rapids
#

yeh so this wouldant work

twin vault
#

ye

cerulean rapids
#

D:

twin vault
#

xd

cerulean rapids
#

either im not amazingly smart, which is highly possible. or this is a slightly overlooked aspect of seamless travel

twin vault
#

only difference is the PostLogin

#

if you need to send from server to tell when the players are ready

cerulean rapids
#

i just need it so that, when all players are loaded and ready to recieve replication, the server gets a bump. so he can start the show.

twin vault
#

makes sense but i never did it, will let someone else answer that

cerulean rapids
#

i understand friend

#

appreciate the time πŸ˜ƒ

twin vault
#

np :3

cerulean rapids
#

I'm still struggling to find the best way to notify my gamemode that all of my clients have loaded in and are ready to recieve replication/possess. Using seamless travel, so i can't use postlogin

#

if any1 has any ideas, id love to hear πŸ˜ƒ

twin juniper
#

@@cerulean rapids HUD!

#

It's only loaded on client

#

So I call "fakepostlogin" to PC and PC does the RPC to server

wary willow
#

@twin juniper Yo, what are you guys calling the update?

#

BTW, just saw the trailer, looking good!

twin juniper
#

@wary willow Ctrl Alt Delete πŸ˜ƒ

#

Trailer? I don't think that's done yet

#

We posted a little gameplay vid

wary willow
#

Ah yeah w/e it was

#

gripper

twin juniper
#

Slinger πŸ˜‰

halcyon abyss
#

Hey guys

#

just a quick question

#

I'm replicating a character

#

and I'm rotation the pawn's yaw with the rotation control

#

but i control the pitch only on the animblueprint

#

I thought that the control rotation would be replicated but it isn't... I wouldn't want to double the amount of traffic for the rotator... What would be the best approach?

cursive shard
#

Hello, has anyone come across an issue that NPCs shakes a little when working on slopes on a dedicated server?

regal narwhal
#

hello, I cant find my session? before use find session I already created a session

thin stratus
#

Under what circumstances?

#

@halcyon abyss Control rotation isn't replicated in that regard as the Controller itself only exist on Server and Local Client

#

So if you want to rotate something for Pitch, you'd need to replicate that float in addition

#

You can set it to SkipOwner if needed/wanted

halcyon abyss
#

Hey cedric Thanks for your answer... yes I know it isn't replicated but I was hoping that setting the "use controller desired rotation" boolean on the character component would replicate that rotator instead of the pawns rotation

#

well anyway

#

I'm working around it by sending rpc's for that rotation

#

unfortunately I can't remove the pawns rotation from being replicated

grand kestrel
#

Ah actually

#

Use get base aim rotation it stems from replicated pitch

#

I believe view rotation is also

#

No need to replicate another pitch var

halcyon abyss
#

base aim rotation? where do I find that?

grand kestrel
#

Pawn

halcyon abyss
#

Thanks for replying Vaei btw πŸ˜ƒ

#

so your saying that the aim rotation is replicated?

grand kestrel
#

No, the result it gets stems from the rotation that's replicated through cmc's prediction

#

Get base aim rotation is a function belonging to pawn, available to bp and cpp alike

halcyon abyss
#

yeah I found it

#

but i'm trying to understand what it does exactly

#

where it gets the rotation from

#

wow that does work on the client

#

where can i find a tutorial on this aim rotation function

#

I'd like to understand it in depth

grand kestrel
#

Lol, it's being replicated through cmc prediction

halcyon abyss
#

Vaei thank you so much! this saves me so much on traffic

#

πŸ˜ƒ

#

since we're here

#

I'm trying to figure out a good value for the Net update frequence

#

frequency

#

I set it to 30... but it's not that smooth

grand kestrel
#

100 and keep lowering until you can notice it then add 5 to 10

#

I guess

halcyon abyss
#

cmc doesnt do any smoothing though right?

grand kestrel
#

For a shooter go for 100

#

In what context

halcyon abyss
#

in between values

#

it doesnt smooth rotation out

#

or at least not as much i guess

grand kestrel
#

It compresses pitch and yaw to int32

#

For replication

halcyon abyss
#

yes exactly.... which scares me for precise aiming

#

but i was ignoring that as of now

#

probably does no compression on the aim

#

just last thing

#

what im not getting is... im running 90 fps...

#

why would i have 100 on net freq

grand kestrel
#

Fps and net frequency are unrelated

halcyon abyss
#

...oh... i though fps would logically cap net freq

#

so I'm missing something important here

#

if the game runs slower than the update it sends on the net.... then... what is it sending during those gaps?

grand kestrel
#

Replication isn't tied to the tick

manic pine
#

it has to be... no need to update unless data's changed

halcyon abyss
#

yeah I trust you! πŸ˜ƒ was just trying to explain it to myself... to consolidate this knowledge

manic pine
#

data only changes in tick

halcyon abyss
#

yeah that's what I'm wondering πŸ˜ƒ

manic pine
#

your server's fps wont be stable though

#

well, might not be

#

netfrequency seems to be used to create netupdatetime

halcyon abyss
#

So i got 10 players

#

each with a netfrequency of 100

#

I'd really like to understand and estimate a good frequence to not clog things up

manic pine
#

how much is really replicated though?

halcyon abyss
#

its the cmc thats it

#

all the rest are one shot rpcs

#

im not replicating anything else on tick or anything

manic pine
#

if its just cmc then its a tradeoff between enemy responsivness for clients vs bandwidth on server/client

#

i think the only good way to find an answer there is testing

halcyon abyss
#

alright thanks πŸ˜ƒ what do you mean by enemy responsiveness thoug?

#

though*

manic pine
#

you are client#1 and are watching client#2

#

if updatefrequency is 1(1 per second), your computer will only receive direction changes etc for client2 once per second

#

the rest of the time the cmc will simply interpolate

halcyon abyss
#

oh yes of course! Didn't understnd you meant that by enemy responsiveness

#

Yeah ill just test around a bit

#

although im not very happy with cmc's interpolation

manic pine
#

i think for small arena-type games, 100 is probably okay

halcyon abyss
#

it's not as smooth

manic pine
#

for something large scale you'd probably wanna do lower though

halcyon abyss
#

awesome! thank you so much Raap!

manic pine
#

there's tons of factors involved however, including server fps as you've noted

#

many unreal tournament players claimed to notice a huge difference for servers running at 40fps vs servers running 100-120fps

twin juniper
#

Hey guys, CharacterMovementComponent seems to be very heavy on Tick() performance on the CPU

#

I was wondering if there is a way to improve performance

#

for the CharMoveComponent

dusty sleet
#

what is the best method of creating a party and then having that party join a dedicated server as a team?

jolly siren
#

Beacons

dusty sleet
#

@jolly siren you know of any working examples/docs to get an idea of how to set it up?

dusty sleet
#

thanks

jolly siren
#

np

elder sable
#

when we replicate an object, only members marked replicated are replicated ?

jolly siren
#

yes

elder sable
#

ok thanks

twin juniper
#

Anyone know if Stat StartFile is doing a CPU profile on the client or the server? Or both? I'm refering to when we are running it in editor with "Run Dedicated Server" checked.

#

Because I need to know if some of these tick functions can be disabled on the client side or if they need to be disabled on both.

jolly siren
#

If you are using a single process then I would assume both

twin juniper
#

Yeah its just... Tick() on my AI Character movement components are taking up a ton of Frame time.

#

So Im not sure how to deal with it because i cant just disable tick on that component or they wont move at all

#

Was just wondering if youn know how to resolve this issue.

jolly siren
#

You have a ton of AI? Have you set the default land movement mode to navmesh walking?

#

I know that is what Paragon uses

twin juniper
#

@jolly siren yea

#

doesnt look to do much though

compact gulch
#

hey.. question... is using -server on standalone commandline sufficient to test dedicated server?

#

i'm running -server -log -nosteam

#

but my other standalone client can't seems to join with "open 127.0.0.1" no error message. just nothing happens

#

any idea why?

next falcon
#

Guys can i make a game with 2 different maps who players can switch. like one player plays on Map1 and the other guy on Map2? and if it works how can i do that ?

final thicket
#

When it comes to using the steam sub system and the interfaces of steams API is Advanced sessions the best way to go ?

#

(With BP)

thin stratus
#

Depends on what Server model you want to use

#

But in generall it's good to go

#

UWorks would also work, doesn't use the Subsystem Interface though (not yet)

#

Idk how much additional things AdvanceSessions has by now

#

But UWorks properly reimplemented all Steam stuff

#

(in my eyes even better than Epic)

wise depot
#

yeah the default steam implementation is pretty trashy imo, i haven't tried UWorks myself but Advanced Sessions (at least as of 4.14) has a lot of its functionality opened up as far as session things go

#

the likes of leaderboards, stats etc I wrote our own implementation of which really isn't difficult to do with the steamworks documentation providing most of it for you to just c&p

#

@next falcon i can't remember how but yeah its possible to do, somewhere IIRC there is a checkbox along the lines of "allow players to be on different maps"

unborn nimbus
#

What's the best way to go about calling an RPC on an object that is placed into the world instead of spawned?

next falcon
#

What is IIRC ?

unborn nimbus
#

If I remember correctly

next falcon
#

oh okay thanks

#

@wise depot which lines ?

sweet spire
#

"allow players to be on different maps" wat?

#

If your talking about level streaming, if u level stream in multiplayer as far as im aware it forces all players to load every single level in even if there not in it

shy nymph
#

Okay guys... im about to lose it D: What else can i do to figure out why i can't find the online session of my dedicated server hosted into the steam Subsystem? I've tried everything but im about to run out of stuff to change to test whats going wrong 😦

wise depot
#

Sorry i was thinking about the wrong engine

#

so in UE4 if you want the client to be on a different level you just stream it in somewhere

shy nymph
wise depot
#

have one persistent level for the server, stream in the maps you need and tell the clients to load in the map they're supposed to belong to at the time

shy nymph
wise depot
#

i'm pretty sure decicated servers don't suppose "presence"

#

hold on let me check, there was something about it a while back on the advanced sessions thread

shy nymph
#

presence is false?

#

i looked through that but couldn't really find anything useful, i was working with the advanced sessions plugin but now im trying on my own since it wouldn't work

#

well it still doesn't u..u

wise depot
#

allow join via prescence maybe?

#

its been a while since i've played with dedicated servers

shy nymph
#

hm i could try to set this to false, let me get back at you..

wise depot
#

break through it and see where its failing internally?

#

is an option i guess

shy nymph
#

can you do that? i mean you have to use stand alone to use steam right?

#

i tried but it would use the OnlineSessionNull to find sessions stepping through it and thats not what i need

wise depot
#

yeah

#

just launch the thing and attach the debugger to it