#multiplayer

1 messages Β· Page 406 of 1

glossy vessel
#

they define basic implementations of the interfaces

shut gyro
#

@vocal dagger When you get the BeaconPlayerState propogated to the Client Beacon, you can set Server's Handshake complete with the client connecting to the host beacon.

#

It is then ok to start sending/receiving voice data, so you can "unmute" the player controller and use the voice delegate to receive/send voice data

worthy wasp
#

oh dang youre doing VOIP @ the ClientBeacon system? We implemented this but moreso for a UI-Party system (SteamParty plugin for study).... didnt think to do VOIP at this point.

frozen fog
#

Hey guys, i'm newbie at multiplayer but i was thinking about making a little project that supports it (player hosted multiplayer).
If i'm not wrong, these are the "high level" stuff i should consider.
-UE4 supports server hosting by a player, i think the shooter example is a good starting point.
-But i need some way of matchmaking, i could use a service like Gamesparks for that.

So, i think i could add cheap multiplayer support without the need of paying high amount of $$ for a server, letting the players host the server themselves and using a cloud service only for things like matchmaking, player ranks, etc. I'm not entirely sure if this is possible, i hope you guys can tell me if i'm wrong.

distant wave
#

"E:\UnrealEngineSource\Unreal Engine" does not exist when packaging dedicated server???

#

@frozen fog Why not make a dedicated server or just host sessions using the advanced sessions plugin?

frozen fog
#

Hi, thanks for the answer! I don't want to host a server myself because that would be a little expensive. I just want to let players host multiplayer rooms, very few people for each host (3-4 players). I'm not sure if letting players host the game is viable (i know it would probably be laggy). I will check the plugin you mentioned, thanks for the info.

distant wave
twin juniper
#

@distant wave hi

#

yep some people are reporting that it works and some are not. i really can't even offer tech advice on the steam setup honestly. mine is not working at present. all that works for me is joining a pure dedicated server using ipnetdriver

my game is on steam, people are able to download and run it from steam. but when they join the server, i just have a UMG button that people press. that button says "join dedicated server" i hard coded the dedicated server IP into the exec console command: open x.x.x.x there.

distant wave
#

hmm

twin juniper
#

that's all i can tell you.

#

honestly i might even have to start flushing my ded server binary every 2 days

#

sometimes i cant even connect if the ded server binary has been up for more than 2 days lol

#

it lags out

#

but i DO get a connection.

#

and i join into the game.

#

that works.

distant wave
#

I will try to do something

#

I will do a new project

#

make ded server for it

#

test it

twin juniper
#

just use source control, save a version of your proj in sourcetree or something like that, and try to fall back. might be quicker. or you can do a new project. whatever.

#

whereare you hosting the ded server?

distant wave
#

I want to do a fresh project so I can see if something is wrong with my project

#

In germany

#

using zap hosting

#

but I live in Romania though

twin juniper
#

switch to ec2

#

its free for a year

distant wave
#

haha

#

I tried

#

nope

#

didnt work

twin juniper
#

didnt worok?

distant wave
#

didnt

twin juniper
#

well you gotta set it up right lol

distant wave
#

I did

twin juniper
#

did you use 2016 serverbase?

#

ami

distant wave
#

yes

twin juniper
#

so the instance started?

distant wave
#

yes

#

xD

#

port forwarded

#

in config

twin juniper
#

ok.. and of course you uploaded your ded server..

distant wave
#

and firewall

#

yes

#

it appears in steam master list

#

I can join it

#

I cannot find it

#

I join it via open steam.Server Unique ID

twin juniper
#

open all ports

distant wave
#

to get the unique id of the server I just print it in OnlineSessionAsyncServerSteam.cpp

twin juniper
#

in inbound, and anywhere in outbound

distant wave
#

I only did 27015 and 7777

#

as sebatnik showed

#

and I looked it up only 27015 and 7777

#

are needed

twin juniper
#

i guess i just dont really understand your need for your game to be on the steam list. if you put it on a hosted ip, people can just join it via clicking join game.

#

your game gets promoted by steam when its on steam

#

not from being on the server list

distant wave
#

Idk I just want it to show up xDD

twin juniper
#

lol y?

#

you want to have the ability?

distant wave
#

yes

twin juniper
#

i got it to work as sebatnik's video on local.. it didnt't work for me yet on dedicated.

#

my game shows up in steam list.

distant wave
#

Sebatnik said I am golden if I get it to show there

#

πŸ˜‚

twin juniper
#

i ended up just having problems with steam authentication

#

and fell back to ipnetdriver

#

as you might have to do as well

#

if you change your code to not use steam, you can maybe just use a test bed, and then later hire someone to write in the steam code.

#

that or you would have to do a ton of research and figure it out. it's time consuming and "blewh" πŸ˜›

distant wave
#

steam code

#

where

twin juniper
#

im more of a designer anyway

distant wave
#

cpp

#

ini

#

where would be this team code

twin juniper
#

the steam code to join the server would be in the find session advanced, as well as your server browser list widget in your game

#

so you can either extend ur ui with a CPP parent class to do it or do it entirely in BP

#

i believe find sessions advanced extends the steam api calls without needing CPP, right?

#

advaned sessions does that

distant wave
#

yea

#

it is just adding all cpp parameters into blueprints

twin juniper
#

sebatnik used that advanced sessions thing - with the dedicated server flag enabeld.

distant wave
#

yea

#

I know

#

and use presence false

twin juniper
#

yep

distant wave
#

and allow join via presence false

#

he didnt show the allow join via presence set to false

#

but it needs to be set to false

#

do you wanna do a team viewer tomorrow?

twin juniper
#

i never changed that flag in mine

#

maybe if im on

#

i have a ton of singleplayer stuff to do

distant wave
#

well I switched it to false when I saw it isnt working with it set to true

twin juniper
#

wana see something im working on real quick? i can paste a vid in h ere

distant wave
#

so..

twin juniper
#

hold on a sec

distant wave
#

sure

#

ye

twin juniper
#

after all the time you siphoned from me i wana force u to watch it lol

#

brb making it

distant wave
#

ok

#

I will watch it

twin juniper
#

and jk u didnt siphon time πŸ˜› that was other people

distant wave
#

I did kinda bother you..

#

but I am desperate

twin juniper
#

i got completely spammed by people for ded server help for the last month or two lol. it was a rumor that got around taht i was a ded server guy πŸ˜›

distant wave
#

I am trying for 3 weeks to get it working

#

not even close to get it to work

twin juniper
#

yes i know. sorry i was a bit dismissive to you when you asked.

#

i was just spammed by everyone.

distant wave
#

I totally understood

twin juniper
#

there ya go. basically what im working on now. i got AI done, and i am adding in the meshes into the game for my campaign.

#

i may make it coop multiplayer at some pt too. can be fun.

#

do you have any demo stuff of your game working in multi?

distant wave
#

@twin juniper Wow dude that is awesome?

#

I am talking on my phone rn and game is really alpha

twin juniper
#

DM me it later if u can. i would love to see.

distant wave
#

I have an idea

#

Do you wanna do a team viewer tomorrow?

twin juniper
#

if im on yea

distant wave
#

This way I can show u everything

twin juniper
#

might not be on though. i have to do shopping and my ex's is coming to town lol

distant wave
#

lol

twin juniper
#

my ex's possibly a bad person in a way, but that's okay

distant wave
#

she’s a bad girl?

twin juniper
#

a little pushy at times, but that's not too big of a deal. it's okay.

#

lol

#

anyway maybe DM me later ok?

distant wave
#

oh yea, she’s a bad girl? πŸ˜‚πŸ˜‚πŸ˜‚

twin juniper
#

i gotta get this singleplayer stuff done lol. and no comment πŸ˜›

distant wave
#

ok

#

Later I will probally be sleeping

#

cuz it is late here

#

When I see you online I’m gonna spam you AF

#

@twin juniper

#

alright

#

Thanks man

twin juniper
#

welcome

distant wave
#

and also You have a very very good game there

#

good job

#

maybe some time we can work together who knows?

lean hornet
#

So im currently running into a issues wich shouldnt be a issue but it is... so i want to display players name over the head but i cant wrap my head around the simples stuff right now aparently what am i doing wrong ?

icy nacelle
#

You're running a multicast from a client

#

See how it says (if server)? It means it only works if its run on server

#

@lean hornet

lean hornet
#

Well i tried it before with run on server wich diddnt work either well (everybody had the servers name)

