#multiplayer

1 messages ยท Page 398 of 1

chrome bay
#

I'm not sure how true that is ๐Ÿ˜›

wary willow
#

But, otherwise, afaik ues

#

Yes

thin stratus
#

Well you would actually ask Devero

wary willow
#

Yeah, I have his plugin

thin stratus
#

James is great overall, but Devero did the plugin after all

chrome bay
#

Devero made the Steam Party plugin

wary willow
#

Steam Party

#

Aye, no need to mess with that shit

#

ezpz

thin stratus
#

But to answer the question anyway @meager spade Are you talking about a Party where you invite Friends from Steam and then queue up for a game

#

Like Overwatch, LoL, etc.?

chrome bay
#

The actual "party beacons" however don't work in UE4 out of the box, you need your own OSS to talk to them. But you can use the other beacons and kinda "fake" it

thin stratus
#

Or an InGame Party, what most RPGs have?

#

There are some already existing Beacon classes, that implement some basics for Lobby or Party

meager spade
#

Okay it's just I have been scouring the source code and see that there is a class called party beacons and was just wondering if that's what it is

#

Yeah exactly like that

chrome bay
#

Lobby Beacons that was the one

meager spade
#

Like overwatch and fortnite etc

thin stratus
#

But you can also go one step back and inherit from the parent of these

#

And implement your own

chrome bay
#

Party Beacons are unusable, they need some kind of custom server backend to make them work. Lobby Beacons work well though, that's what Steam Party uses

thin stratus
#

Just imagine a Beacon as a steady connection that allows to replicate data and send RPCs, but doesn't need the players to be on the same server/Map

chrome bay
#

Party Beacons are typically used for matchmaking too. UT uses them for that.

thin stratus
#

Yeah in the End, Lobby or Party beacons just have some code for you already to toy around with

#

You can, as said, just do that yourself

#

It's zero magic involved

#

If you understand C++ and the general RPCs stuff, then Beacons will work for you

#

Beacons + Steam can be a bit annoying though

hollow pulsar
#

cedric I accidentally gave an Incorrect screenshot this is where my weapons are spawned the other one was just swapping between them.

meager spade
#

So I need to be looking into lobby beacons not the party beacons

thin stratus
#

Specially since the Subsystems find it funny to put header files for types into private folders

hollow pulsar
thin stratus
#

@hollow pulsar Ah awesome, you are already assigning an owner

#

Is this 100% called only on the Server?

hollow pulsar
#

I think its only called by the client

thin stratus
#

Then you can technically skip steps 2 and 3

#

Well then please make sure it's called on the server

#

And also adjust your "EquipWeapon" functions

#

You NEED to move from Client to Server

#

Not other way round

#

Server calling a ServerRPC is okay, as it will call it like a normal event

#

But generally, INPUT happens on Clients

#

So a button press is always a client (or listenServer, but that's special case)

#

And if you want something to happen for everyone/server, you need to call a ServerRPC after the Input

#

You can handle some stuff already local, to limit the lag delay for the client who pressed the button

#

but most stuff goes over to the server who then calls your important code and replicates it to everyone

#

Anyway, gotta go. Pets need attention

hollow pulsar
#

ty for the help ๐Ÿ˜„

fleet raven
#

isn't it great how failing to connect to a server destroys the main menu and reloads it for no reason

ripe raptor
#

Anyone know what these are?

#
[2018.05.29-14.13.23:801][ 95]LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 8```
glossy vessel
#

How can i make sure the client has traveled correctly to prevent replicating actors before level transitions are done, etc. Both if (NetDriver->IsLevelInitializedForActor(this, NetDriver->ClientConnections[i])) and if (NetDriver->ClientConnections[i]->ClientWorldPackageName == GetWorld()->GetOutermost()->GetFName() && NetDriver->ClientConnections[i]->ClientHasInitializedLevelFor(this)) are private functions

glossy vessel
#

Found it GetClientWorldPackageName() . Dunno how i missed that :/

graceful cave
#

is there a way to change the way client updates the character's location when it was changed on the server?

#

it just abruptly teleports them

#

when launched, for example

#

both gifs are 150 ping

#

quake goes through whatever movement you missed while the server was moving your character and plays through it really fast

#

makes it a lot less jarring

#

only solution ive found so far is to have the client launch itself whenever it gets the RPC saying it was hit and tell the server to launch the character with it

#

but then you have the problem of shooting a player and then the knockback being delayed by their ping

#

i wonder if disabling movement replication and doing it manually via an RPC called on tick would be a solution, that way i can control how it gets updated

daring arch
#

yo, quick question

#

how do I make a dedicated server?

bitter lintel
#

Is
GetOwner() == UGameplayStatics::GetPlayerController(GetWorld(), 0)
the best way to tell who the owner of an actor is?

carmine frost
#

that compares the owner to the first playercontroller in the game. If you are on the client, this is usually fine. But if you have a multiplayer game, on the server you will have multiple playercontrollers, so comparing against the first one may not be correct

bitter lintel
#

@carmine frost Thanks! Would you happen to know how it sends messages over for things like the default BallController or FlyingController since there appears to be no owners at all from checking this way on client or server?

carmine frost
#

No, I'm not sure what those are

bitter lintel
#

Any of the default controllers seems to operate with no owners. It's weird.

carmine frost
#

controllers don't have owners

#

they are the top of the owner chain

bitter lintel
#

I mean, like ballController or ThirdPersonController, those are PlayerControllers?

#

They seem to be pawns, sorry about my terminology.

carmine frost
#

Are you sure it's called ThirdPersonController, not ThirdPersonCharacter?

bitter lintel
#

It probably is a Character. It's definitely just a pawn at least. Weird that they have no owners though.

carmine frost
#

only pawns that have been possessed have owners. then only on the server or owning client

bitter lintel
#

SetOwner() is being possesed?

carmine frost
#

because controllers exist only on the server and owning client (i.e. on your client, you won't have controllers for remote players)

#

no, in the process of possessing a pawn, the controller calls SetOwner on the pawn

#

and when a controller's pawn is replicated, it sets itself as the owner on the owning client

bitter lintel
#

Default spawning with the pawn doesn't have an owner though and still somehow sends it's network messages over.

carmine frost
#

it won't have an owner right away

#

i assume you're checking in someplace like BeginPlay

low obsidian
#

Hi, Does anyone know if it is possible to have a session with multiple maps on each session?

carmine frost
#

but it won't have an owner, because the owner isn't set until the controller's "Pawn" property is replicated down. Which will happen very quickly, but some time will pass (a few ticks, maybe) before that happens

bitter lintel
#

@carmine frost No, I'm checking in Tick() and (GetOwner() == UGameplayStatics::GetPlayerController(GetWorld(), 0)) is not true on server or client ever.

#

Just using the Default FlyingCharacter scene right now.

carmine frost
#

then you must be checking something other than the primary controller's pawn

#

in game, just open the console and type 'getall pawn owner'

#

and it should show you all the pawns and their owner

#

then you can compare that list against the result of 'getall pawn controller'

bitter lintel
#

@carmine frost Where should the list show up?

carmine frost
#

open the console by pressing the console key (`) twice

bitter lintel
#

i don't get anything

#

which would make sense

#

Since that is what the code is telling me.

#

I'm just checking the default Character that gets placed in all of these example scenes when you load into it. Then if you go to Number of Players: 2. Then it replicates movement and everything all fine and accepts input but there is no owner.

carmine frost
#

I guess I'd need to try out that sample to understand what it's doing. The fact that you have no pawns, but you're still "driving" something is odd

#

or at least, unexpected

bitter lintel
#

Good, that's what I thought too.

