#multiplayer

1 messages ยท Page 331 of 1

fossil spoke
#

Dont quote me on the name haha

#

Yeah its just an really lightweight version of FVector

#

You get an slight overhead for the Serialisation/Deserialisation though

#

But not super significant

glad sedge
#

Understanding this was the exact same issue I had with JS callbacks. I just couldn't wrap my head around them until one day something clicked and it was the easiest concept in the world.

fossil spoke
#

Yep once it clicks it makes so much more sense

#

Unfortunately its only the surface for networking though haha

glad sedge
#

ugh

#

I'm wondering if I should just scratch everything and restart

#

I came into this like I was coding a single experience, not multi

fossil spoke
#

Yeah Multiplayer is not something that can be easily 'tacked' on as an afterthought

glad sedge
#

If I'm thinking of this correctly, it'll completely alter how I structure the code

fossil spoke
#

Which is very lost on most gamers when they all complain about not having it on an particular game ahha

glad sedge
#

I think that's what is making it difficult - I'm trying to fit the concepts into what I already know.

fossil spoke
#

"Ohh they could do XYZ and have Multiplayer ready" hhaha

#

Yes it alters everything

glad sedge
#

I read that thing on net and physics

fossil spoke
#

Alters how you plan all your code

glad sedge
#

Before I was like "Eh Rocketleague - I could do that, it's so simple'

#

now I'm like 'how the fuck did they do that?'

fossil spoke
#

As an Singleplayer experience, sure it wouldnt be to difficult

#

Multiplayer just adds an entirely new dimension

glad sedge
#

How do you structure multi

fossil spoke
#

Thats an pretty broad question lol

#

In relation to what exactly?

glad sedge
#

heh yeah

#

well I suppose at my level

#

I'm looking at it on a function level

fossil spoke
#

I build MP code as if im an Dedicated Server

glad sedge
#

go on

fossil spoke
#

This forces you to think outside the box when it comes to cosmetic or more importantly actual player interactions

#

If your writing as if your the dedi server start to think, how am i going to know if the player just picked up an weapon

#

How will i know if im to do an Airstrike in an position when an player just pressed on their map

#

Those sorts of questions force you to think about the relationship that the Client has to the Server

#

Especially an dedicated server

#

Since dedicated servers dont know about the Clients HUDs for example

#

It forces you to think, "hey if my client presses on their MiniMap somewhere, how am i to know where they pressed, oh i know i need the client to send that info to me"

glad sedge
#

that's a really good point actually

fossil spoke
#

Really all clients should be doing is performing cosmetic actions based on events from the Server

#

Play Reload animation, start particle effect here, play sound over there etc etc, all those things could be caused by the server being told that another player somewhere has fired an weapon or something like that

glad sedge
#

ok

fossil spoke
#

The Server does all the hard work like performing the line traces to make sure that yes that is indeed an player you just shot, we should apply damage to them now as well, lets tell all players to start an blood splatter particle effect

glad sedge
#

you've convinced me to restart lol

fossil spoke
#

SinglePlayer vs Multiplayer should literally be the SECOND question you ask after the first which is what game do you want to make haha

glad sedge
#

Just as a side note, if I'm calling a function on the server like GetHitResultUnderCursor

#

Only the server will see that, correct? As in, the server is getting the HitResultUnderCursor trace ?

fossil spoke
#

The Server (if its dedicated) might not even be able to call that properly

#

Anything that is UI or HUD related when called in the context of the Server will most likely not return what you expected

#

Simply because the Server may not own an HUD or the UI element

glad sedge
#

that's tricky.

fossil spoke
#

Exactly

glad sedge
#

If I'm moving my object and it's based off the client's cursorlocation, then I need to think about it a different way I guess.

fossil spoke
#

Yep

glad sedge
#

I suppose I could update a transform variable.

#

and when the client updates their position, it also updates the variable.

#

(on the server)

fossil spoke
#

Well like we discussed earlier, you need to tell the Server somehow what the new position of the Box is based on the Clients perspective so that the Server can move the Box there

glad sedge
#

okay so psuedo code-wise

fossil spoke
#

Assume your Client has the box picked up, Client sends an RPC to the Server version of the Box with the HitResult from the GetHitResultUnderCursor and basically the Box updates its own position

#

You would probably limit to only sending the RPC when the Client has moved the Box enough that it snaps to an new grid square

glad sedge
#

Client: OnTick()
GetHitCursor
Update Replicated Var HeldActorLocation
Rep_Notify UpdateHeldActorLocation()

UpdateHeldActorLocation()
HeldActor.location = HeldActorLocation

fossil spoke
#

Client can only communicate with the Server via RPC, the Client cant RepNotify variables

#

So UpdateReplicatedVar would need to be an RPC to the Server from the Client

#

Id pass along the HitResult as well

glad sedge
#

That's probably easier

fossil spoke
#

That way the Server has all the information it needs to do all the work itself and then all Clients just pickup the changes via normal var reps

glad sedge
#

and that way I can check validity on the server a bit more, I guess

fossil spoke
#

Id also abstract the majority of the movement code to the box actor itself via an Interface call

#

ICursorMovable or something

#

MoveActor(HitResult)

glad sedge
#

Are interfaces the only way to pass through ownership ?

fossil spoke
#

Interfaces dont pass ownership

glad sedge
#

I mean being able to access the ownership of non-owner

fossil spoke
#

Its just an better way to segregate your code to the object that is being manipulated

glad sedge
#

oh so there's nothing particularly unique about interfaces in a networking context?

fossil spoke
#

No

#

Id just do it as an general best practices thing

#

The Character or Controller does the GetHitResultUnderCursor and then RPCs to the Servers version of the Box Actor so that the Box Actor is managing itself

#

If that makes sense

glad sedge
#

that does

#

However, once the server updates the movement of the box, the clients will also be updated due to Movement Replicates, right?

fossil spoke
#

Yes

glad sedge
#

ahhh

#

So.. the server is really like 90% ?

fossil spoke
#

Yeah Server is really the main workhorse

glad sedge
#

And the clients are just passing through inputs?

fossil spoke
#

Yep

#

Clients pass input and try to simulate as best they can what is happening on the Server

glad sedge
#

And all the sugar stuff can just be ignored by the server since it doesn't matter - like particle effects

fossil spoke
#

Yes as long as its an Dedi Server

#

If its an LocalHost then you need to make sure to also call any Cosmetic stuff for it as well

#

lol

glad sedge
#

nah, dedicated servers for life

fossil spoke
#

I reckon

#

So to recap, Clients perform inputs and send those to the Server, the Server performs any manipulations and Clients recieve any changes through Var Replication or RPCs

wary willow
#

I'm surprised the question "But in what ways can I pass info from Server to Client" hasn't come up yet.

fossil spoke
#

Replication or RPCs ๐Ÿ˜ƒ

wary willow
#

but how

fossil spoke
#

Magic

wary willow
#

๐Ÿ˜ƒ

#

More surprising is, I rarely see anyone talking about GS or PS