#

I can do more complex stuff but when it comes to this stuff i cant get anything done @icy nacelle

icy nacelle
#

You need to make one more custom event

#

So begin play -> Run on server -> multicast -> set text

#

Also I'd recomend reading Cedrics Compendium to get an understanding of how to do stuff like this

#

@lean hornet

lean hornet
#

so i dont need a rep notify at all (i already did) its just i still have problems with simple stuff i can make full games but when it comes to simple cosmetics wich require networking im helpless

icy nacelle
#

You could do a rep-notify, but as far as I can see, you're using it wrong

#

just set it as replicated

lean hornet
#

Okay understood

icy nacelle
#

Also if you're making a multiplayer game then theres a lot more to it than just cosmetics being replicated.

#

If you're taking the rep notify route then I'd also do this differently

lean hornet
#

I got it tho thank you max .

icy nacelle
#

np

#

I could explain it a little further, the differences between multicasting and rep notify, but its best you just read the compendium πŸ˜ƒ

lean hornet
icy nacelle
#

Thats fine man - multiplayer networks arent easy. I'd still really recommend reading the compendium!

#

Glad you figured it out though.

lean hornet
#

@icy nacelle I already did like i said before it helped me massivly with setting up the whole game i just sometimes struggel with a few things due to my brain.

thin stratus
#

@lean hornet I do want to point out that there is a PlayerName Variable in the PlayerState already.

#

That is already replicated properly

#

So you only need to grab the PlayerState.

#

Your 3D widget is on your Character, so you only have to pass the widget the Character reference and after that you can get a pointer to the player state from that

#

No multicasts or whatever needed

lean hornet
#

@thin stratus thank you so much I totally forgot about the player state.

hidden thorn
#

I just tried to implement networking into 4.20 Prev 5 and I keep getting this error: 'bool UWARUGameInstance::HostSession(TSharedPtr<const FUniqueNetId,0>,FName,bool,bool,int32)': cannot convert argument 1 from 'FUniqueNetIdRepl' to 'TSharedPtr<const FUniqueNetId,0>'

#

I tried the same thing in 4.19.2 and it worked so it must be something with 4.20

umbral adder
#

see the function

hidden thorn
#

I did

#

First thing I thought is that I should change FUniqueNetId to FUniqueNetIdRepl but then I got a different error

umbral adder
#

FUniqueNetID

#

i think

hidden thorn
#

No it's not that since that is the name in cedric_eXi documentation also I changed it to FUniqueNetIdRepl same error cannot convert argument 1 from 'FUniqueNetIdRepl' to 'TSharedPtr<const FUniqueNetIdRepl,0>'

lean hornet
#

So i kinda have ran into a odd issue where after clicking the button to join a session it takes sometimes up to 6 secounds to start joining a session .Any idea why thats happening ?

desert dagger
#

Hey guys I am getting a error which I am not able to figure out can you help me?