#

I thought I was going crazy.

#

I'm making a plugin that replicates movement across the network for client owned or server owned objects but there just is no owner to base it off of when people spawn like this.

#

I'm trying to figure out how Unreal even knows who the owner is when there is literally no owner.

lean hornet
#

im currently trying to test my game project wich port does unreal have and wich do i need to forward ?

twin juniper
#

@lean hornet i set this up some time ago to work with multi testing. here is my setup.

lean hornet
#

@twin juniper thank you

#

imma try that

#

Locally it worked all fine just connecting over network doesnt wrok

twin juniper
#

yeah. i am moving to full dedicated soon. gonna be using amazon aws ec2. excited ๐Ÿ˜ƒ

#

someone on here actually gave me advice on how to do it lol. full circle man.

lean hornet
#

Nice ^^

twin juniper
#

what goes around comes around ๐Ÿ˜ƒ

#

yeah

tropic fjord
#

Hey, guys. I've got a question... I followed this guide for setting up a dedicated server for me 'n others to play around

#

I got the log 'n everything running. The level was loaded, etc.

#

but when I start my project 'n load in as a player, it doesn't show me joining in the log

#

when I start up a second, they can't see one another

#

so I feel like the server setup isn't correct, but I have no idea why ๐Ÿ˜ญ

granite jolt
#

are you sure the dedicated server build and client builds match? If they differ, there is a kind of crc check to make sure that basically stops it connecting

twin juniper
#

@tropic fjord go to (path to your engine build)\UnrealEngine-4.19.2-release\Engine\Binaries\Win64

try running UE4Editor.exe "U:\UnrealProjects\MyProject\MyProject.uproject" -server -game -log with commandline

to see if you are able to create the dedicated server properly and that you are able to join locally. i used this same setup and it worked for me when i tried it a few months ago.

#

make sure to use an open level node on the client you are connecting to the main IP with, and don't forget to setup port forwarding for 7777 (i posted a pic about this above). those steps are in the guide though. so just thoroughly follow all guide steps. should work.

tropic fjord
#

@twin juniper Thanks, it's working โค

twin juniper
#

welcome

mystic field
#

Kind of messing around with multiplayer functionality. I want to make the player pawn movement server based.

#

What would the "target" pin be?

bitter lintel
#

Anyone know why
GetOwner() == UGameplayStatics::GetPlayerController(GetWorld(), 0)
is always false when putting it on the pawn in any of the default scenes and having it replicate?

#

Is that not how you check ownership?

low obsidian
#

Does anyone know how to get servertravel to work in multiplayer in 4.19?

#

it works in 4.18 but in 4.19 I can only get it to work in single player

winged badger
#

@bitter lintel that will return different results on clients and server

#

or at least, might, on client PlayerController[0] is the only PC - local one

#

on server tho... its unlikely to be the same one

bitter lintel
#

Yeah, I know about server and client ownership, it's not owner on either.

#

PlayerController[1] is also not an owner of anything.

winged badger
#

what is the context of that line of code, which class is it in?

bitter lintel
#

an actor component I put on the default pawn

winged badger
#

which makes the Pawn the component's Owner

bitter lintel
#

i just check in TickComponent() every frame

winged badger
#

try GetOwner()->GetController()

bitter lintel
#

GetInstigatorController()?

winged badger
#

with all appropriate null pointer checks, because that is likely to crash if it runs early enough

bitter lintel
#

I don't see GetControlelr as an option

winged badger
#

ah yes, you'll also need to cast the owner to Pawn

bitter lintel
#

Ah, ok

winged badger
#

so Cast<APawn>(GetOwner())->GetController()

#

mind you that is AController reference so its good for checking if it is a PlayerController[0] for example, but not for accessing any PC specific functionality

hollow pulsar
#

How would I go about replicating the action my widget preforms to everyone?

winged badger
#

@mystic field, most of the pawn movement works out of the box in network scenarios

#

you just need to ConsumeInput, and the engine will take care of the rest

bitter lintel
#

@winged badger It works! Thanks a ton.

winged badger
#

@hollow pulsar any actions from user input, along with the any interaction with the UI is executed on client

#

you can use anything attached to the PlayerController to send a Server RPC

#

from most Widgets it is easy to grab a PC reference with GetOwningPlayer or Pawn with GetOwningPlayerPawn, or HUD

#

those can all run a Server RPC, however widget can't since there is no equivalent of it on the server, UI is local only

hollow pulsar
#

So I need to call an event inside the player controller instead of from my widget?

winged badger
#

so your ButtonClick->(Get a PC and run a Server replicated event/function on it)->Whatever is on the other end of that event/function executes on server

#

and i suspect you can take it from here

hollow pulsar
#

PC in the example is player controller right?

winged badger
#

yes

hollow pulsar
#

Alright I'll see if this helps! ๐Ÿ˜„

winged badger
#

it doesn't have to be the best place for it

#

use your best judgement, plenty of stuff that can run it (Pawn, HUD, PlayerState)

#

but it will work

#

actually, correction

#

HUD exists only locally as well, so it can't be used for RPCs

hollow pulsar
winged badger
#

not sure WeaponItemReference index will have any meaning on the server

#

but that depends on the setup you have, which i do not know

#

but basically

#

you make a custom event in the PlayerController, for example

#

you make it Replicated to Server

#

you add inputs to it for any information you have to transfer

#

and then you just call it with PlayerController target directly from OnButtonClicked

meager spade
#

whoops delayed ๐Ÿ˜„

winged badger
#

GBM i think it was

#

whatever that is

hollow pulsar
#

Ok so UI cant exist on server right?

winged badger
#

if its a listen server

#

it will exist for that particular player only

#

there are quite a few things that are not shared over network, Erebel posted a picture with Game Framework classes and how they interact, and its pinned on this channel

meager spade
#

@winged badger i am getting the hang of this ability system in UE4, still a lot i don't know but i am getting there ๐Ÿ˜ƒ

bold ravine
#

I need help

#

Server can fire and client will see it too, but when client fires server cannot see it

winged badger
#

because all input actions are executed locally

#

you need input action fire -> Server RPC fire

bold ravine
#

im relatively new, can you elaborate

winged badger
#

server has no way of knowing you're holding down your RMB

#

only your local machine knows that

#

and you set those as input actions in ProjectSettings->Input

bold ravine
#

How would i execute on the server

winged badger
#

that lets you use the InputActionFire node from objects that have access to your InputComponent

#

namely, your PlayerController and its possessed Pawn

bold ravine
#

Bottom is for the input

meager spade
#

@bold ravine also you need to decide how much you want to run on the client and the server, if you want pure safety, then run the whole Fire routine on the server, if you don't you can only run the parts you need to on the server to replicate it, like muzzle effects, etc

winged badger
#

not Multicast

#

replicated to Server

#

Multicast works only from the Server

bold ravine
#

That way the client cant see its own firing

winged badger
#

so, simplest solution (mind you, far from optimized one) is to RPC it to server first, then Multicast from there

bitter lintel
#

@winged badger Do you know of a way I can check ownership more generally. I can't seem to dip out of this <Pawn> casting early enough for it to not NULL out on me when it's not a Pawn.

bold ravine
#

Never heard of RPC before, how would i do that?

winged badger
#

as long as component is attached to a Pawn, it will not be null

meager spade
bitter lintel
#

Yeah, I'm just trying to make a general component. I might have to do some checking if it's a pawn or not a pawn probably?

winged badger
#

@bold ravine i recommend reading the Cedric's networkign bible, its pinned on this channel

meager spade
#

@bold ravine ^

hollow pulsar
#

Its a very good read

meager spade
#

wait