fossil spoke
#

Just another tool with the added benefit of being automatically replicated to all clients

#

Every client has every other clients PS

wary willow
#

So much easier to funnel

#

FUNNNNNNNNNNNNNNNNELLLLLLLLLL

fossil spoke
#

The hard part for most is understanding the fundamental classes and how they interact in an networked environment

#

HUD, GM, GS, PS, PC all behave differently

glad sedge
#

PS?

#

Sorry, had to step away for a bit

#

But in what ways can I pass info from Server to Client ?

glad sedge
#

actually serious question. If I pass a function to a server and I get the controller's Pawn, I'd be getting the server's pawn wouldn't I?

fossil spoke
#

@glad sedge PS = PlayerState.

#

Yes

twin juniper
#

so i have a global event system in GameState, and "damage" events are broadcasted through it to generate like a combat log. my HUD needs to listen to these events, but since its only server side, how can i get this to execute on the client side?

glad sedge
#

So would i have to pass a reference to the PC I'm doing the server-related action on?

fossil spoke
#

@twin juniper Just multicast an Delegate call

#

Then anything can subscribe to it to recieve an damage event notification

twin juniper
#

"multicast a delegate call" - what does that mean exactly?l

#

like when i broadcast the event?

#

EventSystem->OnEffectDamage.Broadcast <-- make that multicast ?

#

i have my delegate defined as multicast DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FAbilityEventDelegate_OnEffectDamage, float, DamageAmount, ADungeonRunnersCharacter*, Source, ADungeonRunnersCharacter*, Target, bool, Crit);

regal junco
#

He means as an rpc multicast

twin juniper
#

so what im doing now is having my gamestate listen for that event, bind a delegate to it. when it's received, multicast to the clients

#

does that sound about right?

#

hmm i got a stack overflow ๐Ÿ˜Ž

#

or do you mean wrap my "Event.Broadcast" even inside of a multicast function?

twin juniper
#

ok i got it thanks! ๐Ÿ˜ƒ

glad sedge
#

hey @fossil spoke I got it to replicate successfully! Thanks so much!

#

There's quite a bit of jitter. From what I've read, I should create a local client version of what I'm getting the server to do to make it seem like it's smooth?

fossil spoke
#

So the Client should be running the movement updates at the same time so that it has an smooth change and then all the server is doing for the client is making sure that their boxes position ends up at the same position the server calculated.

glad sedge
#

yeah I figured

#

Since I'm not doing that, I guess I'm just seeing the raw server stuff

fossil spoke
#

Your seeing the updates at the rate the server can send them

glad sedge
#

man my server sucks

#

but all good, you've helped me tremendously

fossil spoke
#

No worries. Glad to help.

#

The hole goes even deeper though lol

glad sedge
#

no it doesn't. everything I ever know I know now

fossil spoke
#

Havent even touched on any prediction concepts lol

glad sedge
#

