#multiplayer

1 messages ยท Page 360 of 1

small temple
#

right

#

still doesn't work though

#

like the variable just isn't replicating...

twin juniper
#

did you make the variable in C++?

small temple
#

nope

twin juniper
#

mkay, make sure the replication settings for the var is set to default

small temple
#

sure is

#

๐Ÿคท

manic pine
#

whats triggering the timer

small temple
#

oh hey raap

#

the gamemode is

manic pine
#

through an rpc?

small temple
#

i guess?

#

the whole thing runs on the server

manic pine
#

then how does the client know about it?

small temple
#

because the server updates a replicated variable

manic pine
#

hmm i dont quite follow... what exactly is to the left of the timer in your bp?

small temple
#

i'm totally lost on the whole networking thing again since the screenshot i posted earlier wouldn't work

#

and all my attempts before that

manic pine
#

right the previous screen was what i was referring to

small temple
#

just does not compute anymore

#

oh, to the left of that time is beginplay

#

or was, because it's gone now

#

the timer, not beginplay

manic pine
#

right so you started that timer on both server and client

small temple
#

i think i tried running it on client/server only

#

because yeah, it should only run on the client if i'm doing it that way

#

but i think that didn't work at all

manic pine
#

hmm

#

whats the objective

small temple
#

print other player's timers on screen

manic pine
#

right, so at every x second interval you send rpc to server with client's current time

small temple
#

that's what i was doing, yes

#

before i started trying to do it on the server

#

i'm not sure what the best way is anymore either

manic pine
#

if the server already has the client's time, then obviously thats the best way

small temple
#

i mean, since movement is clientside

#

the timers might not be accurate if i do them serverside

#

actually nnnnoooo that shouldn't be the case

#

urgh i'm so confused

manic pine
#

depends on how youre starting the

#

m

small temple
#

yeah it should be like spawn > latency delay > race starts/timer starts > finish race > still latency > race ends/timer ends

#

anyway

#

that doesn't really matter

manic pine
#

thats hardly a big concern though, you have access to latency

small temple
#

the point is, my timer doesn't work no matter how i do it lol

manic pine
#

decide on a way you want to do it and it shouldn't be a problem

small temple
#

well, neither way seems to work right now

#

do you see any reason for the second example not to work?

#

just to be clear, it does work fully on the server

manic pine
#

the starttimer thing not working?

small temple
#

yeah

#

well actually i need to test if that's true

manic pine
#

that seems to be a server rpc which you are calling from the server ye

small temple
#

yeh

manic pine
#

do server rpcs work when called from server? in blueprints i mean, they do in code

#

it says (if owning client)

small temple
#

should work

twin juniper
#

yes they work

manic pine
#

right

#

is your component set to replicate?

twin juniper
#

!

small temple
#

yeah

#

hold on i might have something

#

nope, i don't

manic pine
#

well you'll hvae to show the start timer event thing then

small temple
#

ok

raven viper
#

So you have a timer in PlayerState, correct? That is actually good. PlayerState is AFAIK owned by server, and then replicated to all clients. However, setting a variable inside them, can only be done via Server, to have that value replicated to all clients. Also, you can access other player's PlayerStates as well from GameState->PlayerArray

small temple
#

but are you sure you're ready for this?

#

it's intense

raven viper
#

So in your case, it would be

small temple
manic pine
#

intense in my mind sounds like a bug trap ^______^

raven viper
#

PlayerState -> RunOnServer Event -> Start Timer -> Promote to Variable (Replicated)

manic pine
#

oh, irony

raven viper
#

Then actually you can read from other PlayerStates, to get the updates on UI

#

No need to RPC all around with values

small temple
#

that's what i'm trying to do @raven viper

raven viper
#

So is it simply like:

#

And this is in PlayerState, correct?

small temple
#

that's in a component on playerstate, yes

manic pine
#

eventtick not running on client

#

is that intentional

#

you only update values ye

small temple
#

on recommendation from @twin juniper ๐Ÿ˜›

#

so yes, intentional

manic pine
#

right, so the only problem here really is that timer var is not being replicated

raven viper
#

Okay so wait.

#

Your events are all reliable I suppose?

small temple
#

yep

#

@manic pine CurrentRaceTimer is being replicated and that's the one i'm reading

raven viper
#

You can just make a Server_CustomTick(RunOnServer/Reliable) event, and put the calc there, and call that on the tick, to make sure you are actually running it on server

manic pine
#

you mean it should be replicating but isnt?

#

alternatively, its not updating?

small temple
#

yeah

raven viper
#

What is that parent ref again?

small temple
#

the PlayerState

manic pine
#

your component is allowd to tick?

small temple
#

clever idea btw @raven viper

#

@manic pine yes and it does

manic pine
#

right, what if you fire off a log entry at the end of the tickevent chain

small temple
#

@manic pine good point though, need to make sure to let it tick on dedicated servers

manic pine
#

ye

raven viper
#

Also, as he said. Smash dat shite with PrintStrings, so you will exactly see what runs and where

small temple
#

yeah it works

#

reaches the end

manic pine
#

and the value outputted is correct?

#

i.e. not nonsense

small temple
#

yep

raven viper
#

Also be careful with reliable tick events, those will kill your RELIABLE_BUFFER in no time

manic pine
#

ye also makes no sense to have this be reliable

#

since a lost package in this case is useless

#

time is outdated already

small temple
#

right

#

the tick isn't reliable right now

#

only the start/end

raven viper
#

So, you get printed the timer value, and it's all good?

small temple
#

oh yeah, drawing it to the hud and it's all good, but only on the server

raven viper
#

And how is the drawing done exactly?

small temple
#

the widget gets the variable on a timer

raven viper
#

I mean, where does it happen? UMG Widget?

manic pine
#

so player state's component is replicated, var is being updated by server, and the var itself is set to replicate...

raven viper
#

Okay, good news bad news :

#

Try This:

Multicast_SetTimer (TimerPin) -> Set Timer (TimerPin)

Server_SetTimer -> Multicast_SetTimer(Get Timer -> TimerPin)

#

And call that

#

Basically a manual variable replication to all clients, just see if it actually replicates something or not. We've seen a few cases where values set by the server on a replicated class and a replicated variable, are actually not getting replicated to the clients.

#

Even though they should.

small temple
#

hmmm

raven viper
#

Tho this multicast event will set the same timer on all playerstates, so it won't be good for your goals, just eliminating the possibility of the replication issue

small temple
#

and you want me to update the replicated variable on the timer right?

#

so yeah, i think i get it

#

hold on

raven viper
#

Yes, and you can turn off the replication for that variable

#

Since you are already manually replicating it

#

If you get ANYTHING on clients, it's a rep issue, so make sure you re-check everything. CanTick, Always Relevant (not only for owner), Component Replicates, etc etc.

small temple
#

how do you want me to run the timer event?

raven viper
#

You mean the Server_SetTimer?

#

You can pop that into the tick, and see if your HUD updates

#

inside PlayerState ofc

#

So it will be like:

#

EventTick -> Your_Current_Logic -> Server_SetTimer

small temple
#

oh yeah, forgot i can link it to tick

#

oh no, i'm confused

#

can't link a timer to tick of course

manic pine
#

your time

#

not a timer

small temple
#

yeah but he said "pop that into the tick"

manic pine
#