49>D:\UnrealSource\UnrealEngine\Engine\Plugins\Online\OnlineSubsystemUtils\Source\OnlineSubsystemUtils\Public\OnlineSubsystemUtils.h(166): error C4130: '==': logical operation on address of string constant
49>D:\UnrealSource\UnrealEngine\Engine\Plugins\Online\OnlineSubsystemUtils\Source\OnlineSubsystemUtils\Public\OnlineSubsystemUtils.h(166): error C2227: left of '->GetSessionInterface' must point to class/struct/union/generic type
49>D:\UnrealSource\UnrealEngine\Engine\Plugins\Online\OnlineSubsystemUtils\Source\OnlineSubsystemUtils\Public\OnlineSubsystemUtils.h(166): note: type is 'const char [5]'```
distant wave
#

@desert dagger What are you trying to accomplish?

#

Also did you change those files?

#

Apparently, there is only one line with errors

#

Did you modify it?

#

@desert dagger Can you copy paste line 166 in OnlineSubsystemUtils.h, please?

#

I mean copy paste it here on Discord.

desert dagger
#

@distant wave I fixed it. We had macro named OSS and Unreal used variable named OSS internally. Renaming Macro fixed it.

dusty halo
umbral adder
#

@dusty halo please explain in detail

dusty halo
#

@umbral adder Nothing much to explain. I press play (dedicted server with 2 players) and these glitch appear. For some reason in World Outline it delete second player and show it again. As you can see from BP_SurvivalCharachter2 it have went to charachter 14, 15... and it keeps doing that. In my old map I don't see these kind of thing.

umbral adder
#

u deleted the pawn in game?

dusty halo
#

No

#

ue4 do it by it self, but actual charachter don't disapear from game

#

Will make another gif in a sec

#

@umbral adder I don't do nothing, they just stand there

dusty halo
#

Still stuck with these

winged badger
#

whose world is the outliner showing?

modern dome
#

If Everything works with a Dedicated Server, it will work with a ListenServer
Is this statement true?

full bane
#

false

modern dome
#

Do you have an example?

full bane
#

mainly has to do with how to handle the Authority switches

#

for example if you have a thing that should only run on the client and you do Role < ROLE_Authority to call a server function

#

it would work on a dedicated server, all remote clients but not on on the ListenServer

#

if you need your game to work on DedicatedServer and as ListenServer, you have to do some extra checks there

#

IsLocallyControlled for example

elder crypt
#

I don't really know where to put this but how come my game isn't properly packaging?

#

It's my first try at doing a multiplayer sort of thing

worthy wasp
#

have you ensured that Windows8.1SDK is installed?

#

@elder crypt

elder crypt
#

I just installed it and it's not showing that anymore which is good @worthy wasp

#

There's still some stuff there :(

#

I added a steam plugin if that might cause any issues

worthy wasp
#

why are you trying to package 32bit?

#

and lastly - your goign to havve to debug your log file - the packager is finding something... not spitting out the error in the UE4 log window - but putting it into the log file.

You'll want to search for BlueprintCompileError i believe - if you find none...search the log for "error" and find what its spitting out... it literally could be anything - static mesh, lighting, etc.

#

as for your steam - if you can SHIFT+TAB in the STANDALONE playtest.... you're steam is operating fine.

#

SHIFT+TAB should bring up the Steam Overlay

#

again - this can ONLY be done in standalone or packaged game (obviously you cant package)

elder crypt
#

I'm not sure why it says stuff about 32bit

#

I'm 100% sure I'm packaging it as 64bit

dusty halo
#

Basically it deletes second player when there is big gap between 2 players

rose egret
#

how do I use functions like DeprojectScreenToWorld and GetHitResultAtScreenPosition on the sever side ?
it seems they all use ULocalPlayer which is not valid on server side! I even don't know whether screen size and things like projection matrix are available on server side or not

#

I am builing a RTS game and want to send mouse position and do selection and ... on server to prevent cheating πŸ˜ƒ

#

btw whats the difference between standalone build and client build! can't I use standalone shipping build for my client?

umbral adder
#

What would be the best way to store the bought skins / items / cosmetic items in a database for a game @thin stratus

thin stratus
#

There are multiple ways

#

Most basic one is a DataBase on some server you host

dusty halo
#

@thin stratus Any idea about my problem?

thin stratus
#

Define big gap

#

How big is that?

#

You are most likely running out of relevant distance

umbral adder
#

@thin stratus yes like store it in an int or what?

winged badger
#

easy to check if NetRelevance is responsible, just check AlwaysRelevant

#

and if it is the culprit, this behavior will stop

rose egret
#

how do I execute a NetMuticast RPC on every client ?

winged badger
#

by calling it server side

thin stratus
#

You call it from a server on a replicated actor that exist on everyonr

winged badger
#

you should really read the Cedric's compendium

#

its pinned on this channel

#

then ask here when you get stuck

thin stratus
#

@umbral adder That is up to

rose egret
#

thats the point I don't have any actor ! I want it to be on player controller

thin stratus
#

PlayerController cant have Multicasting

winged badger
#

first, PC is an Actor

#

and second, what Cedric just said

rose egret
#

could I run the RPC on GameState instead?

thin stratus
#

If you want to reach all PlayerControllers, either save them in an array when the player connects and then loop over thr array and call CLIENT rpcs

#

Or use a Multicast in the GameState and then get the PC and call a normal function on it

winged badger
#

GetGameMode->GetNumPlayers->For(0 to NumPlayers -1) GetPlayerController(index)

#

is relatively easy way to fetch them all from BP

thin stratus
#

Theses are local players

winged badger
#

its from GameMode, not GameInstance

thin stratus
#

E.g. Your ListenServer plays splitscreen online

umbral adder
#

what would be the most optimised and easiest way

#

or what does famous game's do?

thin stratus
#

They have their own backend with people who learned how to do it

#

We cant answer this for you

#

Read up on databases

#

And think about how you want and need to store the skins

rose egret
#

@thin stratus thanks I guess GameState is good choice πŸ˜ƒ

dusty halo
#

@thin stratus Not too big. If I scale cube 40x40x2 and one player stands in one corner and other player stands in other corner in diagonal from other, then it do that.

rose egret
#

what does serialization do to int and float parameters of a RPC function ? it get compressed or not? though I think float can't be compressed

thin stratus
#

With UMG?

#

Don't post the same question into multiple channels

rose egret
#

how to get projection matrix of player on server?

umbral adder
#

@thin stratus sry

#

yes with umg how would i create a widget that gets created on cursor position and which dynamically update's height

brave moon
#

How to properly replicate set actor rotation?

same results (not replicating correctly) with multicast/run on server function and without them. It replicates normal when i use switch has authority but then client have problems with controls...

unique thunder
#

For anyone using AWS GameLift, do you know anything about this? (error during VS compile)

jolly berry
#

With most shooters, and both HitScan and Projectile based guns, when the Client fires, does he send a Server RPC with his aim info, and then Server spawns/does the calculations using that aim info? Or do clients just tell the Server to fire and Server uses its own Camera rotation/Controller rotation state for that client?

#

I’m basically trying to decipher the steps between client shooting, and server shooting, and what information is passed off between the two

slim holly
#

you probably don't want to expose to direction to client

#

but to keep it input based

#

because in relative timeline, aim rotation and shooting have the same latency delay and are driven by same visual feedback

#

and depending the game design, you may have to do a hit confirmation on server side based on movement history

thin stratus
#

@brave moon Try to set control Rotation

#

Or stop using it

twin juniper
#

Anyone here used GameLift?

thin stratus
#

Kinda, why

elder crypt
#

I've been using Advanced Sessions Plugin and I'm able to create and join servers through steam

#

However it hasn't been taking inputs from the players after it's connected

#

Does anyone know why that might be happening?

graceful cave
#

is it possible to get the server's tickrate (as the server) from BP?

#

if not, how can i get it in c++?

#

by that i mean configured tickrate set with NetServerMaxTickRate

#

not based on world delta seconds

twin juniper
#

@thin stratus Just curious how their recurring billing works out from someone that has managed it. The pricing is not that straight forward on their page.

unique thunder
#

I finally got everything to compile (4.19) for GameLift but I can't enable the plugin πŸ€”

#

When I try, it says I have to restart UE for changes to take effect but when it starts back up, the plugin is still disabled.

meager spade
#

added it to your build.cs ?

unique thunder
#

worked ty

uncut pivot
#

AGameMode::Logout should be called when a client crashes right?

thin stratus
#

@twin juniper Cant help you with that. Only set the Service up for clients. Never used it myself so never had to pay

modern gyro
#

https://streamable.com/9tyoq its not that noticeable on the video (its extremely annoying ingame) but client1's pawn is moving choppy as its seen on listen-server window(bottom), like its trying to snap back to previous position each frame. when i launch it with dedicated server flag, both clients look choppy to each other. im not doing any advanced stuff, its just add movement input. what should i look into?

modern gyro
#

could be it

modern gyro
umbral adder
#

@thin stratus how do i connect to a beacon host with steam?

#

basically i want the connection string or the URL

thin stratus
#

@modern gyro Did you test some netsettings to see how bad it is with high ping and package loss?

#

Cause the ListenServer seeing the client laggy might really just be the bug you posted

modern gyro
#

last webm was recorded with pktlag=200

#

BUT it has same bounce with no pktlag

umbral adder
#

anybody know what type of variable is this?

#

or is this a custom made one?

#

@me please

brittle sinew
#

Looks like a custom struct.

#

@umbral adder

umbral adder
#

ok thanks

#

do you know how to get the connection string?

#

for host beacon?

brittle sinew
#

I've never worked with beacons, sorry.

umbral adder
#

ok np

modern gyro
#

@thin stratus just tested default third person template and it has exact same bouncing effect(u need to set skeletal mesh empty and add cube to it so its easier to notice), i assume im not only one experiencing this but for some reason i can't google any good solution

red ledge
#

hey guys

#

if I wanted to make a small matchmaking master server for a game that matches player based on ping and level for example then starts a server instance

#

any idea what framework would be easy to use to communicate with unreal and how I can I send and receive data between that external server and an unreal client instance?

full bane
#

web server + http requests is by far the easiest way

uncut pivot
#

lots of games use socketio

#

xmpp

#

the works

red ledge
#

@full bane web server as in a normal server maybe a C# server with Json?

full bane
#

you have to think how to interface from UE4

red ledge
#

and is it reliable? I don't want anything super fancy but I want something that is not too slow or not secure

full bane
#

and HTTP request is by far the easiest to get going without any hassle

#

so whatever can answer to http requests will do on the backend

#

otherwise you are looking for a plugin or low level socket communicaiton

red ledge
#

gotcha thank you

#

@uncut pivot socket.io that JavaScript framwork? so I have to use it with socket programming in unreal right?

full bane
#

just an a side note, sockets are usually more solid

uncut pivot
#

yeah i believe fortnite uses xmpp

full bane
#

so if you are looking for something scaleable, then xmpp probably gets you further than http request solutions does

uncut pivot
#

the project i work on uses socketio

#

with a node js back end

#

we use node for scalability

red ledge
#

yes just saw that fortnite uses xmpp

#

and so does league of legends

uncut pivot
#

xmpp is already a module in the engine

#

we had to use a plugin for socket io

#

and its had issues

#

so maybe try xmpp

red ledge
#

why did you use socketio in your project tho? just for the Node.js backend?

uncut pivot
#

i can't really disclose that

#

thats under nda

#

basically we dont want to use it anymore

red ledge
#

oh got it thanks

#

so xmpp is probably the best option longterm

uncut pivot
#

for unreal yes

#

if epic is using it

#

its probably best

#

following what epic does is never a bad idea

red ledge
#

I won't say never haha

#

but true they keep the stuff they use updated in the engine

#

what do you recommend to use it for in a small moba like game?

uncut pivot
#

can you write node

red ledge
#

not really

uncut pivot
#

you know c++ though right?

red ledge
#

yup

#

and C#

#

and python

uncut pivot
#

python could work

#

essentially you want something that can scale

#

and youd prolly want to use gamelift

#

for your servers and such

red ledge
#

yeah thought of that

#

it's easier

#

but we are not thinking on that scale

#

pretty much just doing a prototype to test if this could work

#

that's why I was looking for something simple that can be scales later

#

something I can run of a home PC with linux etc

uncut pivot
#

yeah python, C#, node

#

all good

red ledge
#

thank you that was a lot of help

#

btw can I use steam onlinesubsystem with that or no?

#

since it has stuff like a friendlist, secure connection, a store and others already implemented

uncut pivot
#

yeah you should

#

we also updated the steamworks stuff in our fork of the engine

#

you might want to do that too

red ledge
#

I will see that too thanks

#

what do you recommend to use steam for? I want to save on time and effort so I want to use it for everything possible

elder crypt
#

I need help with replicating pawn movement in my game

#

The server pawn can move perfectly fine and the client can see it

#

However when the client tries to move it's not detected at all :(

#

What should I do?

steady briar
#

so if im making a bp where some things are replicated to all, but some are only for the owning client... is it easier to just make a branch right at the start of the event, 1 goes to client, 1 is replicated? or is it more of a... bunch of switches where needed (im really bad with this)

thin stratus
#

@elder crypt Let the Client tell the Server that he wants to move the pawn

#

In addition to moving it on the Client

elder crypt
#

How would I go about doing that?

thin stratus
#

By calling a ServerRPC alongside your normal code

#

Which executes the Movement code agian on the server

#

@steady briar If you need some things only on the owning client

#

Then mark these properties as owning client

#

There are Replication Conditions for variables

#

Other than that, if you need fucntions to only execute on Client or so, then using the SwitchHasAuthority and a LocallyController + Branch right at the start is the easiest way

elder crypt
#

I tried this but I think it's completely wrong

steady briar
#

well in this case im testing with particle effects. i want some to be only for the person who overlaps, then another that all see. im getting really stuck on it

thin stratus
#

Pass the Velocity through Event @elder crypt

steady briar
#

i do have the particles activate/deactivate in a function though, so im not sure if im doing anything right

thin stratus
#

@steady briar Overlaps aren't really replication

#

They happen on all instances of the actor

steady briar
#

no the overlap doesnt have to be replicated

thin stratus
#

I know, that's not what I said

steady briar
#

ok?

#

overlap is what triggers the event though

thin stratus
#

YOu are aware that an actor, replicated or not, can exist on all players, right?

steady briar
#

sure

thin stratus
#

So if you place a block in the scene, non replicated, it exists on Server, Client 1 and Client 2

#

Now the PlayerCHaracter does so too

#

If the PlayerCharacter of Client1 runs into the block

#

the copies on server and client 2 also run into the block

#

It's less replication and more the point that theses class instances, on each player, run into the overlap

#

So your overlap is getting called everywhere and if you want to limit it to the local player who overlaps you need to check if the actor that overlaps is the local player

#

So if your Character runs into the Block, you check INSIDE of the Block, on Overlap Begin, if the OTHER ACTOR is EQUAL the GetPlayerCharacter0

#

That will only be true for the local

steady briar
#

basically i have a pickup. i want one effect to play for the player who triggers it and another effect for everyone to see

thin stratus
#

Yeah I just told you how you do that

steady briar
#

ya i got the local part that seems easy

#

but i cant get the particle to play for all clients

#

if i do an overlap check and do the GetPlayerCharacter0 and stuff, it seems like anything i try to do after that point only goes to that person, which doesnt make sense to me

thin stratus
#

The Branch you have

#

Where you plug in "Equal(OtherActor, GetPlayerCharacter0)"

#

The TRUE exec is the local player.

#

The FALSE exec is everyone else

#

@steady briar

elder crypt
#

hey man thanks so much @thin stratus :) It's working just fine

thin stratus
#

np

steady briar
#

that i did not know. ive been looking at it as a comparison like... well, true false. not thinking of false as things that failed the check

#

clearly im not a programmer

thin stratus
#

It takes time :P

#

You always need to see multiplayer as a world that is duplicated for each player

#

If there is a room with 3 players

#

That rooms exsts 3 times

steady briar
thin stratus
#

While each player has their own pawn and sees a duplicate puppet of the others

steady briar
#

so the TRUE on that branch would show to the overlapping client, the FALSE would show to everyone else?

thin stratus
#

It should yes

#

Cause if ClientA's PlayerCharacter runs in it

#

Calling it CharA

#

Then "GetPlayerCharacter0"

#

Will only return CharA on ClientA

#

For ClientB and ClientC it will return CharB and CharC

#

effectively failing the check

steady briar
#

ok that.... seems to work. damn

#

broke something completely different but....... whatever ill figure that out over a month

#

ok so... overall the lesson here is that if u do a check, the True only applies to that person. right? at least close? <_<

jolly berry
#

whats the difference between IsLocallyControlled() and just checking ROLE_AutomousProxy vs ROLE_SimulatedProxy?

thin stratus
#

@steady briar That specific check, yeah

steady briar
#

good enough for me for now, thanks

#

is a RepNotify variable checkable the same way as a non replicated variable?

jolly berry
#

nvm figured it out, IsLocallyControlled will return true as long as you have a playercontroller controlling that pawn. This can exist in any ROLE state.

#

or more specifically if we were ROLE_Authority, we could still be IsLocallyControlled, which would break our logic if we were just checking for ROLE_AutomousProxy

thin stratus
#

@steady briar Checkable?

steady briar
#

basically checking the local overlap with the repnotify bool if the object has been used

thin stratus
#

You can use that variable the same way as a non-replicated one

steady briar
#

if i add prints after, itll say used or unused, but it doesnt seem to matter

thin stratus
#

RepNotify only makes sure that the OnRep_VariableName function gets called when the client (and in BPs the Server too) receive the updated value

steady briar
#

do players nearby at the time of the switch get updated? or is it only when they enter the range of the update

thin stratus
#

Replicated Variables update when the Viewer is relevant

#

In most cases that is when being in a certain range

#

If you aren't in that range, then you don't get the update.

#

If you later come into that range, you receive the update

steady briar
#

right, so it also applies if ur standing next to it when it happens

thin stratus
#

Players joining later (or reconnecting) also receive the update

#

Yes

#

That counts for Replicated and RepNotify variables

#

RepNotify just has the nice function as addition

steady briar
#

ya im unsure how to actually test that function but thats for another day. currently trying to figure out a couple more issues. one of them is that the check always seems to be true even when it is Used (shouldnt activate)

#

im sure its something im doing stupidly

thin stratus
#

The Function just calls when the value changes

#

If SomeBoolean is true and the Server changes it to false, then it takes a few ms (or longer if lagging) for the value to be false on the client.

#

So you can't blindly assume that after the Server set the value, that it's instantly on the client

#

So if you want to call a function on the client that needs that boolean to be properly changed on teh client (even when lagging), you run into the problem of not knowing when the variable is actually replicated

#

That's what the RepNotify function does for you

#

It calls when the FALSE (or whatever other value your variable can take) value arrives over the net at the client (and server in BPs)

steady briar
#

is there something that would stop the client from getting a repnotify variable?

thin stratus
#

If relevant, then no

#

But that counts for replicated variables in general

#

as said, RepNotify only calls the function in addition

#

That's all

steady briar
#

my brain hurts a bit. thanks for the info, ive already got a few things working that ive been stuck on. plenty to go though

thin stratus
#

no biggie

steady briar
#

oh before i go i guess multiplayer is the right place (ive read a lot of people saying its only when testing dedicated server)

#

the issue seems to have nothing to do with the size of the volume

#

anyone know why they dont consider this an issue worth fixing?

graceful cave
#

is there a way to optimize spawning a lot of actors at the same time, specifically on the server?

#

it causes a tiny hitch at the moment

glacial hamlet
#

can you check your project configs and ensure the async loading check boxes are setup properly? we found in the past that this is basically not meant to be turned off anymore

glacial hamlet
#

yep, enable that top check box. We've played with this when we were faced with extremely challenging async loader thread issues with navitization and found it a bit unstable to disable the async loading thread.

#

you may have disabled it purposefully though

#

yes, unfortunately it will be a long rebuild

#

since that affects UPackages and most of core

#

πŸ‘

scarlet moat
#

I know I've already asked this but has anybody got any idea why the "create player" node would not create a second split screen? I'm trying to learn by looking at an example project that is setup for online but the usual method i use for creating players and setting up a split screen game isn't working. Yes, split screen is enabled in the project setting and also "spawn pawn" is ticked on the node, i've also checked in the level blueprint and checked for any extra camera functions that have been added. The funny thing is, is works as it should if i launch it as a standalone game πŸ˜•

weary saffron
#

Hi people! I started to study networking. I got the first problem. In template project "ThirdPerson", in blueprint "ThirdPersonCharacter" I added node: make HighRes screenshot. But the screenshot is made on all clients and server. How to make screenshot to yourself?

thin stratus
#

@weary saffron Are you testing that in the Editor?

#

Cause that might just be cause of that

strong breach
#

Im trying to get a list of all connected players but when i call GameState->PlayerArray its always empty (im calling it in my game state constructor). I also tried using the game mode but that only works on the server

weary saffron
#

@thin stratus Yes. It's important?

raven holly
#

Hello

#

I am wanting to check if a game server is online based off UDP

#

I'm needing a string to send, and a string to expect, anyone know what the IPdriver sends/expects?

#

Also what encoding does UE use in the Ipdriver?

lost inlet
#

isn't that what beacons are used for?

#

there might be a more basic ping/pong though, not sure if that's easily accessible

distant wave
#

Hello

#

When using Advanced Sessions plugin

#

if I get Current Players

#

it will always return 0

jolly siren
#

@distant wave steam?

distant wave
#

yes but nvm I talked to mordentral and he said there is steam auth problem and steam auth will be implemented in 4.20

jolly siren
#

correct

thin stratus
#

@strong breach Constructor is way too early

#

The PlayerStates add themself into the array

#

That can take a few ms

#

@weary saffron Yeah it might be cause of the editor counting as a single process?

gaunt crown
#

Any insight on how to replicate a Ball's movement? Looking at the 'Rolling Template'

weary saffron
#

@thin stratus Ok, I will try to pack the project and check out the editor.

tired sinew
#

Is it possible to replicate particle systems so that 2 games see the same ones? How should that be handled?

elder crypt
#

How would I go about making a tab menu that shows the names of players on my game?

#

Like the steam names

thin stratus
#

@tired sinew Well you can spawn them on everyone via a Multicast (if called from the Server)

#

@elder crypt You can use the PlayerArray of the GameState

#

That has PlayerStates in it

#

Which have the PlayerName

elder crypt
#

I've been trying to use that but I'm struggling with putting the information on a widget

#

It's been giving visual errors or not showing the name at all

#

wait nah I got it

#

Thanks man :)

#

I just used a "foreachloop"

dull stream
#

has anyone tried to do multiplayer such that the clients shot is always valid? for instance, the client shoots where the player appears on his machine, then server validates the damage by rewinding?

#

i know the character movement component has saved moves, so is such a thing possible? how would you go about validating the shot? any ideas?

#

or is this generally considered something thats not feasible without writing a lot of your own custom netcode

calm hound
#

@dull stream You're saying give the client authority? Sounds like you want the client to do all the work on their machine, then tell the server what they did

dull stream
#

@calm hound Essentially yes, the client is responsible for determining its aim direction and the location in which the projectile is fired

#

and when the projectile collides with the enemy, client side

#

the projectile notifies server it hit the player

#

server then rewinds the player that was hit to ensure that its a valid hit and no cheating occurred

calm hound
#

I mean, you'd be really opening yourself up to cheating to do it that way

dull stream
#

its still rewinding the player to confirm the hit is valid

calm hound
#

the amount of information the server would need to predict cheating would be the same as just doing it

dull stream
#

the rewind prevents cheating

calm hound
#

right

#

but I'm saying, if you're going to make the server rewind and do all the calculations anyways

#

why not just have the server do it in the first place?

dull stream
#

for responsiveness client side. if the client shoots and hits a player it seems very responsive

calm hound
#

Is this a competitive game or cooperative?

dull stream
#

yeah its competitive

calm hound
#

Competitive games that do it this way open themselves up to lag switching

#

the client throttles their data-packets using various software/hardware, and they dupe the server

dull stream
#

ah right

calm hound
#

the client gets the hit regardless, and then the server is told it works, and because of the latency the server has to assume it's correct because the updates of position are all off

#

What I'd recommend

#

is do it on the server, and have the client simulate it. And simply perform corrections to the client's version if it needs to

#

If the client tries to lag switch, the server holds authority. And is restricting their updates anyways

dull stream
#

thats actually the way Im doing it currently, although the corrections client side arent fully implemented yet. I was kinda exploring alternatives while Im still setting things up

calm hound
#

Yeah, unfortunately for competitive games you open yourself up to major cheats that way. Co-op it'd be fine, who cares if some one cheats really

#

but if you wanted to explore the idea, what you'd have to do is basically in an interval, send updates of where the player is ot the server

bitter oriole
#

Basically just let the server decide

dull stream
#

Ive heard that overwatch has a system similar to what i described, where the players shot is usually valid and they do a rewind to check. But theres probably some validation to prevent high lag abuse

bitter oriole
#

And simulate it locally too

calm hound
#

and the server would then say "He was here, now he's here. He can only travenl 500ft in that amount of time, but he traveled 3 miles. kick him, he was cheating"

#

but, the problem then comes down to aim bots

#

if the client does all the work, you can't predict that they aimed themselves or a computer hack did it for them and got an auto lock to the head

dull stream
#

its hard to think about all the ways people can cheat heh

calm hound
#

That's why people love to cheat. They like to try and beat the system

#

When it comes down to it

#

you don't want to risk accidently banning/kicking your players that are just really good, but not cheating

dull stream
#

right

calm hound
#

So predicting if a player has a high DPI and just is very keen to accurate movement and good shots versus an aim bot? Hard to say. That's why you try to give the server all the authority when it comes to that

bitter oriole
#

The core issue with competitive multiplayer on PC is that you can't really prevent cheats, you can only dedicate half the dev time to security, client-side anti-cheat, great dedicated servers, a report system, replay system

#

CS:GO does all of that and gets mostly decently cheat-free

calm hound
#

Yup

dull stream
#

I guess as an indie dev I can only worry so much about that sort of thing. Cheaters will cheat, I probably dont have the time or skill to really have a system as locked down as CSGO or overwatch

#

so do what i can and move on

calm hound
#

best bet is to just put up a lot of barricades to make it last a few weeks πŸ˜›

dull stream
#

heh

calm hound
#

most games are like anti-virus. They just wait till some thing comes up, then patch it

#

It's hard to predict what people will do.

bitter oriole
#

As an indie, the best is to not make a competitive game

#

Probably won't be able to stop the influx of cheaters

dull stream
#

I prefer single player games, but Im hesitant because of all the art that is necessary for single player games

#

i suppose there are certain types of games that could avoid large amount of art creation, but eh

bitter oriole
#

As an indie, MP is a tough sell

#

Competitive is a no-go because of cheaters, and because you're unlikely to ever have the required player counts for an active community

#

Cooperative boils down to enhanced single player with all the complexity of MP

dull stream
#

maybe I should just do a cooperative rofl. I dunno, something to think about for sure.

#

either way, Im learning things so at least theres that

bitter oriole
#

Competitive is very hard to pull off as an indie unless you've got serious financial backing

#

You need to be very good at multiplayer code with a robust server, you need to pay for dedis, and you need a huge marketing campaign

full bane
#

competitive multiplayer is hard mode from every side you can look at it

#

although there are some neural network cheat detection things on the way

dull stream
#

thats crazy

full bane
#

they might be able to do some heavy lifting in the future

bitter oriole
#

Neural anticheat only works if you've got millions of players, dedicated servers, a report system with active players

#

Valve did a presentation at GDC this year

#

It works really well if you're Valve and you're working on CS;GO

full bane
#

I know, that thing has 99% ban rate for aim bot

dull stream
#

wow

full bane
#

using only the report feature and then let overwatch ban people

#

you could extend this to wallhack with some heuristics

bitter oriole
#

Thing is, it only really works if you've done everything before that - great architecture, involved community, huge volume.

#

By the way their AI anticheat isn't better than humans, it's just way faster, and trains based on existing humans doing report triage

full bane
#

well, you don't have the guys that report everyone better than them messing up data

#

but 99% report to ban ratio seems legit

bitter oriole
#

You do have them

#

really, they didn't changed anything on the report system

#

They just trained an AI to detect report situations

full bane
#

I know, I watched the talk

bitter oriole
#

πŸ˜ƒ

full bane
#

but

#

given that we are at the beginning of all of that

dull stream
#

So basically what yall are saying is I need to implement a neural network cheat detection system

full bane
#

and you could easily train it to spot other hacks than aim bot based on mouse movement, I think neural network based anti cheat solutions could go a long way in the future

bitter oriole
#

No, really not @dull stream

dull stream
#

πŸ˜›

bitter oriole
#

That's only a relevant option when you have 50 million players like CS:GO does

#

Right now if you're working with a small team and if you're not super experienced in game dev, I think the best course is to avoid multiplayer, and especially competitive multiplayer

dull stream
#

Im by myself! πŸ˜ƒ

#

Im not sure if I would call myself SUPER experienced, but i have worked at a pretty big studio for a year

#

Im out of a job though unfortunately since it was contract

bitter oriole
#

That's a bummer

#

I think MP is viable when you've got the basic concepts right

#

Competitive, well, I don't want to go into that myself, I think it's a nightmare

dull stream
#

maybe competitive is too strong of a word

#

I just want a fun, multiplayer, player vs player game

#

its not like i would expect people to be playing it at gaming conventions and their to be big tournaments or anything

#

but yeah, i dunno if even that is feasible though. guess it just depends. I probably do need some single player component.

#

or cooperative

bitter oriole
#

Competitive is PVP, yeah

#

I think PVE is a fairly good middle ground because you've got much less incentive to cheat

#

If you can't make other players rage, if you can't kill them, then cheating becomes kind of a non issue

dull stream
#

yeah true, but i do worry about art creation when it comes to PvE. with PvP players can be satisfied with a couple well designed maps

#

PvE you gotta have more art, you gotta have artificial intelligence, gotta have incentives to actually fight against the environment (lots of rewards and character progression). The latter can be downplayed a bit with competitive imo.

#

theres a different set of hurdles to overcome for PvE or single player

#

which is more difficult? I dont really know. I guess single player and PvE is easier if you have the right game idea.

#

And the scope is kept reasonable.

bitter oriole
#

@dull stream I think it's very dependent on your game. Though right idea, decent execution with little content can still work in PVE

#

I often think about Besiege or Portal, games that have decent replayability & length with very little art

dull stream
#

ah, yeah those are good examples

distant wave
#

Hello

#

How do I remove network lag from my game? It doesn’t occur in PIE when checking 2 players and checking dedicated server.

#

It only occurs when I actually join my dedicated server.

#

I used network profiler. I don’t understand what it says lol

#

I need HELP

jolly siren
#

in PIE you can simulate lag with console commands

elder crypt
#

Are variables within a character separate during multiplayer?

#

For example, I have a character blueprint that has a "putts" variable and it goes up each time the player hits the ball

#

If I had two instances of the character (multiplayer) would it keep the putts separate?

unique thunder
#

Anyone using GameLift?

elder crypt
#

I've been playing around with it and there seems to be two instances of the same variable

#

How come that's happening?

#

(It's the green)

unique thunder
#

@elder crypt gamelift?

#

oh

#

nvm

elder crypt
#

nah sorry xd

umbral adder
#

does anyone know how to create a party session in cpp?

umbral adder
weary saffron
#

@thin stratus You right! Problem solved. Thank you!

ripe stratus
#

I'm taking my first attempt at a networked multiplayer game and I've been banging my head on this problem for too long -

Chess - I have a GameBoard AActor that spawns all the game pieces (APawns). The board holds the list of pieces as a TArray<GamePieceBase*>.

I have the tried putting the code to actually move the pieces everywhere and the best I can get is to have the player that happens to be the server have their movement replicated to the other player. Currently I have the movement code in the GameMode but somehow when it hits the code the list of all pieces alternates between all 32 pieces or empty.

I was under the impression that game mode only ran for the server, but somehow it looks like it's running for both clients?

thin stratus
#

It only exists on the server

#

If you try to get it on the client you will access a nullpointer

ripe stratus
#

I'm trying to wrap my head around what I'm seeing then - This array should be unchanging

thin stratus
#

You might be accessing the gamemode wrong

#

If the call comes from a client you need to make sure to server rpc in a client owned actor first

ripe stratus
#

Heh, I don't even know enough to try to ask what that means haha - it isn't in a call from the client though - it's just a timer loop inside the gamemode itself.

thin stratus
#

Did you read my compendium?

ripe stratus
#

Ah that's you!? nice

thin stratus
#

You really want read about ownership and rpcs again then

ripe stratus
#

ok thanks!

thin stratus
#

Furthermore we would need to see your code to see whats wrong

umbral adder
#

@thin stratus i have hear that there is a difference between gamesession and party session

#

is it true?

thin stratus
#

More or less

#

Depends on the service you are using

#

But in generell they are just different names

ripe stratus
#

I gotta say though - between your compendium and Looman's calss on Udemy I've made it much much further than I expected to get in a week

#

Thanks for putting that out there

thin stratus
#

Glad it helps

rose egret
#

is OnRep_MyPropertyName called on dedicated server ?

#

I read somewere it gets called but I only get client side OnRep

ripe stratus
gleaming bobcat
#

OnRep is always called only on client.

bitter oriole
#

Yup

ripe stratus
#

WOOHOO!!! After multiple long nights I have replicated movement for the first time! Thanks @thin stratus That was exactly the section I needed to look at again

thin stratus
#

That is not true though :D

#

The OnRep stuff

#

OnRep calls on the Server when doing BP stuff

#

In C++ it does not call on the Server

#

Leaving you to call it yourself

rose egret
#

@thin stratus u r right. I tested it :|
another damn question. I Spawn an actor on the Server side with Owner but on the client side Owner is null
void ARTSTestGamePlayerController::ServerOnClick_Implementation(FVector_NetQuantize traceStart, FVector_NetQuantize traceEnd)
{

FActorSpawnParameters asp;
asp.Owner = this;
auto  pMeshActor = pWorld->SpawnActor<ARTSTestRepActor>(..., asp);

}

cloud glade
#

hey hey, any good multiplayer tutorials that would be up to date?

bitter oriole
cloud glade
#

thank you Stranger

rose egret
#

what should we set as owner with Actor->SetOwner() ? Pawn or PlayerController

bitter oriole
#

That's very much up to you depending on the game

#

Do you want the object removed when the pawn is killed ?

rose egret
#

I think it differs a lot. because I used PlayerController and now the actor has valid owner on the client which has the specified PlayerController but others have null Owner

#

I think its because each player only has its own player controller

thin stratus
#

Well, you can use the Owner for references of course

#

And use the Pawn as owner if it's owned by the PC

#

To have an easier way of accessing it.

#

But nothing keeps you from just passing the Pawn ref anyway

#

I usually tend to only use the Pawn as an Owner if the Actor I spawn is actually only relevant to the Pawn's lifetime

#

Like a weapon

#

Actors that might survive the Pawn should get the PC

#

As Stranger pointed out

lean hornet
#

What would you reccomend a event tick using a tinterp to get a physics actor from a to b or a Lerp using a custom event wih a timeline ?

thin stratus
#

Timeline gives you more control

#

In my eyes

lean hornet
#

am i doing something emmensly wrong here it seems that it works worse now then when i had it hooked up to the event tick

#

(timeline is set to 0.4sec from 0-1)

rose egret
#

I got into trouble again. My pawn inherits from APawn and I change its position with AddActorLocalOffset on server side but the point is position is replicated to clients other than myself LOL

distant wave
#

bIsMoveing πŸ˜‚

calm hound
#

@dull stream There are tons of lower end cooperative games that are great. Killing Floor was nothing more than AI that went from point A to point B, got close enough? Swipe attack. Then they varried it by changing the attack and walk speeds, swapped some animations. Red Nation is a very simple top-down wave based game people loved, it was one map, and maybe 5 low-res character models. Magicka, although a bigger budget indie game, with a lot of content packed in, isn't that complex of a game either

#

People like to have fun, give them something easy to pickup, and give them a reason to play usually you don't need tons of content.

dull stream
#

Good point

#

Maybe I just think too big hah

calm hound
#

It's possible. But also, you gotta remember. You need to have fun making it as much as they have fun playing it

#

If you are trying to make a game just to sell, you need to work for a big company. Because without all the publisher money and research to help you sell, you're going to have to have something just really really fun to help be spread by word of mouth. So don't worry about pleasing the masses, worry about pleasing yourself

dull stream
#

yeah, i think thats all good advice. really i think i should focus less on making extremely robust systems unless im doing a plugin

#

im not a team of engineers, just one person heh

calm hound
#

The thing is though, you're doing it solo and you're worried about art. So you're trying to do competitive. How are you suppose to balance a competitive game by yourself?

dull stream
#

I know a good amount of devs locally, its just that I was waiting until I had good foundation first.

#

as far as the art stuff goes

calm hound
#

There are always going to be drawbacks to what you wanna make. So if you have something you genuinely want, and enjoy to make, because it's fun. You tend to think of ways around those challenges, be it art or cheating, or just accept it for what it is. But can come out with a solid game, and still maybe make a few bucks

dull stream
#

ya

calm hound
#

Best advice I ever got, was "Just get it in there"

#

Don't worry about complex systems, get some cubes for walls, a cylinder for a player model, and debug lines for weapon traces and be able to shoot each other

#

don't try and make a map full of art, and a character model, and then a weapon with animations and effects before you have gameplay

#

don't even try and make a perfect weapon system first. Just take the quickest route to be able to get the core game play in. And then refine over and over again

dull stream
#

I have reasonably solid gameplay to start with, and i can host a server and play with people. Its just a matter of polishing it and adding more content really. But honestly might post pone the whole thing, I came across some devs with a project thats supposedly near finished, so jumping on to help them push it out

#

so most of the conversation from the other day isnt a high concern anymore. things changed out of no where heh. But I'll probably come back to it because I think the game could do well

calm hound
#

Yeah, honestly. Most productive thing to do is enjoy yourself

dull stream
#

if you're curious I could send you a vid in dm

#

see what you think about it, what might work well as a finished game

calm hound
#

I mean I always like seeing what people are working on

dull stream
#

im curious what you think might be best direction to take it

proper olive
#

G'afternoon folks

stone badge
#

hey every i havequick question im learning how to create a multilayer game all is good , just when i try do add object that can pick up by the player the other players cant see the player picking them they didn't even move from there place when seen form the other player instance ? is there is any tutorial how to fix this thnxx

proper olive
#

@stone badge you'll want to do an RPC event as Server then an RPC event as Multicast to do those actions if you want everyone to see them

pearl plank
#

i am trying to pass the character reference from a client to another via gamemode. So when a client connect to the gamemode, he passes his character reference to the gamemode, where it is stored. When a new client joins the game, the gamemode gives the reference from the other to player to the second one., etc etc. The problem is that the second client sees the reference as invalid, cuz is not yet created in his instance of the game. Any idea how to work around this?

stone badge
#

ahhhh niceee thxx @proper olive

proper olive
#

@pearl plank not yet created? create it! or if it's not "yet" created, try a delay...

#

not sure what your setup is

pearl plank
#

delay does not work

proper olive
#

so what do you mean it's not created?

#

the character?

pearl plank
#

the reference is invalid cuz is not yet created in the new client instance of the game, is valid for the other client

proper olive
#

are you passing a controller or a character? controllers don't replicate from client to client

pearl plank
#

a character

proper olive
#

so you have an array of them on the game mode?

#

is it set to replicate? the array or the variable or what have you

pearl plank
#

no, is the gamemode...

proper olive
#

how many players in your game?

pearl plank
#

doesnt matter

proper olive
#

is it limited or unlimited?

#

like is it "a 2-player game" or is it like, multiplayer whatever it can handle?

#

k well anyway, I have a problem concerning AI in multiplayer if anybody has a sec

#

basically I've managed to unpossess the pawn, spawn default ai controller, use AIMoveTo and get a success/fail, destroy ai controller, and repossess using a saved reference of the controller/pawn

#

BUT..... a few seconds later, on Clients, I suddenly get no valid owner and crazy dispossession bug

#

works fine for server... I'm doing most of the operation as server RPCs

#

and it does work fine on Clients, everything is dandy, I can repossess just fine

#

but a few seconds after running around again, it gets dispossessed out of nowhere, and I'm not seeing any debug exec lines on my BPs

#

or dis-owned?

proper olive
#

I think destroying AI controller is somehow destroying the player controller? I was using it to cancel any leftover AI behavior tho

#

no that wasn't it :/

#

throwing Set Owner up with a saved reference to the player state as an actor object isn't stopping it from happening either

glacial lotus
#

Destroying actors is something that should be multicasted or is it enough if it happens on the server?

#

self-answer: enough on the server

thin stratus
#

*if Actor is replicated

#

Well the Multicast wouldn't work then either

#

But just so you get the idea

#

@glacial lotus

glacial lotus
#

@thin stratus Thanks

swift topaz
#

Will APawn::IsPlayerControlled return true if the function is called on a client?

steady briar
#

if i have a custom event that is set to not replicate or run on owning client, why does every client and server still see it?

thin stratus
#

"See"?

#

It depends on what is calling your CustomEvent

#

And if you mean the Print String message, then that's normal in PIE

proper olive
#

So any idea why my client and server are having weird possession issues when I unpossess on a Server RPC from client? The controller still operators on the character but only on the client's side - on the server's side, the character goes flying off at whatever velocity it's at when this happens, and this only happens like several seconds after I switch to AI controller, whether or not I switch back

#

controller still operates* I can still do input events and get controlled pawn

thin stratus
#

Well Possess events etc. take time to replicate

proper olive
#

and it's frozen in place on client side

thin stratus
#

Are you maybe experiencing that?

proper olive
#

perhaps, I mean the lag is significant

#

like 5 seconds later

steady briar
proper olive
#

it goes - save controller / pawn reference on pawn / controller, then unpossess, spawn default controller.... later on I reposess but even if I cut off everything at this point, the camera suddenly freezes and the character breaks a few seconds later

steady briar
#

this is what someone told me to do to set player controller, because by default i guess it doesnt like to

proper olive
#

I've put set owner to the controller every which way

#

doesn't seem to make a difference

steady briar
#

detection sphere isnt important to the server, its for visual feedback for the individual, but the server and clients 1 and 2 print it when it is set

proper olive
#

the funny thing is, Ican do a whole move-to event, it completes successfully, then I re-take control with my player and everything is moving fine

#

but then 5 seconds later freezes

#

and when it's frozen, I can still do a input event that destroys controlled pawn and respawns saved pawn, and it totally cleans it up

#

so I mean theoretically I COULD just destroy/respawn but that seems wasteful

thin stratus
#

@steady briar BeginPlay calls on every instance of course

steady briar
#

is there a better way? and it seems like its wasteful to send that info to everyone when it only matters to the individual

thin stratus
#

What are you doing there anyway

#

A Pawn, when being spawned, belongs to no one

#

So you can't know who the individual is who owns it

#

Also ownership has to be set via Server

steady briar
#

well someone a while back helped me with this to set the player controller

thin stratus
#

What

#

You simply possess the Pawn from ServerSide

#

That already does everything you need

#

That results in the Pawn being owned by the Controller

#

As well as things like "GetController" to return the PlayerController of the Player (on owning client and server)

#

And that part

#

if you only need that on XY, then limit the BP call

#

If it needs to be set via the Server, then use SwitchHasAuthority

#

If you need it to happen on the owning client, then BeginPlay is wrong

#

Then you need to use the Possessed Event and perform a ClientRPC there

steady briar
#

basically it is just a stat like any other (health or whatever)

#

it will be adjusted by other stats later on, so i guess the server just needs to calculate and set it to avoid exploiting it

#

so should i just delete that mess about the player controller?

thin stratus
#

I would

#

And if it's a stat, then move it to the PlayerState

#

And set it to replicate

#

Well, PlayerState if it's really just a stat

#

If it's relevant for the Character, then leave it in it

#

In when you set it just make sure it's on the Server

#

e.g. Switch has Authority

steady briar
#

hmm...

#

where is the default playerstate? it cant browse to it. i made a new bp based off it but no idea what it should look like

thin stratus
#

These classes are setup in the GameMode

#

Read my compendium for that please

steady briar
#

ok if something is for the character and not playerstate, event beginplay is bad to initialize stuff?

jagged goblet
#

Why is it that when I launch from character blueprint I get smooth normal behavior and when I launch from the main editor page my client teleports all over the place? What's the difference?

twin juniper
#

Hi, I need to get local HUD on the clients that are connected to dedicated server

#

void UMyActorComponent::BeginPlay()
{
Super::BeginPlay();
if (GetWorld() != nullptr)
{
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PlayerController = Iterator->Get();
AMyHUD* MyHUD = Cast<AMyHUD>(PlayerController->GetHUD());
if (MyHUD != nullptr)
{
//Do stuff
}
}
}
}

#

how to do that correctly? I want to do that from an Actor

#

atm this does not work on the clients, HUDs are NULL it seems

unique thunder
#

Do you guys package your game builds while the project & engine are built with the 'Development Server' solution config?

#

I'm getting package errors regarding WMF Media Player when I use VS 2017 and I try to package the game with the Dev Server config

thin stratus
#

@unique thunder The Engine needs to be Editor, not Server

#

And the Project needs both and then packaged for Dev. After that you have to grab the Server binaries from the Server Build and put it into the Binaries Folder of the Package

#

You might also want to look into the frontend

#

@twin juniper HUDs are local, they dont exist on the Server

#

In your function instead or directly accessing the HUD, you need to perform a ClientRPC on the Controller first.

#

Also make sure to limit the BeginPlay call to the Server

unique thunder
#

@thin stratus Can I build the server files without building the engine under Development Editor using commands? I found something like that, just not sure if I need the right config built and then re-built as editor for working

thin stratus
#

The engine should stay as dev editor

unique thunder
#

Great, thank you

late violet
#

Hey, new to Unreal, and coming over from Unity.
Been playing with networking in Unreal for a while now, and have a PlayerController that can possess 3 different pawns (they handle input differently, so I take the input in my PC and send the data to the pawns).
When I run in single player, all 3 pawns are there, and disabled, and when I possess one, it becomes active and the old one disables.
When I turn on networking (I've setup all of the RPCs to possess on the server) only the possessed pawn is replicated.
However, when I possess a new pawn, the old pawn stays active for a while (about 2-3 seconds) before being destroyed on the client. Is this normal, or am I doing something really stupid?

proper olive
#

^ I'm having similar issues, not the same problem, but when I switch from player control to AI control, a few seconds later the pawn does all sorts of weird stuff, moving around jittery and receiving input from controller but no movement

#

but only on client-side. Server works fine. Are you spawning default controllers for the pawns when you unpossess them, @late violet ?

late violet
#

No, just using "Possess(m_otherPawn)"

#

I got to run out of the office now but will be around tomorrow

proper olive
#

And can anyone help elucidate me on UMG usage in multiplayer? It seems like nothing wants to replicate when passed through a UMG window, but UMG windows are like 90% of user-interaction so what's the best method for say passing an actor reference so I can trigger events on it from the UMG blueprint?

cold sparrow
#

does anyone know if multicast event will work beyond net cull distance?

#

I mean if a far player will receive it

bitter oriole
#

@proper olive UMG should not deal with anything replication

#

You need to build your UI as a persistent, player-owned thing that looks at gameplay objects and responds appropriately

proper olive
#

@cold sparrow there's a bug where when you multicast a variable, it gets set temporarily (like 2 or 3 seconds) on everybody even beyond net cull distance before being voided out

#

makes my overhead chat visible across the map πŸ˜„

#

@bitter oriole but how am I supposed to look at gameplay objects and act on them if they're not replicated?

bitter oriole
#

Gameplay objects (actors) are the one to be replicated

proper olive
#

I'm doing things like making entire events on the pawn with saved variables just to accomplish the most basic tasks

bitter oriole
#

Not your UI

proper olive
#

right but what about when I save a variable to the UMG

#

and then try to pass that variable to something else

cold sparrow
#

yes, I need to make sure that RPC is called even beyond net cull distance

proper olive
#

like an actor reference

bitter oriole
#

Your UI shouldn't store data.

#

It should just display it

proper olive
#

ok

#

even actor references 😦

bitter oriole
#

Well, your UI will have to store some data - but data that is relevant to other players ? I don't think so

proper olive
#

so like when I talk to an NPC, I can't just have the widget tell that NPC to play an animation based on your response, I have to tell the owning player to get a saved reference to that NPC and play it from there

#

somewhere on the pawn or whatever, will make keeping track of various NPCs talking a pain

bitter oriole
#

If you want the NPC to animate remotely on other clients based on what you're doing, then yeah, that animation state should be replicated on the NPC, and the NPC will need to store a reference to the player it's talking to - something like that

#

But you don't want the UI doing that

#

I would advise keeping UI dumb, and stateless

proper olive
#

😒

#

lol

#

thanks for your help again, @bitter oriole

bitter oriole
#

You're welcome

#

For what it's worth plenty of games don't replicate NPS talks

proper olive
#

yeah that's lame πŸ˜„

#

jk jk

bitter oriole
#

It is kind of lame

#

One less thing to implement though πŸ˜ƒ

proper olive
#

lol there's so many little things like that like "oh well I see why most games don't do a FPS/Third person switch, it's a pain in the ass" πŸ˜„

#

Ideally I want NPCs to be persistent in the world so I'll have to keep track of it like "currently talking to NPC"

#

but to make a complex scenario with scripted NPCs and dialog choices....

#

it's almost like I'd be better off using overlap volumes to choose your dialog πŸ˜‚

#

"walk over to the rebels to give a speech, walk over to the guards to ... uuhh, give a different speech" etc

#

or maybe like input events for number keys so you can just trigger responses straight from the controller and skip UMG buttons all-together

#

er altho then idk how I'd do the actor reference, whatever. Any other cool ideas?

cold sparrow
#

you should be able to pass information to NPC from UMG, like you select a button and NPC does something

#

and all other clients see it

proper olive
#

in order to pass it to the NPC, I need a reference to the NPC

cold sparrow
#

you already have it

proper olive
#

and any replicated references on UMG to server owned characters come through as invalid

#

I have to save the reference on the player character basically

cold sparrow
#

right, you call function on your character, you character will call function on the server, the server will execute event on NPC. where will you get NPC's reference - you already have it on your client.

#

Unreal does not pass references, like pointers. Instead it passes GUIDs, all cleints will have the same guids if they were created by the server and replicated.

#

so, you do have a reference to your NPC on your client.

#

then in your NPC you call multicast to all clients to play this or that animation, set variables, etc.

proper olive
#

right that's what I was saying, gotta store the reference on the player pawn which is kind of annoying. Can I at least access that variable from the UMG if I set it on the pawn ahead of time? Maybe that's the step I'm missing that makes it all make sense

cold sparrow
#

you can resolve it: get player controller - get controlled pawn - cast to your character

proper olive
#

so the replicated references can be accessed from the UMG, you just have to store them elsewhere

#

I'll try it out as soon as I fix my diving animation πŸ˜„

steady briar
#

so functionality like pressing a button to do something/open a door or something... that should be in player controller? i currently have it in the character so that might be wrong <_<

echo geode
#

Is there anyone have knowledge about UReplicationDriver class?

cold sparrow
#

you do not really need to place anything game logic related to the player controller.

gleaming vector
#

@echo geode i have been reading it's code but it's very new so I doubt anyone has any hands on experience with it

cold sparrow
#

@steady briar , you place all that logic into your character and pass it to the server to do actions.

echo geode
#

@gleaming vector What do you understand from the code? A graph that consists of actor replication with UNetConnection objects?

gleaming vector
#

well, it lets you control who sees what and how often things are replicated

#

atleast the ReplicationDriver does that

#

the Graph is an implementation of it that builds a workable graph to quickly determine if an actor is relevant

#

and how to replicate it

#

I haven't really gotten beyond that high level understanding

#

i dont know how they walk through the graph, or anything about it's topology or rules

echo geode
#

I activated the plugin. Still have no idea how to use it.

gleaming vector
#

oh, you just change a config somewhere

#

the header for ReplicationDriver should have an example

#

it's well commented

echo geode
#

I still have no idea how to use it.

#

@gleaming vector Probaly it is not related with changing player's Server/Client model

#

Is there any mechanism that every player behave like a server?

cold sparrow
#

I did some experiments for RPC: RPCs are being called regardless of net culling settings.

gleaming vector
#

it has nothing to do with changing the server/client model, no

#

what this does is it allows you to change the way the server decides how to replicate objects to clients

#

it's like one step above NetDriver, which does the socket layer

#

but it's below NetworkChannels, which are what emits replication state

echo geode
#

Yeah, its server-only. I think i have no chance to behave a client and server tasks. Thanks for information @gleaming vector

gleaming vector
#

nah, the server/client authority model is baked into every part of the design of the engine

#

that would be a ... project ... to change

elder crypt
#

I've been looking everywhere for answers to this but I haven't really found any

#

I have a vague understanding of how the player array works but does anyone know exactly what it is?

#

Also is there a way to access the playerstate and add varaibles to it?

#

Thanks!

thin stratus
#

What do you want to know?

#

It's an array of PlayerStates

#

PlayerState is available from the PlayerController

#

And from possessed pawns

elder crypt
#

@thin stratus Sorry for the late reply. I was wondering how I could add new playerstates that could be accessed from the player array

#

I want to do the same thing shown in the picture but instead of "player name" have my own variable, such as the player's score

thin stratus
#

You create a bp with PlayerState as parent class

#

You can then set that class in your own GameMode class

#

In the class defaults

#

Similar to a character for example

#

@elder crypt

elder crypt
#

So I'd create the variable inside of the playerstate blueprint that I created, correct?

#

and I just set it as the player state class

thin stratus
#

Yeah you can create your own variable in the PlayerState

elder crypt
#

and with my understanding it'd be already replicated to all players, right?

#

My issue is that I want one player hit a golf ball and have it be shown on the scoreboard

#

I have the variable be "putts" But I'm not sure how I'd call for it in the scoreboard

#

I'm not sure how I'd call for the variable, I suppose

#

That's where I'm mainly confused

#

The image above is what I use for getting the names, and that works perfectly fine

twin vault
#

anyway to check if the code is being executed on client or server if the actor is not replicated?

late violet
#

In Blueprint, there is the HasAuthority, which has Remote or Local

twin vault
#

HasAuthority returns true on non-replicated actors

#

on clients

late violet
#

Oh good point, there is the "Is Server" but I'm not sure what that will return in this case

twin vault
#

oh true didnt remember that node

tropic snow
#

Currently I'm using play sound at set location. In multiplayer other players can hear me as if I was next to them while I'm on the other side of the map. Anyone know how to fix this?

grand kestrel
#

You're not like.. using Get Player Character (0) or something weird like that?