8(

#

Do people really roll their own?

fossil spoke
#

Roll their own what?

glad sedge
#

Like how the server stuff works

fossil spoke
#

Still not following?

glad sedge
#

ah it's not important

fossil spoke
#

Syncing client inputs to match the actions of other clients on the server is an deep deep subject.

#

Ill send you some links later on with some good information on the concepts.

glad sedge
#

please do

fossil spoke
#

But stick to what you have learned today and get used to the way it works.

#

If you need real world code to look at. Try and see if you can make sense of the movement replication on the CharacterMovementComponent.

#

Its pretty complex but takes you right down the rabbit hole hahah

glad sedge
#

haha okay

fossil spoke
#

Practice makes perfect so keep working with it

glad sedge
#

Do you separate your functions into client and server?

#

since I have very similar yet fundementally different functions for what happens with the server and what happens with the local.

fossil spoke
#

Depends on what needs to be done. Sometimes i do.

glad sedge
#

I suppose if I'm smart about it I should be able to cut down on any redundancy

fossil spoke
#

The authority roles help seperate code

#

Make good use of IsDediServer etc etc

#

Checking for locallycontrolled where you can

#

Lots of different flow controls to help

glad sedge
#

yeah that

#

is the next thing I've got to get my head around - ownership

fossil spoke
#

Yep its pretty important

#

The documentation has some helpful guides and tips on managing network roles and what they all mean.

glad sedge
#

Tell you what - whipping out visio isn't a bad idea

modern dome
#

Is it reliable to use a replicated variable in a Multicast when the replicated variable is set just before the multicast call?

glad sedge
#

if (Role < ROLE_Authority) is relative to the owner, isn't it ?

brittle sinew
#

@modern dome no, you have no guarantees of the replication order

#

If you need it in the function, pass it as a parameter

modern dome
#

doesnt work

#

is null

#

if i use it as a parameter

brittle sinew
#

Even if you pass it as a parameter, you need to give it time to replicate to the client as well

#

If you just spawned it

#

Also, I would be careful using get player controller index on a multicast

#

That would work on clients, but on the server you're not guaranteed the local PC is index 0

modern dome
#

whats the best practice for the replication issue?

brittle sinew
#

You could make use of a RepNotify if you're just waiting for it to be replicated

wary willow
#

@modern dome you aren't checking for authority on the server call anyway

#

Why not just pass it directly into the multi

#

And then you should be able to pass the variable "Cast to execute" through that function

#

You're making two RPC calls. Might as well drop it down to one.

modern dome
#

But I already Trier using the Parameter in the multicast and it was none

wary willow
#

Yeah...where do you actually set it?

#

Like that "set" is null right now

#

You don't have anything setting to it

modern dome
#

I already corrected it

#

But it dient work

wary willow
#

But we don't have that information

#

Can you resend a screenshot?

modern dome
#

Cant right now because i am not at home. Can i mention you tonight?

wary willow
#

You don't have to mention anyone, just repost your issue

#

Someone will help. All this @pinging certain people is silly. Anyone can help.

modern dome
#

The setup is AS follows: Controller calls event run in Server, which spawns an actor. This actor is send AS a paremeter to the event above. The actor is forwarded to the multicast

brittle sinew
#

Like I was saying, the actor probably just hasn't replicated down to the client yet, you have no real way around that besides using a RepNotify

#

Assuming x seconds will get the replication there is dangerous

sweet spire
#

You know the player state, its replicated to everyone right? is it every players player state is sent too each other? or just there own to them

#

also if its replicated, does it automatically replicate any veriables in it?

modern dome
#

@brittle sinew but what should i do if the spawned actor is relevant for the gameflow?

#

Would it make sense to wrap the set node into a multicast rpc?

#

Since the order is the same when using reliable rpcs

brittle sinew
#

No, because the clients still wouldn't know about the actor

#

And it would resolve to null on the clients

modern dome
#

Ah yes... :(

#

should I do a while loop / delayloop and wait for repnotify?

brittle sinew
#

Is this function always called right after the actor is spawned?

#

Like, it's called no matter what after it's spawned?

modern dome
#

yeah

brittle sinew
#

So why not just use the RepNotify?

modern dome
#

and what If I later decide to change exactly that?

#

imo Repnotify shouldn't call gameflow relevant events

#

But I guess you are right about the actor not replicated yet

#

Maybe I should wrap the Spawn itself into a Multicast

brittle sinew
#

Well, you need to make somewhat of a decision here. Is the "gameflow relevant event" happening right when you call it more important than the cast being required to run the event or is the cast being there the most important part?

#

No, if it's replicated you don't want to be spawning stuff on clients

#

At a certain point in networking you have to be okay with comprimises and make stuff work even when not everything is provided to you over the networkโ€”it's just not reliable

modern dome
#

Hm, I guess Multicast Spawn is the best thing. All I do is only visual. The Damage calculation is still done on the server

chrome bay
#

Guys quick question, anybody ever have trouble sending a 'const TSubclassof<>` via an RPC?

#

Not compiling, but the error is really odd

brittle sinew
#

I've never tried, but shoot the error I guess?

chrome bay
#

Well the error is happening in the 'generated' header for the entire plugin, which is wierd - so it's not pointing me to anywhere directly

brittle sinew
#

Are you getting ```Severity Code Description Project File Line Suppression State
Error C2678 binary '=': no operator found which takes a left-hand operand of type 'const TSubclassOf<AActor>' (or there is no acceptable conversion) SourceTest416 D:\Unreal Projects\SourceTest416\Intermediate\Build\Win64\SourceTest416\Inc\SourceTest416\SourceTest416.generated.cpp 50

#

Tried it out myself, weird

#

I see one answerhub post commenting on it, but nothing really definitive

#

Looking at the output log it seems it can't decide which operator to use

chrome bay
#

Yeah that was the one, I guess UHT doesn't generate the generated.h file properly for RPC's that have const TSubclassOf Items. Just had to make it non-const. Not end of the world though!

brittle sinew
#

Oh, I didn't even try it non-const, cool you could still get most of the functionality ๐Ÿ˜„

pale vapor
#

Anyone know how I can fix jittery movement when using listen server? (movement done by calling AddMovementInput on client) The movement is jittery for clients only when connected to listen server, like only the listen server is sending bad corrections.

pale vapor
#

Setting p.NetEnableListenServerSmoothing 0 fixed it, for now anyway

trail dragon
#

For a PlayerController, if I just set the values on the client are they replicated to the server (because they are the owner)

#

Or do I have to call a function on the Server to set the server side copy manually

fossil spoke
#

Replicated variables are never replicated from client to server.

trail dragon
#

Cool, suspected that but thought I'd check in the case of PlayerController since they do own it. Thanks!

fossil spoke
#

Ownership is irrelevant, the server is Authority and is the only way for variable replication to occur.

trail dragon
#

If I want to send client-only data (ie: vr hmd position/rotation) would it make sense to override APlayerController::PlayerTick then? It is only called for locally controlled PlayerControllers, so the server copy wouldn't try to retrieve a value from the server HMD I guess.

fossil spoke
#

Sure give it a go.

trail dragon
#

Oof. SpawnDefaultPawnAtTransform seems to be run before the first PlayerTick, so it has no copy of the values

#

Well so much for that idea!

trail dragon
#

I can probably fix it by spawning everyone as a Spectator and then after a moment's delay spawning them as a real pawn.

fossil spoke
#

You can force spawn players as spectators when they join in the GameMode

twin juniper
#

is there a reason why sometimes when an object initially spawns, it doesn't call repnotifies for certain properties? (clientside, mostly during replication.. like joining a game in progress. but never when ingame to witness the server spawning the object for everyone)

#

i have DOREPLIFETIME_CONDITION_NOTIFY(x, x, COND_None, REPNOTIFY_Always); which made it more reliable but it still happens... im ganna write this off as an editor glitch? cant get packaging to work to confirm... idk

sterile pebble
#

@twin juniper it does not call repnotify if new value is equal to old one

slim holly
#

You could manually call the repnotify events during beginplay?

glad sedge
#

Should I replicate the movement of an actor, say a box movement, back to all clients to get the most smooth response?

slim holly
#

probably not the smoothest, but most accurate

#

meanwhile, is it possible to store authorative actor reference to remote?

#

I know that sounds super dumb

glad sedge
#

how do I smooth it out? Right now I'm NetMulticasting my hit result back to the clients and letting them update the position

#

ah actually, I think it's just because I'm running a dedicated server on a single instance with 2 other players

#

my FPS is like 10 heh

slim holly
#

heh

glad sedge
#

I think that'

slim holly
#

sure if it's a simple pre-determined movement you could just sync it using rpc without actually replicating the movement

glad sedge
#

I think that is the way to do it though. Otherwise all the other clients will see is the server and that'll be really chuggy (accurate though)

#

nah it's a little more random. It's an update of a client's mouse movements.

#

my char's can pick up and move boxes

slim holly
#

oh so you want to show mouse cursor location to other players?

glad sedge
#

well pass through that info. I'm replicating FHitResult

#

to the server, then the server passes the movement back to the PC's via a NetMulti

slim holly
#

that's a lot of data tho

glad sedge
#

Yeah I think I can refine it to just be the FVector, TBH

slim holly
#

let server do the heavy lifting

glad sedge
#

Keep it lean

#

Is NetMulti really the only way to keep all clients up to date with what the other clients are doing? Aside from UProp Rep

slim holly
#

if it has to be instantaneous

glad sedge
#

yeah I guess it's game critical.

#

lol oh man. my game is freaking out

glad sedge
#

dumb q - if I'm netmulticasting back to the clients to update them, does that remove the need to run something on the local?

slim holly
#

if there are any non-replicated actions tied to it

#

like visual effects or sounds

glad sedge
#

hmm

#

it's still a little.. chuggy

#

Actually, no it's just me being a dummy

#

and running two players inside PIE again

fossil spoke
#

Package the game and get 2 clients to connect to an local server. Testing MP in PIE can only go so far.

glad sedge
#

yeah, I'll try that in a bit

#

Something I find odd, or at least one of those things I don't quite get.

#

I have 2 clients. If one picks up a box, it stores the actor on the server, tells updates the client's cursor etc.

#

So when I do a net multicast, I pass through the vectors for the store actor's location and updates it.

#

Actually I just answered my own question so I'll shut up

plain flume
#

Can somebody explain me little about the _Validate() method that comes with the Server functions. What can i for example do within the Validate?

wary willow
#

@plain flume To validiate before it gets run

#

Or like most people, no one uses it for anything.

#

Pretty sure eXi's comp had that in there

#

Page 64

potent raven
#

Looking for 2 peoples for a new project that all in the project owns together, currently amount of peoples in it "2" and ideas and plans are set and ready to upgrade at anytime, please message for more info ๐Ÿ˜ƒ

jolly siren
wet oriole
#

Hello Guys, I'm created a simple multiplayer test project, with DefaultPlatformService=Null and using Create Session in LAN mode and Find Session in Lan mode ,
The problem is i've to search at least ten times to find a session on my lan , I've one PC and Laptop connected to an ADSL Router , Why this happens ? After find that session everything works and i can join and see my both character , I'm using 3rd person template

wary willow
#

heh

#

Other than LAN is broken?

#

@wet oriole Doesn't shootergame have the LAN settings?

wet oriole
#

I didn't test shooter game but in the ShooterGame config online subsystem is steam...

#

@wary willow

pallid mesa
wet oriole
#

@pallid mesa I had this error in one of my projects too...

sweet spire
#

Quick silly question, what information is it that carries between map jumps?

#

i cant remember ๐Ÿ˜‚

dapper galleon
#

@sweet spire You mean the game instance?

sweet spire
#

there we go

#

omg

#

thank you

sweet spire
#

see ur on a ball today matheus, is there away in bp to set the ip for find session node?

dapper galleon
#

You'd like to filter the find sessions by the ip?

#

AFAIK It is not possible in BP

#

I think the Advanced Sessions Plugin has some filtering capabilities

#

else you'd have to go with C++

sweet spire
#

no i mean

#

find session

#

searches across the default sub system right?

#

cant u point the default sub system to a certian ip? or range

#

or list of ips

dapper galleon
#

I don't think so

sweet spire
#

wait

#

find session is from advanced session plugin?

dapper galleon
#

No, you have a base implementation from UE4

#

they basically exposes what it's in C++ to BP

sweet spire
#

yeah and it searches for sessions from default sub system right?

dapper galleon
#

yes

sweet spire
#

I know there is a lan option for it,

#

are u not able to point it to an IP adress?

#

as if u where searching lan

dapper galleon
#

Not sure, the point of find sessions is to find more than one session in the subsystem

#

if you have the IP just try joining it... idk ๐Ÿ˜›

sweet spire
#

i can range can have more than one session

#

ports

dapper galleon
#

I see, but using find sessions without filtering with the IP would return it anyway

#

If you really need to set an IP you could take a look at the plugin, but I never really used it

#

the plugin would just take every session and filter by the ip you give, if it even does that

#

I'm not sure if there's a way of giving an IP to the underlying subsystem so it would do the filtering

jolly siren
#

Has anyone written anything to check which properties in a struct changed per OnRep? We have the previous value of the struct if you use the OnRep parameter. So it should be possible, just wondering before I write it.

sterile pebble
#

just compare them? ๐Ÿ˜ƒ

jolly siren
#

yeah I'll just write it

sweet spire
#

Two questions as im pretty chatty today

#

What event gets called when client attempts to join a server on the server side

jolly siren
#

there is PostLogin

sweet spire
#

Theres some stuff before it

#

and i cant find the wiki page for it D:

#

wth

#

where has the ue4 network flow gone

#

wtf its actually gone off the wiki D:<

sweet spire
#

Whats the deal with advance session plugin? try to create a session with default settings or default + lan

#

and it fails every time

brittle sinew
#

I'm guessing it has nothing to do with the plugin, it's just a wrapper for engine functions for the most part

sweet spire
#

LogScriptCore:Warning: Script Msg: CreateSession - Invalid or uninitialized OnlineSubsystem
LogScriptCore:Warning: Script Msg: CreateSession - Cannot map local player to unique net ID

sweet spire
#

no documentation anywhere arhh D:<

#

ohh

#

god dammit lethal

#

i always google things before i ask

#

Well

#

at least it works now

#

LOL

#

god dammit why is it returning 0 sessions D:

#

its not my day today

#

nvm sorted

#

jesus

warm pagoda
#

DenverCoder9, pls, @sweet spire

red sand
#

Can someone help me understand how to retrieve and store user data online

sweet spire
#

DW SION

#

i got this

warm pagoda
#

Huh?

#

No no, DenverCoder9

#

TL;DR: Don't post about a problem then just say that you fixed it. Post your solution, so others can use it if they come across it.

#

Slightly less relevant in Discord, but someone might learn something from your fix that they'll remember if/when they run in to the same problem.

pliant cypress
#

Hi Everyone! :)
Im using the multiplayer blueprints tutorial project made by Epic and I found an interesting issue. Some of the players can only Host, but not Join a session, for others it works both ways. I couldn't find any reference to this so far, is there a thread which addresses this issue?
https://www.youtube.com/playlist?list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ

past pawn
#

hello people! :D
when checking certain conditions, like if an object implements an interface or if a certain boolean is set to true, should that check be performed locally or in the server? just mainly to prevent cheating

fossil spoke
#

Depends on what its for, thats an pretty context sensitive question. If its an cosmetic check then it would be reasonably safe to be performing it on the client. If its gameplay critical then the server should be doing it.

#

@past pawn Do you have any specific issues or concepts in relation to that with which you need help to understand further?

past pawn
#

thank you for your response :)
I just need to check the value of a variable and depending on the value change other stuff, but I wanted to make sure I'm doing it right
so if I'm checking something important for the gameplay, that should ALWAYS be on the server, only cosmetic related stuff goes to the client, right?

sterile pebble
#

in general you should play everything on client as in usuall game

#

but, after every critical event (movement, general action, interactio or something like this) you should sent rpc to server with that information and server checks everything on his side. If client could do this (in the past, because server will get information after client action) then we okay and we do nothing (maybe sent information to other clients if this is needed). If server side see some displacement -> override and sent new information to client

#

this is cause why you sometimes get hit by enemy player in action games after you hide behind wall, and so on

#

anyway, can someone explain to me - how I can make custom replication of movement for NPC characters? Like, the one, who owned by server? I feel it is pretty bad to multicast several params across network ๐Ÿ˜ฆ

sweet spire
#

At what point does the playerstate created?

#

can u cast to it onPostLogin?

spiral quiver
#

Hey guys my little listen server ui isn't working, I can setup/host a match, however when joining one, the game crashes and reveals this message:

#

What does it mean?

sweet spire
#

It means ur URL settings are wrong

#

show ur travel node

spiral quiver
sweet spire
#

mmm why u using console command

spiral quiver
#

Dunno, I followed a tutorial because I'm still learning this stuff.

sweet spire
#

Try using Open Level

spiral quiver
#

now it cant host a game

sweet spire
#

then ur settings are wrong

obsidian relic
#

Options : listen

#

Just

spiral quiver
#

no question mark?

obsidian relic
#

I don't think so

sweet spire
#

It has

#

a ?

#

in it

#

?Listen

obsidian relic
#

In the command yes ..

#

But not in this node

sweet spire
#

Works fine for me

#

Hosting and joining with it

obsidian relic
#

Do you use plugins for sessions ?

#

Like advanced sessions?

sweet spire
#

yeah

#

but iv always used ?listen

spiral quiver
obsidian relic
#

I never used it me.

sweet spire
#

its prefix for the url param if i remember

#

ur level name is wrong then

#

wait

#

u want that one

#

to host right?

spiral quiver
#

Yeah

obsidian relic
#

This click just open a level..

sweet spire
#

Then your level name is not working then

#

Show me level name

spiral quiver
#

I got the combo box displaying "TestMap". The map is called "TestMap".

sweet spire
#

print it iout on screen

spiral quiver
sweet spire
#

Print the map name from the conversion

#

and see if its the same

spiral quiver
#

okay i will try that now

sweet spire
#

or try breaking the connection

#

type it in manually

#

and see if it works

spiral quiver
#

okay it seems to be working now. dont know why, probably a bp bug or somethin

#

but the join game still crashes

sweet spire
#

show output log error

#

Btw does anyone have the image that shows in what order things get created for multiplayer? gamemode, playerstate etc i cant find it on the wiki

spiral quiver
#

Info Play in editor start time for /Game/FirstPersonBP/Maps/Main_Menu 1.289

#

Warning TravelFailure: InvalidURL, Reason for Failure: 'Invalid URL: /Game/FirstPersonBP/Maps/Main_Menu'. Shutting down PIE.

#

Warning TravelFailure: ClientTravelFailure, Reason for Failure: 'Invalid URL: /Game/FirstPersonBP/Maps/Main_Menu'. Shutting down PIE.

sweet spire
#

try swapping your listen to

#

?Listen

spiral quiver
#

with a cap?

sweet spire
#

my bad

#

no cap

#

?listen

spiral quiver
#

oh right, in that case I already have it as that.

sweet spire
#

hmmm

spiral quiver
#

maybe it's the join command.

sweet spire
#

Does the map not load?

#

at what point does it stop

#

Loading the client up as listen server

#

or another client trying to join

spiral quiver
#

it doesnt seems to load the map at all, just crashes.

sweet spire
#

try it with URL empty

#

Yes

spiral quiver
#

Oh, what's wrong with it?

sweet spire
#

try something like

#

Join map

#

with

#

sorry i mean

#

open map

#

set the map name to

#

127.0.0.1:7777

#

That might be wrong, thats just off the top of my head

spiral quiver
#

oh, im bad. found out why it wasnt working.

#

Stupid mistake.

sweet spire
#

id use the open map

#

instead of command lines

#

saves u messing about having to append strings and stuff

spiral quiver
#

Alright, thanks for the help, got it working now.

#

๐Ÿ˜ƒ

sweet spire
#

no worries

#

any got any idea what would cause postlogin to fire off consistantly?

dapper galleon
#

How so?

sweet spire
#

the fuq

#

this is so weird man

#

If i possess a pawn

#

through OnPostLogin

#

It causing it to loop like fucking mad

#

omg nvm

#

found the issue

#

im stupid afl mao

#

lmao

#

Also dude do u know where the information off the wiki went that shown u in what order what gets constructed?

night jay
#

Anyone know what the size difference is between an int and a byte?

#

Need to replicate a value but I dunno which I should use

brittle sinew
#

In BP, int is 4 bytes

#

A byte is, well, a byte :p

#

A byte runs -128โ€“127, an int is 2 million something

#

Billion* oops

night jay
#

So I can't have a byte with a value of say 200?

#

Or is the 128 limit the amount of characters?

brittle sinew
#

I'm actually not 100% sure about byte

#

I know BP doesn't have unsigned values, but a byte is a little bit different

#

If it is unsigned, it's 0โ€“255

night jay
#

So I'm reading

#

I basically want to store a single number

#

That number could be 1

#

but also 5024

#

And I want it to be as small as possible due to me having to network ALOT of those

brittle sinew
#

Well BP doesn't have access to int16, so I guess you have to make a decision there

#

I wouldn't really worry about 1 byte vs 4 a ton though

night jay
#

I have to though

#

Because else I might not reach my bandwidth goal

#

Game I'm making can't rely on dedicated servers and such so we have to minimize the packet sizes

#

Goal is 32 player game and we're already hitting high numbers with just half of that amount

modern dome
#

What is your exact use case?

sterile pebble
#

does basic UPawnMovementComponent replicates AddInputVector by default?

night jay
#

I want to keep track of score and such

#

Kills but alot of other values

#

Can't remember how many Players this was

brittle sinew
#

Unless you do some trickery to only send the delta via a byte and keep track of the values on each client, you're pretty much stuck with int

night jay
#

Ignore the spikes those should be resolved already

#

But without spikes we're at like 150KB/s with less than half the Players in a game

#

(that's the host)

brittle sinew
#

I mean, it gets to a point where you have to think about if running a 32 player game is even feasible on p2p

night jay
#

Even for half of that what we have there is overkill

brittle sinew
#

Each extra client adds more bandwidth sent out to every other client, so it's compounding in a way

night jay
#

Exponential mostly

#

O(N^2) IIRC

#

But if you look at numbers from a 16 player game like Halo Reach

#

And those values are in bits

brittle sinew
#

Well they're running a 10hz minimum, haha

#

That's fairly low

night jay
#

What do you mean

brittle sinew
#

It says their minimum tickrate is 10hz

night jay
#

Their server tickrate?

#

that's indeed low

#

Doesn't CS:GO have like 128hz?

brittle sinew
#

Well how often network communication happens

#

Some servers yeah, the majority are 64

night jay
#

What does UE4 use default

brittle sinew
#

I think COD runs their P2P at 20hz

#

I actually couldn't tell you that

night jay
#

I know there's ServerTickRate or something in C++ but have not found much regarding it yet

#

Also do you have some kind of source where it says Halo & COD have their tickrates mentioned?

brittle sinew
#

Well for Halo I just used the picture you linked, haha

#

For COD I just used general knowledge from around the internet to be honest, apparently in the upcoming game they're bumping it to 60 on dedicated servers so it was news

#

Apparently the remaster game runs at 10hz constant, that's bad

night jay
#

Hhmm

#

With Halo that was the minimum

#

I'm assuming it would go higher if it had the ability to do so

#

Also UE4's server tickrate

#

How does it corrolate with an actor's net update rate

sweet spire
#

silly question, but thoughts on away to send veriable from the client too the server's gamemode

#

since u cant call an rpc because i cant target the gamemode

#

oh i think i got it lmao

night jay
#

Hmm Squad and PUBG ahve to rely on dedicated servers so it seems

sweet spire
#

Yeah because it would totally hammer a listen server

#

alot going on

#

well aparently the owner of a controller is not the owner because a rpc to owner client is not firing ๐Ÿ˜‚

#

wait is a controller not an actor?

sterile pebble
#

anyone knows - does ue4 ping value measured through in-game replication channel or through system network ping command?

sweet spire
#

Ready to throw my self off a bridge, is there anything i can RPC to call on client from the gamemode OnPostLogin

stone lintel
#

Yes you can as stated by UE 4 itself

    virtual void PostLogin(APlayerController* NewPlayer);```
night jay
#

You make an event in your player controller that fires on client

#

And call it on postlogin

sweet spire
#

yeah but u cant RPC to client on a controller

#

the controller is not owned

#

well not an owned actor

stone lintel
#

wha..? seriously, isn't it impossible because PostLogin called after successful login, and each controller determine each connected client

brittle sinew
#

No, you definitely can @sweet spire

#

I'm not sure why they would say that, calling an RPC on PostLogin is fine @stone lintel

stone lintel
#

so far i haven't experienced any trouble calling RPC on PostLogin but maybe that's not the case for someone else ๐Ÿ˜…

brittle sinew
#

Yeah, I have a tiny feeling a small failure got extrapolated to the whole thing with some misconceptions :p

sweet spire
#

Yeah but

#

Try and RPC fron client controller to server

#

It wont fire

#

iv tried

#

I think its because its not an owned actor?

brittle sinew
#

I believe you that you couldn't get it to work, it happens to everyone.

#

But saying you can't call RPCs on a controller in general is just indefensibly false

#

It goes against the whole design system of ownership

sweet spire
#

i said u cant call an rpc to client on controller

brittle sinew
#

Sure, and that's false.

#

:p

sweet spire
#

well it wont fire

stone lintel
#

u mean like running on server or running on client?

sweet spire
#

and i looked on the web

#

and someone else had same issue

brittle sinew
#

Just because you couldn't get it to work doesn't mean you can't do it.

sweet spire
#

Running on client

#

i tried it in ablank project

#

and it also wouldnt fire

brittle sinew
#

Then there's something wrong in how you're doing it

sweet spire
#

hmm

#

acording to the network compodium rpc to client only fire on owned actors right?

#

but controller is not an actor is it?

brittle sinew
#

AController

sweet spire
#

hmm

brittle sinew
#

Look at the prefix

sweet spire
#

no idea then

brittle sinew
#

๐Ÿ˜‰

#

Just to be clear, you're trying this on a PlayerController?

sweet spire
#

yup

#

event post login, new player controller

#

Call Custom event run on client

#

does not fire

#

Does event posses fire on client?

brittle sinew
#

I believe so, can you show your post login BP

sweet spire
#

Looking further back

#

maybe its an issue with something else

#

gonna set breakpoint

brittle sinew
#

Try printing before the switch as well

stone lintel
#

is that function inside the game mode?

#

NVM

#

btw, not sure in BP but in C++ Possess runs on server

#

as stated in here

     * Handles attaching this controller to the specified pawn.
     * Only runs on the network authority (where HasAuthority() returns true).
     * @param InPawn The Pawn to be possessed.
     * @see HasAuthority()
     */
    UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Pawn", meta=(Keywords="set controller"))
    virtual void Possess(APawn* InPawn); ```
brittle sinew
#

Yeah, I don't even know why we're on the pawn here

sweet spire
#

fixed one issue

brittle sinew
#

Thought we were on the controller

sweet spire
#

not letting go of the default pawn

#

Event posses appears to be running on the server but not client

#

let me check again

#

yup not running on client

brittle sinew
#

Okay, I might've been wrong there yeah

#

We were talking about a controller RPC though?

sweet spire
#

same with the execute on owning client

#

This is in my papwn

#

it aint even going off in the actor**

#

not pawn

brittle sinew
#

What??

#

You said it's on your controller.

sweet spire
#

i tried it on the controller did not work

#

but its not running on pawn either

brittle sinew
#

The pawn makes sense, it's probably not replicated to the client yet

#

Running the RPC on the controller should give you no problems though.

sweet spire
#

ahh oki

#

il tryi t back on controller

stone lintel
#

@sweet spire LOL you're BP screenshot is event Possessed from APawn meanwhile my snapshot is Possess from AController ๐Ÿ˜…

sweet spire
#

i tried both and couldnt get it too wkr

#

trying controller again

stone lintel
#

okey good luck

sweet spire
#

Cast to the custom controller from Player controller

#

to call an event replicated to owning client to print to screen

#

Nothing happened

#

No failed cast

stone lintel
#

does BP have a node something like ClientMessage? In c++ it's good for testing ClientRPC

sweet spire
brittle sinew
#

Put the print before the RPC.

stone lintel
#

APlayerController::ClientMessage()

brittle sinew
#

Switch

#

Oops

sweet spire
#

it fires

#

because it goes off on server

#

but not client

brittle sinew
#

Put the print before the switch, that's what I meant

#

You're making the assumption that the switch is working exactly how you intend

#

When you're really just worrying about the RPC

sweet spire
#

didnt fire at all

#

Running on AChar fires on the server only, running on controller fires nothing.

brittle sinew
#

Could you show your PC event one more time?

sweet spire
#

Double checking

#

Cast is not failing either.

brittle sinew
#

Check your logs to make sure of that

#

The event might be firing before your viewport is in-game, I'm not exactly sure how the flow runs

#

I have a client RPC to the controller working on PostLogin on my own project, though.

sweet spire
#

Not firing

brittle sinew
#

Are you calling the parent PostLogin function before running the rest of your code?

sweet spire
brittle sinew
#

Well there's my answer to that

sweet spire
#

Thats the whole post log

brittle sinew
#

Try calling the parent function as your first node

#

Not doing that can screw a lot of things up

sweet spire
#

Not sure what u mean by that

brittle sinew
#

Right click on postlogin

#

Click add call to parent function

#

Call that first

#

Before anything else

sweet spire
brittle sinew
#

Correct

sweet spire
#

Nothing in controller is firing

brittle sinew
#

Okay, well I'm not really sure what to tell you at this point besides play around with it some more

#

I can assure you though: you can definitely call client RPCs on a PlayerController

#

That's not the issue here.

sweet spire
#

acording to someone elses post

#

who had the same issue

#

u cant

brittle sinew
#

Well according to me in my project I can.

sweet spire
#

Hmmm

#

tell me your black magic pls

#

wait wtf

#

in the standalone

brittle sinew
#

Try making it reliable

sweet spire
#

There is 3 controllers

#

in the debug object

#

In the clients debug drop down list for the controller there is 3.

#

and my client shouldnt be seeing the listen servers controller right?

brittle sinew
#

Correct

sweet spire
#

how the heck is there 3 controllers D:

#

My default pawn class is spectator

#

hmmm

#

ima skip giving the pawn and possesing

#

see what happens if u just start as that pawn

#

same thing wth

#

3 controllers

brittle sinew
#

Sounds like you might have bigger issues than just the RPC not firing

sweet spire
#

Client 1 two controllers

#

Yeah

#

Wait

#

When i join another level

#

or session

#

do i need to unload the map before?

#

It said it was in the pervious login map

#

Im using Join session

#

Can someone confirm if this is a bug or not, when i join the session with client, aparently the controller for the client is inside the pervious level they where at

#

Fixed

#

using delay node -.-

#

throws self off bridge

nocturne copper
#

^^ been there all to often

sweet spire
#

Someone like to explain to me why if you just run a event normally, it runs on the client, but if u try and replicate it via run on client with a switch has authority, and run on remote(so that it just calls on the client) it wont run

#

I must have wrong understanding on run on client

brittle sinew
#

If you're on the PlayerController, even on the client you're authority

sweet spire
#

oh

#

-throws self off bridge-

brittle sinew
#

So your RPC is working fine?

sweet spire
#

Iv got to the point now where there is so much stuff going on idk lmao

#

im gonna grab some water

#

then go through everything again

#

I was shoving it switch has auth, because it says when you RPC to run on owning client, it runs on the server too

brittle sinew
#

It shouldn't be doing that, are you sure you're understanding your logging?

#

Client RPCs don't run on the server.

sweet spire
#

I thought i read somewhere it does

#

jfc

#

What is my lyf

brittle sinew
#

No, that's the point of them

#

๐Ÿ˜„

sweet spire
#

Thank you lethal.

#

Idk where the hell id b with our ur help ๐Ÿ˜‚

brittle sinew
#

Multicasts run on all clients and the server, if that's maybe your misunderstanding

sweet spire
#

yeah maybe

#

potato brains

sweet spire
#

Lethal im having to use a delay you know after posses to make this work, do u think it be better if it ran off a blind event once the controller has possesed?

#

To save any future issues

brittle sinew
#

To make what work?

sweet spire
#

Foe the rpc and bind to go off proper in mmogamemode, i had too put in a delay of 5 seconds

#

could prob be less

#

wondering if this could cause issues in future

brittle sinew
#

That doesn't sound right, I have the RPC working fine with no delay

sweet spire
#

without the delay, it does not fire off

#

Maybe its binding the event but its avaliable?

#

testing

#

hmmm

#

i wonder if i have delay somewhere messing with it

dapper galleon
#

you're running that after OnPossess?

sweet spire
#

Yeah

#

node before cast to is Posses

#

Possess*

dapper galleon
#

It's hard, if adding a delay makes it work it was probably initializing something, not sure.

sweet spire
#

gonna go through all my char bp

dapper galleon
#

It often happens while stuff is still replicating

#

Making sure some resource replicated correctly so you can go on is something I didn't quite figure out

#

not sure if it's your case, though

sweet spire
#

Hmm

#

why is it when i start up my game

#

My pawn gets possesed twice

#

i have print out that tells me when pawn is possesed

#

and it always fires twice

#

nvm fixed that bit

dapper galleon
#

What was it?

sweet spire
#

no idea, just deleted it

#

OnPostLogin only gets called once

#

gonna assume that when the actor is spawned, it has a default controller

#

then the possess takes over it

dapper galleon
#

Hum, could be it

#

the unpossess even happens when you close the game ๐Ÿ˜›

#

so it both might run when you don't expect

sweet spire
#

hmmm

#

needs at least 1 second i think

#

do u recon i should just do an event bind

#

When its possed

#

call the rest of the chain?

#

oh wait i wouldnt be able to bind the event lmao just realised

#

Any ideas?

nocturne copper
#

might be able to do a check for is possessed and if it is see if the player controller that is incoming is the same as the "get owning controller"
If not then allow the new incoming controller to possess this pawn and do all the rest of the logic

sweet spire
#

I tried it with them just spawning in with the default pawn u are normally given

#

still same issue

#

Fixed

#

Jusy bound an event for on posses

#

just*

#

once its possesed then it binds and requests session key

#

Hopefully this should work now

nocturne copper
#

ah ok so your haveing it called by the game mode settings. Usually I do a spawn system to have the character I want the player controller to have get created/ spawend in the level. Have the controller do a check to see if it already possess a pawn and if so destory that pawn and then possess the one that was just createc

#

created*

sweet spire
#

oh u can spawn controllers?

nocturne copper
#

sorry for late reply, at work on my end

wet oriole
#

Hello Guys, I need help for join to another computer session over internet via IP, i try to open my friend computer using console command open "His IP" but not working ... I tried creating session with both LAN true on false but not works

sweet spire
#

Your ports open?

nocturne copper
#

not spawnd controllers but they are added with an event on post login I think in the game mode

wet oriole
#

how i can check ? i set a rule for 7777 in windows firewall @sweet spire

nocturne copper
#

dont have a project open in from of me to check

sweet spire
#

you need to have this route ports forward incoming traffic on 7777 to 127.0.0.1

dapper galleon
#

or any internal ip in your lan

#

I mean, doesn't have to be localhost

nocturne copper
wet oriole
#

@sweet spire I don't understand how i can do this, can you please describe or send any tutorial link..

modern dome
#

How can I retrieve all local Player Controllers?

dapper galleon
#

@wet oriole do you have access to your router?

wet oriole
#

I've an ADSL router

dapper galleon
#

I mean, your friends router

sweet spire
#

u need to go google how to port foward

dapper galleon
#

If he's the one hosting

sweet spire
#

its different for each router

#

well slightly

dapper galleon
#

Your friend should use port forwarding in its router for port 7777 into its internal IP

#

Then you'll join using its external ip

wet oriole
#

I'm searching to find how i can do the port forward...

#

it should be on both side or on host only ?

dapper galleon
#

Your friend is the one to do it, though

#

only on the host side

sweet spire
#

wth even with bind event waiting for it too be possesed same issue

wet oriole
#

ok, i'll try @dapper galleon

sweet spire
#

i can bind to the AChar right away

#

But if i bind straight away to the controller when it posses

#

its a no no

#

lmao

dapper galleon
#

what are you binding?

sweet spire
#

just an event

#

Tell call back saying

#

"okay we are possesed"

#

oh u mean the otherone

#

A event too the controller

#

wait i think i might know what the issue is

#

okay the bind is fine

#

its when i call the request event to the client

#

It must be me calling it too fast

#

got a good idea how to fix this now ^^

#

okay nvm no i dont lmao

dapper galleon
#

lol

sweet spire
#

CE request client session key is the issue

#

it calls an event on the client that calls the bind event on the server

dapper galleon
#

I mean

#

It won't call the bind, is it?

sweet spire
#

Basically the server requests the client to send the information, and it calls an RPC to the server with the info that triggers the bind

dapper galleon
#

Hum ok

sweet spire
#

This

dapper galleon
#

Try without the bind, see if it works...

sweet spire
#

can u do it with out bind?

#

clients cant cast to game mode

dapper galleon
#

But you RPC back to the server, no?

sweet spire
#

oh shi ye

#

good point lmao

#

testing

#

nope

#

no difference

#

nope

#

its not even firing

dapper galleon
#

Couldn't say what it is, just print every step and see where it is dying

sweet spire
#

yup ce request client session key

#

appears to be going off too fast

#

its not getting through too the client

#

Yeah its not getting called

#

even tho server is sending it

#

i set the event

#

to reliable

#

now its going off?

brittle sinew
#

๐Ÿ™ƒ

#

I think I said that a while ago

sweet spire
#

DID U

#

pls explain

brittle sinew
#

Non-reliable events "might" go off

sweet spire
#

jfc

brittle sinew
#

:p

sweet spire
#

thank you omg

#

gonna print that out and put it on my wall of reminders

brittle sinew
#

So, what have we learned today

#

Don't make large-scale claims going against all documentation when presented with a single problem due to user error

#

:p

sweet spire
#

i am potato and listen to lethal

#

close enough ๐Ÿ˜‚

dapper galleon
sweet spire
#

accurate picture of me rn

brittle sinew
#

Anything that needs to happen in a flow needs to be reliable

sweet spire
#

gotcha

brittle sinew
#

Otherwise they get overridden by other reliable events or variable replication or things like that

sweet spire
#

oops i forgot to send the player controller to the server with the session key ๐Ÿ˜‚

wet oriole
#

@sweet spire @dapper galleon Thank you guys, I did port forward and now I can connect over internet and everything works, I want to know is it possible to do this process automatic i'm working on a project that only two player can join in a session

sweet spire
#

i cant answer that, i dont know enough about that type of stuff

dapper galleon
#

How automatic?

#

You could open every door, is that automatic?

#

๐Ÿ˜

sweet spire
#

I think what he means is

#

How do other games avoid this issue.

dapper galleon
#

I guess you would know beforehand what ports each system uses

sweet spire
#

Well normally vahid

#

The game servers would have them open ๐Ÿ˜‚

brittle sinew
#

Look at NAT punchthrough, if you use something like Steam it handles it for you automatically

#

That's how I'd say most P2P games do it

dapper galleon
#

Doesn't prevent you to open doors manually for hosting ๐Ÿ˜›

#

but sure

brittle sinew
#

puts PC in DMZ

#

I can't pretend like I haven't done that before, hahaha

#

Bad idea though

wet oriole
#

thank you guys, i don't have enough information about multiplayer sessions and port handling , so if i use steam everything happened in background right ? (I didn't use steam before)

brittle sinew
#

I believe Steam facilitates P2P connections even with firewalls, yes

#

I haven't used it personally either though

wet oriole
#

ok thanks

dapper galleon
#

You'd still have to port forward, afaik.

brittle sinew
#

I don't think so? You don't have to port forward to play most P2P games

#

That's what NAT punchthrough accomplishes

dapper galleon
#

Oh, sorry, I'm just used to the server-client

brittle sinew
#

You're fine haha, it's not something you usually do when just testing

#

In production though, that's usually what your game will be doing to connect with others without having the user do anything manually

wet oriole
#

actually I've another database that I'm trying to matchmaking base on player skills,and i've a question about this : what details (information) i should store in my database after a player create a session using steam?

dapper galleon
#

I'd say that if you will be doing matchmaking on your own, implementing sessions is pretty easy

#

In a way that you shouldn't be worrying about Steam, idk

#

And I guess that it would be even easier

#

But you could also extend the Steam OSS? Not sure.

wet oriole
#

my worry now is the port forwarding problem, otherwise i could use player's ip to join them together , but now i've to use steam i think for joining sessions

#

I didn't check how Steam OnlineSubsystem works yet

#

is it possible to change 7777 to another open port by default in windows ? I think this solution can solve the port forwarding problem

brittle sinew
#

Windows most likely isn't your issue, you also need to get past your router

fossil silo
#

hey guys, is there an easy way to reconnect to the session you are currently on?

wet oriole
#

@brittle sinew so i think i should use steam for joining sessions, and have a copy of session details in my database for matchmaking based on skills in my side , right ?

native moth
#

question: Are playerstates owned by remote clients or the server?

#

or what would be the best way to pass information/events from my GameMode/State to local clients widgets(atm stored in my playercontroller)

brittle sinew
#

Ownership doesn't lie in a "client" or a "server", ownership is simply an actor

#

I believe the PlayerController owns the PlayerState.

sweet spire
#

Lethal all knowing let me query you

#

Lets say i have a Varest request object ver inside the Gamemode

#

thats used to send requests

#

is that dangerous?

#

What happens if two players trigger requests at the same time

brittle sinew
#

I've never used the plugin myself, not really sure of the issue

sweet spire
#

Okay better question

#

If i have a ver inside my gamemode, and players when they login trigger it to carry some data

#

two players going in that the same time

#

could mix it up right?

brittle sinew
#

A "ver"?

native moth
#

doesnt the Varest create a new variable for each request?

sweet spire
#

veriable

brittle sinew
#

Variable

sweet spire
#

yes one of them

brittle sinew
#

:p

sweet spire
#

ima instance the json request object

#

just for safety

#

if i even can that is

native moth
#

Cant remember exactly the varest pplugins method of doing it, but my guess is that you could wrap into a function with local variables, that means each time you run the request, the saved variables are local and will be destroyed once the function stops executing

sweet spire
#

problem is its two functions

#

well i mean, thats how im use to doing it

native moth
#

Well, dont think you have anything to fear

#

because the events will be parsing different requests

sweet spire
#

I just feel like if its not a local ver can two players write in too it at the same time?

native moth
#

But I would pass a reference to a playercontroller inside that event, so you know what playercontroller is associated

dapper galleon
#

Isn't the bind going to fire both responses?

#

when the first request completes

native moth
#

hmm, might be

dapper galleon
#

I tried implementing it myself and I actually did that

sweet spire
#

The bind only fires

dapper galleon
#

lo

sweet spire
#

if the server replies

native moth
#

I dont think blueprints are very good to make asynchronous responses to multiple requests

sweet spire
#

oh wait

#

is anything i do on the playerstate

#

synced to the player

native moth
#

but Halcyon, any reason it should be in a gamemode?

sweet spire
#

i handle the client login and stuff like this, in the player state

#

because i want the server to compare the clients auth session key to the servers

native moth
#

hmm

#

My guess is you could also do in a playerstate and make it run-on-server

sweet spire
#

Hmmm

native moth
#

playercontroller*

sweet spire
#

This isent something

#

i want the player to know about

#

at all

native moth
#

Well, run-on-server events will not notify your client

sweet spire
#

as in

#

I dont even want this to be packaged in the controller

brittle sinew
#

AFAIK the GameMode is still packaged

#

Even in client builds

sweet spire
#

fuck rly

brittle sinew
#

You'd need to use C++ and use UE_SERVER

sweet spire
#

fuq is the point in packaging dedicated servers then

#

might as well just have a command to run something dedicated

#

well

#

off to the player controller it goes lmao

#

unless..

brittle sinew
#

I think your best bet is C++, especially if using credentials

sweet spire
#

dw im gonna end up rewrite most of this in future

brittle sinew
#

If you wrap the relevant code in #if UE_SERVER it won't be packaged in normal builds

sweet spire
#

just gotta get the crappy wheels moving and understand it before i pop over to c++ fully

#

oh ๐Ÿ˜ฎ

native moth
#

btw @brittle sinew, I am once again divin head first into C++! Need to extend the PlayerState to allow me to set the PlayerName... which for somereason is not available in BP

sweet spire
#

so i built it in a function, to bind to another function, got no idea if this is gonna work LOL

brittle sinew
#

Yeah I've seen that comment a few times here and there, not sure why that is @native moth

#

Did you see my comment about ownership, by the way?