the value youre now trying to replicate, send it with a multicast

small temple
#

but i can't pop that into the tick ๐Ÿ‘‰๐Ÿ‘‰

manic pine
#

you can pop the multicast at the end of your tick

#

place*

small temple
#

ah that's just confusing me more raap ๐Ÿ˜›

raven viper
#

Like that

small temple
#

right i already forgot about the pins

raven viper
#

If you get anything on clients, your logic is sound, and it's a replication issue.

small temple
#

sorry if i'm a bit slow but i'm really sick of dealing with this stuff

raven viper
#

I mean the timer changing logic is sound, might be a var replication issue, a wrong call of events, and other numerous stuff

#

But again, be noted: This will change ALL PlayerState timers to a single timer value that you started on server, hence will not work for your final purposes ๐Ÿ˜„

#

Also avoid manual replication on tick.

manic pine
#

only on that specific playerstate

raven viper
#

PlayerState AFAIK is owned by server, so run on owner won't work. However you can ID them always and do it like that. But again, this is just to test, nothing more. Don't even plan on keeping it ๐Ÿ˜„

small temple
#

so you want me to just print TimerToReplicate and see if it's correct right?

raven viper
#

Yes

#

If you get changes from 000000 on client, then it's a rep issue

small temple
raven viper
#

Yep, it should work.

small temple
#

yeah, it prints the exact same stuff as my hud

raven viper
#

So server is okay, but on clients it's nada?

small temple
#

yeah i'm not sure what the deal is with prints btw

#

sometimes server prints show up on clients and other times not

#

this is one of those times where it's not showing up on the client

#

i'll see what happens when i get the variable from my hud

#

still 00:00:000

#

hmmm

#

well that makes sense since the variable isn't replicated ๐Ÿคฆ

raven viper
#

Nah,

small temple
#

then again, no

#

because it's multicast

raven viper
#

If you manually replicate it, there's no need for it to be rep as well, since you are setting it on all clients

small temple
#

right

raven viper
#

So how do you start this CreateTimer event exaclty?

#

Like where you set the start timer, and the bool?

#

Where does it get called?

#

And how, more specifically

small temple
#

gamemode calls BeginTimer which sets the IsTimerTicking bool

raven viper
#

Can you pop me a shot?

small temple
#

i pasted it above i think

manic pine
#

could you try setting your time var to replicate with notify

raven viper
#

Is that controller casted?

manic pine
#

then do a print on notify

small temple
#

@raven viper what controller?

#

@manic pine trying that but actually running into a weird issue, hold on

raven viper
#

The one you are getting the PlayerState from?

small temple
#

@raven viper no it just gets the owner (PlayerState) and casts to it

raven viper
#

Can you show me how and where are you exactly calling that BP?

small temple
#

@manic pine i've never seen this before but if i do a 0 duration print, it doesn't show up on the client

#

otherwise it does

raven viper
#

No no, I mean

small temple
#

oh no, you want to know where i'm calling the timer bp?

raven viper
#

In GameMode

#

Where you start it

#

You sent the pic of a custom event. How is that event getting called and where?

small temple
#

that one?

raven viper
#

The ClientBeginRace

#

Where do you call that?

#

Also that GetPlayerState node doesn't look good, you should be getting one that looks like a variable (replicated)

#

Like so.

small temple
#

@manic pine i guess that's because it's not replicating every frame eh

#

@raven viper the gamemode calls ClientBeginRace

#

and the GetPlayerState node gets a casted playerstate, i know i need to clean up :<

raven viper
#

If you get from the controller, no need to cast.

#

Plus that's specific to player, so this might be the root of your issues

small temple
#

it's a custom PlayerState so i have to cast if i want to access its custom events, don't i?

#

but yes, it's meant to be player-specific

#

btw that does work @manic pine

#

the client prints the correct times

manic pine
#

right, so whats happening then is that the client is overriding it

#

at a later point

raven viper
#

I might have a feeling that the Tick in GameState runs on client

#

And since the variables you originate from are not replicated, your client overrides with 0-0-0 and you get nada at the end

#

Server Tick -> Set correct var
Client Tick -> Override with NULL

manic pine
#

yeah except he had an authority check on that one

#

do you have any other events that uses that var in some way?

raven viper
#

It will be true

manic pine
#

it'll only be true on listenserver

raven viper
#

Since he is not using SwitchHasAuthority, but HasAuthBool on the Parent Ref, which is the PlayerState there

small temple
#

nope, can't think of anything that would override it

#

this var gets set in the timer component and nowhere else

manic pine
#

hes dealing with dedi yes

small temple
#

and i'm testing on a listenserver btw

manic pine
#

ahaha

#

ye kay

small temple
#

brb real quick too, gotta get a snack

raven viper
#

Then basically your Tick is overriding

#

Make sure that's only ran on server (calling a custom event, etc) and you will be good to go

manic pine
#

wait even there its not actually a problem, since in that case

raven viper
#

Since RepNotif printed good values, and you are only changing there, it's kinda obvious

manic pine
#

timer would be started on both too

raven viper
#

Nah, he got a custom event for timer start from GameMode -> Only Exists on Server -> Only Server Timer starts

#

Just auth that tick properly and all good

#

And that is a good final note for me to get to bed, 3 AM, gotta get up early. Hope you get it fixed! Gnite!

manic pine
#

yeah but listenserver is server

small temple
#

i'm gonna replicate these cookies into my stomach

manic pine
#

that seems wise

#

so your repnotify worked great

small temple
#

night @raven viper thanks for the help

manic pine
#

what exactly is your testing scenario

#

listenserver + 1 client?

small temple
#

yeah

#

so i'm trying IsServer before setting the variable

#

but that doesn't help

manic pine
#

no it wouldnt

small temple
#

so clawsome was saying i should run a custom event on server every tick?

#

i guess i'll try that

#

yeah it doesn't work

manic pine
#

if your repnotify for your var is printing the right value on the client

#

then its obviously being updated correctly

small temple
#

i know

#

that only makes it weirder

manic pine
#

you need to find all places where your var is being used

#

one of them has to be writing over it

small temple
#

it's only being set in 1 place

#

in the timer component

manic pine
#

so the client never touches it ?

small temple
#

oh i bet i know what it is

#

actually no, i don't

#

i thought maybe i was caching the playerstate too soon on the widget

#

but i already put in a delay for that

manic pine
#

in your event tick

#

could you put in a print there

#

print the value

small temple
#

in the timer component?

manic pine
#

in that bp above

small temple
#

after the call to ServerTick?

manic pine
#

right

small temple
#

well regardless of where i put it, it does that thing again where it doesn't print on the client if i set the duration too low

#

but yes, before the call it obviously prints on client too

manic pine
#

huh what duration

small temple
#

print duration

manic pine
#

run in dedi mode

#

so you only have to dela with client

small temple
#

well it's just 2 clients so

#

same thing except i don't see what happens on the server

manic pine
#

right, but whats the pure client printing out

small temple
#

server messages

#

or also client messages if i call the print before calling the ServerTick, like i said

manic pine
#

youre printing the TimerCurrentTimespan var yes

small temple
#

yeah

#

(and yeah i got rid of the other var i was replicating before)

manic pine
#

right, but is the value correct on the client?

#

i.e. to you get current lap time

small temple
#

oh right, the value

#

yeah it prints the correct value

manic pine
#

