#multiplayer

1 messages ยท Page 410 of 1

grand kestrel
#

Probably

winged badger
#

if you scrolled somewhat slowly, just enough so you see what weapon you scrolled to

grand kestrel
#

I've been using similar code for the inventory too, equipping/unequipping items, etc, also using items, and several other weapon interactions

winged badger
#

as opposed to having it memorized

grand kestrel
#

Works well enough

winged badger
#

wouldn't that make the animation choppy as well?

thin stratus
#

It sure does. I was just confused by your reload code

grand kestrel
#

Blending fixes that, unless you're thinking of something else

thin stratus
#

I mean if you scroll fast

#

And the server really has to at some point say "Yo, this is wrong, here is the real update."

#

Then you'll face a correction anyway

#

The other idea is to just save the last x swap events and when the Server comes back with the updates and reapply them and make sure you end up at the same weapon

#

Cause if you scrolled through 10 weapons and the Server comes back at weapon 9 when reapplying it, then the server probably has some reason for that

grand kestrel
#

Hmm

#

Well, it's food for thought

#

At some point I probably want to rewrite a few things, might look into it then

thin stratus
#

It's basically the ClientPrediction and Reconciliation from Movement code applied to a fast weapon switch

worthy wasp
unique thunder
#

has anyone used UE4 with AWS and Steam?

worthy wasp
#

tons of people have

unique thunder
#

any idea how to utilize the steam subsystem on an AWS ded server? doesn't work by default

worthy wasp
#

anything steam related with Dedicated Servers - requires your project to be Steam Direct - which replaced Steam GreenLight service.

#

you can test dedicated servers offline/outside of steam - but to test steam implementation - requires Direct

#

100$ to set this up.

unique thunder
#

already bought it, got the steam ID, we've been uploading the build for testing and have tested it through steam directly

#

ded servers work, everything else works

#

but we can't get steam usernames anymore, VOIP doesn't work, anything else related to steam doesn't work

worthy wasp
#

what are your INI settings for your game with AWS integrated?

#

specifically AWS & Steam related

unique thunder
#

sec

worthy wasp
#

@cinder brook - why would the server not render models - and anything socket related has to do with teh skeleton/staticmesh - not rendering..... it would be tied to the .uasset file associated to the skele/mesh

#

are you sure you're not typo'ing the socket name somehow? its case sensite

#

sensitive

unique thunder
#

wasn't sure if the ID needed to be covered

#

is that what you meant though?

worthy wasp
#

@unique thunder - what method of AWS integration are you using?

#

C++ SDK or a plugin?

#

and do you have any .ini setup for AWS ?

unique thunder
#

@worthy wasp A plugin, no .ini setup for AWS

meager spade
#

what am i doing wrong

#

nvm fixed it, me being a derp ๐Ÿ˜„

meager spade
#

ai already placed in the level, are they owned by the server

#

or would they be individual copies on each client?

winged badger
#

AI Controllers do not replicate by default

#

So, no copies unless you turn Replicates on, and OnlyRelevantToOwner off

twin juniper
#

can i have some basics to UE networking?

manic pine
#

give Cedric's network compendium a read, it covers most the basics

winged badger
#

pinned on this channel

twin juniper
#

yup

#

thanks

drifting plank
#

Hey @winged badger
In the documentation netmulticast is defined as written :
"Multicast RPCs are designed to be called from the server, and then executed on the server as well as all currently connected clients."

#

So the relevancy isn't taken in count.

#

In my case, I have a very small relevancy and the multicast is opered on all connected players whatever are their relevancy

#

I don't understand

manic pine
#

the object wont exist on non-relevant clients

drifting plank
#

I will retry

manic pine
#

is this by chance a map-placed actor?

drifting plank
#

map-placed ?

#

They are spawn at different spawns yes

#

But the map is huge

#

I test a new thing and I come back if I have found a solution

ripe hound
#

I have a progress bar and with a funtion in the character im setting the percent but when i do it in Single player mode its working but when i do it with 2 players the bar doesnt work how is that possible

#

Can it be that the target has to be set as the get player?

drifting plank
#

How is updated the progress bar ?

#

On the server and replicated to each player ?

ripe hound
#

set percentage

#

I have a function thats called modify stats and there is a function called Udate stats

#

update stats

#

do i need to set it to Multicast?

drifting plank
#

You can also create a custom event for owning client

#

Called only for the replicated client

ripe hound
#

so like a have num - and call custom event that calls the Modify stats?

drifting plank
#

Each time you update the variable
Or if you want, you can replicate the variable

ripe hound
#

or the update stats of the bars

#

so i update it on the own client now but it still doenst work

#

And i cant Replicate the variable because its a map

drifting plank
#

You try to call a function which only work when called on server

#

The health is normally only on server

#

stat*

#

So you need to notify to the client that a entry of your map has changed.

ripe raptor
#

Where exactly does the engine pick which subsystem to initialize?

#

I am getting OSS null when I shouldn't be, trying to figure out what's going wrong

manic pine
#

should be FOnlineSubsystemModule::LoadDefaultSubsystem

#

it attempts to load the default system specified in the ini and if it cant, loads null

ripe raptor
#

Thank you

twin juniper
#

= when i check the didecated server: the characters doesnt grab the ledge, but they play the"Grab ledge animation and they freeze as wanted, but not graping ledge, the charcter just plays the animation Montage fine and replicated to players and fine when it faces the desired "ledge location + hieght" but the character falls to the ground just as if the charcter is just jumping

#

= mean while when i uncheck the dedicated server: the charcters actually "grab the ledge" which is goood and plays the animation,but they doesnt get and climb the ledge , the animation plays locally but not to the server eventhough i replicated the variables

#

can someone tell me what i did wrong on my (Replicate photos)

#

the climbing ledge on its own is working "as a single player" just trying to replicate it

teal flint
#

Hello, before I used Network emulator toolkit but I can't use it anymore. I create and add a filter, I create link, with default parameter and I launch it but it block all connection. I missed something? I use it with windows 10 updated. Which tool you use for simulate network and latency ?

grand kestrel
#

Clumsy @teal flint

halcyon totem
#

how can I align my capsule with my character?

#

if I move the character the capsule stays

unique thunder
#

replicating physics-based projectiles seems to be too heavy, too many physics ops. should I run the projectile locally and then replicate the hit event only?

summer nova
#

of course

ripe hound
#

Im stil working on the health regeneration part but i dont get it because i get the right value only the Percent of the Progressbar will not be updated

#

Second Question the Stats Regeneration must that be handled on the server or client?

tawny parcel
#

What is the proper way to have an anim notify 'hit' event to replicate - on AI? The notify casts from the AnimBP to the ActorBP. I've tried numerous Run on Server/Client/Multicast and it is not working in a packaged game but works in the editor.

winged badger
#

@ripe hound if they are visible to the player real time, both

#

with server providing an occasional correction to keep things in line

ripe hound
#

oke so i can use multi cast?

winged badger
#

replicated variable is fine

ripe hound
#

well its a map so i cant repllicated the variable

#

thats the problem im trying it to solve it with the map

#

@winged badger Can you maybee help me with the Prgressbar part

winged badger
#

best guess, its the wrong progressbar

ripe hound
#

well the strange part is if i do it on Dedicated 1 client it works only more it doesnt

#

on top is the 2 clients

winged badger
#

well, you do need a reference to the correct progressbar for that to work

ripe hound
#

But if im right it is because i have it working with 1 client so the reference is right

#

And if i look good the Values are also Correct into the bars

winged badger
#

hmm, you haven't used any GetPlayerCharacter[0] or GetPlayerController[0] server side, did you?

ripe hound
#

nope

#

thats what i have i did try also to use the Get player and still doesnt work

static lynx
#

I have a pawn controlled with a controller, typical WASD for a top down space ship. The keys will call the server side event to rotate and move the pawn on the server side so that everyone sees it. Other clients will see it, however, the client that is sending the keys, doesn't see anything. any idea why?

winged badger
#

what creates the widget?

ripe hound
winged badger
#

and its saved how?

ripe hound
#

variable may widget after if its valid

winged badger
#

show me, all the way till it makes it into that struct

ripe hound
#

oke

winged badger
#

@static lynx your movement component is likely not replicating stuff to owner, and you're using one that has no built in simulation

winged badger
#

add a Branch with condition IsLocallyControlled to the start of that BeginPlay

#

BeginPlay executes on all clients and server

#

which means both client 1 and client 2 local copies of their Characters create that widget

#

and add it to Viewport

static lynx
#

@winged badger weird, I have replication on for everything, so I'm not sure why it wouldn't be working.

winged badger
#

which movement component?

#

and as you did not set the OwningPlayer (good practice to toss in your controller in there always)

#

i'd wager you have 2 widgets on screen, the wrong one ontop

