#multiplayer

1 messages ยท Page 378 of 1

twin juniper
#

?

pallid mesa
#

So ideally you can cache your player state on your char

#

And then access it as you like

twin juniper
#

and now...

#

maybe i could set owner to player controller?

#

to get player state from that?

winter plover
#

you can get the PC from the pawn too

#

so you dont really have to, but sure why not

#

it shouldnt make any difference

#

since you wanna score the player, not the character

pallid mesa
#

Just set the owner to whatever is more comfy for you

twin juniper
pallid mesa
#

Dont use that node.

winter plover
#

uhh

#

now you just score whatever pc comes first

#

not the one that necessarily did the shot

twin juniper
#

so i need then GetController?

winter plover
#

you wanna get the controller of whatever fired your projectile

twin juniper
#

yes

#

of the player firing it

#

but it all runs on server

winter plover
#

you still need the specific player controller

#

that represents the firing player

pallid mesa
#

Not exactly GetPlayerController gets the local controller only executed purely on the client. If executed on the server will return different things on dc server and listen server

winter plover
#

otherwise some other player is getting the score

twin juniper
#

so waht node i need

#

GetController is different from GetPlayerController

pallid mesa
#

GetController ()

twin juniper
#

?

#

k

pallid mesa
#

Yes

winter plover
#

you wanna get the controller of your set owner specifically

twin juniper
pallid mesa
#

That one. If self is your pawn.

twin juniper
#

after it hits someone

pallid mesa
#

Yeah looks right

twin juniper
#

it will give 1 score per hit, not kill, seems legit

pallid mesa
#

XD

twin juniper
#

i could make it so killing someone gives 2 points

winter plover
#

you will need a different event for that then

pallid mesa
#

Yes

winter plover
#

after you take damage

#

check on whether or not you have died

#

and if so, pass the instigator of the damage

#

to properly award the kill

twin juniper
#

it works!

#

thanks

pallid mesa
#

Or you can reward players that hit the people

winter plover
#

or that ...

pallid mesa
#

I do that for a personal project hehehe

#

That depends on your game design

twin juniper
#

what i want to do - 1 point per hit (takes 5 hits to kill someone) and 2 points for kill, so you have something why you want to kill someone but not just hit him

winter plover
#

I see

twin juniper
#

and per death it takes away 2 points

winter plover
#

nvm me then

pallid mesa
#

Yeah can do aswell, just check the hp of the hit person

twin juniper
#

yep

#

and it fixed my scoreboard too, because points were not going for players they should be going

pallid mesa
#

Nice :) glad to help

#

Also something else, if you cache your playerstate in your player controller

twin juniper
#

mhmm

pallid mesa
#

You will avoid a cast

twin juniper
#

another problem xd

pallid mesa
#

And that will make the code to run faster (to sumarize)

twin juniper
#

when i get the health of player, it shows different on server and client

winter plover
#

is that a blueprint thing?

twin juniper
#

BP

winter plover
#

Because I usually dont bother caching my casts

#

afaik it's more of a compiler thing in c++

twin juniper
#

when i check health client sees 3, server sees 2, client sees the health but +1

pallid mesa
#

Its better to cache when you are going to use a lot a variable

twin juniper
#

maybe cuz client does that first ยฏ_(ใƒ„)_/ยฏ

pallid mesa
#

Make sure you get the appropiate health value

#

Because the rpc takes a lil bit to replicate

#

You avoid this problem by using an onRepNotify on the health variable

twin juniper
#

oh i did 0.05 seconds delay

#

and it fixed

#

it was in that Projectile BP, not in character

pallid mesa
#

Thats not a very ideal solution but if it works it works XD

#

And OnRep would fix it

twin juniper
#

but i dont want to go through several BP's to change 1 variable, i have my solution ๐Ÿ˜„

pallid mesa
#

Aye

#

If it works it works ๐Ÿคท

#

You can refactor it later on :P

#

Just saying

twin juniper
#

same with fixing stuff - just get duct tape and tape it together... if it works it works ยฏ_(ใƒ„)_/ยฏ

winter plover
#

what he said

#

so god damn much

#

I am only now getting around making stuff a bit more clean

#

and consistent in naming lol

twin juniper
#

im trying to do it the cleanest way

winter plover
#

although you should try to build stuff in a way that's easily extendable

#

and not too locked down

twin juniper
#

so like everything of the 1 thing is in 1 BP, so it doesnt go to other and back

winter plover
#

ie. use loooots of interfaces

#

abstract as much as you can

pallid mesa
#

Usually the most efficient code is not the most reliable

#

So Its a balance

winter plover
#

yea

#

goes doubly so for any multiplayer project

#

because you gotta do client prediction and stuff

#

and it gets kinda messy

twin juniper
#

i cant decide... if player has 5 hp and 1 hit takes away 1 hp, 1 hit gives 1 point, 1 death takes away 2 points, then should for kill it give 2 or 3 points?

winter plover
#

thats a design decision

#

and we dont really know your game well enough for that I suppose

twin juniper
#

mhmm

pallid mesa
#

Just do what you like more :P

twin juniper
#

time for meth math

pallid mesa
#

Hehehe

magic crest
#

๐Ÿ˜ƒ

winter plover
#

me personally I like to avoid scores

#

I am more of an objectives kinda guy

twin juniper
#

that game im making is a deathmatch game with few minutes on timer

magic crest
#

Quick question. A variable acquired in C++ beginPlay, returns null in BP begin play

pallid mesa
#

Im the opposite, I give points for everything

magic crest
#

da fuq

pallid mesa
#

@magic crest called the parent on BP?

winter plover
#

yea you gotta call the super

twin juniper
#

wait so my point scoring system.......

#

mhmm

pallid mesa
#

Right click on begin play node and click on "AddCall to parent"

twin juniper
#

i full kill = 6 points

#

1 death = -2

pallid mesa
#

@magic crest

twin juniper
#

4 points total

winter plover
#

If you dont call the super method it wont execute

twin juniper
#

so i will better have it on 2

magic crest
#

i know i had it at some point. one moment

twin juniper
#

i wont be able to get that game to steam

#

thats why i use "SELECT YOUR NAME"

#

thing on joined session

#

and for testing i always name 2 players - xd and xd1

winter plover
#

have you seen what gets on steam? :v

twin juniper
#

i wont be able cuz i dont have money im not even 16 xd

magic crest
#

da fuq is going on here?

twin juniper
#

how to open level as a host so everyone else goes with him in BP? (im using "Open Level" and "Open <Host IP>")

magic crest
#

try ServerTravel

pallid mesa
#

serverrravel

#

Hahah

#

Yeah

magic crest
#

serverGravel ๐Ÿ˜ƒ

pallid mesa
#

Servertravel + options string

magic crest
#

don;t forget ?listen

pallid mesa
#

In BP's you need to execute a command

twin juniper
#

in execute console command?

#

oh

#

k

pallid mesa
#

Ye

twin juniper
#

and do that in GameMode?

#

oh wait no

#

i need it in UserWidget

past totem
winter plover
#

NetMulticast RPC

past totem
#

No idea what you just said lol

winter plover
#

You have to tell each client to play the animation

past totem
#

Okey how do I do that?

winter plover
#

you're working purely with blueprints right?

past totem
#

Yep

winter plover
#

this should help

#

tl;dr an RPC is just one game instance telling another to run a function

past totem
#

Oh okey so I changed the event to multicast from client and then it worked

#

Thanks!

winter plover
#

a NetMulticast in specific is ther server telling ALL clients to do a thing

past totem
#

Okey got it

twin juniper
#

this doesnt work ^

#

the WinnerPlayer is not valid

winged badger
#

@magic crest the ReceiveBeginPlay() (BlueprintImplementableEvent with blueprint DisplayName BeginPlay) is called from AActor::BeginPlay(), which is in turn called from your Super::BeginPlay()

#

so anything in your c++ class that is above Super::BeginPlay() call will execute before blueprint

#

and anything else after

magic crest
#

Thanks @winged badger Btw, does your name mean 'evil'. If so, fala na pomoci ๐Ÿ˜ƒ

twin juniper
#

can anyone help with my problem above?

mild hull
#

@twin juniper your multicast is most likely faster than the replication of winner, i would not replicate the winner but send it with the multicast

twin juniper
mild hull
#

y

thin stratus
#

@magic crest The Parent BeginPlay calls the BP one. So if you override it you mighr want to move the Super call to the end

#

Damn that's old. I should have scrolled