i dont mean down to the millisecond, just 'after 10 seconds it prints ~10'

small temple
#

with a duration of 0, only on client 1 btw ๐Ÿค”

manic pine
#

duration?

small temple
#

print duration

manic pine
#

set print duration to 2 seconds, set value to the var

small temple
#

yeh, it's fine

#

value is correct

manic pine
#

set in string to var**

#

right, so client has correct value

small temple
#

yeah...

manic pine
#

ergo everything is fine

#

except your ui

#

^_________^

small temple
#

apparently

#

but my UI works fine on server

#

it's a user widget that gets added to a list dynamically on construct

#

with a delay, because otherwise only the server gets one

manic pine
#

that sounds kinda nasty

#

you should be spawning it(on client) in playercontroller

small temple
#

eh, well

#

what i mean is the server only gets a widget for itself

#

because it creates the widget before the client loads in

#

otherwise it's anything but dirty ๐Ÿ˜„

#

it does happen all clientside

manic pine
#

huh

#

this sounds a bit odd

small temple
#

why?

manic pine
#

where and when is the widgets made

small temple
#

i have a HUD widget which holds HUD elements as individual user widgets, including a PlayerList widget that dynamically creates PlayerListItem widgets inside of itself

#

the HUD widget is created in the HUD object

manic pine
#

right, and playercontroller creates the standard hud object, everything fine so far

#

why exactly do you need the delay

small temple
#

oh because the player list isn't quite dynamic enough yet

#

it only gets the list of players once at the start

#

so the listen server would create the list before the client connects

#

and the client wouldn't be in the list

#

i was going to fix that up once i got the timer replication working

manic pine
#

yeah, that needs some fixing

#

i dont see anything wrong in the widget itself

small temple
#

๐Ÿคท

manic pine
#

add a print in the widget

small temple
#

i did, it prints

manic pine
#

between update and set text

small temple
#

oh except the delay shouldn't be set to 0 of course

#

just did that a couple minutes ago to test

manic pine
#

yeah you prolly want some kind of multicast instead, when a player joins and leaves

#

to tell clients to update their list

small temple
#

yep

#

but well, that won't fix my replication problem ๐Ÿ˜ƒ

manic pine
#

it wont

#

whats the print say?

#

is the widget on the client reading the correct value too?

small temple
#

sec

#

no, it prints the default time on the client

#

as expected

#

the SetText node isn't broken lol

manic pine
#

so your playerstate tick is printing the correct value

#

and your widget printing the wrong value

small temple
#

yeah

#

on the client

manic pine
#

eh whta a mess, i have to go to bed but i have a simple workaround for you

#

instead of running your widget update on a timer, just do

#

OnRepNotify -> call widget to set time

small temple
#

yeah i have to go to bed too

manic pine
#

since we found out rep notify worked

small temple
#

i was thinking of that too

manic pine
#

doesnt explain whats wrong, but at leasst it should provide a working thing so you can move on

small temple
#

would be dirty though but yeah, no choice

#

thanks for the help again eh ๐Ÿ˜ƒ

manic pine
#

np, good night

small temple
#

night

shy nymph
#

Really quick, does someone has any experience with Steam Cloud Storage? If so, can i easily Work with Unreals "SaveGame" and upload / Download that one to the steam cloud storage to maintain player settings like selected skins and such?

twin juniper
#

@shy nymph That's a good question... I would like to figure that out as well

#

Seems like it's possible

zenith yarrow
#

I cant filter search results using FOnlineSessionSearch queries, all available sessions are being returned rather than those that meet the criteria, this is a gist of what I have done,
while creating a session...

SessionSettings = MakeShareable(new FOnlineSessionSettings());
SessionSettings->Set(SEARCH_KEYWORDS, MatchTag, EOnlineDataAdvertisementType::ViaOnlineService);

I feed a fstring that has "1V1" in MatchTag...

And, while finding sessions,

SessionSearch = MakeShareable(new FOnlineSessionSearch);
SessionSearch->QuerySettings.Set(SEARCH_KEYWORDS, MatchTag, EOnlineComparisonOp::Equals);

Here, I pass-in "2V2" in MatchTag

Now, where no session result should show-up, I can see "1V1" session when I search for "2V2", can anybody help me understand what is happening here ? why are the SearchParams not being used ?

twin juniper
#

Hey anyone knows how to replicate destructible meshes in mp? Would like to hear an answer in like 1 or 2 hours please.

#

Please anyone?

#

Ok I then just think I can make a BP with dm and set it to replicate

bitter oriole
#

This isn't a hotline, and your question is too vague. If you tried something and that doesn't work like you want it to, tell us about that

twin juniper
#

K

cursive shard
#

Hi everyone, UE4 offers linear and exponential smoothing for multiplayer games. Can I ask if anyone has some experience about how to choose between these two?

pallid mesa
#

@cursive shard you can see the difference between those three on these videos

cursive shard
#

@pallid mesa Thank you very much. I think the linear one looks the best to me. In my own test case I've also noticed that the linear mode handles rotation smooth much better.

#

Through looking at the engine code, I think basically they are just two different ways to interpolating between two transforms(positions and rotations). (Please correct me if I am wrong. Thanks in advance)

pallid mesa
#

Yes, the way you interpolate positions by net update is basically interpolating between two given positions for the other clients to not see rubberbading due to network hiccups

#

Velocity, rotation, position are usually the most important values to have in mind to interpolate

#

So you are choosing the way you are interpolating

cursive shard
#

Thanks, I am little confused about this piece of code. So why the Linear smooth mode makes a lot less sense under the typical high update rate

pallid mesa
#

Thats probably something you'd come to a conclusion testing

cursive shard
#

Alright, I'll do some more tests about these two modes and see if I can figure out something. Thank you very much. If I can get something useful I'll talk about it here.

ripe raptor
#

Hey guys, does anyone know maybe why Steam isn't working in my Release build?

#

It works if I go Play -> Standalone from the editor

#

but not in my packaged game

#

I do have steam_appid.txt in my root game folder (should it be somewhere else?) with my AppID

#

(The steam_appid was in the wrong folder)

zenith yarrow
#

@ripe raptor did you try to update steam in the engine ?

ripe raptor
#

I figured it out, the appid.txt was in the wrong folder :p

#

It tells you to put it where the game binary is, but it means the GameName/Binaries/Win64 folder, not the game's root folder

zenith yarrow
#

gotcha, thanks for the info, but I did not need the txt file, because i had the appID in DefaultEngine.ini, is it better to keep it in a txt instead ?

ripe raptor
#

You have to have it in the txt for a packaged build

#

the defaultengine.ini only works in dev builds and editor

small temple
#

@manic pine @raven viper apparently Date Time and Timespan variables don't replicate

zenith yarrow
#

@ripe raptor OK, by packaged build you mean the shipping build, right ? because it is working for me in a packaged dev-editor build ?

ripe raptor
#

Yes

#

Shipping

manic pine
#

@small temple didnt we discover that repnotify worked?

small temple
#

@manic pine ah yeah, good point

#

i guess they don't replicate outside of their actor or something

#

either way it's not the widget for instance, because i also tried to replicate to my playercontroller and that didn't work either

#

so i looked it up, and other people are having the same issue

#

it didn't occur to me to look it up yesterday ๐Ÿคฃ

manic pine
#