winged badger
#

you won't get too far without a more broad understanding of networking

meager spade
bold ravine
#

Thanks

bitter lintel
#

@winged badger Sorry if you saw this and were just trying to stop helping people, lol.
I'm just trying to make a general actor component that gets the owner. Are you saying I'll have a bunch of different ways to tell who the owner is based on if it's a Pawn, or a child Actor, or a regular Actor, or some other thing I'm probably missing?

winged badger
#

why do you need the Controller?

bitter lintel
#

I'm trying to tell who the owner is.

#

I'm making an actor component plugin that syncs transforms across the network based on who the owner is.

winged badger
#

GetOwner() will return an AActor reference

#

however, only Actors that can be possessed by your PlayerController are also Pawns

#

so if that cast fails, its not possessed by the PC to begin with

hollow pulsar
winged badger
#

there is also a Pawn function IsLocallyControlled which will check if there is a PlayerController AND if its a local one (it will return false if a listen server host querries a PlayerCharacter that is not its own)

bitter lintel
#

Can't you just place a ball in a level that's replicated and that's not controlled by anyone (but is actually owned by the server) and have it roll around?

meager spade
#

all actors spawned without a controller and set to replicated will be replicated

#

if the server spawns them

bitter lintel
#

But how do you check the owner?

#

I'm having difficulties checking the owner of an object I place an actor component on.

winged badger
#

i never needed to find an Owner for a generic Actor

bitter lintel
#

If it's a pawn, I check one way, if it's not, I check a different way?

#

Ah, ok.

meager spade
#

nor have i

bitter lintel
#

Thanks both of you. I learned a bit for sure!

winged badger
#

if you still insist on it, if your Cast to Pawn fails

#

its not a PlayerControlled Actor

#

and if it succeeds then you can check the Controller

bitter lintel
#

It's nulling out on me, I can't seem to get out early enough.

#

(GetOwner() && Cast<APawn>(GetOwner())->GetController() &&
Cast<APawn>(GetOwner())->GetController() == UGameplayStatics::GetPlayerController(GetWorld(), 0))

#

Which makes the whole editor crash.

meager spade
#

that's a big if call

winged badger
#

you are accessing GetController without checking Pawn for null first

bitter lintel
#

oh, just the general cast

#

duh

#

thanks dude!

winged badger
#

oh and @hollow pulsar - DO NOT Multicast from a PlayerController

#

just figured you might be going in that direction, ignore me if you weren't

meager spade
#

think my shader compiler is broken :/

#

stuck on compiling shaders

winged badger
#

it would disconnect every client that doesn't have its own't copy of the PlayerController you are multicasting from

meager spade
#

yeah PlayerController only exists on owning client and server, no other client can see anyone else's PlayerController

#

bad times be had ๐Ÿ˜„

winged badger
#

so only scenario in which Multicast from PC wouldn't break anything is if you had server + 1 client, and client was initiating the Multicast

meager spade
#

brb restarting pc ๐Ÿ˜„

wide chasm
#

How do I get the local pawn????? Please give me a simple way to get the local pawn in a multiplayer game. @wide chasm

winged badger
#

you can get the LocalPlayerController via GameInstance

#

and take it from there

#

if you already have a Pawn reference and want to know if its local tho - Pawn function IsLocallyControlled will do the trick

wide chasm
#

I can't find that function, its weird

#

Wait

#

Nvm ty, I found it when turned of content sensitive

meager spade
#

where you trying to access it?

#

oh right

copper portal
#

Hi everyone! I need some help to make a win system for when a player has collided with a collision box in another player's bp for a certain amount of times. If you know how to help me with this, please PM me

winged badger
#

anything done locally would be sensitive to cheats @copper portal

#

so you have to count your collisions on server only

#

if you are displaying scores as the game goes along, PlayerState would be a good place to store that information

copper portal
#

I dont understand

winged badger
#

you probably do not want your clients to report to server that they collided with the target box

#

because that information could be hacked

copper portal
#

so how would I setup a collision event?

winged badger
#

so OnTargetBoxBeginOverlap, you do HasAuthority check

tawny parcel
#

Is there a way to test 'OnPostLogin' events in editor?

winged badger
#

and if its server, you add a point to OtherActor's PlayerState

copper portal
#

what do you mean by that @winged badger

#

like the player state

winged badger
#

there is a PlayerState class

#

you can set it from either a GameMode or PlayerController, don't recall exactly

copper portal
#

should I create a custom one?

winged badger
#

yes, and create variable to keep the score, and make it replicate

#

you can access the PlayerState from Pawn, or PC with just GetPlayerState (you will need a cast to access your custom functionality here)

#

it replicates by default

#

and GameState, which also replicates by default holds an array of PlayerStates

#

so you can easily access them from anywhere

#

the purpose of the PlayerState class is to hold publicly available information about your players and/or Pawns with enough significance to warrant having one

#

so everyone can read it

copper portal
#

ok so I casted to my player state and I created a variable thats replicated so now I just need to ++?

winged badger
#

when overlap happens, yes, and only if it happens on server

copper portal
#

k

winged badger
#

type Authority into your context menu, and you will see one switch there

#

with outputs for Client and Server

copper portal
#

I have game modes for the amount of wins and im wondering where to check if the minimum amount of collisions it takes to win the game has been exceeded. should it be after the switch has authority or before?

winged badger
#

you create a function in your PlayerState, ideally

#

it increments the Points variable

#

and it checks if number of points are sufficient to win

copper portal
#

if I do a custom event does it have to be run on server?

winged badger
#

so you have say, ScorePoint function in PlayerState that adds a point and checks for a win

copper portal
#

or multicast and then run on server

winged badger
#

anything called after a switch authority Server

#

happens on server

copper portal
#

is replicated?

winged badger
#

and only on server

copper portal
#

o

#

so I dont need to do anything with the event?

winged badger
#

you should also read the Cedric bible for networking ๐Ÿ˜‰

copper portal
#

ty

winged badger
#

when you are a client, there isn't just one PlayerPawn for you

#

server has one, and all other clients have it too

#

and those are separate object that share the same NetID

#

allowing them to be referenced via network

bitter lintel
#

How do I get the owner of an actor that is already in the level and replicated? Would it automatically have an owner?

winged badger
#

so when your Overlap event happens, Switch has authority will ensure whatever comes after executes only on server copy of that Pawn

#

what for @bitter lintel ?

bitter lintel
#

I place a sphere in a level, I have an actor component on it and I want to get the owner.

winged badger
#

and Owner of the component is the Sphere

bitter lintel
#

GetOwner()->GetOwner() gets me the player controller then?

winged badger
#

no, it gets you the Sphere Actor

bitter lintel
#

How do I check the owner of the sphere actor?

winged badger
#

why?

#

what do you want to do with that information?

bitter lintel
#

I'm basically making a replacement of Replicates Movement, but I'm having a big problem with who owns what, lol.

#

I want to either send out an RPC or not based on if it's the owner.

winged badger
#

if its the client version of the Sphere

#

you can't send a RPC unless its attached to your PlayerController

bitter lintel
#

Ownership?

#

Or like literally a child of the player controller?

winged badger
#

it can be possessed by it, attached to something in its chain

#

actor attached to possessed Pawn could send a RPC

#

or any of their components

bitter lintel
#

SetOwner()?

#

I can send RPCs by doing that.

#

I thought.

winged badger
#

if (Role == ROLE_AutonomousProxy)

#

i don't know how that is done in BP tho

bitter lintel
#

I don't use BP.

winged badger
#

then that should work

bitter lintel
#

Should work for what?

winged badger
#

anything attached to a PC will have GetNetRole() == ROLE_AutonomousProxy