ionic rivet
#

Hi I'm using dedicated I'm connection with ip. I am using steam but ฤฑ don't want to use matchmaking.(Some of the available Steam Interfaces include:)

tulip creek
#

How do you guys generally handle optimization in multiplayer games? I'm hoping there's an easy system that allows me to hide certain objects from a single player but show them to other players. Like if the player disables Foliage for example, to simply hide all the foliage meshes in my level for that player alone. I know this can be done but is there any useful documentation you can point me towards?

high heart
#

@tulip creek This might not be super helpful but if the actors aren't replicated you can just hide them client side. Otherwise I think you might find network relevancy stuff useful

#

in my game i sometimes need things to be invisible for non-local players so I have a multicast version of SetOwnerOnlySee that I wrote. basically it just checks what machine it's on and sets visibility appropriately

#

dunno if that's what you're looking for. let me know

hard lance
#

Hello. Can any recommend any decent tutorials on how to create local/online multiplayer via blueprints? I really struggled to follow along with the Replication Live Training video Unreal put out. I am mostly looking to handle replication for now. Ill worry about the rest of the stuff if I ever get the hang of replication.

lusty dust
#

Can you do dedicated server with steam (advertised by steam) on BP project? Or do I need big boy code to do it? Seeing mixed results in searching online.

high heart
#

@hard lance have you looked into the Multiplayer blueprint sample?

#

The project itself is kind of wonky, but the logic is there in theory

#

it exposes most session functionality to blueprints so you won't need C++

lusty dust
#

thanks, ive got listen host working, I can see it and join that session, but not when run it as dedicated server running on my server VM

#

in any case, from what ive read in the meantime here, it seems like i will have to use some big boy code

high heart
#

@lusty dust I'm not totally sure about your issue but I think you'd more or less need to set up a steam session on your ded the same way you would on a p2p. I believe there's a function in the advanced sessions plugin i posted

#

(in order to get it advertised)

twin juniper
#

I use a dedicated server, I do not want to set up sessions with "Steam Create Sessions" I want to connect with IP. I want information on SteamID, inventory and friends list, how can I do it? @thin stratus

hard lance
#

@high heart Thanks. I cant seem to find that project either. I assume its been deprecated. But I can take a look at the docs you linked. Thanks

high heart
#

@hard lance it's in the learn tab under "Gameplay Concepts"

#

Multiplayer Shootout is the one

#

still i think the advanced sessions plugin is probably better

hard lance
#

Thanks @high heart. I will take a look at that project and do some research on the advanced sessions plugin too when the time comes. I haven't hooked up a plugin yet

nova ermine
#

hey guys so i have a actor that simulates physics in my level, but the client cant see it at all. I have replicate movement checked on all the components, and yet the client still can't see it. When I have simulate physics unchecked he can see it.

verbal wave
#

I have a replicated bullet, when hitting a wall it does:

  1. call multitask RPC, to play a spark VFX
  2. destroy itself
    Now I must add a small delay between 1) and 2), otherwise the client won't execute the RPC since it's marked as pending kill (destroyed)
    Is there a cleaner way to do this? A 0.2s delay feels kludgy
winged badger
#

you could call the multicast then TearOff

#

it will make it stop replicating

#

then you can destroy it on each machine locally

magic crest
#

@verbal wave Why not simply call server shot , do traces or whatever you need to do, have a struct with needed data, replicate it and then re-run the whole 'shot simulation' on the client once the struct replicates.

#

Something like this:

void WeaponClass::ServerShot_Implementation()
{
    if(trace)
    {
        HitDataStruct.HitLocation = Hit.Impact;
    }
    
    // Call manually, since it won't trigger on server
    OnRep_HitData();
}

void WeaponClass::OnRep_HitData()
{
    PlayShotEffects(HitDataStruct);
}

void WeaponClass::PlayShotEffects(HitDataStruct& HitDataStruct)
{
    SpawnParticleAtLocation(HitDataStruct.HitLocation);
}

.. and then during gameplay when Fire action is pressed, this gets triggered. You bound it to an action in playerController.

void PlayerClass::OnLeftMouseButtonPressed()
{
    ServerShot();
}
#

Someone correct me if I'm talking rubbish, but this is how I handle my shots. Rama's recommendation from the wiki

#

Works like a charm.

verbal wave
#

@magic crest my projectils are slow (grenades, spider webs etc). I can send a replicated struct to the gun or the pawn, and play effects on hit. However since the projectile has seperated actor I want to seal everything inside it.
Your methodology is awesome though! I can already think of scenarios that this can apply really well, thanks.

magic crest
#

Oooh, sorry. I wasn't aware you had projectiles. I immediately thought 'fast' bullets.

#

What about SetLifeSpan() ?

verbal wave
#

@winged badger I forgot TearOff, gotta try it out. Thank you

#

@magic crest still feels a little naughty ๐Ÿ˜ƒ

magic crest
#

@verbal wave I saw that on udemy course, they said it exists exactly due to latency

verbal wave
#

@winged badger actually if the TearOff RPC arrives faster than PlayEffects (due to terrible network conditions), PlayEffects still wouldn't execute, right?

#

@magic crest makes sense. much better than delay indeed

magic crest
#

But, i'm puzzled. Are you not spawning the projectile over the network? Doesn't the projectile hit the wall on all machines?

verbal wave
#

or I can set lifespan first and set invisible / disable collisions for everything immediately

winged badger
#

and its not a RPC

magic crest
#

That's what I usually do. For pretty much everything, like equipping a wep. Spawn it hidden, start pull animation, trigger visibility, finish pulling out anim.

winged badger
#

virtual void TearOff()

#

at laest, i don't think it is, it just needs to stop replicating the actor

#

it doesn't have to notify clients about it, i believe

verbal wave
#

@winged badger then the client doesn't know it's teared off. But I can include the destroy self part in PlayEffects, that'll work

magic crest
#

@verbal wave Can you use my methodology and instead of playing effects, spawn the projectile locally with data (like direction and projectile speed) set on the server?

winged badger
#

if it doesn't it will continue simulating best it can

#

same as if it lagged out

magic crest
#

Or does the projectile change during flight? ๐Ÿ˜ƒ

winged badger
#

i also tend to spawn projectiles locally, server settles if they hit anything relevant or not

magic crest
#

Yeah. All you need is quick data and then do slow animated things locally.

winged badger
#

basically, i use the Fire(Pressed) to set state EFiringState::Firing

magic crest
#

It's also a good approach to keep your visuals away from logic code in case youyr server becomes dedicated.

winged badger
#

then replicate that state

magic crest
#

so you can safely ommit the OnRep call on the server, since he doesn't need visuals displayed

winged badger
#

and Fire(Released) to set EFiringState::Idle

#

that way i replicate stuff only when firing state changes

magic crest
#

Exactlz, @winged badger . Just replicate states, like bools or enums and react locally

verbal wave
#

@magic crest for bullets they just play effects on clients when hit a wall. But for grenades I actually replicate their movements and handle everything server side because they may go differently because of players movement

magic crest
#

bounce of of players?

winged badger
#

grenade = replicated actor

verbal wave
#

yea

magic crest
#

i see

winged badger
#

so you just need to multicast the animation for character tossing it

#

and replication of grenade actor takes care of the rest

magic crest
#

Personally, I'd keep the projectile non replicated. You can assume that the character's approximation simulation will be close enough (or even better than projectiles approximation movement simulation), so local projectiles will bounce of local players.

#

In the fps example, if you replicate the vector and launch speed, it hits the exact location every single time. I've even played with physics simulation. It was VERY close. Had a small deviation after a 100 shots

#

It was mainly due to fps drops having to run 2 instances of the game on one (fairly old) machine

reef ingot
#

Has anyone used that UETOPIA Online Subsystem?

inland pond
#

Does anyone knows a good way to save my player info data which was prepared within the main menu to get over the connected session via open <ip>? I tried so many things which werent working ๐Ÿ˜ฎ And of course its a multiplayer game so game instance is not a good option.

solar halo
#

PlayerState?

graceful cave
#

bit of a strange issue im dealing with regarding my dedicated server

#

with a lower tickrate, no RPCs are dropped for any client but there are frequent and random disconnects all around

#

basicaly anything under 60

#

even tried 1 tick as an experiment + gameplay joke and i got disconnected as a spectator

#

so i know its not network stress causing it

#

but

#

setting the tickrate to 120, while dropping a lot of nonreliable RPCs, resulted in 0 disconnects