wat, youre saying you cant even replicate a var on the playercontroller?

small temple
#

i can't replicate the var TO my playercontroller

manic pine
#

you dont replicate with a destination though...

small temple
#

no but i'm getting the var from my PC

#

anyway there are workarounds

#

like breaking the timespan and replicating the ints individually

manic pine
#

timespan?

#

oh my

#

i thought you were using a float

small temple
#

lol?

manic pine
#

only one class can replicate

#

and thats Actor(and sublcasses)

#

for the others you can replicate their references, but not replicate their internal values

zenith yarrow
#

I found out the problem with the session search queries not working, if anyone stumbles on it, LAN Queries are not being filtered by the search settings. But if I use steam and create online sessions(not lan) they are filtered correctly. I have no idea why that is the default behaviour but I am filtering the recived results in OnFindSessionsComplete() like so for now,

if (SessionSearch->SearchResults.Num() > 0)
            {
                for (int32 SearchIdx = 0; SearchIdx < SessionSearch->SearchResults.Num(); SearchIdx++)
                {
                    if (bIsLanSession)
                    {
                        for (auto setting : SessionSearch->SearchResults[SearchIdx].Session.SessionSettings.Settings)
                        {
                            UE_LOG(LogTemp, Warning, TEXT("Key : %s , Value : %s"), *setting.Key.ToString(), *setting.Value.ToString());
                            if (setting.Key == SEARCH_KEYWORDS && setting.Value.Data == MatchTag)
                            {
                                // Yup this is correct LAN result, join it or add it to a array 
                            }
                            else
                            {
                                //Not the session you were looking for
                            }
                        }
                    }
                }
            }
manic pine
#

actors and actor components*

small temple
#

PlayerState is a subclass of Actor

manic pine
#

yes, and playerstate does replicate

small temple
#

yeah, so?

manic pine
#

yeah, but any objects inside it that are not also actors/actorcomponents, wont replicate their internals

small temple
#

well, my race timer is an ActorComponent

manic pine
#

right, and the actual time is?

small temple
#

the Timespan variable?

manic pine
#

ye

small temple
#

it's a struct...

manic pine
#

thats a struct

small temple
#

of ints

manic pine
#

not based on Actor

#

not based on ActorComponent

#

ergo, it cannot replicate its internals

small temple
#

ohhhh i had no idea that was a thing

manic pine
#

yeah, its the entire point of the Actor class, to provide replication

small temple
#

there's no way to see that anywhere

#

plus, how does that even make sense?

manic pine
#

you need a number of functions and whatnot for the replication stuff, functions the non-USTRUCT structs dont have

small temple
#

i didn't even know structs had functions

#

because... they don't?

manic pine
#

structs can have functions

small temple
#

it doesn't make sense to me

#

how is a struct anything more than a collection of variables?

manic pine
#

in c++ there's little difference between struct and class

#

in ue4 they've made them a bit different though

small temple
#

but then how come you can replicate a transform or a location or a rotation but not a timespan?

#

because those are part of AActor?

manic pine
#

i think those are done a bit different

small temple
#

right

manic pine
#

i think it should be possible to get structs to replicate properly hmm

#

maybe its just timespan that doesnt have support for it?

small temple
#

Timespan and DateTime

manic pine
#

neither works?

small temple
#

maybe some other stuff but i don't know

#

i wonder if custom structs replicate?

manic pine
#

i think they should if you provide the necessary uproperties

#

anyway why not just switch it to a float

#

keep the timespan on the server, but use float for replication

#

no need to replicate the entire struct

#

yeah, i see in the code the FTimespan struct is not a USTRUCT at all

past bear
#

should be possible to convert a timespan into a single integer

#

(and back again)

manic pine
#

yeah it only has a 64bit int member from what i can see

past bear
#

64 bit might be a problem for replication, but you might only need 32 bits worth of information

small temple
#

yeah i'll do something like that

#

but i wanted to avoid having to rebuild the timespan from a single number

#

just want to get stuff working quickly

#

can't do that if i have to bring out my shitty math skills

manic pine
#

well, at least this explains it

small temple
#

ye

manic pine
#

shouldnt be hard finding a workaround

small temple
#

no i'm just splitting the timespan into 3 ints now

#

it already works

manic pine
#

so youre now running player time on server ye

small temple
#

yeah...

#

maybe i shouldn't though

#

because i need the timer to update really fast on the client

#

so i'll have to do a separate client-side timer too...

manic pine
#

and now its only updating on replication

small temple
#

yeah

manic pine
#

you did limit it in the widget didnt you

small temple
#

that too but actually it isn't necessary

manic pine
#

you wouldnt technically need a timer on the client then

small temple
#

anyway i guess i shouldn't run the timer on the server only, and then use the original timespan for the local clients but the replicated one for remote ones

manic pine
#

just a starting point

#

in the widget you can do elapsed = nowtime - starttime

small temple
#

oh that's a good point, lol

manic pine
#

simplifies things a great deal ye

small temple
#

or is it? the widget would get the client time

#

but the server would set the start time

#

so they might not match up

manic pine
#

on the server, set starttime to now + client latency / 2

small temple
#

latency varies though

manic pine
#

its an average latency

small temple
#

not good enough for a racing game...

manic pine
#

you might also just wanna keep time on client

#

so server just tells client when to 'start'

small temple
#

that's what i wanted to do yeah

manic pine
#

then every once in a while, you send an rpc to server with client's current time

#

so server can replicate it to other clients

small temple
#

it's not working though...

#

so before, i had the gamemode call StartTime, which ran on the server

#

ehh wait maybe i messed something up

#

oh yeah no of course

pliant cypress
#

Hello good people of the internet! :)
I got a weird latency issue and I was hoping some of you can give me advice how make it to work correctly.
When I move Cards from a Position to another (ex from Board to Discard), there is window where I change the Card's Values. It's when I have already copied the data to the target Position but haven't deleted from the original position, so the Card's data exists in both. That is when I change the Position ID on the Card, everything else remains the same. It works fine for the server, but the client receives the info with some latency, and it messes up the client side with blank cards because the data is not there anymore.
Is there a good solution for this? Any advice is greatly appreciated.

thin stratus
#

@pliant cypress Either use OnRep functions/Variables

#

Or use an RPC

#

Generally, Clients only need to know the ID of the card and any value that might change during the game

#

All other information, like text or images etc, should be in a datatable

#

And the only thing you replicate is a struct that contains the TableRow (ID) and whatever values change during gameplay

#

Idk how your game works, but I assume you have Arrays with cards

#

So Array of Struct it is

pliant cypress
#

yes

#

it is an array of structs

thin stratus
#

Yeah so, when you need something to be done only when the variables are replicated, use a repnotify

#

Or an RPC to send the change

pliant cypress
#

Im not sure I can replicate the frontend though, as it is different for each player. for example the player can drag a card with the mouse, move it around and drop it back to its hand (not making a move) and the other player shouldnt see that

thin stratus
#

I'm only talking about the backend

pliant cypress
#

backend work fine, this problem is frontend only. I have a visual feedback of the backend and the data is there, but the frontend doesnt seem to follow all the time.

#

I can put in a delay to make it work (it does I tried), but it looks a lame solution and Im afraid it could later mess up the frontend completly

thin stratus
#

No delays

#

That is in fact 'lame' :P

#

Especially when a person has a higher ping