static lynx
#

CharacterMovement, thinking about changing it.

winged badger
#

ah, you can see movement

#

but you do not see the animations?

static lynx
#

I don't see ship rotation my screen, but I do on other clients

ripe hound
#

@winged badger its working now thx ๐Ÿ˜„

winged badger
#

and anim BP is dependant on Velocity?

#

its also a good practice to let your HUD class juggle all ingame widgets (i still prefer GI for menus), often prevents accidents of this type

static lynx
#

Also, is it better practice to send the inputs to the server and let the server move the pawn? Or best to put the inputs to the pawn on the client, and let it replicate from there?

winged badger
#

what are you doing now?

#

CMC is generally able to do network simulation on its own

static lynx
#

I have a top down space shooter

#

so I just need to do Ship Rotation on one axis, and forward vector movements

winged badger
#

and vanilla approach is InputAxis -> Multiply by ForwardVector -> AddMovementInput

static lynx
#

Oh I can do that, I'm just wondering how to do it

#

Should I do it

  1. Client presses key -> Server receives Key event -> Server rotates/moves pawn
    or
  2. Client Presses key -> Client rotates/moves pawn -> Client replicates data across network with replicates bool
winged badger
#

sorry, its 2am, and CMC is not a light subject ๐Ÿ˜ƒ

static lynx
#

no worries. haha

#

I appreciate the help regardless. ๐Ÿ˜ƒ

gray scroll
#

I am getting "An error occurred (FleetCapacityExceededException) when calling the CreateGameSession operation (reached max retries: 4): No available process."

#

when trying to run a create game session command for local gamelift

#

any idea what may be causing that?

teal flint
#

@grand kestrel Thanks a lot