#

what could cause a lower tickrate to disconnect players despite the overall network stability being better?

#

there isnt a happy medium for no dropped RPCs and no disconnects, 60 disconnects players and occasionally doesnt display kill/death messages

inland pond
#

@solar halo I have previously used the playerstate but it will be always reset after I have entered the session.

solar halo
#

Hm

graceful cave
#

@inland pond save your user settings into a struct and create a variable for that struct in the player state which can then be broken

#

then each value can be set by the server as a replicated variable

solar halo
#

I store stuff on PS and when I connect it's fine so idk.

#

So for example I replicate a variable in my PS and it carries over from level to level.

inland pond
#

Yeah thats already downloaded ;P I have also tried his CopyProperties Override

#

@graceful cave Okay I will check. @solar halo Thats interesting I will double check if I havent made a mistake.

#

@solar halo replicated variables were only replicated if set on server side right?

solar halo
#

I'm pretty positive you can only replicate stuff on the server.

#

derp you can replicate on client, but I'm only doing Replicated on the UPROPERTY and DOREPLIFETIME(class, var);

bitter oriole
#

Replication is always from server to client

#

Not "on" on or the other

inland pond
#

@bitter oriole Thanks! I think this was my mistake I have made ๐Ÿ˜œ

solar halo
#

That's what I was thinking, but then I remembered the Client decorator for UPROPERTY.

inland pond
#

I dont get it lol. This is within my JoinMenu. The UpdatePlayerInfo gets called within playerstate on the server.

#

And this section gets called on the gamemode right at the beginning. And already here is the player name not the correct one.

graceful cave
#

and in your game instance or wherever you want to set the values

#

make this variable

#

get the variable in the graph and drag this off

#

then you can properly save values to it

inland pond
#

Thanks for your detailed description. Inside of the collapsed nodes I am using break. And the struct you were refering is in my case playinfo. Switching the node set Player Info with set member [...] still hasn't made my playername come into the game mode :S

graceful cave
#

actually im wrong with the last part

#

get a reference to your game instance in your player state

#

and get the struct variable from there

#

instead of creating a new variable in the player state

#

thats assuming you made the struct in the gameinstance to begin with

inland pond
#

Does it work with your setup on your machine? I cant get it to work

graceful cave
#

basically your gameinstance should look like this

#

and your player state should look like this

slate veldt
#

Hi all, currently working on a multiplayer game, and the player can switch between 1st and 3rd person. When this is done, we have a 1st person representation of the gun, and a third person representation, and each has child static mesh actors for the weapon attachments.
In terms of the visibility chain, the 1st person weapon should only ever be seen by the owning player (bOnlyOwnerSee) , and then we turn on and off the 3rd and 1st meshes for that player via SetOwnerNoSee appropriately when the move into and out of first person.
Currently I'm having to call the same on each of the attachments meshes too, but this seems like a lot of micromanagement
Is there any easier way to setup this visibility chain? For instance, can I just set each of the attachments owner to the appropriate gun and then SetOwnerNoSee on the weapons, at which case it can go down to the children and do the same?

#

Aka, just call it on the weapon and that automatically calls it on the child actors meshes

inland pond
#

@graceful cave Thanks for all the effort but its still not working. Ill give up <.<

winged badger
#

@inland pond do all your players have the same wrong name?

inland pond
#

They all have the default value from the struct

#

in my case "Default"

winged badger
#

you need to be on client-side exec when you fetch it

#

if they are setting it locally (or using Steam name)

#

then RPC that to the server

inland pond
#

Do you mean from the game instance or player state ?

winged badger
#

when your players enters his name, it exists only on his local machine

#

wherever you stored it

#

server can't get it directly

#

server can't query information from clients

inland pond
#

But I call it on the server the storage function and it also arives at the server which I have checked with a print function (Exevute on Server Only)

winged badger
#

so UpdatePlayerInfo prints the correct name?

inland pond
#

this is the function I call from my Widget with the updated player name.(Thits function lives in the PlayerState) After this function I call open <ip>and on retrieving the playerinfo on the game mode of the new session its the default name. ๐Ÿ˜ฎ

winged badger
#

then you update it, and immediately transition maps?

inland pond
#

Yea then I call open <ip>

winged badger
#

but before you do call open IP

#

your client is the host

#

you can't set info on the server before you join it

inland pond
#

indeed ... well

#

Damn so this is the big mistake I have made all the time. ๐Ÿ˜ฎ But what can I do to get the PlayerInfo struct at OnPostLoginfrom the player currently connected...

winged badger
#

its not ready yet OnPostLogin

#

if you grab the PS and test if its valid directly from the event

#

it won't be

inland pond
#

Mhh then I need to call an event within the playerstate on beginplay and notify the game mode that a player now have a player name ready and update it to all players

#

And indeed the event would be needed to be called on the server

#

@winged badger Thanks Zlo I will try it

inland pond
#

Omg It worked! somehow begin play from playerstate get called twice but thats another problem. Nice Thanks!

worn nymph
#

@inland pond yes begin play will get called once for the client and once for the server

terse dawn
#

So, I have a question on Begin Play spawning and "owning connections" https://docs.unrealengine.com/en-us/Gameplay/Networking/Actors/OwningConnections

and RPC calls: https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs

If I spawn an actor on Begin Play, it seems it has two owners (I checked via a simple print string), the server-side and client-side pawns, server calls an RPC on that actor and it's fine, client is not. So obviously this leads me to the actor that I spawned on Begin Play to either be owned by a different client (how?), it's sever-owned (I didn't do a Is Locally Controlled or Switch Has Authority) or not likely unowned.

Basically, can anyone tell me what's going on exactly so I can wrap my head around it? I tried doing Is Locally Controlled branch before, and sure enough it did have one owner of that actor. The issue then, it didn't look the same to the other clients. But the server saw it just fine.

TL;DR: Begin play spawn looks great on both client and server. But RPCs drop from Client. How can I achieve the same thing, but ensure that I can do a ServerRPC call to that actor while maintaining the same visuals.

Any help would be greatly appreciated. Thank you.

inland pond
#

@worn nymph nice, was just needed a switch has authority ๐Ÿ˜‰

winged badger
#

you can only call server RPCs on actors and components that have a UActorChannel

#

meaning they are attached to your PlayerController

#

the server versions of those actors and components can freely interact with server objects, as if it was a single player game

#

so you don't do GetSimulatedActor()->DoSomethingServer() on client

#

instead, inside one of actors/components owned by your PC you do ServerDoSomethingWithSimulatedActor()->GetSimulatedActor()->DoSomething()

#

word Server in example function name indicating that it is a Server RPC

#

Tick() and BeginPlay() happen on every actor on both client and server, independently

#

techniques to filter what you want to do depending if its a client/server include SwitchHasAuthority (in BP) or GetOwner()->Role == ROLE_Auhority (c++, GetOwner() not required if you're doing it from pawn or PC)

#

IsLocallyControlled is good only if you wanted to say, display a widget over the item you're looking at, or do something equally client-specific

#

and only if your PlayerPawn is accessible with self(this) or GetOwner() or GetControlledPawn()

#

(in other words, if you are checking IsLocallyControlled from an object owned by your PlayerController)

high heart
#

Do steam sessions expire after an amount of time? I've noticed that if I sit in an open lobby (in my game this is just a normal steam session) for an hour or so nobody can find my game. It's also possible that advertisement is just failing sometimes, but it's proven a bit tricky to test. Anybody @here have info about this?

heavy marlin
#

has anyone used the messagebus and ue4's networking at the same time?

#

@wild prawn ? ๐Ÿ˜„

#

basically i want finer control over who gets what when than ue4 networking allows, so pub/sub is perfect

hidden thorn
#

If I want to update a skeletal mesh (was created in the constructor c++ and bReplicates is true) to all the player would I have to use a NetMulticast ??

#
//.h
UPROPERTY(VisibleAnywhere, Replicated, BlueprintReadOnly, Category = Default)
class USkeletalMeshComponent* TMesh;

//.cpp In the Player file
ARPGPlayer::ARPGPlayer()
{
    bReplicates = true;
    
    TMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Mesh"));
    TMesh->SetupAttachment(GetMesh());
}

void ARPGPlayer::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(ARPGPlayer, TMesh);
}

//.h
UFUNCTION(NetMulticast, Reliable, WithValidation)
void ChangeMesh(class USkeletalMesh* Mesh);

//.cpp
void UTESTing::ChangeMesh_Implementation(class USkeletalMesh* Mesh)
{
    if (Player->HasAuthority())
        Player->TMesh->SetSkeletalMesh(Mesh);
}

bool UTESTing::ChangeMesh_Validate(class USkeletalMesh* Mesh)
{
    return true;
}
glacial hamlet
#

multicast probably the easiest method, you could use OnRep / property replication but YMMV either way

hidden thorn
#

YMMV ??

#

Also shouldn't that be everything except the place where called obviously

wary willow
#

@hidden thorn "update sk" ?

#

Like the SK moving or animation?

#

or, switching them out

#

^

#

I see now

#

yeah, MC or RepNot

hidden thorn
#

I am using MultiCast as it seems easier and since I am new to networking I will try to understand the RPCs first and then use OnRep (so far I didn't had to use them)

#

With what I have there the servers' mesh changes but the clients' mesh doesn't not on his own screen or on the server.

glacial hamlet
#

your mileage may vary.

hidden thorn
#

That means nothing to me, what is that supposed to mean?

#

I've never heard that before

hidden thorn
#

oh ok, I see what you mean

#

Just had a look on guguru

glacial hamlet
#

seems like for the mesh you'd want everyone to know asap and won't be doing it frequrently, multicast might be useful, but replication will ensure things actually stay in sync with what the server sees, which may or may not be important

hidden thorn
#

Ok

wary willow
#

Alright

#

Has anyone ever experienced "collision" or character offset issues as the client?

#

This is in VR btw, but may be applicable in other MP games

heavy marlin
magic crest
#

Morning...

night jay
#

@heavy marlin Reason why is because the hacks & solutions you mention are basic networking principles which has been documented countless of times

heavy marlin
#

@night jay they may be basic but seemingly every game that comes out has the same exploits

night jay
#

Well alot of indie devs don't do any proper network research

heavy marlin
#

funcom made a few MMO's then released conan exiles and it is/was full of exploits

#

same with SOE

#

so i dont agree

night jay
#

Then the decision was concious

heavy marlin
#

they patched them though

night jay
#

UE4 has replicated authoritive movement from the server from the get go

#

The 2 hacks you've mentioned would already be mitigated if you follow basic protocols for this

heavy marlin
#

yes i know i was just trying to start the conversation

night jay
#

If Conan messed up with this, that means they tried their own solution which failed

night jay
#

Golden rule is if you trust the client you gonna have cheaters

wary willow
#

This is a good book as well

glacial hamlet
#

don't forget the launch exploits The division had on PC... client authoritative ammo... cheat prevention is often overlooked

wary willow
#

Meh

#

TBH, you shouldnt' get too wrapped up in that

#

Unless you really are trying to push competitive

#

Cheaters are going to cheat

#

You won't be able to stop them

night jay
#

Which alot of MP games are

#

Not professional competitive

wary willow
#

No.

night jay
#

But still competitive

heavy marlin
#

im more concerned with item duplication

wary willow
#

Not every MP game is trying to be in teh competitive scene

heavy marlin
#

i mean there are so many ways to do it

night jay
#

It doesn't have to be in the competitive scene to be competitive

wary willow
#

Memory dupe is too easy

night jay
#

BEing competitive means wanting to win, nothing else

wary willow
#

?

#

Um no

#

Maybe in your language

night jay
#

Halo 1 had no competitive scene

#

No MLG or whatever

wary willow
#

But when someone talks "competitve" in MP games

night jay
#

It's still a competitive game

wary willow
#

we're talking eSports level

night jay
#

Then call it esports

heavy marlin
#

competitive in games means .. yeah that

wary willow
#

every game is competitive to a certain degree.

night jay
#

That's the point

wary willow
#

?

night jay
#

So you're gonna have cheaters in any competitive game

glacial hamlet
#

lol

night jay
#

Esports related or not

#

Or at least, attempts to cheat

wary willow
#

You're going to have cheaters regardless, who cares

#

That's my point

heavy marlin
#

yeah so its less about the fact people cheat, and more about how it impacts on other players

wary willow
#

If you waste too much time on things people are going to circumvent anyyway

heavy marlin
#

i dont care if someones duplicating a pot plant

wary willow
#

You are going to lose scope way too quickly

night jay
#

But just because people will be able to circumvent cheating, doesn't mean you should have no kind of security whatsoever

heavy marlin
#

omg australian book prices are horrific

wary willow
#

I never said that?

#

I just said, don't waste your time on it

#

Implement some basic stuff, move on.

heavy marlin
#

@night jay is a pedantic pete

night jay
#

Gee, thanks

wary willow
#

I had to Google that...sadly

heavy marlin
#

haha

night jay
#

Me too

wary willow
#

I thought he said Peasant

#

I was like..peasant, okay

#

But anyway, there's nothing wrong with being a worryrat

#

Which seems to be close enough to that word

#

Do people actually say pedantic

night jay
#

I've just seen cheating destroy a games' lifespan, be it competitive esports or not

heavy marlin
#

yes

wary willow
#

Like, I just said it outloud and it just sounds weird

heavy marlin
#

mootjuh my point was while we were trying to discuss how much you should worry about it you were arguing what precisely constitutes a competitive game

#

it was funny

wary willow
#

I don't disagree that cheating will ruin games

#

But, if you ever get to the level that cheating is a huge issue

#

Then you are probably rolling around in dollar bills

#

naked

heavy marlin
#

yeah thats true

wary willow
#

And if you have that kind of money

#

You'll be able to license out some tougher cheat prevention

heavy marlin
#

you can hire a network wizard?

wary willow
#

And/or hire out some engineers to knock it out for you

#

Aye

night jay
#

As a programmer you would probably not see all those dollar bills yourself though

wary willow
#

But for most on here, that's not their biggest concern. Or should it be.,

heavy marlin
#

yeah so you pay them a pittance and throw cake at them

wary willow
#

Depends, you can opt into royalty on top of salary

heavy marlin
#

while you do wheelies in your segway

night jay
#

Anyways regarding your concern regarding item duplication, same story as character movement

#

The server manages your inventory

wary willow
#

Yup, but also, you can just put it in the cloud ๐Ÿ˜‰

night jay
#

Isn't that the cloud

wary willow
#

That's actually what I am planning to do with it.

#

Well, database

night jay
#

Oh yeah

wary willow
#

I'm going to make a quick check on server, to see what spawned, see what people got in their inventory, make sure it's legit. then if so, beam it up to the DB.

#

when they log in or if they want to server travel/go into Single Player mode, they can take what they have

magic crest
#

Hey.. which object do you guys keep responsible for loading / streaming levels? GameInstance or something else?

bitter oriole
#

Yeah, that

magic crest
#

alright

heavy marlin
#

yeah gameinstance is boss

magic crest
#

erm.. how do I forward declare a struct? I'd like to use the FLevelStreamingLoadedStatus in GameInstance, but I'm getting errors. I got it to work by including the .h needed. Is this the proper way?

#

the include is in MyGameInstance.h

heavy marlin
#

yes you cant forward declare a value type

#

only a pointer

magic crest
#

Thnx

magic crest
#

I have this thing setup by one of the designers, but I'm not too familiar with BPs so I'm not sure how this should be transfered to C++.

#

Currently this is on a character which is replicated. Basically, the server needs to call RepLoadLevel and then magically, this gets called on client. How do I declare the RED thing in C++ (is it a multicast dynamic delegate) and which object should it be declared on? Does the objecct need to be replicated? Is GameState a good place?

#

Ignore the logic (branches)

magic crest
#

or is this just a normal RPC?

magic crest
#

Ok. I think I got it. Please, correct me if I'm wrong. The blue RepLoadLevel node is a UFUNCTION with NetMulticast and the red node is the implementation, yes?

sterile silo
#

Was just curious if you can work on a game using the pre-compiled binary version of UE4 from the Epic Games Launcher that is intended to eventually be a dedicated server based Multiplayer game.

Basically is there any challenge moving from Epic Games Launcher to Source compiled once we decide to work on Multiplayer?

heady delta
#

is there a way to get owner only properties to update to a new owner, or do I have to send them manually when to initially update the new owner

wild prawn
#

@heavy marlin message bus is not intended for multiplayer. it's primarily meant for distributed applications on the same network at this time.

#

you could set up something that works over the internet, especially with the TCP Messaging plug-in, but that will require some twiddling. there's currently also no way to add network endpoints programmatically.

#

i think you'll be better off just bending the existing Unreal networking to your needs

twin juniper
#

so many people trying to connect to my game

#

that the servers literally shitting the bed

#

lmao

modern dome
#

Does UE offert funtionality to "transfer Host" ?
In older games, when you played Multiplayer and the Host disconnected, you became the Host.

#

Would be useful in Coop Games

bitter oriole
#

I don't believe it does

#

No idea how hard it would be

cerulean rapids
brittle sinew
#

You would need some sort of database, but it doesn't necessarily need to be SQL

#

Or you could host it in a third-party service

twin juniper
#

Anyone know how to make dedi servers use all cpu cores?

#

It seems to only be using one

bitter oriole
#

Doesn't work like that @twin juniper

#

Using all cores require some serious work

twin juniper
#

I know I saw someone post something tho

#

like

#

-usemulticore

#

or something

bitter oriole
#

@twin juniper All game logic in UE4 is on one core only

hidden thorn
#

Is there a reason for why this is happening??

#
//.h
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Clothing)
class USkeletalMeshComponent* BottomMesh;

//.cpp
void ARPGPlayerState::ChangeMesh_Implementation()
{
    Player->GetPlayerOutfit()->ChangeMesh(Mesh, Player->BottomMesh);
}

//.h
UPROPERTY(VisibleAnywhere, Replicated, BlueprintReadOnly, Category = Character)
class ARPGPlayer* Player;

//.cpp
void URPGPlayerOutfit::ChangeMesh_Implementation(class USkeletalMesh* Mesh, class USkeletalMeshComponent* MeshComp)
{
    GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Green, "Change Mesh");

    //This doesn't work, it changes it on the server but not on the client
    
    Player->BottomMesh->SetSkeletalMesh(Mesh);

    //This works
    MeshComp->SetSkeletalMesh(Mesh);
}
gloomy tiger
#