#

As said, you need to hook it up to OnRep or RPC

#

Owning Client RPC makes sure it's not happening on others

#

And OnRep variable can be set to ConditionOwnerOnly

pliant cypress
#

hm... I haven't tried OnRep yet

#

maybe I should give it a go

#

thx @thin stratus

pliant cypress
#

OMG

#

I set it to reliable and it worked like magic and rainbows

#

it is like a second Xmas :D

twin juniper
#

how to replicate actor spawn

ripe raptor
#

If I save the game and I'm connected to Steam, will it automatically save to cloud?

#

or do I have to do anything extra?

thin stratus
#

You'll have to actually save to the cloud

#

Check the OnlineSubsystem Interface if it has any Cloud saving functions

#

Otherwise you'll have to manually hook into it via the steamapi header

late sundial
#

i have a problem with multiplayer, client player characters are lagging on a movement terribly, all stuff is set to replicated, is this right way to do the movement replication? i havent tried this over online yet.

#

or should i go with "switch on authority", and what about that float value does that need also replication through the nodes?

pallid mesa
#

if your character inheritates from character class you don't need to replicate movement since character movement component does it for you

late sundial
#

its just basic character with custom controller, movement component is set to replicated, all update frequencys are default

#

with those settings the movement is stuttering

#

and parent class is character yeah from top right

late sundial
#

gonna check tomorrow more of this its time to go ๐Ÿ˜ด

ripe raptor
#

@thin stratus - a bit late but thanks for the answer.

pallid mesa
#

just get rid of those "server" character and plug directly the add movement input into the axis inputs

small temple
#

guys, what's the best way to update UMG widgets in response to server-side events?

#

like say, if i want to update a list of players

#

i need to update it when a player joins

#

my first thought would be to use an event dispatcher, but serverside event dispatchers are only serverside so that doesn't work

#

do i really have to go and add custom client-side events and dispatchers for everything or is there a better way?

hazy haven
#

onrep event for the player list?

small temple
#

heh, good timing, i was just looking

#

that's how i'm doing it right now actually, for something else

#

but i don't like it because it's yet another event dispatcher

#

also the standard playerarray that comes with gamestate isn't replicated so i'd have to make my own and so on

#

none of this is a huge deal but it just seems like there must be a better, cleaner way

#

also by the way, if i do it onrep, that doesn't work on listen servers, so then i need a second dispatcher for those...

hazy haven
#

i get ya. maybe there is a better awesome way, but im not sure what it is!

small temple
#

yeah, i doubt there is ๐Ÿ˜ฆ

#

but damn, what a mess

inner iris
#

Working on getting dedicated servers to show up with steam but it looks like the engine code changes are behind that pull request which seems to be a dead link now

brittle sinew
#

It seems to be 500'ing at the moment, but I've seen the pull before

inner iris
#

@brittle sinew 500'ing as in temporarily unavailable?

brittle sinew
inner iris
#

Yeah I get that every time

#

Tried earlier today too

brittle sinew
#

Huh. That's odd

#

The rest of the site seems to be working fine

inner iris
#

Yeah it does

#

I figured the pull got rejected and the link died or something, but not sure how it works

#

I had thought it'd stay regardless

brittle sinew
#

Rofl, changing the pull ID to 2134 or 2136 works fine

#

ยฏ_(ใƒ„)_/ยฏ

#

Couldn't tell you, sorry

inner iris
#

No worries! Hopefully can find another way- this seems to be the only discussion / wiki around getting dedicated servers to show in steam

brittle sinew
#

I know it was a super long discussion, and all of the PRs seem to be loading pretty slow

#

It might just be that it's taking too long to load and timing out on the server, dunno

#

(well, now that I look back at the message I seem pretty dumb)

#

Haha.

inner iris
#

Iโ€™ll try to contact the original author and see if he has the code elsewhere! Seems like a topic that is very hard to find official docs on

pallid mesa
#

Im interested aswell, ask them if you can contact them if they could please update the wiki

#

Thanks

inner iris
#

Will do!

lost inlet
#

from what i remember of that pull request it made a bunch of online subsystem interface changes and iirc i don't think they were all necessary

#

that PR loading bug on github has been an issue for like 2 weeks now

late sundial
#

@pallid mesa it was like that at beginning, and the character movement lag was there ๐Ÿ˜Ÿ

#

not on server player, but all clients

burnt meteor
#
-------------------------------
Player is spawing correctly in editor, but not in standalone game
#

i am using World Composition Also(if that make any difference)

pallid mesa
#

Enable on character movement component linear interpolation

#

Are you modifying location or something or something?

inner iris
#

Seems the link is invalid but his repository is still intact

#

@lost inlet can you recall what wasn't necessary? Going to attempt to make this work now

manic pine
#

is it possible to have a uobject(not actor) replicate as a member of an actor in the same way a ustruct would?

twin juniper
#

anyone can help?

inner iris
#

@twin juniper Is the weapon class replicated?

twin juniper
#

yes

manic pine
#

what if you try in your Weapon bp to add a beginplay-> authorityremote->print message

twin juniper
#

@manic pine and print it only from authority or both?

manic pine
#

only from remote

#

to see if it spawns on client at all

twin juniper
#

it prints

manic pine
#

ergo replication is definitely happening

#

its just not visible

twin juniper
#

mhmm, im setting a mesh at beginplay depending on what weapon it is

#

ok nvm works now

#

@manic pine now it works fine, had to set weapon data var to replicate, it stores the mesh too

manic pine
#

right, clients beginplay didnt have it and couldnt choose a mesh

twin juniper
#

do i have to do the same for barrelID, sightID, railID? what im setting in expose from spawn?

manic pine
#

that seems likely...basically anything that's not part of the class defaults

#

because thats all the client has access to

twin juniper
#

oh i made all those attachment ID vars replicate in MyCharacter and now all players can see the selected attachments on the gun player is holding

#

๐Ÿ˜„

manic pine
#

very neat

late sundial
#

hey, i asked this same thing yesterday and havent found any fix for it yet. on multiplayer my characters movement is laggy on clients, server host sees everything smoothly

#

i have done replications to character and its components

#

oh looks like those replications are default, but anyways

#

client has laggy character and it sees other players very laggy also (other characters have same settings)

elder sable
#

If i replicate an actor managed by a ChildActorComponent, do i have to replicate the component ?

icy nacelle
#

Trying to replicate a drag and drop when a client drops an item infront of another client (dedicated server game). Item does not show up for both players. Can someone show me what I'm doing wrong? I've added a custom event for running on server.

#

Any help would be much appreciated ๐Ÿ˜ƒ

#

(I believe I can avoid these problems by using the SpawnActor 'Owner', but I am not sure how to go about this)

manic pine
#

youre calling a server rpc on a client-side only object

#

try moving your "ReplicateToServer"(rename it to something more descriptive) to your character class or maybe your controller class

small temple
#

@manic pine

#

i'm trying to do a dynamic player list that updates when players join/leave

#

i've tried multiple methods and i can't get it to work

#

basically because of the damn listen server following different rules than the clients

#

you got any ideas?

manic pine
#

how you attempting to do it?

small temple
#

first i tried to update the list for the clients with an onrep function

#

and for the server too actually

#

but the server gets added to the list differently from the clients

#

so i tried to do it OnPostLogin for the server

#