#

on clients

bitter lintel
#

But how do I tell who owns it?

#

nm maybe

winged badger
#

anything not attached will have ROLE_SimulatedProxy

bitter lintel
#

To the client PC?

winged badger
#

and anything on server will have ROLE_Authority

#

regardless of what its attached to

bitter lintel
#

But I need to find the owner. No?

winged badger
#

i'd have to read the GetNetRole() to answer that

#

but i think it should work out of the box

copper portal
#

something is not working @winged badger

#

it seems like its not adding anything to the score

winged badger
#

PrintString everything along the execution path

copper portal
#

yeah ik

winged badger
#

and see where it breaks

copper portal
#

it breaks on the event

#

oh I see where it breaks

#

its not finding the session property

#

oh I see y

#

I think it works now

#

How can I get the name of the player that won? @winged badger

warped trail
#

My dudes. Can anyone recommend a good starter tutorial for setting up multiplayer games (C++) I feel like I have a decent background but I'm still a bit weak on replication. Also, how would I go about testing? Do I have to package up and run it locally every time? Or is it more dynamic than that, allowing me to make small changes and try something new? Thanks!!!

uncut pivot
#

you can run the editor as a listen server or a dedicated server

twin juniper
#

@warped trail there's a really good one i know about on the unreal youtube channel - if you search in youtube for "multiplayer unreal" it's the first result. it's mostly BP based, but you can extend it to CPP if you like.

#

i used this tutorial for my 6dof game.

warped trail
#

Awesome! Thanks! And that's really helpful! Thanks so much guys, I feel like if I get on the right track, I'll do okay!

twin juniper
#

@warped trail the tutorial also features steam integration - which will be really useful to add to your game.

#

so that way, if you decide to publish later, you can actually profit from it. it's a great starting point. you won't need to have the game ON steam to test, you can use a local app id, add a few lines to defaultengine.ini

#

so basically what you do, after you make your game locally, you would test it on two separate machines if you use steam - you can circumvent buying a second machine if you put it on steam first and test it that way, or if you test using a dedicated server. one final thing i will mention - great shortcut to making a dedicated server : use UE4Editor.exe "U:\UnrealProjects\MyProject\MyProject.uproject" -server -game -log where UE4editor.exe is the path to your game engine binary. and point the uproject path to where your game is.

#

so if you don't end up using steam, you can still test on dedicated. most businesses use dedicated servers because they are hosted on a high bandwidth connection, and someone on this very channel gave me advice how to set up an AWS ec2 dedicated server (cost for this server is about $40/mo).

#

so just keep that in mind - you'll be going from local testing -> dedicated.

warped trail
#

Oh that's great! I have an AWS account so I think I can host there for now. I'm working on a small area for now, getting all the features up.

Hey thanks man, that's a lot of good info, I'm definitely going to save it. I'll get started tonight!!

twin juniper
#

great! good luck with your project blobsmile

hollow pulsar
#

Hey @twin juniper Could you help a smidge?

twin juniper
#

hi

hollow pulsar
#

My guns are firing on the server but not for the client

twin juniper
#

ooh

#

you still working on that stuff?

hollow pulsar
#

Yeah its been a toughin

twin juniper
#

so what you got going on with the guns, do they have like a muzzle flash, and static mesh blueprints for projectiles? somethin like that? that's what i do

hollow pulsar
#

Its just a line trace atm

#

I could show you the blueprint for firing?

twin juniper
#

ok

twin juniper
#

that thing isn't showing me if it's run on server or run multicast but i am assuming you set that up right

hollow pulsar
twin juniper
#

ok and you say not firing on client

hollow pulsar
#

Correct

twin juniper
#

there's one step you are missing, in the paradigm for how i did it in my game

#

but you have the first part right for Fire1

#

if you go to the Fire function, and look at it

#

you need to set that to multicast, and reliable

#

because that function will be executing on all players. so what we want is - we want to always force the server to BEGIN exec. so we have that. once we do that, we need to then tell the server (which has the exec flow) to broadcast to all users.

#

so wait ill show you an example

#

holdon

hollow pulsar
#

Oki

twin juniper
#

this is gonna be a little blurred but bear with me ill add captions ๐Ÿ˜›

#

brb making pic

meager spade
#

@hollow pulsar what mess is that

#

why you multicasting the fire event?

twin juniper
#

@meager spade i multicast the firing because exec flow is on server when it reaches the call

#

so that way all users see a version of the spawned bp

meager spade
#

if he is using a projectile, but you only replicate the projectile, muzzle flash, etc through multicast

#

not the whole firing of the gun

twin juniper
#

so in my version here i have a multicast firing, and then i create a muzzle flash particle (attached to the point of the gun barrel) and then you can spawn it in.

meager spade
#

i did mine different to that, but if it works, it works

twin juniper
#

did you set your projectiles to replicated?

#

really? dang i didnt think that worked haha

#

cool

#

i thought you always had to multicast spawn events ๐Ÿ˜›

meager spade
#

all you need to do is spawn the projectile on the server, as replicated

twin juniper
#

ahh

#

you have to turn on replicates movement too right? Kaos

meager spade
#

so basically, Client->Asks server to fire->Server fires the gun, spawns the projectile, the muzzle flash is multicasted from the server, the projectile hits the client and deals damage

#

let me quickly mock up a test

hollow pulsar
twin juniper
#

ok in my current setup - i have the projectiles set to replicates on, but not replicates movement. so i think if you turn on replicates movement you can do it that way, without using a multicast call.

meager spade
#

again FireAll is being multicasted

hollow pulsar
#

and It shouldnt be?

twin juniper
#

Olin you can leave it without that, and replicate the projectile as an alternative

meager spade
#

let me just do an example based on the Blueprint FPS template

twin juniper
#

here's what he's saying

#

imagine for a moment my shield is a projectile

#

i have replicates and replicates movement on

#

in taht case, when you spawn it from a server exec flow like you have right before fire all

#

you can do it that way instead.

#

it's very similar ๐Ÿ˜ƒ

#

either way.

#

so you can turn fire all into a normal custom event.

#

since server already has that exec line

#

and then just spawn in your bp, make sure you set velocity on it, and everything

#

and then in your BP, set the replicate settings as above

hollow pulsar
#

Ok well does it matter im drawing a line trace and not using a projectile?

#

Or is the logic the saem

twin juniper
#

why you doing a trace? because line traces are local to the player

#

you are testing if the player is in view or something?

hollow pulsar
#

No my firing is just a line trace for hit detection

twin juniper
#

you can do the trace with server exec flow and just print out using multicast as a test for that

#

well

#

if you are gonna do hit detection

#

what do you mean hit detection?

#

like you are gonna fire a missile if its in view or something?

hollow pulsar
#

I mean the line trace tells me if it hits an actor if it does apply damage to said actor

twin juniper
#

ohh ok

#

interfaces

meager spade
#

here let me show you

twin juniper
#

you can use an interface to affect health of the hit target. from the output of break hit from the line trace.

#

or you can use apply damage or whatever that native node is - but i havent used it.

hollow pulsar
twin juniper
#

if you have native actors in your game - make sure to add a tag to your hit actor

#

to check if its the right type for receiving damage

#

you can use does implement interface or actor has tag

#

as a check there

#

you know whaat im saying right?

#

to test what actor you hit

hollow pulsar
#

Not sure how to use a tag

twin juniper
#

ok you go to the actor bp, and you add in tags that way

#

i use tags a lot

#

there on bottom right

twin juniper
#

ah there you go

meager spade
#

same principle if you are doing hitscan

twin juniper
#

Kaos particles have to be multicast right?