Hey people!

Is open <ip>:<port> the only way to connect to a server?

twin juniper
#

@gloomy tiger APlayerController::ClientTravel()

heavy marlin
#

@wild prawn thanks for the tip, ill take another look at what I can do with the built in networking

tawny raven
#

Does anyone know how to give each client(and the host) a number and then see who has a certain number and give them a certain role in blueprints? I've already asked in #blueprint but since I can't figure out my issue I thought I'd come here

sly basin
#

@tawny raven If you're using sessions or steam sessions there's a unique id built in

tawny raven
#

I am using Steam Sessions.

sly basin
#

Get Unique Net ID will return a unique number

#

Get Unique Net ID From Player State is usefull too. In game state there's a player array

#

the index of the player array is usable but it's probably better to use unique net id I think

tawny raven
#

I'll try that and report back.

#

Thank you @sly basin

graceful cave
#

ive been having the same issue for a while and still havent found a good solution

#

when im hosting my game on a listen server, there are no disconnects

#

on a dedicated server, players frequently disconnect whether its hosted on a VPS or my own machine

#

ive been disconnected from the server on my own machine before

#

set the max packet size and client netspeeds really high and that didnt change anything

#

happens at any tickrate it seems

#

sometimes its a standard disconnect and other times the screen goes black and all the hud elements return N/A implying there is no owned character

winged badger
#

logs are your friend @graceful cave

graceful cave
#

the server console just says what it says during a healthy disconnect usually

#

sometimes it says they timed out but doesnt give any other info

nova ermine
#

hey guys so im trying to set a skeletal mesh, but the client can't see the mesh being set

kindred geyser
#

has anyone got any idea what may be happening here? It seems the animations aren't replicating properly outside of a certain radius of other players on the network. The character seems to be fighting with an X-Axis variable somewhere when that radius is exceeded

twin juniper
#

Hey guys, how would you link two pawns together? Like restrict their movement so that they canโ€™t move more than some distance away from each other?

#

In a multiplayer game of course

#

On separate pcs

nova ermine
winged badger
#

@graceful cave and do client logs have anything to add?

#

@nova ermine if you are multicasting, its server event, then multicast event, never the other way around

nova ermine
#

yeah thats what I have @winged badger

winged badger
#

@kindred geyser the movement animations should be working out of the box

#

without any additional replication

nova ermine
graceful cave
winged badger
#

too low resolution i can't read anything on it

kindred geyser
#

yeah thats what I thought - however I'm using a TurnInPlace (rather than RootMotion) system which somehow is conflicting with the character's direction when rotating. Been trying to figure this out for days now lol

nova ermine
#

@graceful cave it does, it spawns the weapon in the clients hand so I know it fully gets through it all

graceful cave
#

who is unable to see the weapon in his hand?

nova ermine
#

No they can see it spawn in there hands, but the client can't see the weapon swap onto the ground

winged badger
#

are you doing any by-hand replication @kindred geyser ?

nova ermine
#

@graceful cave

winged badger
#

because that manequin was flickering just about at the usual net update frequency

graceful cave
#

id still try putting a print node right before it changes the mesh on the ground to make sure the client prints too

#

should ideally see Server: and Client 1: in the console

kindred geyser
#

yeah i am passing some variables to the server manually when the turn in place takes place, which all seem to be correctly implemented as far as I can see

winged badger
#

triggering an animation by hand maybe with RepNotify?

kindred geyser
#

hmm. I will take a look. thanks for some direction.

winged badger
#

it looks like client is simulating movement and runnig the animation

#

but something interrupts it about 10 times per second

kindred geyser
#

what i can't understand is how it's working when within a radius that is close to other players, but outside of that zone it starts to play up

nova ermine
#

@graceful cave okay so the client doesn't print, how do I fix that?

winged badger
#

did you tweak the NetCullingDistanceSquared?

graceful cave
#

your multicast isnt being called from the server

#

or

kindred geyser
#

no i dont think so, will take a look

graceful cave
#

make sure every branch is checking replicated variables

#

the client and server may have different instances of whats being checked

nova ermine
#

do I have to set the variables to replicate?

graceful cave
#

yeah and make sure the server is setting them so all clients update

#

print at the start of your multicast to make sure the client gets that far

#

then check each branch

nova ermine
#

like all the variables? The booleans, and the object and actor refs?

winged badger
#

btw @satan you can increase the amount of stuff beeing logged with console commands like "log lognet verbose"

graceful cave
#

yep i have that set

winged badger
#

be prepared for spam, tho

graceful cave
#

yeah my logs are huge lol

#

hard to find anything in them

winged badger
#

you can print something from bluepint on GameInstace HandleNetworkError i think its called

#

that is easy to spot when you skim

#

like 200 x characters

#

and whatever logs are involved in causing it, will be just above that

graceful cave
#

i have that event in my gameinstance but it just prints the error message ingame for the client

#

its either ConnectionLost or the screen just goes black

#

without the client being aware of a disconnect

#

all widgets stay etc

winged badger
#

so, no "graceful" exit to main menu?

kindred geyser
graceful cave
#

only sometimes

winged badger
#

that usually happens when a RPC targets something that doesn't exist

#

or when you overflow the reliable buffer

graceful cave
#

most likely the reliable buffer

winged badger
#

like multicast from a PlayerController, or a GameMode

graceful cave
#

is the reliable buffer something that can be increased?

#

its strange because theres literally 0 issues with listen servers

winged badger
#

i only saw it once after one of my designers decided its a good idea to add a few multicasts in MonsterBase_BP

#

didn't have to go farther then just removing those for a fix

#

but reliable buffer overflow is pretty noticable in the logs

graceful cave
#

what should i search for?

#

and in server or client logs?

winged badger
#

its probably red, if not definetely yellow line

#

server

graceful cave
#

havent seen any red in there

winged badger
#

you might not have something attached to a PC on a dedicated server

#

a component created in actor that can't tick on dedicated server, something like that

#

would be a weird design choice, but can also cause random disconnects

graceful cave
#

thats what i was thinking but it looks like everything has that checked

#

and its really inconsistent

#

i barely get disconnected at all and can go 4-5 sessions without it

winged badger
#

also, failed validate can DC

graceful cave
#

but someone else with similar ping gets it constantly

winged badger
#

or rather, will DC

graceful cave
#

failed validate as in?

winged badger
#

code implementation of server RPC has bool MyClass::MyFunction_Validate()

#

in addition to _Implementation

#

if that function returns false, it means the client's cheating, apparently

#

its a UFUNCTION(Server, Reliable, WithValidation, ...)

graceful cave
#

ill have to look at client logs next time it happens

#

just close game immediately so its at the end

#

its strange that it only happens on a dedicated server though

#