that doesn't work for whatever reason, couldn't figure out why

#

then i also tried doing it on PlayerState BeginPlay/EndPlay

#

that doesn't work at all, although i think i just realized why

#

it's an annoying issue because it should be really simple, it's not like i don't understand it like with the replication stuff or whatever

#

it's just an enormous fucking mess

#

so i'm mostly wondering what you think would be the best way to do that

manic pine
#

have you looked at GameState?

small temple
#

yeah my player list array and onrep function for it are in my gamestate

manic pine
#

i havent actually used it myself yet, but it seems a bit weird to me... it has a playerarray, yet from what i can see it's not actually replicated?

small temple
#

exactly

manic pine
#

UPROPERTY(Transient, BlueprintReadOnly, Category=GameState)
TArray<APlayerState*> PlayerArray;

small temple
#

it's not replicated but it is the same for clients and server

manic pine
#

and the function AddPlayerState is not a client rpc...

#

so the playerarray is actually up to date?

small temple
#

yeah but it doesn't have an OnRep function so i can't know when it updates

manic pine
#

right.... but how is it replicated?

small temple
#

it isn't

#

it probably just gets set for both client and server

#

separately

manic pine
#

yeah but when a new player joins, it needs to be updated

#

if the array isnt replicated, and not the AddPlayerState function...

small temple
#

๐Ÿคท

manic pine
#

is it some kind of magic

small temple
#

yes that would make the most sense

manic pine
#

because this would be the obvious place to put anything related to ui player arrays too

#

as youve already thought

small temple
#

well it's not a big deal because i can make my own player array

#

even if it's a pain in the ass

#

and doesn't work for some inexplicable reason

manic pine
#

youre making your own replicated array?

small temple
#

yep

manic pine
#

whats the declaration?

#

oh youre bp eh hmm

#

whats the contents of the container

#

the types

small temple
#

player controllers right now

manic pine
#

yeah thats no good

small temple
#

the gamemode calls the gamestate to update the array OnPostLogin btw

manic pine
#

cant give clients access to other clients pc's

small temple
#

ehhhh?

#

it's just a list of all the PC's in the game right now

#

it doesn't give you access or anything

manic pine
#

yeah, other clients should never have pcs not their own

#

they also come with Only relevant to owner, by default, so they wont replicate

small temple
#

buuut i can get their playerstate though, right?

manic pine
#

yep

#

thats the sensible thing

small temple
#

right, that's what i'm doing

#

no i mean i can get the playerstate from someone else's controller

#

but anyway no big deal, i can change the array to hold playerstates

manic pine
#

the array should only ever hold playerstates

small temple
#

it's just a bit messier down the line (literally in visual terms)

manic pine
#

well just an extra getplayerstate when you make the container ye

small temple
#

yeah

manic pine
#

right, assuming thats changed, what exactly was the problem

small temple
#

hold on, i'll fix this first

icy nacelle
#

@thanks raap, I'll give it a go.

#

This works, thanks @manic pine

manic pine
#

yw

small temple
#

@manic pine i think i can get it working

#

for some reason the widget isn't receiving my OnLogout dispatcher from the gamemode though

#

but i can work around that

#

i think...

manic pine
#

youre calling on a widget from gamemode?

small temple
#

no

#

@manic pine you insult me ๐Ÿ˜›

manic pine
#

haha yeah i was starting to wonder for a minute

#

the way i imagined you'd do it was onrepnotify with the player array

small temple
#

lol

#

i do it with an event dispatcher which fires onrep (for clients only) and also whenever the array is updated

manic pine
#

why not exclusively on array update?

small temple
#

OnRep functions don't fire on servers

manic pine
#

on listenservers? hmmmmm

small temple
#

yeah i know

manic pine
#

thats a bugger

small temple
#

at least i can use a single dispatcher here

#

hmmm i said "here" because i thought i couldn't do it with a single one somewhere else but i think i can and now i feel stupid

manic pine
#

onpostlogin add player to array then call listenserverupdateui and onnotify updateui ye

#

and listenserverupdateui and clients updateui can be the same

small temple
#

ye

#

should i have specific dispatchers for updating UI like that?

manic pine
#

hmm maybe, how are you doing it on listenserver right now?

small temple
#

i mean i just call a universal dispatcher that describes what happens

#

like when my player list gets updated i call OnPlayerListUpdated

#

and then anything else in the game can bind to that

#

i don't have a separate, specific dispatcher for UI

#

anyway this doesn't matter, i have a problem

#

wait it's probably a UI problem

manic pine
#

the player list update could, theoretically, be used for more than just ui

#

so its not necessarily ui specific ye

small temple
#

right

manic pine
#

its prolly fine, which class has it though?

small temple
#

gamestate

manic pine
#

ye sounds good

small temple
#

yeeeeeee

trail bloom
#

Guys are the Simulated Proxies being extrapolated (dead reckoning) or does the CharacterMovementComponent interpolates between the last 2 known positions?

small temple
#

my god, it finally works

frank quartz
burnt meteor
#

@Apst#8432 and @raap#5040 i see u two always chatting lol

grand kestrel
#

Can I get some advice/info on multiplayer inventories? Here are my questions or concerns

  • How do you handle the shuffling of inventory via requests made from UI? Do you get client to test that it's possible, then send to server?
  • How do you handle validation and corrections?
  • When/where do you setup the UI following an event, such as splitting a stack, picking up an item, etc?
  • Naturally I'll want to be replicating the inventory and not using multicast, so is there a convenient way I can simply detect changes? Is it logical to replicate both the inventory and a 'pending modifications' array?
#

I think I have basically the right idea in my head and some on paper, but want to check how other people are handling these things

fossil spoke
#

If it was me, id create an inventory as an component. The inventory itself would just be an array of objects. The UI would be an completely seperate layer, all it does is visualise the information inside the array and delegate any drag drop or swap requests to the inventory component. Multicasting an inventory is unnecessary if all important actions are performed server side.

#

@grand kestrel

#

You should only really need to tell the server when an item action occurs

#

Pickup, Drop, Swap whatever

grand kestrel
#

The reason I'm considering doing it on both is that it would allow for instant feedback, wouldn't have to wait for server

fossil spoke
#

Yes thats fine, but whatever the server returns should always be corrected on the client.

normal raven
#

Anyone got a good way of replicating a rendertarget with blueprints? I only need to replicate it once per client, when they first join. After that I'm replicating inputs, but I feel like making a huge array of inputs and looping through it when you first join isn't the best solution...

burnt meteor
#

@here i have bought a static ip from my isp and i have a dedicated server now what should i do?

fossil spoke
#

The Mods are not here to answer questions at your whim. Please only ping us if there is an issue.

burnt meteor
#

sry

fossil spoke
#

Someone else maybe able to help you.

burnt meteor
#

alright.

fossil spoke
#

An little more information on what your trying to achieve would also be helpful.

burnt meteor
#

like??

fossil spoke
#

Your statement above on its own may have context to people you were discussing it with before.

burnt meteor
#

i have never see anybody discuss this before

fossil spoke
#

But to anyone else reading it makes no sense

#

Why did you buy the server?

burnt meteor
#

@here i have bought a static ip from my isp and i have a dedicated server (which is built from ue4 source v4.17)
I want my friends to join
now what should i do?

#

buy server?

#

i bought a static ip

#

not server

fossil spoke
#