meager spade
#

yeah

twin juniper
#

ok

#

i might be sending slightly more data if i multicast the entire function i think

#

i might switch mine over to that. cool

meager spade
#

would have to multicast the sound aswell

#

if you have sounds

#

and it works i just tested it

#

@hollow pulsar do you want me to give you a hand on teamviewer quickly

hollow pulsar
#

Yes please

meager spade
#

okay send me TV details in PM

#

doesn't offer to help much :D

twin juniper
#

I created a matchmaking script for a game of mine a while ago with the Steam subprocess, and appId 480

#

but when I sent it to my friend after exporting, we couldn't play together

#

are you using advanced sessions plugin or normal. because if you use that plugin you can have custom servernames. just to let u know.

copper portal
#

Does anyone know how I can create a player name tag that shows for everyone in a 2D game?

twin juniper
#

advanced

#

I think

#

lemme check

#

can't you create widgets that display in the actual game? @copper portal

copper portal
#

im using a text render in the character bp

twin juniper
#

you should be able to drag a widget display into the PC

#

@twin juniper I'm using advanced

copper portal
#

what do you mean

twin juniper
#

and online subsystem steam

#

spaghety. i use same, it works for me. you're just using a listen server and not dedicated right?

#

no, not dedicated

#

oh, right I forgot about how you need to open a level with the listen property right?

#

is that it?

#