makes me think theres some net setting somewhere that listen servers ignore

#

for example, i couldnt get listen servers to obey the NetServerMaxTickrate setting and had to cap my framerate

#

as host

#

or non reliable RPCs would just get dropped

#

so it makes me wonder if theres some other setting somewhere

#

thats uncapped on listen servers and prevented disconnects

#

so far ive only changed max packet size and client netspeed

winged badger
#

@kindred geyser yep, w/e is causing it, its not there

#

replicating movement of attached components inheriting from USceneComponent can also cause all kinds of artefacts

kindred geyser
#

excuse my ignorance... w/e?

winged badger
#

whatever

kindred geyser
#

oh lol

#

yeah, I'm having trouble sourcing the issue hey. Will be onto this until it is done. Its certainly a strange occurance

#

thanks for your time man

winged badger
#

well, components that are attached get moved with the character normally

#

but if you replicate their movement as well, then you will get several sources replicating the movement of same character

kindred geyser
#

yeah i had that issue on a different project, causing double speed animations on the client

winged badger
#

and the fact that one packet was sent first, does not guarantee it will arrive first

kindred geyser
#

but that was because i replicated the variables twice

#

the funny thing is, on that project - this wasn't an issue lol

winged badger
#

the radius in which it happens might just be that so close some variable is below some threashold for MovementComponent to try and simulate it, so it doesn't

kindred geyser
#

hmm interesting

#

so perhaps i'm assuming the wrong culprit

#

radius might be irrelevant

winged badger
#

i'd definetely look into why its happening, and not why its happening only over 1000 or so UU away from the observer

kindred geyser
#

duly noted

winged badger
#

(mind you, this was a guess on my part, never went to read the code how MovementComponent simulates movement)

#

but your NetRelevancy radius is 15000 UU, and that flickering happened much closer then that

kindred geyser
#

as far as I'm aware, this system of TurnInPlace isn't the norm when it comes to rotating the character with animations... its typically done with RootMotion - so I must be missing some form of replication when the Rotate Variables are passed on

winged badger
#

well, server will definetely replicate RootMotion and correct whatever client thinks the position is

#

unless you turn off ReplicateMovement, i think

#

in which case it might rotate right, but fail to move, depending on your setup

kindred geyser
#

I know it has to be something simple I'm missing - the code that initiates all of this seems to be correct. However I've checked all the available boxes that are relevant to this situation. Obviously not everything though ugh

#

back to the drawing board

#

thanks again, Zlo

graceful cave
#

found something finally!
[2018.03.15-23.42.50:612][363]LogNet: Error: UActorChannel::ReadContentBlockPayload: ReadContentBlockHeader FAILED. Bunch.IsError() == TRUE. Closing connection. RepObj: NULL, Channel: 9
[2018.03.15-23.42.50:612][363]LogNet: Error: UActorChannel::ReceivedBunch: ReadContentBlockPayload FAILED. Bunch.IsError() == TRUE. Closing connection. RepObj: NULL, Channel: 9
[2018.03.15-23.42.50:612][363]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 162.248.92.183:7777, Name: IpConnection_6, Driver: GameNetDriver IpNetDriver_6, IsServer: NO, PC: BP_PlayerController_DM_C_0, Owner: BP_PlayerController_DM_C_0, Channels: 104, Time: 2018.03.15-23.42.50
[2018.03.15-23.42.50:612][363]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 162.248.92.183:7777, Name: IpConnection_6, Driver: GameNetDriver IpNetDriver_6, IsServer: NO, PC: BP_PlayerController_DM_C_0, Owner: BP_PlayerController_DM_C_0
[2018.03.15-23.42.50:612][363]LogNetTraffic: Error: UChannel::ReceivedRawBunch: Bunch.IsError() after ReceivedNextBunch 1

winged badger
#

so you are replicating null somewhere

graceful cave
#

i wonder what could be causing that to only apply to certain players though

winged badger
#

i think this means that client got rid of the object while dedicated server is still replicating the thing

graceful cave
#

heres a line before that actually
[2018.03.15-23.42.50:612][363]LogNetTraffic: Error: ReadContentBlockHeader: Stably named sub-object not found. Component: [12010]RocketProjectileServer_C_5.[12014]Sphere, Actor: RocketProjectileServer_C_5

winged badger
#

that is useful

graceful cave
#

actually yeah i found something in the blueprint that might be causing it

#

its just a dummy object that everyone else sees and the actual damaging rocket is created only on the client

#

if the owner of the server rocket is the local controller, it just tells the server to destroy it

#

else it multicasts the explosion and explosion sound and then destroys it

#

so that makes sense

#

its getting destroyed twice by the server technically

#

im surprised it doesnt crash more often lol

#

ok yeah every time that message appears in the log its due to that actor

winged badger
#

for a (probably pretty incomplete) explanation about stable naming

#