twin juniper
#
The Replication Graph Plugin provides a replication system optimized for games with large Actor and player counts. The system works by building a series of customized nodes that can centralize data and computation. These nodes persist across multiple frames and can be shared by client connections, cutting down on redundant CPU work and enabling Actors to be grouped together in nodes based on game-specific update rules. We may make changes to the API, so this is considered Experimental in 4.20, but it is in use in Fortnite Battle Royale and it will be a fully supported feature.```
#

How useful is this feature?

#

I have read the documentation written and looked through the ShooterGame example. However, I am unsure how much this feature is needed, and when it should be used.

bitter oriole
#

Doubtful ShooterGame uses it ?

manic pine
#

well, they made the feature for fortnite, so presumably its useful for similar game types

#

wouldnt have bothered if there was no need

twin juniper
#

@bitter oriole They made an announcement that they created an example in ShooterGame

#

It's called ShooterGameReplicationGraph.cpp I believe it is inside of /Online/Public

manic pine
#

what kind of objects is it used for in the example? the regular characters?

twin juniper
#

They made a live stream. Skip to 14:50

manic pine
#

hmm so its kinda like group-based net relevancy?

#

instead of checking hundreds/thousands of actors for net relevancy individually, sort them into a group and perform one check?

bitter oriole
#

The description reads like "Blueprint-based net relevancy on steroids"

#

If that's what it is, it's probably not useful for everyone

sly kernel
#

is it possible to save online coop game, so that whoever played can continue from the same spot later ?

#

(using Blueprints, no C++)

bitter oriole
#

Saving is pretty much entirely up to you, so yeah

#

Just implement it like you would implement it or a single-player game

#

When you quit the session, save, ignore the other players, and you're good to go

sly kernel
#

but how does it all get synced up when new session is started and clients join server ? (unless it's all done by UE4 under the hood and I don't need to worry about that)

bitter oriole
#

I don't think UE4 has any high-level saving

#

It's you who decide what to save, where, when, how

#

If you're asking about the game design aspect, well, the player to start a session would be the one deciding the save to use

#

First player to join for a dedicated server, I guess ? But that's really up to you

sly kernel
#

I don't really want to deal with dedicated servers.. Probably will be a listen server.

#

so, I assume whoever was server initially has to be sever until the game is beat ?

bitter oriole
#

You can look into how Borderlands 2 did it

#

Every player has his own save and progress, and friends can join him

#

When you start a game, you load your current save, when friends join, they just join, wherever you are

#

Their own game save is unaffected, save for character progression - they still level up while playing with you

#

When they exit, they can just keep playing their own save (though their character might be stronger now)

sly kernel
#

I see.. I guess I am just gonna have to experiment

timber nest
#

Im struggling with MP integration right now too, your not alone ๐Ÿ˜ƒ

sly kernel
#

I am still on the fence about MP

#

I don't like MP (and got no time playing MP anyway), but I know it's a good promotional tool as Twitch / YouTube streamers love playing MP games.

bitter oriole
#

The Borderlands-style, Destiny style save sharing I described is what i'm doing for my next game. Basically solo, but friends can join you, and some activites are hard enough to make it useful, game progress separate from character progress

sly kernel
#

is there any difference between saving in SP game and saving in MP game (Destiny-style) from coding (Blueprints) perspective ?

summer nova
#

no

bitter oriole
#

Not really, no.

#

Especially with a listen server

#

Basically the same as single player except you maybe won't save the other players

sly kernel
#

aye, cool

#

thanks

cold sparrow
#

trying to figure out if there is an event called on a client once the player joined the game. Can someone point to it?

#

I found in game mode has OnPostLogin, but that is on the server

manic pine
#

nothing specific that i know of, but there's a number of general events and functions fired related to joining a game

#

for instance playercontroller's beginplay

#

lots of repnotifies... some static uworld events

winged badger
#

Notify(Server)WorldLoaded might work for you

cold sparrow
#

as far as I know, beginplay on a player controller is not the safest place to start calling RPCs...

manic pine
#

server-> client no, client->server is fine

cold sparrow
#

right, hm... still can't figure out what I can use on a client. Basically what I need I need to pass some data from the server to the client upon map loaded (on client)

#

map's begin play may be? Is it save to say that a client is connected and ready to go?

manic pine
#

im not a fan of ->client rpcs, usually more sensible to use a replicated var with repnotify

#

if this is client-unique data you could put a replicated var in controller/playerstate/pawn

#

if its data for everyone, gamestate

cold sparrow
#

technically it is an array of structs that I need to pass to the connected client. hm... In a variable I can say to sync initially: Initial only. Will that be called every time when a client connected?

manic pine
#

yeah, on the initial bunch

#

which is when the actor channel opens for the first time

#

though if it loses relevancy and then becomes relevant again, it'll be resent, of course

cold sparrow
#

hm... it must be relevant all the time

#

I will put it into actor that is always relevant

manic pine
#

well, you can make a replicated actor to do whatever you want, but playerstate/gamestate are always relevant

cold sparrow
#

right

manic pine
#

as is the playercontroller for a specific player

cold sparrow
#

all right, thanks so much. I think I will try with a variable to start.

#

Actually, one sec: here is an idea

#

what if I receive on rep notify for whatever variable - that can signal that replication is opened and I can start query server for the data.

#

Thing is that I want to compress that data before sending.

#

that array might be a lengthy one, but compressed it is very small.

manic pine
#

does the client have some say in how its compressed?

cold sparrow
#

no, I can zip on fly, and client will unzip it.

manic pine
#

then you dont really need to query server for it ye

cold sparrow
#

it is a dynamic array of hit events to recreate a dynamic mesh (surface) for my voxel world. So new clients will recreate it, but I need that data.

#

so the best would be push that data once a player connected, but zip it before sending, as it might be a lot of elements.

#

after that I can receive just updates

manic pine
#

yah, im just saying; unless there's some information the client has that the server needs, then this should be a one-way communication line ye?

cold sparrow
#

yes

manic pine
#

you can also look into delta serialization arrays

cold sparrow
#

server -> client

manic pine
#

which lets you be notified when an array changes

cold sparrow
#

delta ser. arrays?

#

hm... I thought that Unreal has only all arrays or nothing?

manic pine
#

it replicates additions and removals from an array

#

unlike the regular array which is all or nothing

cold sparrow
#

Is it UE4 feature?

manic pine
#

ye

cold sparrow
#

Cool. I did not know that. I will take a look! Thanks

steady briar
#

so i have a simple projectile that replicates, except for the timeline inside it that controls deceleration. is there something fancy i might be missing?

#

i dont think the timeline has to be replicated because it should be the same every time, so if the server spawns the projectile, shouldnt it work?

static lynx
#

I'm using blueprints. Whats the best way to replicate movement of a pawn?

#

Should I just use the built in replication bool options?

#

Or should I send my controller inputs to the server and let the server update the movement for everyone at the same time?

cold sparrow
#

use built in character replication

static lynx
#

ok, so don't send the keys? thanks!

zinc crater
#

Is anyway familiar with the Behaviour tree/move to replication issue that maybe help me ?

We do have a pawn with a AI controler, and while senses, animation and everything works, the AI moves only for the server, while the client doesn't seems movement.

#

anyone*

#

sorry

zinc crater
#

Ok, weird thing... I just made a test, running a server and a client, and the AI moves efectively for the client player, BUT ONLY if the server player is looking at tha AI...

Anyone experienced this?

Anyone?

winged badger
#

played with net relevancy settings?

#

@zinc crater

zinc crater
#

@winged badger A little bit. Tried to make the movement always relevant

#

but I don't know which one should be, the Controler, the pawn... I am lost tbh

winged badger
#

what you describe usually means net relevancy problem

zinc crater
#

want a screenshot of the setting ?

#

aha...

#

any idea where I should try to start shooting at ?

winged badger
#

you didn't touch the AActor::IsNetRelevantFor ?

zinc crater
#

we are using BP so far

winged badger
#

first check if replication works fine in one of 2 cases

#

near the place client first spawned

#

or near 0,0,0

#

or just near server Pawn

#

if your PlayerController is not directly possessing the Pawn

#

then you have extra considerations

zinc crater
#

The player controles is asigned as default on the player.

#

and the AI controler is also asigned into this pawn, we don't change controllers on construction or beginplay, as far as I know

#

let me check anyway just in case in this iteration there is any changes.

winged badger
#

this pawn being the AI controlled NPC?

zinc crater
#

er.. yes

#

sorry ZLO I am not english native speaker, so I sometimes tend to express myself as a potato.

#

This is the only thing we do in the AI controlled pawn, we just check for posession. But this will be deprecated soon.

#

but by default, and AI controller is set on the configuration

#

I promiss is not a zombie game! this is just a multiplayer stress test.

#

๐Ÿ˜›

#

inb4 "another zombie game!" hahaha

winged badger
#

i have zombies in mine, they serve their purpose

zinc crater
#

Yeah, for basic AI and multiplayer testing, they are pretty okay.

winged badger
#

slow, tough and stupid

#

in contrast to pretty much everything else

zinc crater
#

sometime funny to shoot yeah Hahaha

steady briar
#

ok im going bonkers here. i have my projectile replicating but the timeline isnt going. ive seen a few people say they can get out of sync and get jittery, but mines just not going.

#

i dont think the actual timeline has to be replicated since it should be the same for each projectile (and it would be tricky cuz its fast)

zinc crater
#

The time should be updating a variable, and that variable should be set on server, and replicated.

#

I believe @steady briar

#

oof... not the time... the timeline.

steady briar
#

honestly i thought that would be unnecessary. might be right im not trying to argue but... does it actually have to be replicated?

#

replicating movement people say is a bad idea because of jittering for fast moving things like that

zinc crater
#

Whenever is a variable that needs to be seen by all players, yes.

steady briar
#

like, when the projectile fires everyone knows its speed and direction. couldnt they also be aware of the timeline and adjust it per client?

#

like its predictable i mean

winged badger
#

you can simulate

#

pretty well as long as there are no physics collisions involved

steady briar
#

well its a projectile so it just needs to know if/what it hits

zinc crater
#

Why do you need that timeline for exactly ?

#

what it does ?

steady briar
#

deceleration, eventually will have damage scaling too

winged badger
#

projectile is actor?

steady briar
#

ya

zinc crater
#

I am almost sure you can do decceleration without the need of the timeline.

#

but not an expert into that matter.

winged badger
#

and timeline is inside it? beginplay?

steady briar
#

well ive been plugging some stuff in so its a bit ugly but...

#

this is the projectile bp. might be a lot of clutter... i tend to do that when i run out of ideas and start googling

winged badger
#

@steady briar just let the projectile actor run the timeline on beginplay

#

you have to spawn it everywhere

#

anyways

#

RPCs for this are just... redundant

steady briar
#

ya it used to have nothing whatsoever

#

most of this bp does absolutely nothing

#

without anything replicated in the projectile, it worked the same because its a replicated event from the character

#

i just wasnt sure why the timeline wasnt working so i did my usual spam a bunch of garbage in a bp and see if anything happens

winged badger
#

as soon as server spawns a replicated actor

#

clients will too

#

and they will all run their Tick and BeginPlay separately

#

use it

steady briar
#

u mean like this? cut out the junk functions at the top?

#

also if i set the projectile itself to Replicates it just explodes and doesnt move from spawn. supposed to ignore pawn so i dunno what thats about

zinc crater
#

Is the projectile being spawned by the server ?

winged badger
#

it does need the initial velocity

steady briar
#

this is in character at the end

#

its ugly im organizing <_< but i do what Zlo helped me with a while ago with a rock o.O

winged badger
#

thats bad

steady briar
#

everyone sees the same projectile, direction and all (i have a random aim offset thing to check)

#

everythings bad T_T

winged badger
#

GetPlayerCharacter[0] is executed server side there

#

guess what it returns?

steady briar
#

Canada?

manic pine
#

this getplayercharacter(index) should be banned

winged badger
#

might as well

steady briar
#

ya i plugged that in just out of curiosity

#

it didnt seem to change anything though

winged badger
#

but it will either always return the listen server host, or in case of dedicated server, first client that logged in

steady briar
#

i have spaces here for doing tests/checks i dont have yet (has ammo etc)

#

ill have to pass through a character reference through those functions for instigator

winged badger
#

hint:

steady briar
#

delete all?

winged badger
#

have a function Fire() and function CanFire()

#

preferably both on your character and on your weapon

#

Character::Fire() calls Weapon->Fire()

#

character CanFire() checks for stuff that he has a weapon, is not dead, basically stuff in character scope

#

weapon CanFire() checks for ammo, weapon not jammer, etc

#

Character's CanFire() does its own check and ANDs the result with Weapon's CanFire()

steady briar
#

ya thats eventually the plan. currently i was just trying to test the projectile itself. i wanted it to work properly so when i add the other stuff and something breaks i know its before the projectile

winged badger
#

yeah, that rarely works out that way

steady briar
#

the bomb tutorial seems to be pretty good about that

winged badger
#

once you are neck deep in clutter, you're pretty much doomed

steady briar
#

i am clutter T_T

#

but... still unsure why timeline isnt going. the checks and stuff shouldnt be related right?

zinc crater
#

@winged badger I think I tried so far all combinations of relevancy with no luck.

#

๐Ÿ˜ฆ

winged badger
#

does your BT execute when server's Pawn is not around

#

might not me a networking issue at all, just a buggy decorator

small temple
#

hey, are there any differences between a local client and a remote one besides ping and packet loss etc?

#

i have a bug that's probably network related that i can't reproduce locally, even if i launch 2 separate instances of my game

#

and even if i simulate lag

hasty adder
#

Explain the bug

small temple
#

@hasty adder i'm not sure what the exact bug is since i can't replicate it

#

and it's hard to explain what happens without explaining the whole game

#

but i guess i'll try

#

i'm making a racing game

#

when you load a map, you start as spectator and have to spawn manually

#

and being a racing game, the game records lap times etc

#

so the problem is when a client joins a server and spawns before the host, the game doesn't record lap times for that client

#

if the host spawns before the client, everything is fine

#

and i'm sure this is just a bug of my own fault

#

it's just that i can't find it because i can't replicate it locally

halcyon totem
#

why cant i drag and drop MotionControllerPawn.uasset from my vr porject into my 3rd / 1st person project???

#

i need to make my game VR mode

edgy galleon
#

did you drag it into the content folder using explorer?

winged badger
#

@small temple any AlwaysLoaded streaming levels around?

small temple
#

@winged badger not that i know of, no

#

not using level streaming

winged badger
#

sublevel, basically

#

(i had a very similar experience and in the end it was an engine bug, when client finishes loading first any sublevels set to AlwaysLoaded were not set as Visible to that client)

#

it also involved SeamlessTravel

small temple
#

ah, my clients definitely aren't loading first here

#

unless my playtesters are really super quick lol

#

but yeah i'm not using any form of level streaming at the moment so i doubt that's it

winged badger
#

nod

small temple
#

i'll give it a try though

#

nope, that's not it ๐Ÿ˜›

winged badger
#

how do you record lap times?

small temple
#

the client sends them to the server which then broadcasts them back

winged badger
#

if you added a second client

#

would it stop recording for both the client1 and server?

small temple
#

well, i wouldn't know because i can't replicate this bug locally

winged badger
#

(would indicate you forgot to check for IsLocallyControlled on BeginPlay)

#

and ran the same logic on whoever spawns last

#

on every copy of the PlayerPawn on every connected machine

#

basically "overwriting" the logic that recorded lap times prior

#

sideeffects may include few "No owning connection for" output log lines

#

but that depends on the setup

small temple
#

it's possible but i doubt that's it considering everything works fine normally

winged badger
#

it would have to involve using GetPlayerController[0]

#

to have that effect

small temple
#

but my question is: why would this only happen with a remote client?

#

i just tested a client with 1000 ms lag (in a config file so applies before joining the server) and it still worked fine btw

#

how is that different from testing with my friends who live a country away?

winged badger
#

i do not think this is in any way related to lag

small temple
#

me neither

#

but what else can it be then?

winged badger
#

unless you show me how it records the lap times

small temple
#

and i don't mean the actual bug, because that could be a bunch of things, like your example

winged badger
#

there are too many variations to guess

small temple
#

for the bug, yes

#

but the bug isn't the issue ๐Ÿ˜ƒ

#

the issue is that i can't replicate it locally for some reason

winged badger
#

ofc its an issue

hasty adder
#

Pie acts different

small temple
#

not using pie

#

i'm testing with packaged exe's

winged badger
#

ok, and the issue appears in shipping?

small temple
#

development, not shipping

winged badger
#

you're running 2 games on same machine? steam involved?

small temple
#

no steam

#

just connecting directly

winged badger
#

not enough information for me then ๐Ÿ˜ฆ

small temple
#

just ask if you want more ๐Ÿ˜›

hasty adder
#

So over lan it works

#

But not over internet

small temple
#

over lan on the same machine, yeah

hasty adder
#

Same machine

#

Youd@be connecting to local Host tgeb

#

Then

small temple
#

yeah

hasty adder
#

I'm not sure with fake latency you will get the same results like you'd want. Would have to know how lag simulates. Rpc events may be happening instantly still not giving you the bug

small temple
#

they don't

#

i can confirm they definitely don't after testing with 1000ms ping ๐Ÿ˜›

hasty adder
#

Both client and host simulating the lag?

small temple
#

only client

#

i can try with both lagging but i don't see how that would make a difference

#

just tried with 1s lag on both ends, still works fine lol

halcyon totem
#

im losing my hairline because of this one maybe someone can help me but I placed my thirdperson guy in the world, but when I click play, he stays there and im able to move around in another 3rd person guy but he wont show up on edit mode

small temple
#

it sounds like you're in over your head a bit @halcyon totem

halcyon totem
#

yes

#

the damn instructor was confusing

#

also he spent 10 minutes doing something wrong

small temple
#

following a multiplayer tutorial?

elder crypt
#

I'm having a really odd issue

#

For some reason on the server's screen the client pawn is much larger

small temple
#

๐Ÿค”

elder crypt
#

But on the client's screen both sizes are normal

small temple
#

you mean the server's pawn is much smaller on the server's screen @elder crypt

#

are you messing with the scale anywhere?

elder crypt
#

That's what I meant yeah. My bad

#

And nope :(

small temple
#

then i have no idea, sorry

elder crypt
#

That's okay :)

#

It's so off

#

odd*

edgy galleon
#

so when playing in editor how do you grab your local playercontroller instead of using index 0?

gleaming vector
#

if you are on your local client, playercontroller at index 0 is always you

#

if you are on the server, you can't be sure who it's going to be

#

so, like, if you are doing things like UI or HUD work, getting player controller 0 is totally kosher

edgy galleon
#

Yeah that's what i've been doing it's just a pain to run the game outside of the editor to test it

#

was wondering if there was a way around that

manic pine
#

use your context

#

if you are in a pawn blueprint, then you have a controller available through getcontroller

#

if you are in your hud/umg, you (should) have it available through owner/owningcontroller/owningpawn

#

these global static functions are terrible

edgy galleon
#

ahh that worked thanks @manic pine

jovial ravine
#

I would sure love some feedback on my approach here. I have a Golf game w/ replication I've been trying to sort out. My ball is a pawn, the client calculates the speed and angle then sends it to the server to add the physical velocity. After that is calculate, I call a multicast to project the ball movement to all clients. Is this even close to a good approach here? I can't get it to work but I think it's a client side issue in my calculation logic.

#

Just to add, my current issue is each client can hit but the pawn doesn't move however the server does calculate and cast the ball movement to everyone else

dusty halo
#

@jovial ravine I'm not that experiend with MP yet, it's still a pain in the ass for me, but from logic side, if it's MP game, then why would you do calculation on client and send it to server?

#

From avoiding cheating part at least I would do oposite, would do calculation on server side and then just send resoults to client. But maybe I'm wrong and someone will correct me

#

It's like in shooter games, where damage is calculated on server side and then resoult passed to client

jovial ravine
#

I have gone back and forth internally myself on this one but I settled on let the client determine the parameters but leave the actual application of force up to the server. I always remember the words "never trust the client"... I'm not convinced what I'm doing is even remotely best practice though!

#

I am just struggling with this simple concept and at this point, the only one that sees ball movement is the server so obviously I'm not doing the multicast correctly at the moment

dusty halo
#

I would try to run calculation on server and then multicast resoult to clients. It would be safer and would help with replication too. Now I'm not at PC so can't test it, but it will be easier to multicast too.

#

Also you can check if any of your variables don't give you these problem, try to set them to replicate

#

Is your ball even set to replicated and replicated on movement?

jovial ravine
#

I double checked my variables and pawn, all set to replicate.. I'm guessing I am not doing the SetWorldLocationAndRotation right on the multicast... as I said, the server sees everyone moving.. the clients don't see the movement even though they initiated it.

dusty halo
#

So everything works how it should be on server side?

jovial ravine
#

correct

dusty halo
#

Ok, then check with print string your multicast resoults just to check if it multicast calcolation or not

#

*calculation

jovial ravine
#

will do

#

thanks for the pointer

dusty halo
#

And then let me know. Becouse at the moment I have a feeling that it replicates calculation as it should be

jovial ravine
#

yeah, it's showing the replicated #'s on all clients... it's just like the client doesn't actually do anything with it

dusty halo
#

Ok. That's what I tought

#

Are you sure thet BP is replicated? Not your static mesh or what ever you're using but your BP? And it's also replicated on movement?

#

These part

jovial ravine
#

yes sir...all checked

dusty halo
#

Hm, then I need to think a bit

jovial ravine
#

I may have it.. I was using my SetWorldLocationandRotation on the sceneroot and not the ball itself

#

im testing that now

#

that seems to be it, now I have other problems but at least the balls are moving on all clients!

#

Thank you @dusty halo for your time!

dusty halo
#

@jovial ravine np. Mp is a pain in the ass ๐Ÿ˜‚ that's what I usually do, when I have no clue what's not working, I check what is working

jovial ravine
#

yes it is..even for a simple rolling ball

dusty halo
#

If there is anything else I can help you with, let me know, will try to help

jovial ravine
#

I appreciate your time sir

cedar galleon
#

Hey guys, I have problem, I have create code in the blueprint of map, when overlap trigger spawn AI NPC, but when run with dedicated server (client) the NPC spawn and after few second auto-destroy actor....why? Destroy only for client, in the SERVER the NPC work...can help me? tk

zinc crater
#

@winged badger Hi, Sorry for the time I needed for an answer. The AI moves if the server is watching them, or maybe close not sure. But We can see the AI moving on the client if the server's pawn is around, yeah.

cedar galleon
#

@zinc crater for me man?

zinc crater
#

Hey, no. ๐Ÿ˜ƒ As you can see @winged badger is nominated in the comment. ๐Ÿ˜ƒ

cedar galleon
#

ah ok! can help me for me problem?

zinc crater
#

hmm... let me see how we do it. I am not the main programer, so...

#

give me some time and I'll chek it, I think we are spawning actors in MP no problem.

#

anyway, you're spawning at 0,0,0 have you seen if the character teleports to 0,0,0 when is server validated, just in case...

#

it's being destroyed for sure ?

cedar galleon
#

same problem....

#

spawn AI but after few seconds destroy the actor

zinc crater
#

I just checked our code, and it looks like yours. It's an execute on server.

#

So try this.
OnOverlap call a custom event

#

and on that custom event, try to execute on server directly.

#

and I am sorry if I can't help you man.

cedar galleon
#

Rotation

#

?

#

why

zinc crater
#

just forget that, is just an example

#

is the closests one I had now...

#

what matter is that this custom event executes on server

cedar galleon
#

not work...

zinc crater
#

Maybeit's a silly question. Is the actor you're spawning a proper AI ?

icy nacelle
#

When I'm saving player's data to a database, how should I handle the player ID? Their steam ID?

zinc crater
#

@cedar galleon

#

Try this way...

#

You should call a custom event that calls another depending on authority

#

So if it has authority, calls a custom event that is ALLWAYS RELIABLE and executes on server

#

and that custom event calls another custom event that executes an all

#

That third one (Tell clients) is the one that must do the proper spawn AI

#

While if it's remote (a client) just "Asks the server" if he can spawn (in my case a particle)

#

sorry if that doesn't works I am out of ideas... but at least tried... ๐Ÿ˜ฆ

steady briar
#

so everyone can see my projectile, with none of it being set to replicate. if i set it to replicate it spawns 2 and they immediately impact eachother. is that weird?

cedar galleon
#

@zinc crater not work...

zinc crater
#

Sorry @cedar galleon I tried what I could. Your problem may not be a replication problem then.

steady briar
#

should a projectile spawning be multicast or run on server? both seem to have the same result, visually. same prints i need to figure out whats wrong with those too but thats later

#

and things like damage should be done on the server, things like explosion/visuals should be multicast for all to see, right? O.o

next falcon
#

Is there a way to replicate an actor or component just for the server and one specific player ?

winged badger
#

if that player is the owner, yes

#

OnlyRelevantToOwner

next falcon
#

is it possible for one component too ?

winged badger
#

look under Replication settings in class defaults

#

you'll find the checkbox there

next falcon
#

jea i find it just in the actor defaults but not in a component defaults

winged badger
#

ha, it is an actor setting

#

i did not know that ๐Ÿ˜„

next falcon
#

ookay But good to know ๐Ÿ˜„

twin juniper
#

Has anyone has this before on dedicated servers?

#

4.20

next falcon
#

Okay another question: Can i replicate a actor for two players and the server?

Like so it is the same actor for players in range ?

winged badger
#

it does that by default

#

15000 UU range

next falcon
#

Okay if i get out of the replication range and the server spawns a component and than i return again in the range what happens ?

twin juniper
#

Does anyone know how to fix the issue I posted above?

winged badger
#

i've never seen it, what did you send with the login request?

twin juniper
#

Nothing out of the ordinary

#

It works in 4.19 so it must have been a change in 420

winged badger
#

which net driver?

next falcon
#

Okay if i get out of the replication range and the server spawns a component and than i return again in the range what happens ?

thin stratus
#

You know, between now and back when you asked this the first time, you could have simply tested what happens

#
  • DM people randomly for help is against the rules
next falcon
#

There are rules to ask people for help? thats **** man

#

and jeah i tested it and it stoped replicating but sometimes its starts again

#

and sometimes doesn't start

#

tested 142 times

severe widget
#

DMing randomly is the part of the rule that is important

next falcon
#

oh okay than it wasn't random

#

i asked him

#

@thin stratus You know, u could just help me instead of telling me that

winged badger
#

well, you want to know what's going on exactly

#

type in log lognet veryverbose in your console

#

and read ^^

#

(the logs)

thin stratus
#

:P It was totaly random. I wasn't even part of any discussion here.

next falcon
#

there was no discussion anywhere

#

i just asked you cause u helped me already and i know u have a big knowledge about it

winged badger
#

some people do this for a living @next falcon, and when i pull 12 hour day sure, i'll help a bit when i look at discord, but as long as it doesn't take my attention from the work i do

#

giving you a piece of information that will point you in the right direction can be enough

#

i personally don't like when people prod me directly just because i helped them abit prior

#

and i imagine its the same for Cedric

next falcon
#

Just pls help me

#

I need just a bit of information

#

and if i pm someone than it has nothing to do with this server or the rules here

mild hull
#

try the multiplayer content example, there are really great treasure chests in it

winged badger
#

then ask a very specific question here, something i can answer inside a minute if i know the answer off the top of my head

next falcon
#

Okay if i get out of the replication range and the server spawns a component and than i return again in the range what happens ?

winged badger
#

it should use its NetOwners relevancy setting to decide if it should start replicating again

next falcon
#

it is always relevant

winged badger
#

then there should be no change whatsoever if it leaves the range or enters back in it

next falcon
#

Okay and what relevency need it so it replicates if i get closer

winged badger
#

default ones, maybe adjusting the NetCullDistanceSquared to something that suits you better

#

default being 15000^2

next falcon
#

i have a int (replicated) that every tick increases if i am close to it it gets replicated but if i move back its Not and if i move closer it stays unreplicated ?

winged badger
#

bool AActor::IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const
{
    if (bAlwaysRelevant || IsOwnedBy(ViewTarget) || IsOwnedBy(RealViewer) || this == ViewTarget || ViewTarget == Instigator)
    {
        return true;
    }
    else if ( bNetUseOwnerRelevancy && Owner)
    {
        return Owner->IsNetRelevantFor(RealViewer, ViewTarget, SrcLocation);
    }
    else if ( bOnlyRelevantToOwner )
    {
        return false;
    }
    else if ( RootComponent && RootComponent->GetAttachParent() && RootComponent->GetAttachParent()->GetOwner() && (Cast<USkeletalMeshComponent>(RootComponent->GetAttachParent()) || (RootComponent->GetAttachParent()->GetOwner() == Owner)) )
    {
        return RootComponent->GetAttachParent()->GetOwner()->IsNetRelevantFor(RealViewer, ViewTarget, SrcLocation);
    }
    else if( bHidden && (!RootComponent || !RootComponent->IsCollisionEnabled()) )
    {
        return false;
    }

    if (!RootComponent)
    {
        UE_LOG(LogNet, Warning, TEXT("Actor %s / %s has no root component in AActor::IsNetRelevantFor. (Make bAlwaysRelevant=true?)"), *GetClass()->GetName(), *GetName() );
        return false;
    }

    return !GetDefault<AGameNetworkManager>()->bUseDistanceBasedRelevancy ||
            IsWithinNetRelevancyDistance(SrcLocation);
}
next falcon
#

why does my Int not replicated again ?

chrome bay
#

Because the actor holding it is too far away

next falcon
#

no its not

#

i stand on it

chrome bay
#

In that case no idea

next falcon
#

:/

chrome bay
#

Properties can't change whether they replicate or not at runtime, so something else must be going on

next falcon
#

seams that the activation range is smaller than the deactivation ๐Ÿ˜ฆ

#

if i look at it, it works 4 sec. and than it stoped and if look away it replicates again

#

wtf is happening

steady briar
#

hate to be that guy i gotta go in 10 mins just wanted something to think about. i have a projectile that replicates perfectly except a timeline that adjusts speed. if i print the float it works, but it doesnt actually adjust the speed. any ideas for me to ponder anyone?

next falcon
#

@winged badger Okay it works but only if i don't look at the actor??

jolly siren
#

Is the actor being occluded?

next falcon
#

what does that mean ?

steady briar
#

behind something, not visible

next falcon
#

it has a static mesh component

steady briar
#

unless im wrong which is... quite often

next falcon
#

but nothing else

jolly siren
#

@steady briar what do you mean by speed? what property are you updating exactly?

steady briar
#

well actually thats a good question...

#

i was modifying Initial Speed which... looking back at this............... name might be self explanatory

#

what would i modify for the speed of a projectile using ProjectileMovement? im using vector for direction

#

speed for speed

#

if that makes sense

twin juniper
#

Vyk show him y our BP you showed me

manic pine
#

doesnt projmovement have a velocity vec member

jolly siren
#

UProjectileMovementComponent::Velocity

steady briar
#

projectile has velocity and speed

#

if u have a speed number it uses that, but velocity for direction

#

but it only has initial speed so i guess i was adjusting initial speed and of course it wasnt changing its speed because its not initial once its launched...

jolly siren
#

Correct

steady briar
#

so then how do i adjust speed?

twin juniper
steady briar
#

ya its a simple thing, i thought it wasnt replicating the timeline but i think it is working perfectly, just adjusting a number it doesnt use

#

and most of that bp is just shiny stuff that pretends it does real stuff. it could be like 5 nodes

twin juniper
#

his timeline at the top wont work and i suggested using an RPC to call it but someone else said to use beginplay

steady briar
#

rpc didnt do it either. i do think the timeline is perfect, its -what- im adjusting thats wrong

jolly siren
#

You would update the velocity.

steady briar
#

wondering if ill have to use velocity instead of speed because i dont see anything but initial and max speed

#

hmm... ya i was hoping i didnt have to use velocity, seems more complicated somehow...

#

ok so if i did the same thing but velocity (assuming X) it would slow it probably?

#

@jolly siren thats probably it thanks... was in a hurry and thought id get some better brains on my problem and... it became immediately apparent with the variables name. will see if i can fix it later today

jolly siren
#

np, you will probably also have to update it on both the client and server; but I'll let you experiment with that ๐Ÿ˜ƒ

next falcon
#

Hey
I want to make a floor out of floor components and i want to do it like every player sees only their own floor components so the components are on the server and that client But if another player get near to the other player, the floors they use are the same so replicated on server ,player one and player two but all other players who are far away doesn't see the components

And "don't see them" doesn't mean just invisble, they doesn't exist on players client

Whats the best way to do it or is that even possible ? IF yes How ?

twin juniper
#

Is anyone using the replication graph in 4.20?

jolly siren
#

ShooterGame is, if you haven't looked at it yet

twin juniper
#

I have looked into it a bit.

#

There was also a live stream where they showed fortnite's code

jolly siren
#

Right, yeah I watched that too

twin juniper
#

@jolly siren It only seems useful for large, open world games.

#

I feel as though a game like unreal tournament, or left for dead for example would not be so good with it.

jolly siren
#

Yeah, it was designed for Fortnite; so it makes sense.

wary willow
#

Cross Platform between PS4/PC still requires custom subsystem or we groovy ezpz in UE4 thanks to Fortnite?

#

(or use GameSparks/PlayFab real-time)

fast ivy
#

Hoping someone can point me in the right direction. I'm working on an multiplayer RTS Game. Trouble I have is using the controllable AI to determine who gets multicasted.

#

For example when a team AI enters the cull distance of an enemy AI how do I replicate that to all the team members

#

or more specifically how does the net cull distance work? Is there a component I can attach to the AI characters?

#

determining who gets the multicast

winged badger
#

unless one of the special conditions is true (like owned by PC viewing, AlwaysRelevant...) it defaults to DistanceBasedRelevancy

#

that would be the NetCullDitanceSquared (default is 15000 UU)

fast ivy
#

I'm curious though, what is based on the distance? distance to the client?

winged badger
#

you can read the AActor::IsNetRelevantFor and APawn::IsNetRelevantFor override if you can do c++

#

your PlayerController, which defaults its location to the possessed Pawn

#

for the calculation

fast ivy
#

okay, so if the playercontroller is not attached to the pawn then it doesn't move

#

because I've had this issue. I still move my RTS character but the cull distance component does not follow the RTS character

winged badger
#

AIController inbetween?

#

for MoveTo or BT?

fast ivy
#

so essentially the cull distance starts when the possession

winged badger
#

do you use some kind of ObserverPawn with camera slapped to it, or does your PC not have a Pawn?

fast ivy
#

no I mean my RTS character is not calling the cull. So units disappear regardless of where my RTS character is

#

it's an actual character that has a camera

#

but for some reason whatever the culldistance is based on is not attached to the RTS character

winged badger
#

ok, but still the question remains: what is your PlayerController possessing?

fast ivy
#

the RTS character

#

the overhead controlling "unit" if you will

winged badger
#

SimpleMoveTo for movement?

fast ivy
#

well it's not AI

#

I think we got mixed up somewhere lol

#

Is there a way to use the AI characters to determine who gets replicated instead of my overhead pawn

winged badger
#

as long as your PlayerController actually possessed and owns the RTSCharacter

fast ivy
#

that's my main issue

#

or my playercontroller for this matter

winged badger
#

NetRelevancy should work

#

calling SetPawn from PC fixes the scenario even when you have an AIController possessing the character

#

and no, iirc multicasting from non-relevant Pawns won't do anything to help you

fast ivy
#

What exactly do you mean SetPawn? like the default pawn?

winged badger
#

i mean the function SetPawn

#

that is not exposed to BP

fast ivy
#

ah okay. thank you.

#

I'm assuming none of this is exposed to blueprint?

winged badger
#

if you have any c++ code

#

just add a base class for the PC

#
UFUNCTION(BlueprintCallable)
void SetPawnBP(APawn* inPawn) { SetPawn(inPawn); }
#

and you can then call it from BP

fast ivy
#

Alright. I'll give that a shot thank you.

winged badger
#

(all of that goes in .h, and base class for PlayerController has to inherit from APlayerController)

shut gyro
#

Ok, so I am watching the Krazy Karts multiplayer tutorial on Udemy and it has really good info for a multiplayer game, only thing that I know of that they don't discuss or go into detail is using the PhysX engine to simulate physics as they used a dumbed down version using their own physics engine.

#

Obviously I don't want to reinvent the wheel, and I am planning on hosting lots of players in my game, so what are some things to keep in mind when using the PhysX engine with replication?

#

I already know a little about semi-fixed time sub-stepping, I know there is a lot of annoying stuff with replaying PhysX scenes but I don't really know how to go about doing that ๐Ÿ˜›

jolly siren
bold hatch
#

@jolly siren did it work

#

?

jolly siren
#

The review process will take a bit

bold hatch
#

anyone ever done multiplayer through blueprint?

thin stratus
#

Probably the majority?

rose egret
#

how do I get network synced time in clients? my replicated actor hits the ground in clients and I want to print impact time to see which client hit later

#

๐Ÿ˜

manic pine
#

game state

#

GetServerWorldTimeSeconds

rose egret
#

AActor doesn't use velocity for prediction?
I have a rocket which only moves in a defined direction and speed. should I do prediction myself?

thin stratus
#

Only Characters have prediction

#

All other Actors etc. are simply setting location

#

If it lags, it will jump to the newest update wihout prediction

#

Well not only characters. Could be that something like the ProjectileComponent has something

manic pine
#

charmovecomp does extrapolation

#

but thats the only move comp that does

#

if you wanna predict projectiles youll have to do it yourself

#

projectilemovecomp simulates on both server and client i believe

#

with corrections from server

#

but it'll be lagging behind the server by ping/2

rose egret
#

GetServerWorldTimeSeconds on dedicated server gives me a value more than clients when I use it for the first time! why?

twin juniper
#

Hello Sirs,
Has anyone had an issue where World Composition tiles are not loading in quickly so players are falling out of the world?

celest sigil
#

Has anyone used UNEASY's Good Particle: Status, Blueprint Component? Having a heck of a time getting the particles replicated. ๐Ÿ˜ฆ

icy nacelle
#

Is there an event for 'player disconnecting' in BP?

celest sigil
#

EventOnLogout

icy nacelle
#

Is that on the controller/state?

#

I cant find it

celest sigil
#

Atleast that's what I use and I'll clear their controller.

#

It's in my Gamemode

icy nacelle
#

ah

#

Thanks bud, I was looking in the controller/state ๐Ÿ˜›

#

Also I haven't used that system but I've managed to replicate particles before

#

How are you replicating them?

celest sigil
#

I think I finally got it figured out. I was making a magic system where depending on what Magical Element you're using, it'll spawn a particle on your hands showing what Element you currently have.

heady merlin
#

@jolly siren they override GetNetOwningPlayer to provide the ownership on network for Pawns, that nullptr setting appears to be a mistake on their part, either that or GetNetOwningPlayer can revert to its default implementation of checking its owner

rose egret
#

when we use NetPktLag on a client it applies to the outgoing packets. am I right?
In real network is ping the same ? I mean sending packet from server to client will takes the same time ?

rose egret
#

shit. the replicated actor is not spawned at the the exact location I used on dedicated server. how UE4 sends initial Position And Rotation to clients?
Server Pos: Is X=5352.663 Y=8980.523 Z=6142.833
Client Position Is X=5327.800 Y=8933.700 Z=6031

icy nacelle
#

Sometimes when this runs, it works fine, sometimes client 2's name will be set to none, and sometimes both clients will have their names set to none. Any idea why? I'm trying to understand the problem.

icy nacelle
#

Is it because the playerstate is initiated first?

winged badger
#

dedicated server?

#

you do know BeginPlay runs on every copy of the PlayerState on server and all clients?

#

and that PlayerController[0] returns a different result in each

#

and even if not for the PlayerController[0] approach (PS can get its controller directly, no need for statics)

#

the steam name is pulled locally from the steam client running on that machine

#

so, whoever runs that last, wins

icy nacelle
#

Yeah instead I've changed it from Get Player Name (inputting a PC) to Get Player Name (inputting a PS)

#

although it looks like Get Player Name (PS) is not with advanced sessions ๐Ÿค” will this still return the steam name?

winged badger
#

it should run just fine as long as you check if PlayerState owner is the local controller

#

then RPC the name over to server

icy nacelle
#

great, thanks Zlo!

twin juniper
#

How to increase level streaming time?

proper sun
#

if i send someone this engine i have for this unreal game will they put online into it please

bitter oriole
#

Uh ?

#

You want someone to add multiplayer for your game ?

proper sun
#

yes please

bitter oriole
#

Well I've got bad news - that's probably more work than you already put into it.

#

Multiplayer is hard

proper sun
#

ok

bitter oriole
#

You should look into how it's done, learn, do it patiently

proper sun
#

ok

hasty adder
#

Just do a save-as Multiplayer format

knotty finch
soft relic
#

Whats the problem with this? (inside game state)

winged badger
#

it doesn't get past the cast except for the local player controlelr

#

@soft relic

#

it can exec server only, it would work as intended then

#

let the PlayerControllers handle their own client updates via replication

#

(there is only one PC on each client, so for any PlayerState that is not your own, GetOwner is NULL)

#

@knotty finch GameModes have bUseSeamlessTravel boolean

soft relic
#

What I want to do is everytime someone changes his selection, it updates to all the players

knotty finch
#

@winged badger that's set to true

winged badger
#

then keep it in PlayerStates

#

update PS and let the PC pull the data locally from there

#

you are Multicasting that which means it runs on all clients, and they all try to access all PlayerControllers

soft relic
#

So I should change to playerstates instead?

winged badger
#

PlayerStates are fully replicated to everyone

#

PlayerControllers are not

#

so i don't know your setup, but that would probably work for you

soft relic
#

So you're tellingme to keep the game state as it is but instead of casting to the pc cast to the ps

winged badger
#

@knotty finch ExecuteConsoleCommand: ServerTravel MapName?listen ?

#

not cast

#

move that Characters array

#

into the PlayerState

knotty finch
#

Isn't that just a BP node @winged badger ?

winged badger
#

it is, but if you're constructing a string and calling it from code

#

string argument should look much the same

knotty finch
#

Yeah but it probably just wraps seamless travel @winged badger

winged badger
#

you might be missing ?listen

#

for example

#

that would break it nicely

knotty finch
#

But clients are already connected to the listen server

#

And seamless travel doesn't except params. Only a map name.

#

Basically I'm trying to set up a system like in left for dead where once you complete one map you travel to the next. And clients are able to connect and play on the first map. But upon completion the seamless travel only works on the server. It seems like clients are still connected they just don't travel

blissful thorn
#

I believe the ?listen parameter is what you do to get the specific map on the server to be the map the players load into.

knotty finch
#

I'll give that a shot. I tried adding a param to the map name on the seamless travel method and it crashed. It seems like the method takes a map name and constructs a url from that, and that url can contain params like "listen" but it wasn't clear how to add those params to the url.

blissful thorn
#

hey i actually know the reason why its crashing, thanks to my good ol bud victor

#

one sec let me find it

knotty finch
#

You are my hero

blissful thorn
#

nah, thank victor

knotty finch
#

Ok ok, I'm gonna try that in a minute on the blank fps template first and then my project

blissful thorn
#

sounds like a plan!

steady briar
#

projectile velocity is the devil.

meager spade
#

how so?

knotty finch
#

Actually I think I'm just an idiot @blissful thorn @winged badger this whole time I've been using SeamlessTravel instead of ServerTravel

meager spade
#

:/

blissful thorn
#

it happens to us all

meager spade
#

speak for yourself ๐Ÿ˜„

#

but yeah its true it does

steady briar
#

velocity is so much more annoying than the oldschool Speed, but we can only set Initial and Max speed

#

cant adjust it like i wanted to with a timeline. velocity i cant get it to go in the proper direction using the same transform as speed so i just gotta redo everything. gotta be done though

#

not sure why theres an option for max speed if it isnt adjustable though. so gravity doesnt drop it too fast? seems like lowering gravity would have the same effect o.O

winged badger
#

that made almost no sense @steady briar

#

and iirc MaxWalkSpeed is what limits the length of Velocity vector when travelling over land

icy nacelle
#

I'm still having a hard time understanding appropriate ways for clients to interact with objects in the world and for these interactions to be replicated.
For this instance, I'm trying to make an object spawn where a player can pick up an object, that object fades out, and after a few seconds it fades back in again.

So far I've got this fully working on single player and have been attempting to figure out how this could work for all clients to see.

#

Here's what I got, minus the attempts I've made to replicate it with multicasting etc

#

This is an actor permanently in the world.

#

(open in browser for full res)

#

I've been running into similar problems with other world objects - If someone could elaborate on the proper procedure for replicating objects that are permanently in the world it'd be very much appreciated.

sharp pagoda
#

@icy nacelle 1. With your approach, there's going to an unreasonable amount of code duplication since you're having the logic in every item in the game. 2. Make fade in/out first call the SetCollisionEnabled() then call a new event (multicast) which handles setting the material parameters.

icy nacelle
#

So I should handle the material in a separate function on a multicast?

sharp pagoda
#

Yes

icy nacelle
#

Because even if I change fade in/out into multicast events they still do not work

sharp pagoda
#

The dynamic material is not replicated, so you must multicast it

#

Who owns the item?

icy nacelle
#

Ah, since posting that screenshot I have set it to replicate

sharp pagoda
#

Is the item itself replicated?

icy nacelle
#

Yeah

#

hmmm actually hold up

#

Yeah no I forgot to replicate the actual class

#

God dammit.

#

Apologies - I will take on your advice about optimising my code!

livid barn
#

is there anywhere I can adjust parameters on how agressive the server will adjust the player's position? Not having much luck witht he Character Movement Component, network settings.

I'm adjusting the max accel and walking speeds fairly often which trips up when the client and server desync a little

winter zenith
#

I'm looking to replicate a weapon's current ammo with client-side prediction so I don't have to wait on latency to see the ammo remaining count change. With a simple prediction for a weapon that fires rapidly enough I would see the ammo numbers jump around quite a lot as the client would be well ahead of the server in terms of shots made (for a higher latency). My current thought is to not actually replicate the current ammo but have the client manage it entirely on their end, and in order to adjust the ammo (e.g. reload) implement that via a RPC the server could make to the client. Does anyone have a different solution that might be a bit more elegant than that? thanks! ๐Ÿ˜ƒ

livid barn
#

@winter zenith yeah its starting to look like I need to roll my own CMC which I really wanted to avoid :\ Havent done C++ in ages, and even then some of the syntax kept cofusing me

winter zenith
#

It does look a bit intimidating, but the example in that wiki is pretty fleshed out. I was able to take that previously and roll with it as a basis quite happily ๐Ÿ˜ƒ

#

and the result was pretty ๐Ÿ‘Œ as it was all movement ability stuff that the client fully knew about

winged badger
#

@winter zenith you can try with a timestamp

#

if 0,1 seconds have passed since server sent the update at the time it was received

#

and client is firing 300 RPM

#

you locally simulate the difference (5 shots have been fired since the update was sent)

#

won't work out of the box tho

fiery dome
#

Yo I have steam session finding and joining working in C++ but it only works with friends joining me since I have port forwarding. Everyone on the forums sees to suggest that the OnlineSubsystem should automatically use steam's NAT punchthrough.... any ideas?

winged badger
#

Only friends being able to join suggests its not a port forwarding issue.

#

Port forwarding just eliminates the need to punch through the NAT

#

But it does so for everyone equally

fiery dome
#

yes as in playtestest can find and connect to my game

#

friend or not

#

because I have the open ports

#

but when they host a session no one can find them

livid barn
#

ah, so THEY havent opened ports when they run a server, and ya need a way for ya game to punch on through?

fiery dome
#

yeah!

#

Steam supports this

livid barn
#

oh cool that I did not know. I've always just manually opened ports on my router ๐Ÿ˜›

fiery dome
#

and half the material I read online says the online subsystem should use steam's punchthrough

#

but it doesnt :/

#

yeah the game will be using dedicated servers for the most part but for custom games I want players to be able to use a call of duty style networking model

livid barn
#

yeah not sure how that works sorry. All i can suggest is basically dig into how steam punches through ya router. Maybe there is some flag somewhere you may need to enable for it?
Maybe its working for the people who run it who have routers that support NATs, but others that say its not working have some security firewall thing preventing them?

#

http://canyouseeme.org/ is a good way to check to see if ports are open at your end, can forward that onto community to use when they run a server?

fiery dome
#

yeah port forwarding aint too hard but I would really love people to just click host game ๐Ÿ˜ฆ

livid barn
#

dont a lot of games these days when someone chooses "host game", doesnt actually spool up a server on their own system, but actually has a server instance spool up at some data center somewhere and then everyone connects to that?

fiery dome
#

yeah they's how most modern games work however we cant afford the infrastructure ๐Ÿ˜ฆ

#

Call of Duty opened a p2p listen server

#

used NAT punchtrhough

#

same with dark souls and stuff

winged badger
#

@fiery dome i believe listen server NAT punchthrough works with steam sockets

winged badger
#

(continuing after move from #cpp)

livid barn
#

Zlo: I'll throw up a stream of what I'm doing, just incase you spot something

winged badger
#

if you are having a Replicated backup variable

#

nothing will cause as bad a jitter as not using SkipOwner

#

when replicating it

livid barn
winged badger
#

in case of directly RPCing MoveSpeed to server, it should be Unreliable, all your ServerMove functions are anyways

#

you can also Lerp that speed update

livid barn
#

reckon a lerp will help with the deiscrepency? Cause currently I have a Curve that reads the Current Speed of the character, and adjusts the Max Acceleration based on the current speed.

So thus as you get faster your acceleration dies off

winged badger
#

but in the end you set the speed to 400 or 1000 directly, no?

#

no acceleration there

#

just jumps to 400

livid barn
#

yeah, BUT that will be changed in the future. Max speed will be dictated by a constantly updating stamina value. SO I'll hit the same problem im getting witht he accel value chaning

winged badger
#

discrepancy in the position is miniscule

livid barn
#

inorite! i wish I could tell the server to chill a bit and let the client have it ๐Ÿ˜›

#

is there a way to print out timestamps?

#

i saw someone else did it in a video, but had no idea how they did it

winged badger
#

not sure

fiery dome
#

@winged badger how would I get that working?

winged badger
#

i just gimmicked it with AdvancedSessions

#

since i did not need more then a prototype that connects properly so far

#

as far as i know, open ip:port directly will not work with NAT punchthrough

#

the client knows the servers ip:port, but the server's router has no idea that it should be listening to connections from client's IP address

fiery dome
#

Odd

#

people cant even find the session on my end

winged badger
#

that is where port forwarding comes into play, just forwarding everything

fiery dome
#

only when I host can they find the session

hardy dome
#

Hey fellow devs

#

How can I activate clients button in the widget by pushing a button on server?

#

I do this

#

Basically I created a bool var in the game instance, set it on server player controller and check on tick on client player controller . But nothing happens on the client side

livid barn
#

I'm guessing something like

Server sets PlayerState's ButtonActive=True
Widget reads off PlayerState if ButtonActive == True.
Then Widget unlocks the button

#

or server to player controller

#

then again if its a global thing, possible the widget canm just read off the GameState?

#

assuming the variable is replicated?

#

maybe need a dedicated Event to be triggered on Multicast to set the variable possibly?

hardy dome
#

I just narrowed the problem to the variable (yes, it's replicated): this bool var doesn't change for the client after the server change it.

winged badger
#

GameInstance isn't shared

#

over network

#

you'd have to move it to GameState

#

the boolean

hardy dome
#

will it work across the maps than?

winged badger
#

no

hardy dome
#

The idea is to activate the button while the server is on the different level

#

That's why I used game instance

winged badger
#

they can't be connected to the server

#

if server doesn't have the client's level open with ?listen

hardy dome
#

Yep, levels have to be different

winged badger
#

to communicate across levels

#

you should use a system outside unreal's network replication system, like for example steam lobby

#

its not technically part of the game, so it doesn't have to conform to same restrictions

hardy dome
#

that's sad, because I don't want to use any subsystem

winged badger
#

(use Session data to communicate)

hardy dome
#

Got that, thanks

#

Than I'll have to move my widget to that map and set the var in the gamestate and cat to it eventually

#

I guess ๐Ÿ˜‰

livid barn
#

actuaslly you shouldnt need to

#

have the main Bool live in Game Instance or whatever

#

then have game state read off the state of the bool from gameinstance

#

then the widget from the game state

#

that sound doable?

winged badger
#

they won't be sharing GameState, or any game framework class unless they are on the same level

hardy dome
#

I think @livid barn talked about replication while being on the same level

#

Anyway thanks a lot @winged badger and @livid barn

livid barn
#

oh der, so you have multiple instances of the server running, each one runnign different levels and players?

hardy dome
#

nope, I have one server, that has to transfer data to clients that are on other maps

bitter oriole
#

Nothing built-in in UE for that

#

Client & server always are on the same level in UE4

fiery dome
#

this guy has done some work on this for mmos

#

you can download the project I think, and see how he's done it

hardy dome
#

@fiery dome cool, thanks!

fiery dome
#

Lemme know if that's what you're looking for

hardy dome
#

In future - yes, but now I'll just move my client widgets to the clients map

#

So the widget will exist on the map where both server and client are

icy nacelle
#

@winged badger Did you tag me? Got a notification this morning and it looked like it was from you

#

Asking about ownership?

winged badger
#

misread something in your BP, then deleted it

icy nacelle
#

ah

#

thanks anyway friend

soft relic
#

^Gamemode

#

What does it fail?

#

I'm calling it from pc

loud umbra
livid barn
#

@loud umbra You want to look up "VOIP" Voice Over IP systems.ย  Theres a bunch of different approaches, I don't know them off the top of my head; but a number of other Unreal games use various VOIP systems.ย  You may even be able to use Steam's VOIP system I think?

#

So I've got a weird symptom I'm about to try and chase up, and not sure how (so will fumble through for the next little while unless anyone has suggestions?)

Basically I have a character that runs along and their Max Acceleration setting is reduced the faster their velocity is. This is done by reading off a curve which has Speed/Velocity axises. If X speed, then set Y velocity.
I update the values each time OnCharacterMovementUpdated and that seems to keep things within sync sort of. BUT After a few seconds of running I suddenly get a position reset by the server and I cant figure out why the server things the player's character is slowing down.

#
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: Cur Spd: [996.360779] Max Spd: [1000.0] Max Accl: [10.727844] Is Sprinting? [true]    Now [52.372]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [996.549377] Max Spd: [1000.0] Max Accl: [10.690125] Is Sprinting? [true]    Now [52.374]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [996.683655] Max Spd: [1000.0] Max Accl: [10.663269] Is Sprinting? [true]    Now [52.386]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: -------------------------
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: Cur Spd: [993.387207] Max Spd: [1000.0] Max Accl: [11.322559] Is Sprinting? [true]    Now [52.397]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [996.817566] Max Spd: [1000.0] Max Accl: [10.636486] Is Sprinting? [true]    Now [52.399]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [997.030029] Max Spd: [1000.0] Max Accl: [10.593994] Is Sprinting? [true]    Now [52.419]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: -------------------------
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: Cur Spd: [941.213867] Max Spd: [1000.0] Max Accl: [21.757227] Is Sprinting? [true]    Now [52.433]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [996.55896] Max Spd: [1000.0] Max Accl: [10.688208] Is Sprinting? [true]    Now [52.434]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [997.071594] Max Spd: [1000.0] Max Accl: [10.585682] Is Sprinting? [true]    Now [52.446]```
#
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: Cur Spd: [489.814758] Max Spd: [1000.0] Max Accl: [550.926208] Is Sprinting? [true]    Now [52.460]
LogNetPlayerMovement: Warning: *** Server: Error for ThirdPersonCharacter_C_0 at Time=10.205 is 15.494 LocDiff(X=-15.414 Y=1.575 Z=-0.048) ClientLoc(X=2263.830 Y=3666.000 Z=108.200) ServerLoc(X=2248.416 Y=3667.575 Z=108.152) Base: ThirdPersonExampleMap:PersistentLevel.Landscape_0.LandscapeHeightfieldCollisionComponent_1 Bone: None Accel(X=10.600 Y=-1.100 Z=0
.000) Velocity(X=487.298 Y=-49.591 Z=0.000)
LogNetPlayerMovement: Warning: *** Client: Error for ThirdPersonCharacter_C_0 at Time=10.205 is 15.493 LocDiff(X=15.413 Y=-1.570 Z=0.048) ClientLoc(X=2263.829 Y=3666.005 Z=108.200) ServerLoc(X=2248.416 Y=3667.575 Z=108.152) NewBase: ThirdPersonExampleMap:PersistentLevel.Landscape_0.LandscapeHeightfieldCollisionComponent_1 NewBone: None ClientVel(X=991.862 Y=
-101.791 Z=0.000) ServerVel(X=487.298 Y=-49.591 Z=0.000) SavedMoves 0
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [489.962677] Max Spd: [1000.0] Max Accl: [550.186646] Is Sprinting? [true]    Now [52.463]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [505.53772] Max Spd: [1000.0] Max Accl: [486.155701] Is Sprinting? [true]    Now [52.475]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: -------------------------
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Server: Cur Spd: [505.545715] Max Spd: [1000.0] Max Accl: [486.135712] Is Sprinting? [true]    Now [52.486]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [511.09668] Max Spd: [1000.0] Max Accl: [472.258301] Is Sprinting? [true]    Now [52.487]
LogBlueprintUserMessages: [ThirdPersonCharacter_C_0] Client 1: Cur Spd: [516.534546] Max Spd: [1000.0] Max Accl: [458.663635] Is Sprinting? [true]    Now [52.498]```
meager spade
#

i am using Anim notifies to change montage section, problem is it's not changing the montage on other clients

#

the montage is playing on other clients just not section change

livid barn
#

in regards to the sudden slow down i mentioned above. I threw togther a v4.15 and v4.19 version of my network test project and the same symptom happens in that ๐Ÿ˜ฆ

winged badger
#

you might be losing packets

#

if you have a lot of stuff replicating

#

the ServerMove functions are not reliable

low obsidian
#

Hi guys, I have a quick question. I have a pick up item in my game. When the player overlaps with it, it will call an event and run it on the server (increase players health). The variable is replicated. Can the player call this function over and over again to get infinite health? If so, how could I prevent this?

meager spade
#

use a Do Once or set a bool saying they picked it up

low obsidian
#

On the server side right?