(when you're creating a server)

#

yupper

#

hold on

#

ill get an example

#

thats how i do it

#

thanks

#

maybe I'll use advanced sessions

#

right now I was just using them to get steam names

#

that's how you'd use find session advanced.

#

they have a version out for 4.19.2

#

you know the advanced sessions dev?

#

all you gotta do is get the code plugin, put it into your Plugins folder

#

gen project files, build it in vs

#

and you're good. just enable plugin.

#

not personally, just on forums

#

I already have the plugin

#

ok

#

yeah it's a great tool i use it all the time

#

is there a playtesting section of this discord?

#

would you post that here?

#

and yeah the only reason i switched to advanced was to get servernames ๐Ÿ˜›

#

what does it mean by "allow to join via prescene"?

#

does that mean steam friends can join?

#

presence is for listen servers

#

and then disabling those flags would make it work for dedicated

#

then how do you set up the "join game" thing

#

ok holdon

#

why is there a timer?

#

so you basically use find sessions advanced or find sessions if you arent using adv

#

then you get the session array. if youre testing only and not in a production envoronment you can just get the first of the find sessions array

#

then what you do is you join session on that - ignore timer sorry that was debug code i had in there.

#

my bad haha

#

its ok

#

i was doing a check to see if the loading screen stayed up for too long

#

and if it was up (network latency bug) i destroyed session caller and tried again or cancelled the attempt

#

but just ignore that

wary willow
#

...

copper portal
#

Anyone know how I can have a player tag that shows for everyone with their names on a text render?

plain flume
#

Hello. Is there any way to force some variable change to run on server, even if the variable isn't changing? I have a OnRep Struct variable that can be toggled and OnRep checks that if the variable has changed. Now I have some extra node that I constantly Toggle On and Off so the OnRep will run everytime

#

I have for example this. IF the laser mode happens to be same the server won't update struct and clients don't get anything. Now I just Flipflop so one value is constantly changing and get the update. Surely there is some way to bypass this?

wary wyvern
#

Guys, what if I need to rotate character from client with inputs but without controller rotation? Does it mean I have to send RPC event to the server?

twin juniper
#

Anyone know how to force return full lobbies/servers in a server browser as currently steam doesn't return any server if its slots are full. I looked into the c++ and found FOnlineAsyncTaskSteamFindLobbiesBase::CreateQuery. This causes by default not to return servers which are full. I am currently using advanced sessions. Anyone got a solution to this?

vocal dagger
#

Hi all, does someone know if I join a session do I always travel to a new map? I'm trying to understand the OnlineBeacon system

#

So for example if I want to create a party on the main menu of my game, I cannot just create a PartySession and invite friends since they will have to actually travel to a new map, instead I think I could use a beacon and replicate the session data to all connected players without joining the partysession and travelling to a new map, am I correct?

meager spade
#

beacons can be used for connecting on the same map (main menu map for example)

#

without travelling

#

i havent gone too far into session but i think beacon session are different to gamesessions

#

@hollow pulsar what actually returns 0,0,0?

vocal dagger
#

for what I have read a beacon is not a session, it replicates a session, so you can create one, place a beacon and replicate without joining?

twin juniper
#

Aren't beacons used for games that use a queue system for when joining the server. So if the session is full you join and wait in a queue before you actually join the session?

carmine frost
#

@plain flume you should use a byte for this, rather than flipping a flag

#

with a flag, if you end up marking the struct for replication twice in a single frame, it wouldn't replicate because the value is the same as it was the last time it was replicated

fleet sluice
#

@vocal dagger The BP node "JoinSession" is hard-coded to travel. The C++ equivalent usually doesn't do that. The BP node's name is a bit misleading: one would think it just calls JoinSession(), but instead it does something like this:

if (OnJoinSessionSuccessful)
{
    GetConnectString();
    TravelToTheString();
}```
I don't know the details on how beacons work, but a high-level overview would be this: they create and manage a separate NetDriver (than the one used by actual client-server connections), which listens for specific beacon connections and replicates RPCs and properties between client and host beacons.

A while ago, I sent a PM to a gentleman called Josh, who was (or is) working with Epic. He was kind enough to offer this comprehensive response, as well add it to AnswerHub: https://answers.unrealengine.com/questions/467973/what-are-online-beacons-and-how-do-they-work.html
#

@twin juniper Yes, beacons can be used for queues as well. Theoretically, they can use any data that you wish to replicate (or RPCs) without actually travelling.

#

I doubt beacons support NAT traversal though. They would also need some for of master server to advertise themselves. On LAN, this is trivial: a beacon just broadcasts on all sockets and listens on one, but over the internet, 2 beacons (client + host) have no way of interacting with each other unless they know where they're at, hence: an external master server of some sort.

hollow pulsar
winged badger
#

branch -> if OtherActor (Cast to Pawn) IsLocallyControlled -> do stuff

#

if you want it to react local only

hollow pulsar
#

Its reacting locally the problem is in my branch to check if the colliding actor is player only works for player index 0.

winged badger
#

because it checks Player[0] by checking the Pawn of Controller[0]

#

you don't have other controllers available locally

#

if you want to check for any Player try Pawn->IsPlayerControlled

hollow pulsar
#

Do you know the blueprint version of that?

winged badger
#

same

#

you just can't use an actor reference, you have to cast it to pawn first

hollow pulsar
sharp pagoda
#

Looks like you want to iterate through all NoHMDCharacter actors and compare against each one

hollow pulsar
#

My goal is if no hmd character collides with the weapon attach weapon to that no hmd character

sharp pagoda
#

Yea no you don't want to iterate then, you want to use actor tags

#

Check if the hit actor has the specific tag

#

Then attach if that's true

hollow pulsar
#

So the logic is like this (Collision Event) (Check for Tag)(Branch if Tag is right)(Attach)?

sharp pagoda
#

Yep

hollow pulsar
#

How do I check for tags Ive got no clue tbh

sharp pagoda
#

ActorHasTag

hollow pulsar
#

Yeah but now I still need a reference to NoHMDCharacter to attach to.

sharp pagoda
#

Check if the Other Actor has the player tag, then cast it to NoHMDCharacter

#

On success, attach it

hollow pulsar
#

But how will it know which NoHMDCharacter to attach to?

sharp pagoda
#

The OtherActor is the character you want to attach it to. You just have to cast it so you can access the specific members you need such as the Mesh

hollow pulsar
#

Thanks alot

#

It works perfectly!

#

๐Ÿ˜„

twin juniper
#

@hollow pulsar hey! did you get your Fire1 function working from yesterday?

gleaming vector
#

what, if anything, would throttle the rate a number of actors would be replicated to clients?

#

I'm seeing a delay from when a bunch of actors get spawned to them showing up on clients, and I was wondering if anyone knew of places that would throttle this

copper portal
#

Does anyone know how I can make player name tags that shows for everyone?

twin juniper
copper portal
#

but how would I make it so that it displays on say a text render

#

that replicates to everyone @twin juniper

cyan bane
#

@gleaming vector Do you know if you're hitting your max bandwidth on spawn? That'll do it.

gleaming vector
#

that's what I thought, but I ran the netprofiler and it doesn't appear so

#

I've done the basic assumption checking... yeah they are set to replicate, yes they are spawning on the server, yes they are being marked as dirty for replication

#

but they take their sweet time being replicated

#

it's a strange behavior

twin juniper
#

@copper portal sorry, was chatting away in the main chat. I believe you can use a RPC run on owning client with the game state text var depending on which player controller it is.

sharp pagoda
#

@gleaming vector I imagine the packets that represent the newly spawned actors aren't high priority and other packets are getting onto the wire instead. I'm not sure how you'd be able to increase the priority of just spawn packets without increasing the net priority of the entire actor though

gleaming vector
#

that's what I'm thinking

copper portal
#

what is rpc @twin juniper

gleaming vector
#

either that or something else is throttling, like osme kind of priority problem

twin juniper
#

it is a custom event - you set network rep params in there

#

here i'll show you

copper portal
#

k

#

just making sure

#

where should I put the event?

twin juniper
#

here is the base of the logic - you can use run on owning client there

#

i would actually put it in the pawn character.

copper portal
#

so the character bp?

twin juniper
#

and reference to game state by using get game state, or reference to player controller by get player controller ->cast to gameplaypc or whatever pc you have active

#

yep

#

the main one u possessed and move with

copper portal
#

wait

#

I dont think I have a gameplay pc type thing

#

does it matter?

twin juniper
#

dont need unless you have the need for it.

#

you usually want a custom player controller for added functionality though

#

i use playercontroller for things like - input actions / chat messages / join messages for when clients join my multiplayer game.

copper portal
#

Would my lobby playercontroller work?

#

or a game instance

twin juniper
#

for the thing you talked about earlier?

#

the tag thing?

#

yeah you store the text array in game state (that's how i did it)

copper portal
#

yeah what I want to do is create a name tag for every person that everyone can see and change the text to the player's username

twin juniper
#

then you access it from your main pawn using a run on owning client RPC.

copper portal
#

im confused on how I would set the names

#

would I do like a for each loop and create the name tags and set the text or each of em?

twin juniper
#

so are the IDs for players or items in the game like powerups?

copper portal
#

players

#

I want to get player names

#

and make a name tag for each player with their name

#

that everyone can see

twin juniper
#

ok i did the same

#

hold on ill get the logic

copper portal
#

๐Ÿ‘

twin juniper
#

ok so

#

you'll probably want a player controller for this

#

so create a player controller, name it GameplayPC

#

remember, each time a client logs in to your game, a player controller for that client is made.

#

it's instantiated.

#

per player.

#

get that?

copper portal
#

yeah but do I need to set it as default in every level?

twin juniper
#

once you make the player controller, you go to beginplay the custom event

#

yep you set it in world settings

#

and in project settings if you like if you want a global default

#

but world settings sets it per map

#

so here's the logic

#

if you look at "Add Info" custom event there

#

it runs on server

#

add info adds to a text array of player names

#

you have to figure out the logic for how you'll get the player ID. so you will probably need them to enter it in when the launch the game or something like that. you want them to have their own IDs.

#

but my logic adds that into a "GameState text array"

#

that text array stores the player names.

#

you can then call the names via PlayerName -> Get -> (Index) keeping in mind the indices start at 0

copper portal
#

I get the player name with get player state and then get player name

#

so how would I add that to the array of player names?

twin juniper
#

thats in the second pic

#

the most recent i sent

#

you add it to the array in that way by using add from a server RPC call

copper portal
#

ik

twin juniper
#

so they get added like this. player names (0) : Bob. player nems (1) : Judy. so on

#

bob joins first, judy joins second.

copper portal
#

but how do I get the names of everyone that has joined the game?

twin juniper
#

you want to display them all? you have to use a for loop

#

like that foreach on the bottom there

#

foreach loop, get it from the array there.

copper portal
#

wait

twin juniper
#

that print should print out all names.

copper portal
#

what I am asking is how do I get the names

#

from the player state and then get player name?

twin juniper
#

you access the names from where you store them. i recommended to use game state to store the text array

copper portal
#

thats not what i mean. How do I add the names from player state > get player name like in the screenshot above

#

to the array of player names

twin juniper
#

yes that's in my pic

#

you use add and add to array.

#

they get added in order. and if you call the add function from your player controller beginplay, they will be added in order of login.

copper portal
#

im confused af

twin juniper
#

yeah you have to use get game state -> cast to your active game state -> and get the array ref as above.

#

then use add, and pass in your reference in to there.

#

just try it out. should work.

#

that's howi did it.

copper portal
#

how would I get the username of the player who joined the lobby

#

?

twin juniper
#

does your lobby map have a custom player controller?

#

if not open the lobby map, set it in world settings first

#

then from beginplay on the lobbyPC, you can get the name

#

hey olin!

#

๐Ÿ˜ƒ

hollow pulsar
#

@twin juniper Ive got my firing working and I can kill the AI and it replicates perfectly ๐Ÿ˜„

twin juniper
#

nice

#

did you end up using multicast for the entire fire custom event or just for the spawn and particle / sound

#

haha

hollow pulsar
#

I rewrote my fire event and it works now

copper portal
twin juniper
#

you have to add a variable in your game state for player names

#

thats how i did it anyway

#

the game state is global for all players

#

so create a custom game state

#

add the playe rnames array text var in there

copper portal
#

wait

#

would a player state work

twin juniper
#

and get game state -> cast to custom game state -> get player names

#

game state worked for me

#

i didnt use player state

#

so not sure on that. sorry.

#

game state will work though

copper portal
#

ill just try it on player state

#

xD

#

ok and then what do I do after I created the var?

hollow pulsar
#

Hey Gothic do you know how I'd add score to the player who killed a zombie?

twin juniper
#

@copper portal here is what i can recommend to you because there are a lot of small technical details here. please go to youtube, type multiplayer unreal. the first result that pops up will help you. after you try that tutorial out, if you have any questions, maybe you can let me know? is that okay?

#

yup

#

so you have score vars per player, so store the int var in your pawn char

#

have an interface call, when the zombie dies, you interface to your pawn bp, increment the score val by that amt

copper portal
#

@twin juniper but that wont help me make the player tags

hollow pulsar
#

Holy shit thats genius

#

Lemme try that real quick

twin juniper
#

typicalegg - its in the tut i promise you. the player id stuff is in there

#

just please look at it k? Unreal Engine Published on Jul 14, 2016 tutorial Blueprint Multiplayer: Project Overview | 01 | v4.11 Tutorial Series | Unreal Engine is the desc

#

here is an example of what he does egg. his name is wes bun, really talented epic dev. he made the tut. he adds player names too. if you go thru it for a while it'll really help you out.

copper portal
#

I dont think it would help me tho.

#

Cuz it doesnt mention player name tags and thats what I am after

twin juniper
#

so i have an affect health interface, if the health of enemy = 0, then it dies, it calls a death function, passes in the attacking player object (in case you have mult players in coop)

#

so it goes in thru there

hollow pulsar
#

Is there a way I can draw affecting player from EventAnyDamage?

twin juniper
#

yes

#

you get the attacking player from either the instigated by or damage causer pins

#

try both

#

im gonna be adding any damage to my pawns soon.. so they can be affected by radial missiles

#

so i'm glad you brought that up ๐Ÿ˜ƒ

#

@hollow pulsar are you able to use anydamage?

#

does the damage actually cause damage to your enemy ai? edit think i see how it works now. i guess i will have to call apply damage from teh pawn that does damage, and event any damage for pawns that recv damage. can correct me if i'm wrong. i might try to shift my damage stuff from my interface calls to event anydamage / apply damage fairly soon (mainly so i can get radial damage done to my chars). we'll see.

winged badger
#

@gleaming vector how much time is "their sweet time" ?

gleaming vector
#

minutes

#

it's variable

#

but it measures in minutes

winged badger
#

and what amount of actors?

#

did you check the UNetDriver::ServerReplicateActors ?

gleaming vector
#

I'm currently digging there

#

they aren't being considered

#

which gives me a lead

winged badger
#

i know its a "bit of a spam" but running with log lognet (very)verbose might provide a clue as well

gleaming vector
#

i did that

#

it's how I got to the fact that they are missing the boat on the consider list

#

it also is telling me that they aren't being delayed due to saturation

winged badger
#

is ActorChannel created for them in timely manner?

gleaming vector
#

i dont know

winged badger
#

do they trickle in, or do they all appear at the same time?

gleaming vector
#

all at the same time

winged badger
#

my best guess is that engine is missing an ensure somewhere

gleaming vector
#

I have a few leads

winged badger
#

like if you try to subscribe same function to a delegate twice

#

it will hang for quite a while, then continue

gleaming vector
#

the actors are being added to the consider list

#

but they aren't surviving it

#

so, I've breakpointed all of the places where the server throws out items out of the consider list and lets see what pops off

#

there are, thankfully, only 3 conditions where that would happen

#
                {
                    // If the level this actor belongs to isn't loaded on client, don't bother sending
                    continue;
                }

                if (!IsActorRelevantToConnection(Actor, ConnectionViewers))
                {
                    // If not relevant (and we don't have a channel), skip
                    continue;
                }```
#

                if ( PriorityConnection == nullptr )
                {
                    // Not owned by this connection, if we have a channel, close it, and continue
                    // NOTE - We won't close the channel if any connection has a NULL view target.
                    //    This is to give all connections a chance to own it
                    if ( !bHasNullViewTarget && Channel != NULL && Time - Channel->RelevantTime >= RelevantTimeout )
                    {
                        Channel->Close();
                    }

                    // This connection doesn't own this actor
                    continue;
                }```
winged badger
#

Relevancy seems the most likely culprit there

gleaming vector
#

agreed

winged badger
#

unless you altered IsNetRelevantFor for those Actors heavily, it would have to be distance based

#

alternative would be the level they are spawning in (it would have to be a streaming level) is not visible to clients for some reason

#

(they would still see the Actors in it loaded from the package, but it would not be the same level as on Server, in any way that matters for networking iirc)

gleaming vector
#

I think I figured it out

#

for some reason, all these objects have a location of 0,0,0

#

(which I probably should have checked)

#

and that's out of the bubble

winged badger
#

i was going to ask if you have a PC controlling the AI Controller next which possesses the Pawns

#

that also creates some weird NetRelavancy results

gleaming vector
#

yeah

winged badger
#

works if you call SetPawn from the PC tho

gleaming vector
#

oh, I think I know what is going on

#

and it has to do with level streaming

#

I'm spawning the items really early on, so their spawn points are 0,0,0

#

when I get around to spawning them again, the levels are fully loaded

winged badger
#

SpawnDeferred() then FinishSpawning() when you need them?

#

takes a new FTransform

#

unlikely to be relevant to this, but there is also a bug with level Visibility of StreamingLevels that are set to AlwaysLoaded on clients, workaround being loading them manually

#

i am off to bed, gl and gn

gleaming vector
#

that's what I'm doing but it's all still too early

#

peace

agile lotus
#

How can I make sure this shows up online, right now it shows the servers name on all players or clients name on all players

#

Its a widget that needs to grab the players name

agile lotus
twin juniper
#

can try using has auth, keep same behavior for serverside, and use diff behavior for client.

#

to get the exact logic would have to test i think

agile lotus
#

what if I only do it on server side

#

and let it replicate

twin juniper
#

you mean if you exec it from server, and set the vars to replicate? maybe

agile lotus
#

I'll try it

twin juniper
#

for that you would do something like this - where you can replace the multicast call at the end with a normal call to do what you wanted.

#

so if on has auth, it's the client, the client still tells the server to exec it

#

you're def right to store it in game state though. that's where i store a text array of playernames.

copper portal
#

On my begin play event in my character bp, I have this code https://gyazo.com/abdf0af6f60bdf4a17a52d42e21abc59 which sets the text of a tag for the user's name and it works fine on the host's side but if you look at the client's side, it shows the same name as the host. How do I fix this @twin juniper

โ€‹

twin juniper
#

egg, player controllers are unique per possessed pawn

#

so if you move that stuff over to your player controller, you'll have unique IDs for each one

#

did you watch that multiplayer tutorial i linked? because it's in there

copper portal
#

no because if you have the answer, I dont need to watch anything

agile lotus
#

Server seems to work fine with that auth logic but client still doesn't maybe I should set the widget component to replicate

twin juniper
#

@copper portal so the way i do it in my game is very similar to the multipalyer tut i linked. it's complicated so i wanted you to look at that fot the details. basically what i do is i use a player settings struct that's loaded for each player on login. that player settings struct has a text var that is the player name, and that's added to an array of player names in my game state.

#

each player needs a way of having their own text ID. and to do that you need to load the info in somehow

#

once you have your player text id, you can break apart the player settings struct like this and get the player id that way

agile lotus
twin juniper
#

@agile lotus how are you getting the client player ID?

#

are you sure it's unique from server's?

#

when you pass it in?

agile lotus
#

Yeah it works on server screen

#

every client has unique name

#

client doesnt show anyones name

copper portal
#

@twin juniper I put the code in player controller but it doesnt do anything

#

still the same problem

twin juniper
#

@agile lotus if it works on server, and it's properly setting something,. all you need to do is exec on server event that sets something in your game state. since the game state is global, it will read on clients too.

#

you guys are having a similar issue.. hmmm

agile lotus
#

I display names everywhere else just fine

twin juniper
#

egg you gotta make sure the player text id is unique for the client. prazon said his is already unique per all players but only shows up for server

agile lotus
#

transferring it into a widget component is the only one not working

twin juniper
#

are you trying to transfer it into a 3d widget or something lik ethat?

copper portal
#

wym @twin juniper

agile lotus
#

yeah

twin juniper
#

not sure how those work in terms of replicatrion but i believe it's similar to using something like a timeline, there may be some settign in there where you have to turn on replication to get it to work for clients

#

i only use one for VR

#

egg so if you are always passing in the same text value, say you pass in bob for server and bob for client, then it will always display same

#

so you gotta first make sure you pass in unique player names

#

once u are sure that is working then u just gotta set the values in the game state player array.

copper portal
#

if I put it in the player controller, it shows no names on server side but only server name in client and no name for the client

#

but wym by the unique player names

twin juniper
#

i just expaliend it.. you gotta make sure you properly pass in the names.. so you don't always pass in the same ones. so if you pass in Bob for server, Bob for client 1 , bob for client 2 , there may be some error in how you are passing in your player names.

copper portal
#

so how do I not make that happen?

agile lotus
#

because you're using for each loop you're not defining which player state you are grabbing I think

#

so I have a player index number that I assign each player

#

I make sure the name I grab matches with the player index I 've assigned

copper portal
#

so how do I make the index?

twin juniper
#

the way i did it is by using a struct of player settings. that gets loaded for each client when they start the game and login to my game. then the info gets added automatically when they enter into a lobby.

#

where are you storing your player names?

#

its just set arbitrarily?

agile lotus
#

its kind of complicated for my method but

#

OnPostLogin I find an open index from 1-4 (0-3)

copper portal
agile lotus
#

^You're grabbing every player state that exists and trying to set all the names at once

#

I grab only one player state, that is matched with its index number

copper portal
#

so how do I set the player index?

agile lotus
#

I have a struct

#

which is a table of data

#

when a player logins or joins

#

I find the next empty number

twin juniper
#

i have a struct too.

agile lotus
#

and assign their unique Net ID to that number

copper portal
#

how do I make the struct then

twin juniper
#

you have to add a var.

copper portal
#

so what vars? just a int?

agile lotus
twin juniper
#

add new -> blueprints -> structure.

agile lotus
#

This is one of my structs

#

its like a table of vars

twin juniper
#

that's the one i was talking about. please watch that.

#

it goes thru the player id stuff.

agile lotus
#

So when my players are going through PostLogin I save their unique ID, and Index to a struct. Then when I PostLogin or SpawnDefaultPawnFor on the actual gameplay mode and map I can reiterate through those player states in the player array. Using the index and unique ID I saved I make sure their characters are brought over the map travel

#

When I first used structs they were complicated to setup

#

but they are a huge life saver

#

so I understand the frustration when first learning about them

copper portal
#

so how do I set the index in the struct when a player joins

#

@agile lotus

agile lotus
#

OnPostLogin

copper portal
#

ye

agile lotus
#

Maybe grab the length of PlayerArray during post login and set their index to that value

copper portal
#

k

#

but how do I set it in the struct

#

I made a var for it but I dont know how to use it

#

@agile lotus @twin juniper

twin juniper
#

you have to break the struct to access elements inside it.

copper portal
#

k

twin juniper
#

again please watch that multiplayer blueprint tutorial man. that has all the info you need to get started with the player ID structure stuff and i swear to you it's all in there.

copper portal
#

you sure? He created the structure and then moved onto main menu

#

could you give me the exact episode?

#

nvm I figured out how to set it

#

For some reason when I try to test my game, it crashes

#

instantly

agile lotus
#

whats the log say

#

about the crash

agile lotus
#

@twin juniper Attempting to do it without a 3d widget component

#

will report back

twin juniper
#

i mean if it works on everything but..

#

your code works, just the extension is wrong somehow. so you'd have to look at the details on that. you can probably get it to work in a 3d widget if it's referenced properly. maybe the 3d widget needs to be spawned from server, or set to be replicated.

#

i only use one localized 3d widget per player for a hud type thing.. so

#

i dont have any references to other players in my 3d widgets.

copper portal
#

@twin juniper I think I did it with the struct but the problem where it works on server only is still occuring

twin juniper
#

@copper portal i will try to help in a few moments - i am currently working on a texturing thing right now.

copper portal
#

im getting off soon so if its not possible to do it rn, you will have to help me tomorrow @twin juniper

twin juniper
#

will probably be on tomorrow

#

if someone else is here they can help too, i will try to though, i like helping.

agile lotus
#

okay now the client was able to see server name but it showed up on client pawn

#

lmao

#

disconnected the switch to experiment

#

which is how I got that result

twin juniper
#

what exactly are you doing? like an indicator for enemy ships that shows up on a hud?

#

because i have a player UI that shows all names, as well as a hud indicator.. mine does work..

agile lotus
#

this is server screen

#

client (Awhbek) sees awhbek over both of them

twin juniper
#

ahh

#

and you as prazon see awhbek correctly and your name correctly

#

got it

#

here's how i do it in mine if that helps any..

#

i have a custom array in my game state

#

and

#

what i do

#

is i have an actor component in my main pawn

#

see the comp track in radar component there on left?

agile lotus
#

Yes

twin juniper
#

it is a way to id it

agile lotus
#

You're using a widget on your HUD right?

twin juniper
#

yeah hold on

#

ill show you how it looks so you see it. its a HUD object

#

they have links there

#

but gimme a sec ill post a pic

#

so see how they both have little blips

#

it matches with their color

#

way i did that is by using actor components

#

the radar is an on scren radar, lil hard to see

#

but the indicators are there in the middle of the screen, with the tiny blips

#

if ur in game its easier to recognize, i made the alpha fade a bit

agile lotus
#

Ah I see

twin juniper
#

i manually add to each player controller's hud with the actor itself.

#

once you do thata, each actor component will have a diff id

#

i probably did this the long way lol

#

if i used the default player names arr like you did the code would be simpler

#

but i had issues with the name not printing just like you did

#

if you turn on component replicates, for the actor component you have the ID for

#

i know it should work both ways, client -> server and server -> client

#

if i were you though i would keep debugging, it seems like you are probably close with it

#

heres the function where i add the array

#

and what i do is i add it to all HUDs in every player controller

meager spade
#

@twin juniper did you change your multicast

twin juniper
#

hi

#

nope i have been busy doing level design for multi

#

i wrote it down in a list of task changes tho in my notepad

#

good news is level design is almost done ๐Ÿ˜ƒ

#

just adding player starts and spawn points rn

thin stratus
#

Did something change in terms of Destroying Sessions in the last few versions?

#

I was always able to destroy a session in the MainMenu when coming from a match

#

And then being able to host again

#

Now it tells me it can't destroy the session, however it also tells me the session already exists when trying to host again

#

:/

#

Even calling Destroy session when actually hitting "ToMainMenu" in the match doesn't destroy it

#
LogOnline: Warning: OSS: Can't destroy a null online session (GameSession)
LogTemp: Creating Session with ServerName , GameModeName: Deathmatch and MapName Atrium.
LogOnline: Warning: OSS: Cannot create session 'GameSession': session already exists.
#

Hmm

#

Guess it's a PIE bug

reef tinsel
#

Hello

#

What might be cheaper, in terms of optimization>

#

Vector Net Quant or a Vector2D ?

#

(I only need X and Y from an actor location)

twin juniper
#

@reef tinsel You can still quantize the Vector2d no?

#

Quantize it, and only use X/Y at least

#

I'm setting up Steam achievements, and I've done it before but can't remember this problem I'm having: I can see achievments in the steam overlay, and I can unlock them, but when I click "show all achievements" in the steam client for the app, it just takes me to the community page?

#

This is problematic because I need to test stat progress, but I can't see the progress without going to that page

#

I'm wondering if it's something that only becomes available once the app has been released...

wary willow
#

Nah

#

I was using acheivements/stats prior to the Demo Launch

#

Just make sure on Steamworks it's active

twin juniper
#

It is active, and I can see the achievements (I've even unlocked one), but selecting "show all achievements" so that I can see what my stats are, just brings me to the community page

#

There doesn't seem to be a "all achievements" page for this appID @wary willow

twin juniper
#

why is my client lagging so much?

#

it updates like once 10 seconds

#

when i call "SetActorLocation" on server it happens instantly but client teleports to that position only after maybe 5 seconds

twin juniper
#

@granite jolt hey u there?

granite jolt
#

usually yeah