i'd guess that Sphere component reference is replicated at some point, and component isn't set to replicate (or rocket isn't set to replicate)

graceful cave
#

it does replicate

#

what confuses me is why it doesnt generate errors every time

#

but heres the issue

#

its set to owner no see since its a dummy

#

and the owner just destroys it since it has nothing to do with it

#

but other clients need to see it explode

#

after the explosion it goes on to destroy it

#

which is where the issue is coming from

winged badger
#

and then server replicates it and boom

graceful cave
#

i really hope this is the issue anyway

#

cuz my game is almost done and this is the only major problem ive been trying to solve

winged badger
#

it makes sense

graceful cave
#

so changing ServerDestroy to run on ownling client instead

#

should deal with it the way i intended

winged badger
#

and it would be random

#

i think the replication wouldn't fail as long as destroyed dummy doesn't get GCed before server replication kicks in

#

(IsPendingKill == true) would not crash the clients connection, that is

#

i'd go for setting the dummy Hidden for those who don't need to see it

#

and destroy it on server only (replicated dummy) when its time for it to die

graceful cave
#

right im just thinking of the best way to do it

#

how the whole system works is

#

the client spawns his own rocket thats only on his client and thats what actually registers the damage

#

at the same time he tells the server to spawn the dummy

winged badger
#

wait, client in charge ot telling the server if it did damage?

graceful cave
#

both of them are sent a variable upon spawning with the time they spawn so when the client rocket explodes, the server checks all dummy rockets sharing the time with the client rocket and calls the blueprint i showed you

#

yeah it does, im not worried about cheating considering this game is just something im gonna play with friends

winged badger
#

there are other reasons other then cheating why its a bad idea to implement it like that

#

like client having only approximate information

graceful cave
#

yeah im aware that it can make weird things happen for the person getting hit by the rocket

#

getting killed by something that appeared to miss

#

but unless it has full ping compensation its nearly unusable

#

and its been pretty rare to get die to a clear miss even when playing with guys who have 150+ ping

winged badger
#

well, i'd never go for a solution like that, but its your design ๐Ÿ˜ƒ

graceful cave
#

haha yeah id never do it in a real game but if you saw what i was making youd probably think its okay

#

thanks for the help, i woulda never thought to check the clientside logs

winged badger
#

yw

inland pond
#

Am I correct that If I want to use the same map for different game modes e.g (FFA or TDM) I need to copy those maps like Arena01FFA and Arena01TDM and set each to their idividual game mode via game overide? using seamless travel from Lobby into Level ๐Ÿ˜ฎ

twin juniper
#

How do you know if your issue is related to CPU usage, or Network Bandwidth?

glacial hamlet
#

@inland pond no, you shouldn't need to copy the maps, you should be able to have a sub-level you can choose based on the game mode. The game mode override can be done via server launch arguments for a travel

thin stratus
#

@glacial hamlet @LifeArtist#2293 You can specify a GameMode on Level Load

#

?game=GAMEMODESHORTCODE

#

Where GAMEMODESHORTCODE can be specified in the Project settings and assigned to a GameMode of your choice

#

e.g. TDM to BP_GameMode_TDM Class

glacial hamlet
#

right, thats what I meant to point @inland pond at

thin stratus
#

Yus (:

inland pond
#

@glacial hamlet @thin stratus Thanks for you both responses. Is this is only working with the open command and not servertravel command?

thin stratus
#

ServerTravel also works

#

ServerTravel MAPNAME?game=GAMEMODESHORTCODE

inland pond
#

Okay thanks ๐Ÿ˜„

twin juniper
#

Anyone have a checklist of things to check if you are having network issues?

winged badger
#

define "network issues"

twin juniper
#

Left click => takes 5 seconds to process
Movement teleports you backwards
...etc

#

Complete disconnection

#

of a player

#

when u get > 8 players

#

lel

#

@winged badger I'm pretty sure that's all net issues

winged badger
#

what does left click do?

twin juniper
#

it shouldnt matter lol

#

dont zone in

#

on that

#

lol

winged badger
#

it does if its exec is local

twin juniper
#

This is all the rpcs

winged badger
#

anything with "reliable buffer overflow" in the logs?

twin juniper
#

no

#

im barely using it tbh

#

I get a ton of this though @winged badger

#

not the spawn actor thing, the other one above it

winged badger
#

figured

#

looks like your movement simulation is taking too long

#

8 iterations x 0.05 = 0,4 < 0,406

#

but i never took apart a MovementComponent so can't really help you with why

twin juniper
#

@winged badger Another issue is that these three RPs are being called even when my player isnt moving:

SetMovementInputVectorOnServer
ServerMove
ServerUpdateCamera

#

Look at the number of calls

#

its ridiculous

winged badger
#

did you add those?

twin juniper
#

No?

#

These are Engine functions

winged badger
#

ok

twin juniper
#

Like built into the engine

#

sadly

winged badger
#

it should be able to handle those

#

anything interesting in client logs?

twin juniper
#

No not really

winged badger
#

over what time was that profile result recorded?

twin juniper
#

@winged badger So im wondering

#

i had my netupdatefreq set to 18 on my player

#

could that have been causing hitching lol

winged badger
#

that is udner 2,5MB

#

which is not alot really

#

3 seconds worth for a decent connection

twin juniper
#

@winged badger the default is 100

winged badger
#

i tend to keep them between 2 and 10

winter plover
#

It makes perfect sense for movement calls to eat up this much data

#

after all you are constantly updating the player position

#

they are also fairly compact per individual call

twin juniper
#

Any one what is causing this when trying to compile Developer_Editor?

winged badger
#

apparently, you are missing a file

twin juniper
#

I think I fixed it

#

Thanks to this post:

#

`[โ€“]SheeEttinHobbyist 4 points 1 year ago
Go all the way into advanced permissions on the top level folder. Set yourself as owner. Give yourself full control. Set it to apply to folders, subfolders, and files. Set it to replace permissions on child objects (make them inherit).

That should recurse through everything and fix any permissions issues. But that's not necessarily your problem.

permalinkembedsave`

#

I just set my Projects folder so my windows user had "Full Control"

#

For some reason, I didn't have Write permissions to some files

sly basin
#

Dedicated server environment, when I allow a client to uncap framerate the server starts rubberbanding him around when connected if the framerate is really high. Is this because the clients sending packat rate is tied to framerate? Should I do something like change the trickrate on character ?

winged badger
#

NetUpdateFrequency

#

is how many net updates happen each second

#

and it definetely causes more traffic, ConsumeInputVector happens on Tick

#

and goes to server

#

it is a RPC so its not dependent on the NetUpdateFrequency tho

twin juniper
#

@winged badger how can u limit player tick rate then

#

to a certain value

#

And what's a good value?

winged badger
#

you have tick frequency for every actor

#

number of seconds between each actor tick

sly basin
#

I was looking at that, I'll give it a try in a few minutes

#

tick the actor @ 120 or something

winged badger
#

you can get movement component to tick slower

sly basin
#

independently? I was looking for it

winged badger
#

they also have tickrates

sly basin
#

Thanks I'll look again

winged badger
#

@twin juniper what's a good value? i don't know

#

experiment a little

twin juniper
#

It's really dumb that the FPS affects that rpc

#

seems poor by design

#

to have to restrict player fps

#

to save on performance

winged badger
#

techniaclly, you don't

#

and there is no guarantee capping movement component's tick will improve anything net-related

#

if you have resources to spare you can increase number of simulation iterations there

pallid mesa
#

Objectively speaking, sending less updates to the server will reduce the number of rpc calls to that function.

#

About client FPS's that was something tested on 4.18 and they did have an effect on server net saturation

#

Didnt dig enough to give a proper explanation but it does.

sly basin
#

I didn't sniff the network data but when I uncapped and the output was 300+ the issue was really obvious.

#

It shouldn't be too hard to track down

pallid mesa
#

Ayee

sly basin
#

I would always cap it at something sane for myself but if a client wants to uncap it would be nice to allow it

#

if I want to alter the tickrate on the movement component do i need to go up to the parent? I'm not seeing any settings in the detail panel on my custom class

pallid mesa
#

There are some variables related just navigate on your pawn/character details panel and check what you have there

#

Also in your DefaultEngine.ini

#

You'd like to adjust the NetServerTickRate value to fit your necesities

sly basin
#

Will do - haven't got there yet but plan on checking out the network stuff when I get closer

#

In the meantime this fixed it - .00833 works out to about 120 times a second

winged badger
#

120 ticks/second

sly basin
#

although I could only set it on the character itself - there was no where to only do it on the movement component

#

could be because it's derived from a c++ class that's derived from the base class I dunno - I'll look into it

winged badger
#

UActorComponent::SetComponentTickInterval()

sly basin
#

perfect

#

I'm a dummy with c++ but that I can follow ๐Ÿ˜ƒ

twin juniper
#

there's gotta be

#

some sort of set of standards tho

#

for these things

sly basin
#

Going all the way back to Q3 engine I remember there being issues that had to be fixed when it came to framerate and networked movement. If I learn how it works and can manipulate the settings that seems fine?

#

I don't have enough of an understanding to talk with authority on the subject but it's probably better to leave it open ended for flexibility. What I want it to do might not be the same as what someone else wants or needs

twin juniper
#

Why are people saying to increase tick rate to 60

#

the default is 30

#

But my question is:

Is this dependent on number of players? If more players, do we increase or decrease the value

sly basin
#

You want to scale it depending on number of clients or are you asking if it scales automatically?

flat haven
#

@twin juniper: tickrate is number of times per second that client/server syncs or to be more specific, sends data to each other. I don't know how it works exactly in UT, but in old HLDS servers I used to set 60 tickrate server side, as not many players would have monitors with more than 60Hz on those old days. Today, I don't think if it would be any reasonable to go over 120 in any multiplayer game (does modern monitors ever go over 120 Hz, could we even notice it for most of gameplayes?). For MMO/card game/etc. it can be waaay below 30 without any notice most of the time, but for FPS (like CS) it sounds way too few nowadays (I could propably end with 120 eventually 140 or so if I could get a few asks for that). More updates means more resources being used (especially net usage and engine simulations server side increasing cpu/gpu usage), what could end up with more costs, ie using amazon's gamelift, you could end up with more instances in use, what would increase your costs. You should balance beetween user experience and server costs. I'm sorry for writing a bit fuzzy, but I'm not familiar with UT servers, so I gave you general information about tickrate. Ah, and about limiting ticktare depending on number of players, it depends on UT implementation I am not familiar, so I can't tell you if it's possible at will (I bet it is), but it sounds like a bad idea for me, in general. I would rather end up with more instances than decreasing user experience at will.

twin juniper
#

@flat haven I am trying to attempt to get at least 50~ players on my servers.

#

I would need to lower it greatly I'm assuming

flat haven
#

See example of Fortnite from few months ago: https://youtu.be/SwZ_NUruGTM?t=3m30s (at 3:30). It takes ~50 updates from players per second, but sends about 20 back. It varies from ~100 to ~2 players. Imagine you begin with 30 tickrate at 10 players, and end up with like 10 at 60 players. You need to balance user experience and server costs, but I can't go in details with UT, unfortunately.

Both Fortnite and PUBG are built with the Unreal Engine, and use amazons cloud service AWS to host their game servers. But which development studio is better...

โ–ถ Play video
twin juniper
#

@flat haven No, this isn't for UT I was just looking for information online and found that thread.

#

My game is basically a multiplayer survival game. However, it starts to have massive lag when player count > 8-10~

#

Which is VERY bad

hidden thorn
#

So I am using NetMulticast to change a "ChildActorComponent" ActorClass which works but when I want to use AttachToComponent it doesn't work.

#
void ARPGPlayer::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{
    // set up game play key bindings
    check(PlayerInputComponent);

    PlayerInputComponent->BindAction("TakeItem", EInputEvent::IE_Pressed, this, &ARPGPlayer::LocalChangeItem);
}

void ARPGPlayer::LocalChangeItem()
{
    if (HasAuthority())
        ChangeItem();
}

//NetMulticast Method
void ARPGPlayer::ChangeItem_Implementation()
{
    LeftHand->SetChildActorClass(SomeClass);
    LeftHand->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, "HoldItem");
}

bool ARPGPlayer::ChangeItem_Validate()
{
    return true;
}
#

So as you can see LeftHand->SetChildActorClass(SomeClass) works just fine on both server and client but the AttachToComponent doesn't, I assume I am doing something wrong and there is a right way of doing this.

#

I know there is a workaround, where I would move the mesh inside the bp so I don't have to change the socket but I want to understand why this isn't working.

modern dome
#

Is world rebasing working in MP?

past totem
#

How would I restart a dedicated server via the graph/a C++ function?

#

Or just reset the current level

#

@ me if you answer please

thorn merlin
#

has anyone used spatial OS yet? any opinions on that?

past totem
thorn merlin
#

@past totem it looks like there are a few other ways too - https://www.youtube.com/watch?v=QNLYliyH3e0 https://www.youtube.com/watch?v=LseY59ffKK8

What is the Reset Level Node in Unreal Engine 4 Note there seems to be some discrepancy between what the comment says for this node and what actually happens...

โ–ถ Play video
past totem
#

@thorn merlin thx!

twin juniper
#

What do you guys think is the best hosting provider for multiplayer games?

#

I've been using Digital Ocean standard droplets.

thorn merlin
#

amazon ec2 has a lot of scaling options and locations all over the world

twin juniper
#

It's also very expensive

past totem
#

Do you guys just contact the companies with info about your game and they host it (if they want)?

thorn merlin
#

havnt looked too much into it tho

past totem
#

I mean, to host for example a survival game for people to buy a server for

#

You still pay them?

twin juniper
#

@past totem ?

past totem
#

@twin juniper ?

twin juniper
#

you buy servers

#

no one gives u them

#

lol

past totem
#

I mean

#

For example for them to add my game on their site

#

Would it cost money?

twin juniper
#

OHHHH

#

OHH

#

I don't know

past totem
#

Because others buy it

#

Ahh xD

twin juniper
#

I would love to look into that though

past totem
#

I'm currently getting free servers from them for advertising xSD

#

I might ask them about it when I get more progress on my game

ripe cypress
#

Anyone know right off why this doesnt work on clients well it does but its real jumpy going up not smooth on server smooth

twin juniper
#

@past totem I would love to know that too to be honest

past totem
#

hmm I can ask them now rl hold on

twin juniper
#

Please do!

past totem
#

I asked him (the manager) but he aint online rn

#

Also I'v kinda of a random question, if you are hosting a game it's because you are interested or beacuse you are getting paid from the developers? (or both)

#

It sounds like they are just interested, there is also a channel to suggest games on their Discord

#

The problem will be just getting them interested :P Which I'm sure if the game is selling it wont be a problem

twin juniper
#

Why does battlefield 1 have a tickrate of 60 lol

#

When fortnite's is like 17

#

wew

fringe dove
#

is it possible to tell from the role/remote role whether a APlayerState is the local play's or not?

#

or is there a better way? (I'm wanting to avoid replication delay like you might get from Controller::PlayerState)

fleet sluice
#

@twin juniper Because that's what makes the difference between average netcode (Fortnite) and great netcode (BF). In today's world, there is no excuse to use a low tickrate, unless you're intentionally bloating the bandwidth with bullshit (i.e. servers tell the clients how each pixel on an animation should behave rather than just sending an enum representing an animation state).

twin juniper
#

NetCullDistanceSquared seems to take a decent amount of time to update. Sometimes it NEVER updates the object

twin juniper
#

Also looks like my Multicast functions are playing for ALL players, even if they are not net relevant, based on netculldistancesquared

winged badger
#

RPC is not replication @twin juniper

#

RPC is you explicitly calling a function over network

twin juniper
#

Isn't there a way to make RPC's only call when net relevant?

winged badger
#

its not affected by tickrate, net dormancy, net relevancy or anything else

twin juniper
#

So is there nothing you can do

#

It's just a helpless persuit?

winged badger
#

you could call in a Client function on the Controllers/Pawns

#

each one separately

#

and determina how relevant they are yourself

twin juniper
#

I think

#

Multicast functions

#

should automatically take into account relevancy

#

only call on relevant clients

winged badger
#

its not how network infrastructure works tho

twin juniper
#

It's how it should work.

#

There will never be a use case for why a multicast would need to be still called on clients that are not relevant.

twin juniper
#

Name one usage case

#

For when that would be beneficial

winged badger
#

and

#

say you multicast from a GameState

#

or a PlayerState

#

a chat update perhaps?

twin juniper
#

You don't use multicast for that

#

You can just loop through PlayersArray and call client RPCs on them

winged badger
#

objective updated animation

#

world event started

#

there are cases where you don't want multicasts filtered by their distance to some actor

#

especially if multicast happens in an actor that doens't really have a physical state

#

so its location is really not relevant

#

personally i think only purpose of multicasts is to notify users of something (animation, UI update, play sound)

cyan light
#

oh

winged badger
#

only movement should send RPCs on Tick and as it happens, does that out of the box

cyan light
#

thought you meant multicast delegates

#

rather than rpcs / property sync

winged badger
cyan light
#

๐Ÿ˜ƒ

wary willow
#

@fleet sluice OSS UWorks victor39Happy OSS UWorks victor39Happy OSS UWorks victor39Happy

fleet sluice
#

โœ…

#

That will definitely be a multicast

winged badger
#

notifying all users Victor is happy?

manic pine
#

netrelevancy multicast would be nasty

#

maybe as a ufunction option

winged badger
#

each would need to have an attached IsNetRelevant

manic pine
#

thats in the actor class already

fleet sluice
#

Notifying all customers when OSU is ready ^^

winged badger
#

yep, and you'd need this per function

manic pine
#

yeah but presumably the internal implementation of netmulticast just iterates through playercontrolelrs

#

and could just as easily do a 'is net relevant for' before calling

#

for each

#

but yeah, you could almost as easily do it yourself, so no biggie

fleet sluice
#

It should, but that's not how it works

#

Internally, multicasts are broadcast to anyone regardless of relevancy

#

The relevancy check is done locally, on each client, AFTER they get the multicast'ed call

manic pine
#

ye we were speaking hypothetically

#

as in, it would be easy to implement

fleet sluice
#

I'm saying it's not

#

I've seen the code

manic pine
#

oh?

fleet sluice
#

Spent the last month digging through someone else's shit in the NetDriver and its associated classes

manic pine
#

hmm

fleet sluice
#

There are even comments about how "things are like this because X but should be like Y"

manic pine
#

i always imagined it went thorugh each server playercontroller and found the relevant actor channel

#

sad

#

well net multicasts are for visual fx anyway

winged badger
#

and you can usually piggyback whatever you'd use them for when you're replicating some state

manic pine
#

yah, onrep is my dearest of friends

winged badger
#

like setting FireState::Reloading on the server and using its OnRep t trigger reloading annimation

manic pine
#

speaking of, i had a nasty onrep problem a few days ago

#

with onrep(mycustomstruct)

#

sorry, onrep(myoldcustomstruct)

#

it didnt fill in the previous values in myoldcustomstruct

#

only the actual replicated var in struct

#

i did string logs in all the constructors and operators and found that it first ran copyconstructor with correct values... but then ran regular constructor and passed that to the onrep

#

like it was deliberately trying to sabotage me

#

this onrep(oldvalue) thing isnt documented at all

winged badger
#

gotta love those undocumented caveats

manic pine
#

i couldnt even find the code, because its all generated

#

what it should have done was obviously copyconstruct old value, set new replicated var value, then pass that into onrep

#

instead it did a completely new struct and set replicated var value only?

#

witchcraft

dire temple
#

Is there a way to save and load save data to a server? I have an avatar with custom variables to morph the character, there are over 100 variables. I am using an SQL server for multiplayer (think MMO), instead of saving and loading over 100 variables to the sql table, is there a way I can write/read a SaveData variable?

winged badger
#

save data is where? client?

manic pine
#

fire them all into binary field mebbeh

#

long as you dont plan on changing the order of the vars in the future

dire temple
#

SaveData is on client, should update to server everytime a change is made and reflect across all other connected clients

#

If there is a more efficient way I am open to it, I have not yet implemented this part to the server and researching the best way

winged badger
#

the only way you can push anything to server is the ServerRPC

#

i don't think you'd want to push 100+ variables every time one changes tho