Ok well that gives some more context now doesnt it? You want to play games with your friends on your own game

#

Have you built the Server executable for your game yet?

burnt meteor
#

yes

#

its working as u see:

#

but i have not port forwarded

#

i want a experienced person to help

fossil spoke
#

Experience doesnt come for free. If you run your server executable your friends should be able to join if you give them your IP address

burnt meteor
#

but i dint port forward

#

and i used my local ip for testing..

fossil spoke
#

Then port forward

burnt meteor
#

ok

#

@fossil spoke but i have a problem, i got a static ip from my isp so what ip should i use to join in ue4?

grand kestrel
#

@fossil spoke Before I forget (I'm swamped!) thanks for the info ๐Ÿ˜ƒ

fossil spoke
#

@burnt meteor The static IP

#

google: myip

burnt meteor
#

ok

fossil spoke
#

It will tell you your public IP address

#

Which should be your Static IP which is what you use to connect

burnt meteor
#

so when i buy a static ip from my isp all the pc's in my net become static and the same?

#

thanks ๐Ÿ‘

fossil spoke
#

No your Router has an Static IP

burnt meteor
#

hm..

fossil spoke
#

Your connected computers have local addresses which the Router manages

burnt meteor
#

could u explain?

#

mhm...

#

so when we type whats my ip the router's ip is displayed or my ip?

fossil spoke
#

Yes and then what happens is that the Server is listening on the Port 7777 (by default) to any incoming traffic which the Router will send to if its not blocked by an firewall or the Router hasnt got that port forwarded

burnt meteor
#

so its the router's right?

fossil spoke
#

Whats the routers?

burnt meteor
#

ip

#

what i had asked ๐Ÿ‘†๐Ÿ‘†

fossil spoke
#

Yes, your Static IP is assigned to your Router by the ISP

burnt meteor
#

thanks ๐Ÿ‘ for ur time

fossil spoke
#

No worries

#

@grand kestrel Also no worries ๐Ÿ˜ƒ

twin juniper
#

how should i spawn a spectator pawn and possessing a player into it on death?

#

i have tried with OnRep_Health, but it didnt work

bitter oriole
#

So, anyone has experience with multiplayer on non-characters ?

bitter oriole
#

Working on vehicle pawns right now - it works, but just using bReplicatesMovement is obviously not enough, prediction / rollback is required too

#

Curious to know if anyone else has implemented that

inner iris
#

@bitter oriole the Ben Tristem Udemy multiplayer course covers creating and replicating a vehicle in the final section. Might be useful!

#

Also speaking of that course- itโ€™s still in production and has a really solid steam listen server multiplayer integration section- could be a good opportunity to see if theyโ€™d be willing to add a section for dedicated servers with steam too as they have all the framework in place already. Definitely an area that is essential for many games but has little to no documentation on how to set up. Otherwise it looks like the course will just finish up after this vehicle section

bitter oriole
#

Okay

twin juniper
#

Do I have to make possessing pawns execute on server?

twin juniper
#

anyone?

fossil spoke
#

Yes you should possess pawns on the server side

twin juniper
#

So run in server with a variable in it (player controller for what player to possess)

#

writing anyone is helping, so... Anyone?

bitter oriole
#

@inner iris So that course is actually pretty great.

#

Thanks for the hint

thin stratus
#

@twin juniper that depends when and where you call it

#

For initial possess, you would use OnPostLogin in the GameMode

#

That is server side and gives you the controller of the player that joined

#

For respawning people usually perform a serverrpc inside of the playercontroller and then call a Respawn function in the game mode while passing the controller with it

#

If setup smoothly, initial spawn and Respawn can use the same function in the game mode

twin juniper
#

I use on death spawn spectator pawn and possess into it and destroy a character of dead player, but it doesn't delete it

#

Ok will try when I'm home

blissful thorn
#

Anyone familiar with DTLS via OpenSSL? I have built a working client-server implementation into my game but I have a question if the method im using for session tracking is best practice.

twin juniper
#

@thin stratus will this work? In onrep_health if health is 0 or less get game mode and calling a custom event with player controller reference and from there do everything?

thin stratus
#

Onrep calls on everyone

#

You want to just to it whereveer you set the health

twin juniper
#

From there I can do run on server

#

Oh ok

thin stratus
#

As that should already be on the server

#

Well vars only replicate if set by server

#

So to make an onrep happen you need to ve on the server

#

So you can directly handle the <= check there etc

twin juniper
#

But custom event with run on server from onrep_health will run on server. Or not

thin stratus
#

Yes but that's doing it twice

#

Onrep only calls if you set zhe health on the server

twin juniper
#

Oh the on any damage is on server

thin stratus
#

It needs to be :D

#

That's what the server icon is for

#

Anyway, need to go. At UNI atm

twin juniper
#

Yes ๐Ÿ˜„

#

K

inner iris
#

@bitter oriole no problem! ๐Ÿ˜ƒ

burnt meteor
#

@twin juniper i have a solution if u want

bitter oriole
#

@inner iris Funny seing you on the coding side of things, btw, thought you were much more of an art person

inner iris
#

@bitter oriole Doing my best to get to a decent level on the coding side too, have always wanted to make a game! Art is no fun if you canโ€™t do interesting things with it ๐Ÿ˜ƒ

bitter oriole
#

Gonna make a game out of these landscapes ? ๐Ÿ˜ƒ

inner iris
#

A lot more than landscapes if all goes well ๐Ÿ˜ƒ

twin juniper
#

how do i get a player that got damaged from on any damage?

inner iris
#

@twin juniper when on any damaged is called, the actor that is calling it is the one that has been damaged.

twin juniper
#

and how to get the pawn hit?

#

with getplayer controller - get controlled pawn in it?

inner iris
#

I assume you are calling the damage event on the pawn, no?

twin juniper
#

on character

inner iris
#

Character is a pawn

twin juniper
inner iris
#

Yeah that should be fine- what isn't working for you?

twin juniper
#

my spectator pawn is spawning at 0,0,0

inner iris
#

That's an issue with your spawn logic, not the damage logic

twin juniper
#

thats the function with "run on server"

inner iris
#

Is this being called on the character?

twin juniper
#

yes

#

in above on any damage its shown

inner iris
#

I'm not sure why you are getting the controlled pawn when you already have it as self

twin juniper
#

well, the event is run on server

#

wouldnt it return server char?

inner iris
#

Typically possessing and unpossessing logic happens somewhere other than the pawn such as in the GameMode as you are dealing with destroying and possessing pawns

#

Also I'm not sure if you are using the standard spectator pawn or a custom one- I'd test first by spawning to a specific location and seeing if it works, then you can rule out a spawn collision issue.

twin juniper
#

oh ok

#

thanks, will try in few minutes when i finally make the viewmodel work

inner iris
twin juniper
#

@inner iris now it works if client kills server, but if server does that the server dies

#

maybe something in giving damage is wrong

#

wait no nothing wrong with damage giving

#

I checked with destroyactor instead of respawn and it works ok

#

ok i got it all working

#

But the client cant controll spectator pawn

tame adder
#

would someone please be able to help me on an issue im having with my server hostings for some reason when i leave the game(Destroy session) it doesnt actually like i leave the game but i then cant find any other servers or cant even re-join the same game again unless i use the console and connnect through the lan ip address (open 127.0.0.2) please help ill show my screen

hasty adder
#

@raw novaeey#1200 sounds like you should investigate your error handling in uhh

#

I forget the name ofnit it has all your host and join logic

#

Make sure on error you are not destroying the session for the server

#

I think there's a tutorial a lot of ppl follow and a bool whew they plug both server and client into destroying session resulting in server closing its session if a client leaves

tame adder
#

but i think we want to destroy the one of the clients and thats our issue right now like the client can leave but then cant rejoin or search for the same server

#

hmm i need to find that ahaha

#

would you happen to know the link

hasty adder
#

Not off hand, mobile at the moment.

#

When client goes to a main menu you can always run a destroy session as a fail safe

tame adder
#

yea we try that but it seems it doesnt work correctly

hasty adder
#

This all pie or multiple computers ?

#

Steam involved?

tame adder
#

we are using online subsystem steam

#

and i test on the same pc but with 2 projects opened

hasty adder
#

Hmm. That shouldn't work if steam is actually on.

#

Should be two different computer different steam accounts etc

tame adder
#

okay i can do that

hasty adder
#

And I've seen you may need two different networks routing like that is sketchy. Like trying to dial your own telephone #

tame adder
#

can they be on the same network

#

ahhh

#

okay

hasty adder
#

Tech steam should be doing its tunneling so with two computers it might work on same network i have messed with that in a year :0

tame adder
#

so the issue might be becasue steam isnt on

hasty adder
#

With steam off you'd be connecting through port 7777

twin juniper
#

It doesnt effect anything... but i worry it may in the future be a problem

edgy condor
#

what c++ socket library should I use for a linux server?

bitter oriole
#

So I've got the strangest of issues. I have two pawns in a network session. On the listen server, it looks like the local player has RemoteRole == ROLE_AutonomousProxy, instead of ROLE_SimulatedProxy

#

It's made even stranger (ahah) by the fact that on the client, that pawn correctly has Role = ROLE_SimulatedProxy, RemoteRole = ROLE_Authority

#

What gives ?

twin juniper
#

anyone here using point and click with acceleration? like for rts/moba games

#

the problem i see that sometimes(only sometimes) move to location (called from server side) has an ugly glitch, where the movement does not start smoothly

#

like the first couple of frames of the movement are cut out

bitter oriole
#

Hey @chrome bay , you're all over Google with multiplayer physics. Trying to do a cooperative physics thing, like a MP ball game - got any hints ?

#

@fierce birch looks involved in this too ๐Ÿ˜ƒ

chrome bay
#

it should be relatively easy to write a custom ball physics component! Avoid PhysX like the plague is my only advice

#

I've tried... god knows how many times, to get PhysX replication with replay/prediction working nicely but it's just a minefield.

bitter oriole
#

So you can't have real physics in MP ?

#

I mean if the "ball" is a crate and falls on a surface, I still want it to slide along the surface, bump, etc

chrome bay
#

Unfortunately not so much - since PhysX is so crazy un-derterministic, the simulations differ too much on each player to have a smooth simulation

#

So you end up with constant corrections from the server

#

and replay is... difficult

#

I believe this is why Rocket League uses Bullet, they wanted more control over the simulation etc.

bitter oriole
#

Okay

#

So from your point of view, the best options are either to have authoritative clients, or custom physics ?

#

If I don't care about cheating etc

chrome bay
#

Yeh almost definitely. Just to clarify, are the players the balls or are the balls not player-controlled?

bitter oriole
#

Player-controlled, and they're not really balls, let's say vehicles

chrome bay
#

Yeah gotcha

#

For the early phase I would go for client-authoritive, but if you decide against that later then custom physics is the best way

bitter oriole
#

Okay

#

Did you do any of these yourself ?

chrome bay
#

The pawns in the top-down game are just hovering spheres, so they were relatively easy.

bitter oriole
#

Yeah, unfortunately collisions are something i'd like to work well, so I guess i'm going to go with authoritative

chrome bay
#

Yeah I think so. Luckily for us Epic gave us source so Character Movement is there in all it's glory to strip the essential parts out of

#

I've done a few fancier things for my collision with those pawns but other than that, the main bulk of it is epic's handywork

#

in a way

bitter oriole
#

Would an authoritative client work by just sending location & speed to the other ? Or am I still going to need prediction ?

chrome bay
#

no prediction needed for the authoritative client

#

Although you probably still want to implement some smoothing of some kind

#

for players looking at other clients I mean

bitter oriole
#

Yeah, I mean, if I have two clients and a listen server, the client A is still going to need to simulate client B I guess

chrome bay
#

Yeah what I tend to do is send input as well, so remote players keep simulating with the same input until they hear otherwise.. that can help a lot sometimes, especially when data rate is quite low

#

A lil extrapolation if you will

#

In Character Movement the server doesn't actually simulate the client at all until they get a new packet, and they work out the delta time for the simulation from the last time they recieved a packet. It's a bit odd IMO, I don't like it much but I guess there's a reason they went with that method.

bitter oriole
#

Okay !

#

Well, that's helpful information

#

Thanks a lot

chrome bay
#

No worries!

#

Still waiting for Epic to make the character movement class more abstract so we can use it for more things... but that's probably not going to be a priority for them

#

Maybe when UT gets vehicles.. who knows

#

Though UT's been dead since july so no idea what's going on there

bitter oriole
#

UT has always been a side project for Epic, I mean that was pretty official

chrome bay
#

Yeah it looks like they're all on Fortnite for the time being, since BR is doing so well

bitter oriole
#

Do I need the movement component class, by the way ? I mean does it do anything in particular that I need ?

chrome bay
#

It can be quite handy, some stuff in code specifically looks for 'Movement Components' and calls some of the functions from all over

#

Radial Force Component for example looks for 'AddLinearForce' etc.

#

specifically on a 'UMovementComponent'

#

Inheriting from UPawnMovementComponent can be useful since some AI classes interface with it too

bitter oriole
#

Does that come with interfaces I need to implement ?

#

I mean the base PawnMovementComponent is pretty light

#

But in inherits the NavMovementComponent which isn't

chrome bay
#

Lemme check a sec, just opening up VS

#

Yeah sorry UNavMovementComponent is the one AI looks for

#

I think PawnMovement just has a couple of minor useful things, I can't remember if it's strictly 'required' for pawns

#

Although you could Shift + Alt + F it and see if any major classes come up :p

bitter oriole
#

Yeah I still have a hard time seeing how to interface with the movement component class. The entire API seems geared toward moving with speed

#

I don't see how I can implement physics with it

#

I mean if I have inputs that do "accelerate left", how do I tie that into "RequestDirectMove" ?

#

There is also a "RequestPathMove" but which is used ?

#

Well, gonna read some docs ๐Ÿ˜ƒ

twin juniper
#

are there any circumstances where character event "begin play" is not being called after player connects to server

#

by this i mean client side character event "begin play"

#

i saw this on rare occasions, for example when a player runs my client for the first time

#

perhaps someone could give a better insight what could be happening

#

because i cannot reproduce the problem

chrome bay
#

Sorry my bad - those 'RequestMove' functions are actually really badly named.. they just input the full velocity required to get to the next path / target point - which you can usually just normalize and use for input which I think is what CMC does

#

@twin juniper I believe clients call BeginPlay at a different time to server - maybe they don't if the game hasn't been started yet