#multiplayer

1 messages ยท Page 36 of 1

winged badger
#

once the ball is on a ballistic trajectory

#

its somewhat predictable what happens next

#

i say somewhat because physix is not deterministic

thin stratus
#

And now someone would come in and say "BUT CHAOS IS NOW"

#

And we yet have to discover this

#

Also, fwiw, I usually do Balls with ProjectileMovementComponent and setting the "InterpolatedComponent" to a Mesh to make it look a lot smoother.

winged badger
#

chaos is only "out" since 4.22 i think it still doesn't work ๐Ÿ˜„

thin stratus
#

In C++ one can also set the Velocity of the Component to the one of the Actor in PostReceiveVelocity or so

winged badger
#

but generally, once your player contact with the ball is done

#

ball more or less follows the same rule as to where it flies to next on each machine

#

so it doesn't need a tick by tick position update by RPCs

#

it just needs a correction here and there

thin stratus
#

Using Physics for this is really unstable. It's not even "somewhat", it's really shitty

#

Idk what kind of Ball we are talking about, but if it's really just a bouncing ball, use the ProjectileMovementComponent

#

It solves a lot of headache and has some interpolation for the mesh build in to smooth stuff out

#

It's basically the best you can get before coding your own or doing illegal stuff like making the ball a Character

arctic mesa
#

guess i could also make a death zone where it destroys the physics object once it hits the deadzone?

unique cloak
#

?

arctic mesa
#

so from what i gathered from our chat, this is what i did

#

client gets the actor's transform and passes it to the server event, that passes it to the multicast event, that passes it to the setworldtransform node

arctic mesa
#

well, it does indeed function like you said, zlo, it's teleporting

#

however, setting US to run on every tick freezes the ball, as it's trying constantly to set it's transform

#

...i should look for a different approach. the ball DOES float when telekinesis is active, meaning telekinesis deactivates the ball's "gravity"

valid imp
#

I have a fixed size & fixed order large array of ints I want to replicate.
Say I create an FFastArraySerializerItem (with my int side that I want replicated) and set the ReplicationID to the element index, then in OnRep_MyArray I sort the array. Have I then indeed achieved correct-order replication?

prisma pelican
#

anyone know if draw debug is replicated?

#

for testing purposes

dark edge
kindred ether
#

could someone please help me with some replication im trying to - a float inside a actor but the client cant change it for the server or other clients i have been stuck with this for so long i took 2 weeks of the project bc this one thing and i still cant fix it for the life of me xD

fathom aspen
#

Honestly that's a basic question that even if you bypass by a help of someone it will be just a matter of time till you ask similar questions. So let me introduce you to this: #multiplayer message

kindred ether
#

yeah if server does it it will replicate to the clients but not the other way i have tried using events but the client cant run my event that has run on server

#

could you pls join vc to watch the stream and i will show you even if you mute

mint drift
#

Hey guys I am trying something here and if someone could give a hand would be awesome.
Goal: My character dies and only other dead players will be able to see this dead character. The alive ones dont see it. Only dead see dead

Any tips on it?

fathom aspen
#

That's normal, dead have their world, we have ours
Well all you have to do is literally replicate the death event, at a very basic level, say you replicate bDied and inside OnRep_Died you drive animations, etc.

fathom aspen
kindred ether
fathom aspen
#

You make sure it's owned by the client, aka PlayerController/Pawn/PlayerState

#

Or it's one of them

#

And that it's safe to RPC at that point in time

kindred ether
#

idk how to give it a owner

fathom aspen
#

SetOwner is one way

kindred ether
#

would i make the client spawn it?

fathom aspen
#

Then it's not replicated and you can't RPC at all

#

You spawn it on the server, make sure it's replicated

#

SpawnActor has Owner pin you can use it too

kindred ether
#

what if theres more then one client

sinful tree
#

Then you can't really replicate through that actor. You'd have to replicate through a player owned actor (Like Player Controller, Player State, or their controlled pawn)

kindred ether
sinful tree
#

No

fathom aspen
#

No, just one client

mint drift
kindred ether
#

so it wont be replicated for all clients only the one??!!

sinful tree
#

Spawning a replicated actor on the server by default will end up being replicated to all clients.
You cannot call Client -> Server RPCs on replicated actors that are not owned by the client attempting to make the RPC.

#

So if you want your client to be able to interact with said actor, you'd have to call the RPC on their Player Controller/Playerstate/Controlled Pawn, likely passing through a reference to the actor they're trying to interact with, and when finally running on the server, the server can access the actor, and run whatever functions or set any replicated variables on that actor.

kindred ether
#

im new to replication so im clue less

fathom aspen
dark edge
amber saffron
#

Same been at this for a couple days now and still cant get a single actor to spawn on the server for everyone to see

dark edge
#

A replicated actor spawned on the server will be there for all to see.

amber saffron
#

i can get it to spawn on the server but cant get others that join after to see it

fathom aspen
fathom aspen
sinful tree
# mint drift

That's not spawning a replicated actor on the server, that's multicasting which gets everyone to spawn their own copy.

dark edge
kindred ether
mint drift
#

oh nvm. Lost little context

#

I will focus on my issue, too complex for here as well

dark edge
fathom aspen
dark edge
kindred ether
#

im not really sure how i could show you what i mean without you in vc

#

discord dont let me send vids

fathom aspen
#

But it does let you send screenshots to your code

kindred ether
#

im not sure if this is the bit you want lol

dark edge
#

replicate a variable

fathom aspen
#

This bit is enough to say you are doing things incorrectly

kindred ether
#

thats what people in vc said to do lol

dark edge
#

Start from the beginning. Show your player hunger variable and how you're reducing it and updating the UI

#

gotta make sure that part is correct first BEFORE dealing with refilling it

#

The only RPC in this whole setup should be between your input and the "eat" mechanic

kindred ether
#

its just a float that get - on event tick but that dont seem to be the problem

kindred ether
#

no bc hunger dont need to be replicated between characters

dark edge
#

Just show it, you'd be done by now

#

yes it does

kindred ether
#

why

dark edge
#

unless you want client to be able to say what its hunger is no matter what the server thinks

kindred ether
#

its replicated now

dark edge
#

ok so now that it's replicated any change to it ON THE SERVER will be replicated to the client

#

show how you're making it go down over time if you're doing that

#

If you're not then proceed to making the Food variable on the feeding station replicated as well

kindred ether
#

mean this?

dark edge
kindred ether
#

thats in the player character

dark edge
#

OK then
Then it's as simple as

In Character:
Input -> Run on Server Event -> Do the interaction mechanic to talk to whatever you're nearby (sphere trace, get overlapping actors, whatever) -> Call Interact or Eat on the food station (passing over the character that's doing the interaction/eating (self))

In FoodStation:
Event Eat -> do the math to figure out how much food is being transferred -> remove that much from Self's Food, add that much to InteractingCharacter's Food

kindred ether
#

on all players

dark edge
dark edge
kindred ether
dark edge
#

and tick is probably overkill but that's fine for now

#

if you're doing it on tick, you'd want to use DeltaTime in your math or it'll go faster or slower based on tick rate

#

just put a HasAuthority switch before Hunger

#

also that should NOT be a run on server event, just a plain event

#

Event tick happens on server too

kindred ether
#

okay done all that

dark edge
#

To reiterate, here's the code paths.

In Character:
Tick -> HasAuthority -> True -> Update Hunger
-> False -> Update UI?

EatInput -> Run on Server Event -> Do Stuff to get at the food station -> Call Eat on it or whatever, passing over Self as a parameter (EatingCharacter)

In FoodStation:
Eat -> Do math -> Update self.Food and EatingCharacter.Food

kindred ether
#

yeah that made 0 sense to me ๐Ÿ˜‚

kindred ether
amber saffron
#

Currently away from my computer, but here was my original attempt at trying to replicate my actors
#multiplayer message

I have since then tried to re adjust based on some advice from some of you, but have not made any progress. From my first attempt, what needs to change/be removed/placed somewhere else?

Trying to: spawn actors on server(will most likely be an actor pool, but for now just these actors), each player will be able to pull from these actors to build their own things that others can see but not touch(at least for now) (the actors created are child's of a master actor but are set to replicate)

kindred ether
#

starting to think im never going to be able to replicate this lmao i have had it like this for like 2 weeks now

dark edge
#

you update Food on server

#

you update UI on client

#

Food is a replicated variable

kindred ether
#

yeah the players food bar works it just the food itself that dont

dark edge
#

replicated variable

#

it can literally be the same thing if you make a food component

kindred ether
#

it is a replicated float but that dont work

dark edge
#

Show your code

#

how can we help if we don't know WFT you even have?

#

Show the setup for the feeding station and all the code in it

kindred ether
#

could you join vc even if you mute then i can stream and it will be much more easy

#

i cant really screen shot all the code at once

dark edge
#

you presumably walk up to it and press a button right?

#

show that

kindred ether
#

then when you press e it will check if inZone is true and if so it will eat

#

in the player character

#

and the (box) is just a box collision

kindred ether
#

i know but its simple and i dont need to over complicate it

dark edge
#

Do it more like this
Press E -> Run on Server Event
Run on Server Event -> Check overlaps or whatever -> Eat

#

Who has the trigger, the character or the zone?

dark edge
kindred ether
#

the actor has the box collision

dark edge
#

and it's sorta ass backwards anyway

#

Here to start with, just get actor of class for now

#

E -> Run on Server Event

Run on Server Event -> Get actor of class -> Eat

#

You would later replace Get Actor of Class with your general "select actor to interact with and call interact on it" logic

kindred ether
#

idk why i have a stuff on released xD

#

i dont see why i have to change these rn when they dont seem to be the problem

#

@dark edge you gone again?

#

okay well ima go sleep now bc this way clearly isnt working

dark edge
#

your input is never making it to the server

distant vault
#

Hello, I am trying to get access to players info stored in the game mode through player controller but I am get errors. Can anybody help?

sinful tree
dark edge
distant vault
#

the actual player information is in the controller

distant vault
waxen canopy
#

Hi All, Good day...

We have tried to use Thirdpersonsample provided by Juaxix and made our own thirdperson game...however the moment we a room is joined the players fly off...I have been discussing this with juaxix and he suggested few settings but they are already enabled. Does someone have any idea to solve this issue...There are no errors. It says players hv joined the room.

sinful tree
# distant vault This if for all the players connected to the game mode

This is storing player info in the game mode. You should just be storing that data in the playerstate. There's no need to have an array of player info as each playerstate should contain the data about the specific player, and if at any time you wanted to look up all the players in an array, you can use the gamestate's Player Array which is an array of all the connected playerstates.

rose egret
#

dose UCheatManager support RPC ?

warped steppe
#

just my guess though, never looked into it

rose egret
#

I dont remember well but I guess console coomand is sent to server if its cheat

#

๐Ÿค”

prisma snow
#

I'd assume it's not, but it should be easy to manually RPC

kindred ether
#

and im about to move the box collision into the player character

dark edge
#

I do a sphere trace -> filter -> sort by some metric -> choose the thing to interact with

kindred ether
#

ty for telling me all the stuff i need to go fix to lol

dark edge
#

something like "choose closest actor in trace that implements InteractionInterface or has an InteractionComponent" is the usual way to do it

#

I use an Interaction component but many people use an interface

#

you'd just include the InteractingCharacter in the interface call then the feeding station knows WHO to give food to etc

elder sable
#

Hi, i'm making an example project for a subsystem and i can't get the session from the null subsystem with

 OSS->GetSessionInterface()->GetResolvedConnectString(SessionName, StrServerURL, NAME_BeaconPort);

I was using steam subsystem before that, is there something specific with the null subsystem ?

true spade
#

Hi, I have a question about nameplates above heads in the multiplayer game. So how it's suppose to be done, I tried to do it with Player controller on begin play Im getting player display name and setting widget text, but the problem is only host (server) can see those, and clients can't. And I'm even using Multicast for it and still not working on clients. Can someone please explain how to do it, it will help me a lot. Thanks in advance ๐Ÿ™‚

elder sable
true spade
elder sable
#

Then your code is wrong

true spade
#

Can you explain a bit how it's suppose to be done?

#

Currently in the character Im getting player state and calling multicast in the begin play to update name widget

elder sable
#

Do you check if your playerstate is valid ? Do you bind your delegate before your broadcast ?

true spade
#

Bind delegate? Currently not using any dispatchers, the player state should be valid (I guess) since it executes some code in character's begin play for the controller side and after setting name

elder sable
#

What do you mean by "multicast" then ?

true spade
#

This one, and calling Server_SetPlayerName in the begin play

elder sable
#

You don't need rpc you just need properties

true spade
#

Then I'd need just in the widget get owning player player state and get playername it should work?

#

I tried even that and it didn't work

#

I the widget I tried this one too

elder sable
#

And where do you check if your data are available here ?

true spade
#

Currently here I don't

elder sable
#

You need to wait for data to be replicated before displaying them

#

playerstate onrep etc ..

true spade
#

So how I can manage that? I didn't use playerStates often

elder sable
#

You can make a delegate and broadcast when the data you need are ready

true spade
#

Form where I should broadcast, and when?

fathom aspen
#

From PlayerState::OnRep_PlayerName

true spade
#

Oh, kk. I just had the replicated player name, and not repNotify till now

#

Gonna try that now. Thanks, I'll let you know after trying

rocky night
#

Hi, so i have for example a Crate which a player can loot. Unfortunatly i overs ee something. Other Players can interrupt the Process when someone is looting (He is holding a key down) It is checking with a (boolean is looting?) Which i set at begin of loot liekis it false then loot if not.. its busy. Ok that works BUT! when the other player which is not looting press and then RELEASE the Key its interuppting the looting player.... dang stucked on that

#

abover of course the first boolean is set to true when interacting... but it goes through in the screenshot.... its a bp interface which says key relase and asks then for the boolean.. it doesnt work it goes through. The code is in the lootbox as it holds the interface... @fathom aspen sorry for the ping but i am afraid it could go under here

glacial pollen
#

Long time no see you guys. I have a real doozy for you guys today:
Player A and B spawn near each other. Both can aim and linetrace to the other.
Player A moves 5 feet. Player B SEES A move 5 feet, but line trace only works at ORIGINAL spawn location.

If I add a cube as a child of the skeletal mesh, everything works, so this is a particular component issue rather than a general config/multiplayer/auth issue.

In the 5+ years in Unreal, I've never seen anything like this:
Left: Player A has moved, Player B is now aiming at A's new location, but no hit result!
Right: Player A has moved, but Player B is still aiming at A's original location, hit result!

true spade
rocky night
glacial pollen
#

I'll double check, it would be weird that the location of the mesh moves visually, but not "physically" if it was a replication problem.

fathom aspen
rocky night
elder sable
#

Never ping a Wizard

rocky night
rocky night
#

other question... i give a player a stealth suit while playing... it glitches so the player moves and it goes to invincible is he stops moving it bugs to unreal standard material.. doenst happen with lit materials

young kestrel
#

Thanks to this discord I finally was able to understand how that FCharacterNetworkMoveData stuff works (more or less)
I also was able to confirm that my code works (partially)
Which does give me the hope that I will actually be able to finish the basic framework for my project at some point in my life.

I also was able to cleanup the code now.

elder sable
#

I'm using OSS->GetSessionInterface()->GetResolvedConnectString(SessionName, ServerURL, NAME_BeaconPort); to get the server address, i was thinking to change only the game port but can the IP be different for the beacon and game port ?

drowsy meteor
#

Hi everybody, I'm very new to unreal engine and i've been understanding a lot of things but i just couldnt figure out how to work with multiplayer, any body have some ressources for a " beginner in multiplayer course "

prisma snow
drowsy meteor
#

thnx very much :d

drowsy meteor
prisma snow
torpid girder
#

hello, i am probably doing something totally wrong, i've started my client in spectator, i then select a character, and call my function stopspectating on my PC, from here i set bPlayerIsWaiting = true; and call ServerRestartPlayer(); however i think this isn't the right way to change from spectator to playing

fathom aspen
#

It depends how they were switched into spectators. You just switch them back (undo)

torpid girder
#

i launched them into spectator mode when the game mode starts, so once they have their character, i can't for the life of me figure out what will switch their state into playing, i assume there must be something else that wraps switching state i haven't found yet

#

i am defo doing the wrong thing, probably got my terminology muddled up too

#

so i set bStartPlayersAsSpectators = true in my gamemode, yes great, my player character is spawned, i open up a character selection widget, yes good select the character, so not to introduce any other complication no code to use the selection has been implemented. now i need to execute something that would have taken place by default if i hadn't set bStartPlayersAsSpectators to true

#

i assume i have to make a call from the client player controller to the server player controller to call something in game mode

fathom aspen
#

Well the thing you are missing is my message from a few days ago: #multiplayer message
You have to understand that a SpectatorPawn already gets spawned by default for you regardless of that setting. That setting you set to true in GameMode is meant not to spawn a Pawn so the SpectatorPawn doesn't get destroyed in return, and that way you stay in NAME_Spectating state. I talk about that in here: https://wizardcell.com/unreal/persistent-data/#gameframework-objects-creation-order-and-calls (SpectatorPawn section) @torpid girder

torpid girder
#

now that makes sense

fathom aspen
#

And in the link from days ago I speak about how I switch from playing to spectating state and the other way around

#

Sometimes answers are a few clicks away

torpid girder
#

yes i understand, what i am seeing now makes sense

#

ah and now back to the problem from this morning, when i change the state, the controller tick then switches it to inactive

fathom aspen
#

Debug and find out why

torpid girder
#

i know what is happening, which makes me think this solution you show (same as what i thought i had to do this morning) appears wrong, the aplayercontroller on tick comes along and sets the state to inactive because nothing was spawned, unless the code to spawn and player into playing mode is separate, which then begs the questions if i have to handle this myself why do i need states

fathom aspen
#

It does that only if you go into NAME_Playing state which you shouldn't be going into

torpid girder
#

i had a feeling i am doing the wrong thing, so to enter a playing state, i feel like i should be calling something like ServerRestartPlayer()

distant vault
#

Anybody know why it fails to cast? I'm trying to get asceses to the players state. this is in a widget

sinful tree
fathom aspen
sinful tree
#

Of what?

torpid girder
distant vault
distant vault
fathom aspen
distant vault
#

I already made the player state part of the game mode

torpid girder
sinful tree
distant vault
#

I have a hud class that creates the widget

#

maybe the player state hasnt had time to spawn yet

#

ill add in a delay

torpid girder
#

i am sure i have this totally wrong, so i have a spectator pawn, i call for a state change, i transition from spectating, the spectator pawn gets destroyed, but nothing triggers the creations of a new pawn

#

so on tick the player controller picks this up and sets the state to inactive

latent heart
#

Do you have a default pawn class?

torpid girder
#

yes

#

it used to spawn in before i set the gamemode to bStartPlayersAsSpectators = true;

latent heart
#

Check what it's doing in RestartPlayer - if it's even called.

torpid girder
#

i don't think its even called, double checking

latent heart
#

If it's not called, check what it's doing on state change. ๐Ÿ™‚

torpid girder
#

i am sure i've done something stupid and i can't see it, but its right in front of me

sinful tree
# distant vault It was the delay thanks man

Just be aware that even the delay may not necessarily work - what your trying to accomplish is waiting for the playerstate to be valid, and you can only really accomplish that by overriding OnRep_PlayerState() in a C++ player controller class and using that event to trigger anything that needs to read the playerstate when it's known to be valid.

Example: What if someone has a really bad connection, and it takes 3 seconds before their playerstate is replicated to them? Your delay would still fail on their client.

quasi tide
#

Delay for 5 minutes. If they're still not ready, their connection sucks too much, kick 'em. ๐Ÿง 

distant vault
torpid girder
#

ok so if i have this right BeginPlayingState() must contain calls to gamemode to restart the player? it isn't implemented

torpid girder
#

aha, right so that was seriously hard work, i am still not sure why i have to set so many vars to change state, but fine i met the criteria and now time to die and do it all over again ๐Ÿ™‚

#

thanks for your help @latent heart @fathom aspen

wheat magnet
#

is there any built in method for implementing p2p networking in unreal?

chrome bay
#

Outside of listen servers, no

elder sable
#

Does UE create a session by default ? I just make a find session without creating one and there is an existing session

wheat magnet
dusky yarrow
#

you literally cant. a player need to act as a "Host" aka listen server for p2p to work

prisma snow
#

Unless there is a crazy reason for p2p, I'd just go listen servers

wheat magnet
#

okay

verbal tendon
#

There's the Computer Science definition of p2p, and there is what people colloquially refer to as "p2p", as opposed to running dedicated servers. The latter is what UE does, and you can simplify the required implementation by using EOS

bitter oriole
#

P2P, listen server and dedi are three very distinct architectures that are equally common

#

Unreal just doesn't do the first one

verbal tendon
#

The last time I've seen actual p2p networking in a game, is almost 2 decades ago. I would not refer to it as equally common

kindred widget
#

Doesn't GTA do P2P?

bitter oriole
#

Almost every game does some

#

How many games kick all players when you lose network?

verbal tendon
#

Uhm... that's not how that works

kindred widget
#

Pretty sure RDR2 online stuff and For Honor do P2P as well.

bitter oriole
#

Listen server = one specific player hosts, with total control over the game, god mode if they cheat, and obviously everyone get dropped if they do

verbal tendon
#

P2P networking used to be a thing back in the days, and it was using full-mesh network topology, for lockstep games. It was horrendous

quasi tide
#

For Honor definitely launched with P2P

bitter oriole
#

Destiny has been doing P2P for 10 years

quasi tide
#

Pretty sure they've since changed it

bitter oriole
#

Everyone does some P2P because servers are expensive

#

Usually with at least a layer of dedicated servers for player state

verbal tendon
#

Kill me now ๐Ÿ˜‚

#

I mean ... yes sure, you can do it, just like you could do it 20 years ago

#

But there's nothing in the world that would motivate me to work on such a game nowadays

#

fixedpoint implentations are a breeze

bitter oriole
#

If I was going to make a MP game today it would 100% be peer to peer

verbal tendon
#

of course there's a difference when you can just use the implemented classes and networking

#

I used to write the networking code, down to the low level system socket handling

#

and we had different classes for linux/windows/mac, because they use different socket types at the OS layer

bitter oriole
#

Well yeah that's socket 101

#

Or just write the ifdef soup once and treasure it for the next 30 years

#

At least it's not like the API changes

verbal tendon
#

Now now, show respect to the dead. Let's not bring them up in conversation ๐Ÿ™‚

bitter oriole
#

It's all about web4 these days

#

The RTX 4000 way

#

rip

verbal tendon
#

Got a plan? ๐Ÿ˜„

latent heart
#

Why before february?

dusky yarrow
#

crypto mining?

quasi tide
#

Yup. Totally a Laura thing to do.

dark edge
#

I paid $730 for a 6600XT
Kicking myself but I had to play Elden Ring and things were spendy.

prisma snow
bleak moon
#

Anyone aware of any known bugs with child actors and standalone testing mode? The child actor isn't showing up on client side even though the actor blueprint is set to be replicated on net load and in general.

quasi tide
#

Child Actor Component?

fathom aspen
bleak moon
fathom aspen
#

We hoped that was the case since long, but turned out that there were none ๐Ÿ˜”

bleak moon
#

So this is a pretty prevalent problem? ๐Ÿ˜ฎ

fathom aspen
#

Or at least that I don't knowโ„ข๏ธ of any

#

Yeah CACs are problematic as hell

bleak moon
#

Damn, ok good to know

quasi tide
#

Should probably be removed honestly.

distant vault
#

Hello, I have this event that is suppose to launch the game from the lobby but I cant seem to get it working. Any reason why or any alternate to this?

weak linden
#

Does anyone know if UObject::Rename() is "safe" to use in multiplayer to change owner/outer? Or should I just be using NewObject and providing the old object to copy properties from?

prisma pelican
#

how to transfer all clients with server to new level?

#

i dont know what to do after server travel

bitter oriole
#

Just ServerTravel to the new map.

#

(no OpenLevel needed)

prisma pelican
#

@bitter oriole what do i put for in URL if I dont openlevel?

lost inlet
#

The map name

bitter oriole
#

The "URL" field of ServerTravel

prisma pelican
#

just the map name?

bitter oriole
#

Yeah the map name

lost inlet
#

Yes , with travel args if needed

prisma pelican
#

like this?

lost inlet
#

Same as GetWorld()->ServerTravel in C++

prisma pelican
#

is it same as this one?

bitter oriole
prisma pelican
#

thanks you guys for answering my previous question, i set up the transition map like the doc said, but without open level the next map doesnt open

elder sable
#

Hi, i'm using GetResolvedConnectString to get my lobby endpoint (using beacons) but i would like to get the game endpoint without calling this function again, is that possible to get the game port only ?

distant vault
fathom aspen
#

That is very descriptive and helpfulโ„ข๏ธ

#

Debug and find out what's not working/executing

fathom aspen
fathom aspen
prisma pelican
#

made sure that the servertravel is running on server side

#

i dont fully understand what the second one means

fathom aspen
#

That's a setting in GameMode in Class Defaults

prisma pelican
#

i turned it on, was i not suppose to?

fathom aspen
#

You can turn it on, it won't work though if you are traveling in editor

#

Because seamless travel PIE isn't fully supported in editor

#

In 5.1 it is with the help of a CVAR

prisma pelican
#

i packaged the game to test and the issue is that it brings me back to the main host menu instead of the level i specified in server run

fathom aspen
#

If it brings you back then something is workingโ„ข๏ธ

dim trail
#

what is the cost of a multicast vs server rpc?

bitter oriole
#

Server RPC is client to server, multicast is server to clients

dim trail
#

im looking at a plugin for damage text numbers, they are using a server rpc instead of what i would assume should be a multicast

prisma pelican
fathom aspen
#

My handsomeness seems to be helping ๐Ÿคญ

fathom aspen
#

I have not tried it yet, so that should mean something patrick_hehe

prisma pelican
#

what am i suppose to share if there are no errors showing on log?

fathom aspen
#

Sometimes I have to make a sacrifice for our father in heaven to forgive us sinners

fathom aspen
#

But still I would debug what servertravel is doing behind the curtains

prisma pelican
#

i shall take your advice wise man

fathom aspen
#

... wise handsome man

lunar fox
#

You also donโ€™t need to use seamless travel just to bring over connected clients. Itโ€™s more if you want to preserve PlayerState etc across maps

fathom aspen
#

Respect level is now at 1000

fathom aspen
prisma pelican
fathom aspen
#

It is enoughโ„ข๏ธ

#

With turning off that setting in GameMode

prisma pelican
#

you mentioned that it cant be tested in editor

#

how about standalone mode?

#

instead of packaged

fathom aspen
#

It can if you do some things

#

It does in standalone

prisma pelican
#

do you run your own dedicated server usually to test?

#

or you do via steam or smt

fathom aspen
#

As said, I do standalone

prisma pelican
#

aight evilbunny

#

thanks lots beautiful man and woman

elder sable
#

Any idea why GetResolvedConnectString(NAME_GameSession, StrServerURL, NAME_GamePort); returns 10.21.21.2:0 ?

fathom aspen
#

Because that's what it should return?

#

What type of GetResolvedConnectionString is this?

#

There are like a dozen of them

#

But I know the one that returns bool

elder sable
#

It shouldn't be 7777 for the port ?

#

By "returns" i mean the value of StrServerURL

#

With Name_BeaconPort the address is 10.21.21.2:15000

#

So i guess something is wrong for the game port

elder sable
fathom aspen
#

And you are using Null OSS?

elder sable
#

Yep

fathom aspen
#

You should probably explicitly specify the port 7777 when you host

#

If you're not doing so

elder sable
#

But if someone change the port ? Would be better to not hardcode it

fathom aspen
#

I mean you want to pass it as a param or something

#

There is an option for port iirc

elder sable
#

Oh, yeah i will use a param then, thanks !

fathom aspen
#

But you could also try seeing what happens under the hood when FURL gets constructed, there is UrlConfig.DefaultPort

#

Maybe it's being messed up at some point

elder sable
#

The DefaultPort of FUrl is valid, the port is 0 from GetResolved...

#

Maybe it's supposed to be 0 for the game port dunno, don't want to spend too much time on this :p

shy radish
#

hey, is the networking code in v5.1 still the same from previous versions of ue4 (4.27 / 4.26) or has it changed again? because I am following a course by tom looman on creating a multiplayer shooter game and for some reason the weapon actor wont replicate...

fathom aspen
#

It is still the same, though they introduced a new replication system

#

And in your context you're not using the new system

shy radish
#

could this explain why

void BeginPlay()
{
  if(HasAuth())
  {
    // Spawn Weapon
  }
}

Isnt working on the client because 5.1 has a new networking system?

fathom aspen
#

Again the new replication system has nothing to do with you, neither you neither the course neither anyone is using it

#

TL is doing that check in BeginPlay so they spawn the actor on server

#

Considering BeginPlay fires on both server and client, so they are filtering execution

#

If that code is executing and the actor bReplicates then it should be replicating just fineโ„ข๏ธ

shy radish
#

but this is my issue the weapon actor is replicated but spawns only on server and not on client which as explained is because the weapon actor isn't replicated

barren surge
barren surge
#

Have you defined a GetLifetimeReplicatedProps() function on the actor that owns the weapon and correctly declares the weapon property var?

barren surge
#

๐Ÿคทโ€โ™‚๏ธ

#

would need to see more of the code then...

chrome bay
#

willing to bet it's relevancy related

shy radish
#

you mean net relelvancy?

chrome bay
#

yee

shy radish
#

tried it too no result

chrome bay
#

Impossible to say then really without being able to debug it

shy radish
#

how would you debug this?

chrome bay
#

Well you need to figure out why it isn't replicating. Make sure its spawning first, make sure it's not being destroyed by something else, make sure it is in fact replicated etc. Check logs

#

But it's going to be specific to your code/project

barren surge
shy radish
barren surge
shy radish
shy radish
wheat magnet
#

does android in unreal support dedicated multiplayer?

shy radish
sinful tree
# wheat magnet ?

Are you trying to run a dedicated server on an android, or are you wanting an android device to connect to a dedicated server?

wheat magnet
#

like oculus quest 2.

sinful tree
#

I can't fathom why it wouldn't work.

wheat magnet
#

in other words, I have oculus quest 2. I want to package .apk game for quest 2 which connect to dedicated/listen server and users will play in VR multiplayer.

sinful tree
#

Like, your app on your device is a client, the server is something the client would connect to.

wheat magnet
#

not dedicated. But listen server maybe?

#

Like we create sessions in unreal engine

#

for multiplayer.

sinful tree
#

Technically it's possible.

wheat magnet
#

My question is that, is multiplayer supported for android devices?. Like for PC

#

Technically or exactly?

sinful tree
#

If you can run the game on android, you should be able to run it as a listen server. As to how well that will work though...

wheat magnet
#

how it will work over internet?

#

Like dedicated server. Not local/LAN server

#

is there any proper documentation/article for android multiplayer?

sinful tree
#

I think you may be mixing up terms....
Dedicated Server: A dedicated piece of software running exclusively to host the game. It runs headless, no 3D rendering is done.
Listen Server: The game client acts as a host of a game while also playing it.

So, these being defined.... If you were to run a dedicated server, you'd likely have it set up on a PC somewhere. You could still have it host a session and allow players to connect to it.
If you were to use Listen Server on an Oculus Quest 2, that means the Quest is having to also act as the server, which means more processing power is taken up trying to host the game, and typically for VR apps, you want them running at the absolute best they can so you can hit the framerate targets so you're not making your players feel sick. Further insult to injury is that additional network data is having to be routed through the host Quest over wifi. So it is technically possible, but probably not the best idea.

wheat magnet
#

So what is best idea?

#

I know the QUALCOMM chipsets is not equivalent to intel architecture CPU's

rose egret
#

what happens if I spawn a replicated actor and call a multicast right away, (actor is net relevant)
will client receive that Muticast ?

#

will the multicast be ignored ?

sinful tree
# wheat magnet So what is best idea?

It's not so much about what is best. It's about what you're trying to accomplish.
If you want players to be able to host their own online multiplayer instances and don't want them to have to rely on external hardware or setting up their own severs, and you don't want to host servers for them (ie. They only need their Oculus Quest to player your game online) then having them being able to host their own sessions on their quest is really your only option.

If you want to allow players to host their own servers, that means you're releasing a server executable to the wild, allowing players to host their own games on whatever hardware they want.

If you want to host servers yourself, that's possible too, but then you have to build your own backend to support your playerbase - eg. Player wants to connect, a server instance is started for them, they join, a session is started for others to join etc....

wheat magnet
#

If I package dedicated server for windows platform ( like people do mostly in these days ), And package game for quest 2(.apk), Will I able to connect to that dedicated server ( open 127.0.0.1 ) in android?

sinful tree
#

Yes

wheat magnet
#

But server is running on windows platform. How does it will work with android?. Like If I sent server RPC from android, does it gets called on windows server?

sinful tree
#

Network connections don't usually care about the device connecting. What you've just asked is like asking how does an Android load a webpage when the windows server sends them the web page.
Data is data.

Your server and your client are set up with those RPCs - the RPCs are the instructions for communicating between two endpoints, regardless of what they may be running on. One could even make their own client made in a completely different language, running on an Arduino to connect to an Unreal Engine server, and so long as it communicates the right data back and forth & calls the correct RPCs, the unreal server could care less that it isn't actually an unreal client, or that it isn't running on one of their supported platforms.

#

This is also why it's actually very difficult to validate a client over the internet. You can't trust client machines as someone with know-how can make it so it always responds back with whatever data they want.

wheat magnet
#

This means multiplayer in unreal engine is not platform specific.

#

So it's like cross platform. I will test sessions/steam/EOS things in quest 2. I hope these plugins/subsystems works well with android.

half cradle
#

so i just packaged a third person template with dedicated server and im getting slightly shitty performance at 2 clients and absolutely dogshit at 3
about 30-60ms lag to replicate movement on the other client with 2 and >500ms with 3

#

am i missing something fundemental here or is this just a hardware issue?

#

the PC is not exactly sweating it

rose egret
#

how to make a Server_XXX() virtual so that I can override it in subclass ?

quasi tide
#

You override the _Implementation method

sinful tree
#

From what I understand, if you're using Seamless travel on a server, a player controller would persist through the transition, but if you're just server travelling without seamless, then new player controllers would be created as each client is effectively reconnecting to the server. Client Travel (ie. Moving from server to server) would also be a hard travel, so player controller wouldn't persist.

weak linden
sinful tree
weak linden
#

The clients' local GameInstance is a great place to store stuff like that, player name shouldn't need to be stored in that manner though (Since you can use SetPlayerName and it "should" be copied to any new player states when switching levels)

fathom aspen
#

Read the link I sent and you have all the info you asked for + you can start preaching about this stuff

half cradle
half cradle
timid moat
#

@thin stratus About your last paragraphs in your "UE4 Multiplayer Sessions in C++" tutorial, I have found this answer useful: https://forums.unrealengine.com/t/how-to-use-c-session-search-results-with-blueprints/352007/5?u=viacognita

half cradle
#

specifically the Start_WithTURN_SignallingServer.ps1

blazing spruce
#

Hi, I'm having an issue getting my security camera system working on the client properly, I've got a Control Panel BP which does this, works fine for the server but when the client interacts with it, it sets the clients view to the camera but doesn't disable their input and enable the input on the control panel instead so they cant cycle through the cameras nor can they exit them, any ideas why?

#

Interaction

fervent jay
#

early on with EOS it was a bit of a task, but its alot easier today..

hushed rain
#

Having problems replicating the result of a random line trace location so I can spawn fire at the location for a molotov. Any ideas why the server/client line traces don't line up?

#

The random line trace runs on a timeline to perform multiple line traces with a random end result within a box, should output the hit location to the multicast, no?

sinful tree
# hushed rain Having problems replicating the result of a random line trace location so I can ...

Your "Fire Spawner" actor should likely be a replicated actor. On begin play you then wouldn't need to multicast the sound, you just have the sound play.
After playing the sound, you should use a Has Authority node and use the "Authority" path to have the server run the next bit of code (your line traces) - there should be no need for the "Run On Server" event.
Rather than multicasting to everyone to spawn BP_Fire, have that too as a replicated actor and don't multicast - just let the server spawn it, that way you allow your server to be in control of that actor on all clients.

gusty turtle
#

i think my possess node is not working beacuse it has to be run server side

#

i would like to be able to call it from the playercontroller tho

#

where should i run the possess node?

#

in the level blueprint?

#

but i do not understand how to call events within the level blueprint from another blueprint

blazing spruce
valid imp
#

Anyone knows the max Array size (for say bytes) that can be replicated? Assuming whole array has to be sent ofc.

sinful tree
tall bobcat
#

looking for blueprint coder to code/or implement GUI, Playercontroller .no, quest system, ability systen, inventory system

quasi tide
#

Please don't spam. As I have already told you in #ue5-general

tall bobcat
#

You just wrote instructions

sinful tree
quasi tide
kindred widget
#

And even if you could ask for hired or volunteer help in channels, GUI stuff has nothing to do with Multiplayer. ๐Ÿ˜„

sinful tree
#

Looks like the array would be truncated to fit as well, so it would still attempt to send but it'd have missing entries so it's under the size limit.

valid imp
pallid mesa
#

its really 64k, and no, unreal doesn't chunk it for you

#

you have to chunk it yourself ๐Ÿ˜„

#

ooor... err... increase the maxbunchsize (do not do it unless you know what you are doing ๐Ÿ™ˆ )

fathom aspen
sinful tree
#

Sending huge arrays be like:

hushed rain
sinful tree
hushed rain
#

Hmmm it is showing line traces on client tho wtf..

sinful tree
#

Post your updated code.

hushed rain
#

the fire actor is just a timeline damager with particle

sinful tree
#

How long is your timeline?

hushed rain
#

like 30 seconds i think

sinful tree
#

And the New Track 0 is firing periodically?

hushed rain
#

20 seconds with an event track

#

firing every .5 seconds or so

#

maybe everyh second

#

yea every .5

sinful tree
#

Also, are you actually spawning the Fire Spawner on the server?

hushed rain
#

yea when the molotov hits the ground it does a multicast to spawn it

sinful tree
#

"Executes on All" is not spawning on the server. That spawns a copy on all clients.

hushed rain
#

ohhhh duh

#

so thats why it was running on all then

sinful tree
#

Yep. The other thing is, I'm not sure if that fire damage actor is completely necessary and it's a bit wasteful spawning actors every .5 seconds that are I'm guessing pretty much deactivated as soon as they've spawned?

hushed rain
#

nice! i think it works perfectly now

#

yea im probably going to tweak it to be way less actors but bigger actors

#

is timeline the worst way to do fire?

#

also im kinda going for a procedural/random sort of molotov

sinful tree
#

Not the best per se.... If you wanted to deal damage over time, a timer is usually sufficient, but it depends on if the track you're using is firing at a static rate or not, which going by what you just said, you may have some random points set where it triggers, but even that could likely be handled better by a timer that you retrigger with new random values rather than relying on a static timeline graph.

Example:

#

Either way, timeline/timer works fine for such a situation.

hushed rain
#

But yea, i've heard timelines are just slightly more performant ticks lol.

quasi tide
#

That makes no sense. Timelines use tick as well.

#

What someone might think is timelines are more "performant" because they are more akin to on-demand ticks.

hushed rain
#

Ahh maybe that was it.

#

So timer is the most performant way to do repeating time-based events?

graceful flame
#

This way or that way doesn't really matter so much when they both end up requiring stuff to change every frame.

hushed rain
#

Interesting, thanks for the info. ๐Ÿ˜„

prisma pelican
#

would hosting game session in game instance instead of game mode cause any issues?

plucky prawn
#

Don't timers run on tick though?

frosty dune
#

Hey guys, newby to UE here. What would be the best way to go about storing player data for multiple players on a dedicated server (Money, item amounts, etc)? Would it be something like sqlite or can I get away with something already in the blueprint'ing system?

#

Gotcha. Thanks! ๐Ÿ™‚

graceful flame
# frosty dune Gotcha. Thanks! ๐Ÿ™‚

Just know that save games are files stored locally and therefore not secure. If you're storing something sensitive like gold amount you can't trust the client save game because they can easily change the values. So instead you probably want to use a secure cloud database and REST API for data storage and reading.

frosty dune
graceful flame
#

Feel free to use save game for client settings though like video and audio, mouse, keyboard bindings ... etc

frosty dune
#

Yeah that makes sense. I'm familiar with Postgres/MySQL so I can just implement one of those probably

sinful tree
#

If your intention is to allow other players to host servers, then you cannot use an external database reliably. If you are hosting your own servers (ie. no one else has server executables, no one can host as a listen server) then you can use external databases.

distant vault
#

Hello, im testing out server travel in standalone with 2 players and I get these errors some times and for some reason my other player cant find the hosts match. anybody know what this means.

weak linden
# frosty dune That's a hot tip. Yeah I can't store that information locally. I'll probably jus...

Just an FYI, you can most definitely use SaveObjects server side, as long as all your data, such as currency, items, etc, is managed/updated and validated via the server itself, then there's no need to worry.

Of course, if the data needs to be shared/accessible to other servers, then there will definitely be a need for a custom back-end solution, REST API, SQL, etc, but those will still need the server to be in charge of managing, to prevent any "funny business".

weak linden
dark edge
#

If it's meant to be continuous or on the order of many a second, use tick/timeline

distant vault
uneven kraken
#

Is there a way to set NetUpdateFrequency at the field-level, or the component-level, rather than an entire Actor?

hollow eagle
#

no

dry pebble
#

What would be the best way to dynamically change bUseControllerRotationYaw only when a client is moving/pressing input and then also have that replicated to other clients? This is so you only rotate towards camera's direction when moving. I have it so only when input is pressed bUseControllerRotationYaw = true and when it's (0,0) bUseControllerRotationYaw = false. But other clients can't see them rotating.

grave fog
#

how to get clients player controller ?

winged badger
#

from where?

weak linden
# dry pebble What would be the best way to dynamically change bUseControllerRotationYaw only ...

This is C++ but can easily also be achieved in BP if you need it (use VectorLength in BP instead of Size), I run this on Tick, so it updates on all clients

// In Tick
bUseControllerRotationYaw = IsMoving();

// Function header.
UFUNCTION(BlueprintCallable)
bool IsMoving(float Threshold = 0.0f);

// Function CPP
bool AMyCharacter::IsMoving(float Threshold)
{
    return GetVelocity().Size() > Threshold;
}
#

The optional threshold is in cm/s

grave fog
#

how to get clients player controller on server ?

winged badger
#

again, context

weak linden
winged badger
#

you can have 10 clients and want one specific controller

grave fog
#

player controller

#

on servers PC

weak linden
#

The PC is the controller, it doesn't matter if you're on server or not, or are you trying to get *another* players' controller?

grave fog
#

if I run event as run on server veriables I use on that event are server veriables or client variables ?

weak linden
#

If you run a "Run on Server" event from the clients own controller, it will run on the server within that controller, so any variables are local values to the servers

winged badger
#

anything coming out of ServerRPC is evaluated on server

dry pebble
weak linden
dry pebble
weak linden
#

Correct

dry pebble
# weak linden Correct

Ahh thank you so much! I thought I was going to have to make a custom struct for the character movement component FSavedMoves or something. You really simplified that

weak linden
dry pebble
weak linden
rough dock
#

hey im kinda having a problem with this. i have a string that gets shuffled so the messages are random each time you load into the lobby but the client and the servers string is different

#

im not really good with replication so i fell like im doing something wrong

#

it works when the host of the custom game hits start then it searches for the actor that i want then it replicates to all since its coming from server

#

then the bp casts to widget so it can start the scrolling text

#

also when it makes the full message it replicates to all the message

rough dock
#

also i just tried replicating all the variables that didnt work

weak linden
# rough dock hey im kinda having a problem with this. i have a string that gets shuffled so t...

The first issue I see is that you have a replicated variable in your Game Instance, which itself is not replicated, the server and client/s have separate local instances, secondly, am I right in assuming this code is in a widget? If that's also the case, widgets also only exist on the client, so you will probably need to route this via an RPC in the widgets owning controller instead ๐Ÿ˜…

Unfortunately I'm just heading off for the night, so I can't give you much more help than that right now, but if you don't have it solved in about 8-10 hours from now, feel free to give me a message ๐Ÿ‘Œ

rough dock
#

and rpc is repnotify right

weak linden
#

No, widgets don't exist on the server at all, and no, an RPC is a custom Event marked as Run on Server/Owning client/Multicast

fathom aspen
weak linden
#

But technicalities ๐Ÿคซ

fathom aspen
#

Messing around with replication when you have little to no experience with it is like playing with fire

#

So better take the time to learn it

fathom aspen
#

It's watch + read ๐Ÿ˜„

valid imp
fathom aspen
#

vori meant you do if it's bigger than the max-size

ancient adder
#

I have a run on owning client function in my component but it executes before the component is created on client side, is there a way to make it delay the execution untill the client is ready or something like that? without adding extra functions

fathom aspen
#

I know at least two, but they involve adding extra code, like any other way that would exist out there

pallid mesa
violet birch
#

Hey! Has anyone tried making server to server communication working for UE5?

Client to server and server to client is solved, but a better server to server would be nice.

violet birch
pallid mesa
#

yes

#

but for notifcations and such it's not a problem

#

unless you want to build something more complex

violet birch
# pallid mesa unless you want to build something more complex

Fair enough ๐Ÿ™‚ I guess it depends on complexity.
The question is mostly out of discussion and curiosity, but lets say a MMORPG.
That's quite complex and I def. see some problems with delay. The middle-backend (MB) I guess should still exist to hold track of universe-state and server scaling.

I was thinking about this and it would be nice if the UE servers could communicate some information without MB or at least in parallel. Lets say physics and collision would be handled by UE server and client. Position and critical events would go through MB.
The scaling thing also needs to be a combo of server<->server and MB for when you cross server borders. There should be a proxy player actor replicated over to all the servers that can see the player but not authorized over it.
So far I've only found solutions that would alter engine source. Which of course is fine if you want to maintain that code ๐Ÿคทโ€โ™‚๏ธ

pallid mesa
#

for that... you'd be better off building your own networking model from scratch, main advice is to explore how wow does it

bitter oriole
#

And physics/collision is what drives position, so one of those servers in your achitecture needs the ownership on it (the one the client is connected to)

violet birch
#

yeah I guess. do you know if Iris will add anything of it?

pallid mesa
#

no, I'm afraid not

#

Iris is a complete rewrite of unreal's networking model but the principles will still be preserved (listen/dedicated)

#

server to server is beyond the scope, but... not sure if we ever will see official support or something in the future

violet birch
#

I understand why, but sad ๐Ÿ™
But there is of course pros of writing your own layer. Control and all that.
If I want to do that do I need to replace UE network layer?

kindred widget
#

I think that depends on requirements. You can easily use Unreal's networking for localized stuff and have a backend handle server to server stuff. For example, if you had two parts of a world. One server could run one, the other server could run the other. You would be able to use Unreal's normal networking in each based on some set state from the backend. Your servers could be modified to send and receive data from and to your backend, and your Unreal Network just becomes the local manager basically. Same idea for instances of a same level like common MMO dungeon running, etc.

bitter oriole
bitter oriole
#

Honestly, really depends on the game. Are you doing a trading cards game with turn-based gameplay with a central server defining card ownership? Then it's not that much work to simply do everything yourself

violet birch
violet birch
#

yeah the scope really does effect the complexity of the answer ๐Ÿค” This is a little bit over my head, but I'm thinking quite complex. You know dynamic server borders, 10th of thousands players and scalable servers with shared map area and so on. A middle-backend holding the "universe" and controlling what happens and so on

bitter oriole
prisma snow
bitter oriole
prisma snow
prisma snow
bitter oriole
#

Unreal's net model is a consequence of Unreal Tournament, Gears, Paragon and Fortnite - games where people join a server to play a 20 minutes game and then leave or maybe stay connected while the server travels to a different map. If you break out of that mold, you have to accept that there are consequences

#

It's made for multiplayer shooters, plain and simple

#

It's quite good at that, too

#

If what you're doing is Magic Arena, Destiny or Diplomacy, well, it's not really what it's made for

prisma snow
violet birch
#

Yeah it's not a small challenge xD Yeah I've understood UE isn't made for it. I really just wanted some more thoughts and discussion around it.
I have investigated using Online Beacons as a actor on the server to communicate with other servers. But it's not really trivial.

#

A nice compromise would be to have a lot of servers hosting separate parts of the world, some hosting the same, and when you walk over a border you net travel. Then a common backend service would keep track of states so that the different instances can match.
We use a grpc library today to sync stuff between the servers and backend.

#

Coming from the Automotive industry, I'm fascinated that game industry still are so secretive about their implementations. Especially common stuff. Though some stuff might be harder to generalize in games ๐Ÿคทโ€โ™‚๏ธ

At least we do have pretty awesome game engines now a days ๐Ÿฅณ

bitter oriole
#

The folks at Bungie have detailed their infrastructure, for example

#

(microservices, essentially)

#

The main thing here is that what you're asking about isn't common (most games don't have player state handovers between servers, very, very few do) and it's typically the sort of stuff teams of 100 engineers talk about

violet birch
#

Okay your right. That is actually a good point.

bitter oriole
#

Most of the gamedev experience is more like "we have to write the entire game code in less than a year so what can we reuse from our previous game and still make appear different"

#

Few people actually get to invent entire network architectures

kindred widget
#

Game industry isn't really secretive about anything except for cheat prevention stuff. There just also isn't a good source of common data and every studio has their preferred ways. You have to pick around for information a lot.

violet birch
#

I mean I still find it much harder to find implementations in detail. Sure there are a lot of broad picture videos and so on. A lot of forums are bad (especially UE for some reason)

So maybe secretive is the wrong word. It's how the information is distributed I think. Or maybe it's even a personal preference thing.

But this kind of network implementation isn't that common I guess.

#

I could give more examples, but it feels out of scope of this channel ๐Ÿ™‚ I appreciate your thought though, they make sense. I might need to revaluate my view on the industry

bitter oriole
#

I mean, the stuff we're talking about here is usually decades in the making, less by choice and more as a consequence of which game you made before.

#

Epic has a specific multiplayer model for Unreal because it's what they've needed so far

#

That Unreal doesn't do sharded MMO multiplayer servers is, well, a consequence of never working on a MMO

violet birch
#

Is there a engine out there that focuses on MMO?

bitter oriole
#

How many MMOs do you think get released these days?

dark edge
bitter oriole
#

More to the point, who has the marketing budget to pay for enough players to have something you could call an MMO

#

And tech wise, when Fortnite and Destiny have the player counts they have for the time they've had them, why would you want to build a traditional MMO

#

Anyway, say you still want to build a traditional MMO with Unreal, and you don't want instancing but a completely open world map with all players on it - you'll throw out the networking model, and build something yourself

#

If you do that, well, you're going to have to reinvent rollback multiplayer, things like that - this is extensively documented

#

It's just that no one writes tutorials for making an MMO because making an MMO is 1000 developer-years of work

violet birch
#

A company could have the budget? Like the company I'm working at. We are doing a MMO in UE5.
Luckily for the company, I'm not the one working on the multiplayer part ๐Ÿ˜† I'm just curious.

What is a "traditional MMO"? ๐Ÿค” I don't know if that's what we are doing.

I know that we are altering the engine, not sure in what extent. (well, I know some because I was in that team, but not anymore. We have solved server to server, but I don't know if it's good/stable enough)
I don't really agree on that there are extensively documented, but I absolutely understand why there are no tutorials.

#

Maybe the documentation would seem extensive for someone more experienced than me. MMO-networking is not the easiest area in game dev I'm guessing.

bitter oriole
# violet birch A company could have the budget? Like the company I'm working at. We are doing a...

A company could have the budget? Like the company I'm working at. We are doing a MMO in UE5.
If you have the budget to reach millions of players, that's great news! I'm not sure many companies today outside of blizz, amazon and a few others can do that.
What is a "traditional MMO"? ๐Ÿค” I don't know if that's what we are doing.
Fully open world map with as may players in one spot as you can find willing to be there - as opposed to Destiny's instanced levels where you have hard caps on player count.
I don't really agree on that there are extensively documented
There's entire tutorials on rollback multiplayer in Unreal specifically, for example

violet birch
#

That's my general perception of game industry.

But I think we should focus on how much better it has become over the years ^^ I have a tendency to forget that

#

I haven't used UDN that much, but it's not that good. I don't know anyone that uses it to be honest.

bitter oriole
#

Literally the first time I've heard anyone say UDN wasn't that good

prisma snow
#

UDN?

bitter oriole
#

$$

prisma snow
#

Ohh I see

#

$$

violet birch
prisma snow
#

$$ open lots of doors, although I am always surprised at how far you can go for free in this industry

bitter oriole
violet birch
violet birch
bitter oriole
#

I think MMO tech is kinda overrated - sure, it's a bunch of very hard infrastructure problems, but the content pipeline and community is probably a bigger one

#

At least today we have a lot of nice tools

violet birch
#

haha yeah I hope they do xD
But I think it's the implementation of the forum and not the expertise of the people hanging there that is the issue. Anyways I'm gonna come clean and say I think I might need to give it a new chance ๐Ÿ˜„

bitter oriole
#

Really you probably don't want C++ for much of your game servers when ๐Ÿฆ€ is right there

#

But like, probably not C++, whatever your pick.

#

There's a bunch of dedicated server-side languages for safety and uptime too

prisma snow
#

So an MMO would basically rely on a custom server(s) that handle all game logic, and then the client is only for input/output, rendering stuff, and asethetics?

bitter oriole
#

Yeah

#

That's kinda how they work historically

#

Fairly dumb clients compared to shooters where the client and server work more symmetrically

prisma snow
#

Writing such a server system sounds indeed extremely complex. Mainly due to the real-time stuff, plus of course the complexities of such big spaces with so many players

prisma snow
bitter oriole
#

Shooters run most of the game locally, really

#

That's what prediction involves

prisma snow
#

Well that's true, at least movement/combat which is the meat of it usually

bitter oriole
#

You run the entire game on each machine, and then when the server tells you the ground truth that it decided on, five frames later, you have to rollback to that state and replay your latest changes on top

#

It doesn't get much smarter than that, client side

#

Shooter clients are trusted to a much higher extent than any other genre

#

The classic "shooter is right" line of decision where servers prioritize shooters vs their targets is something no MMO is going to do

plucky prawn
bitter oriole
#

I'm not saying the server trusts the client blindly

#

I'm talking about how servers reconcile two clients who say "I'm A, I shot B" and "I'm B, I moved out of sight from A"

#

You have to pick one version of the truth because they're both right from their perspective due to lag

#

Usually, you pick A, with some checks like you said

#

You could do everything server side without any complex logic and just go "too bad A, B had moved away, even though your screen showed B's head in your crosshair when you fired"

#

That would be way easier

#

But "missing" a shot that you correctly took on your machine sucks immensely, so most shooter developers go through absurd lengths to prioritize that, even when it means the other, equally correct player will be noticeably shot through a wall

#

AFAIK most MMOs will run everything on the server without much prediction, and then download the feedback to the client

#

I suspect spellcasting progress bars exist mainly because of that, yeah

prisma snow
#

Also sound cues and animations can hide latency very well

#

RTS usually have some input delay by default (lockstep) and some hide it really well, SC2 cames to mind (although Starcraft is extremely responsive)

bitter oriole
#

Even a casting delay of 0.2s (after the player has committed to the action) is a godsend because most of the time that will be enough to tell every client what's gonna happen and when exactly

#

The "shot through wall" thing then doesn't happen because you get nuked by that fireball at a time more consistent with your location

#

Yeah also that

#

TLDR, shooters are absurdly hard multiplayer wise

#

MMOs have different difficulties

#

Much simpler clients, less interactive real-time stuff, at the cost of needing to run 150k players on your tick

#

Server go not brrt

worthy knot
#

im running a print string of this on event tick, it only displays changes on the server, i made it return a vector variable which is set to replicated and still displays only on server. on the other hand i had to make a server and multicast call on event tick then the variable displays changes on server and client, why is it like this

#

i dont want a whole server and multicast event running on event tick

bitter oriole
#

Why not use a simple replicated variable?

timid moat
#

This tutorial https://cedric-neukirchen.net/2021/06/27/ue4-multiplayer-sessions-in-c/ is really difficult to make it work with Blueprint. I think it is better to create another class to make the calls to the methods on GameInstance, instead of trying to modify the code: I'm blocked trying to create my own UENUM to use EOnJoinSessionCompleteResult with blueprints.

This post shall give you a short introduction to handling your Multiplayer Sessions via your own C++ code. Most of you probably either started with...

worthy knot
#

you mean this?

plucky prawn
#

ye but dont though

timid moat
#

If you are talking about my question, that is what I'm going to do: not use blueprint because it is a mess. The only reason to use blueprint is let the user to join a session clicking a button in a blueprint widget.

worthy knot
timid moat
#

I don't know a lot about sessions, but if there more than one session in the server, how can I choose the one to join? Or probably there is only one every time in the server.

#

In Shooter Game project sample from Unreal 4.27 the use Slate for the UI, so they don't have any problem because they do everything from C++.

normal fox
#

how do you replicate a variable from client to server in umg bp?

#

so that all players see the change

bitter oriole
normal fox
#

the change does not happen server side.

bitter oriole
normal fox
#

the user widget?

#

where would i need to replicate this?

bitter oriole
#

A widget should not be replicated, so it won't be able to send RPCs.

normal fox
#

i see.

bitter oriole
#

Normally only your player controller or possessed pawn is able to send server events

normal fox
#

so i need to cast to the pc?
how would the other clients/server be able to then see the update in their widget?

bitter oriole
#

You need to get a pointer to the PC, then have that PC send a reliable server event to the server, which will be able to alter game state on the server

#

Provided that state is replicated, the value will be updated to other clients down the road

#

Their widgets should either use a replication event or self-update on tick

normal fox
#

thanks for the help.
imma see what wonky thing i can make work ๐Ÿ‘Œ

trim plume
#

Hi. We are making a racing game were the vehicles will reach 1000 kmh, everything seems smooth until we reach around 500 kmh.
We tried lots of things, and the best result is when we're using the SmoothSync plugin, which made us reach 500 kmh, any greater than that and the vehicle jitter.
The player owned vehicle is buttery smooth all the time, it's the other players that jitter when at high speed.
It should be possible since Redout2 is made with unreal, and they can drive like 1400kmh.
We've spent a week now trying to solve this issue.
Anything that can help us is greatly appreciated. Thank you in advance.

normal fox
violet birch
prisma snow
bitter oriole
violet birch
bitter oriole
#

Like, Amazon literally had to rollback the entire game a few times last year because they messed it up

bitter oriole
#

New World

violet birch
#

Made in lumberyard. I wonder if they released their network solution somewhere now that Lumberyard is open source. ๐Ÿค”

trim plume
bitter oriole
violet birch
#

Maybe not, but maybe some ideas and solutions that could be valuable to look at.

Edit: Seems like O3DE is not really Lumberyard. Just the base and then stuff is replaced

normal fox
tranquil yoke
#

I have a case, where i replicate actor from Server1 to Server2 via Beacons, i do it by adding it to customNetDriver of HostBeacon Server1 , and then on the reciving end it gets added to GameNetDriver of the server2, Now issue is on Server1 it has NetRole == Authority, but when server2 recieves it NetRole becomes simulated.

What i want is i want to change the NetRole on Server2 to Authority also, so my game logic on Server2 should stay the same.

anyone know how to manually change roles ?

violet birch
tranquil yoke
#

What is that something else ?

violet birch
tranquil yoke
#

I think having NetRole - simulated on BeaconNet Driver is fine, but when it gets added to GameNetDriver it should be authority again

glad escarp
#

Hey folks. I currently have a simple host game menu which has an editable text box that saves whatever is entered into the field on commit, as a string variable on my game instance. This variable is used as the session name when creating an online session. I wanted to store it on the game instance so that it would be persistent and I could use it later when destroying the session. Is this flow correct or is there something else I should be doing for best practices?

violet birch
fossil merlin
#

Anyone have issues moving to 5.1 with code containing Switch has Authority nodes? None of my code seems to fire correctly now with those nodes in place from 5.0 to 5.1 running as a client.

gusty turtle
#

Im trying to have a component of a blueprint move after user input through blueprints, the blueprints moving the component are run on the server and the movement does not replicate on the client. I got it working by multicasting the event that moves the component but is that the correct way to do it, or should I only call it on the server and replicate the movemnet of the component?

#

since now the objects arent really synced, and I think if player spawns later on all components will be in their original state for them

rocky kestrel
#

Does anyone have idea why me or my friend can't connect dedicated server? Without "[OnlineSubsystemSteam]
bEnabled=true" it works you can host server and you can join with ip. But when I enable Steam no-one cant join server. It's shipping packaged server and game. Both ways launched from steam.

#

is it just dedicated servers and SteamSubsystem doesn't work together. Then I have to make login functionality and databases. Steam just could be easy that I can use steamID64 and no login expect steam needed.

thin stratus
#

That's as simple as it gets

#

If the Server is using NULL, then you won't be to connect to it

#

It will deny you due to mismatching UniqueNetIds

rocky kestrel
thin stratus
#

You need to copy the .dll files of Steam into the Binaries folder of your Server

#

Otherwise it will try to connect via a SteamAccount

#

Which it shouldn't of course

violet birch
rocky kestrel
thin stratus
#

They should be in that folder or not?

#

Like

#

.dll files

#

I don't remember how that exactly works

#

Been ages

rocky kestrel
#

There is only steam_api64.dll

#

in that Steamv153 folder

thin stratus
#

Can you check the ThirdParty folder of your engine

#

There should also be steam i nthere somewhere

#

There should be more than 1 .dll iirc

#

And you need to then copy them to your packaged server's Binaries folder, where the exe is

rocky kestrel
thin stratus
#

Well, then just try that one dll

#

Again, been a good chunk of time since I had to do that

rocky kestrel
#

haha np. Thank you for help I try that!

tranquil yoke
#

@violet birch thanks

u changed NotifyControlMessage, which means u added a new NetConnection via the beacons , which means it should have added playercontroller, playerstate and gamestate . am i right ?

#

I tried adding the netConnection, but NetRole was creating issue so i just moved to adding actors and pawns directly most of the replication which is required for simulation is inside the pawn itself.

cerulean seal
#

For multiplayer with the gameplay ability system, Does anyone know if you have to register for attribute change callbacks on the server?

I'm trying to sign up for an attribute change on my client to update my health bar, but for some reason, the callback only fires if I register on the server. Then I have to setup a multicast event to get it to spread to the clients. I have verified that the attribute is replicating to the clients, so I'm confused why I cant register for the callback on my clients.

https://gist.github.com/imstylen/c62ac651cafe3e9c08dd4cb0a6aec253

Gist

On Attribute Changed Callback. GitHub Gist: instantly share code, notes, and snippets.

violet birch
# tranquil yoke <@140940687951527937> thanks u changed NotifyControlMessage, which means u add...

This is a bit outside my understanding of it. But we created a new class derived from OnlineBeaconClient and override NotifyControlMessage from there. Which means, I think, it still using the beacon impl of NetConnection.
I don't think it's any different from creating a regular beacon connection except that we are following a different Connection flow scheme.

This is as far as my knowledge goes. We did a pros and cons. Pros was just that it will leverage UE replication as is. Cons was resource cost because there will be a beacon per server and a connection per actor. Or something like that ๐Ÿค”

tranquil yoke
#

Thanks for your help

violet birch
# tranquil yoke Thanks for your help

np and good luck. Fun to see that your are going like 99% the same route as we are ๐Ÿ˜„ I just wish I could help you more.
If I find out more I will ping you

oak hornet
#

hi does somebody heare know why when i create sessions gets created with "ERROR" status??

#

amazon gamelift

violet birch
#

@tranquil yoke Are you trying to avoid engine source changes? I know we decided that was inevitable for us.

tranquil yoke
timid moat
#

Can there be more than one session on a dedicated server? If so, how do I know which one to join?

#

Thanks!

kindred widget
sinful tree
#

One could argue you could want multiple sessions if you set up the server to run multiple worlds. ๐Ÿค”

timid moat
#

@kindred widget @sinful tree Thanks!

kindred widget
#

Yeah. I'm used to the ARK model. ๐Ÿ˜„ Each world is just a different server.

sweet ore
#

hi guys. i want to ask how to make a room system that give every player a room just like lobby but with 2 more things 1- the player can alter in this room change furniture for example 2- room dont close if player left so others can visit anytime
how to do this with unreal?

clear gate
#

Hello,
I have a capsule component attached to my character mesh, and when I get its rotation it shows correctly on client, but the server doesn't account for the animation and shows me a static value. How can I get an accurate rotation of this component on server? The actor and components are set to replicate

thin stratus
#

Because no, you don't have to bind on the server and notify the client. That's very wrong :D

thin stratus
#

Also it's not clear what a room exactly is. A Lobby is usually hosted by someone or something.
If that someone leaves, no one hosts anymore.

#

So no more Lobby/Room.

latent heart
#

Or you could save it locally.

#

With a SaveGame

dark edge
#

set โ€œMesh Component Update Flagโ€ on your skeletal mesh to โ€œAlways Tick Pose and Refresh Bonesโ€

sweet ore
#

i mean the room it self how to give it to every player

latent heart
#

You need some way to unique identify each player, like a steam Id.

#

Then you need to load and save the room with the associated id

sweet ore
#

i have id for every player but i'm stuck in giving rooms

#

i need to create only one level?

latent heart
#

Create a base, empty level and spawn the room contents dynamically.

sweet ore
#

thanks i will try it

solemn raven
#

I'm working on a multiplayer game with persistent state. I see there is stuff like RemoteDatabaseSupport is it generally best practice to store relevant state in postgres or another database and then access it from game servers? Is there a different database commonly used with unreal or different approach commonly used? Thanks

latent heart
#

Do you even want to use a database?

#

You could use a save game instead.

#

Depends on the scope of your game.

solemn raven
#

maybe I'll look into save games

#

can they be used for global things in the world other players would see too?

#

base with a new name, something like that

weak linden
#

Yes, that would work with SaveObjects as it would with other types of databases

#

The only "downside" to SaveObjects (this is entirely subjective based on use case) is that they are entirely controlled within the game/engine, there is no external access, which is totally fine if you don't need access to the data in an external tool

pastel fiber
#

I have no idea how the multiplayer game works.

Assume I want to create a competitive game with two groups, each of 5 players.
From one group's perspective, its players are allies, the other players from the opposite group are enemies.
It means a single game needs two groups.

Now, I host this game to a dedicated server, there are 100 groups are trying to play simultaneously.
Question:

  1. Does the server need to run 50 instances of the game?
  2. Is it possible for a single game instance (rather than 50 instances) to orchestrate 50 games?
latent heart
#
  1. You need 50 server instances
#
  1. Yes, but not something ue supports out of the box. Don't try it unless it's an extremely simple game that's probably better off run by a bit of javascript on a webserver.
vital vault
#

I have a function A work in server and it also call function B work in both client and server, what i need to function B can work both client and server in c++

pastel fiber
latent heart
#

50 copies of the engine running.

quasi tide
#

You're going to need a beefy server to run 50 game instances ๐Ÿ˜…

#

That $5 server from DigitalOcean just ain't going to cut it

latent heart
vital vault
latent heart
#

On 1 specific client or on all clients?

vital vault
#

local client

latent heart
#

So on a listen server?

#

Not a dedicated one?

vital vault
#

i need bind input both server and client

latent heart
#

There would be no point binding input on the srever, the server doesn't have input?!

vital vault
#

AbilityHandle i set when owner has authority

latent heart
#

If you want to run a function on a client, make an RPC UFUNCTION with the Client specifier.

pastel fiber
#

Sometimes I experience Connection Lost when playing online game.
It occurs almost at the end of the game right before "You are victorious" or "You lose" is shown.
My internet connection is stable.

Is it an indication that there may be a listen server that quits too early? ๐Ÿค”

vital vault
hushed rain
#

Anyone using Steam sockets? Is there a big increase in ping for players?

valid imp
pallid mesa
#

mhm

#

It'd be cool, yeah

#

at a user level it isn't that trivial as you need to check against the reliable buffer

#

so it'd be cool having a type of rpc that streams data over time as long as the reliable buffer allows it

timid moat
#

Any idea about what it is happening?

#

Thanks!

dark edge
#

Start small

low helm
#

Start small, make 4 arenas in one server so 8 teams can fight

#

just like the good old fashioned WC3 maps

#

where you just have another landscape off to the side

quasi tide
#

@fathom aspen GMC is 30% off if you wanted to try it

blazing spruce
#

Hi, im having an issue getting my client to have input on a security camera system, so essentially player walks up to a control panel, presses the interact key and then it needs to disable their input so they cant move and then enable input on the control panel for the cameras so they can cycle between cameras when using it.. works fine for the server ofc but the client wont enable its input, how can I get it to let the client have input cause the EnableInput event aint doing anything for the client?

verbal tendon
#

on input on client -> call serverside RPC, do things, call clientside RPC from server, etc...

#

Check out the pinned messages

timid moat
proven fog
#

Do clients get AWorldSettings?

fathom aspen
fathom aspen
quasi tide
fathom aspen
#

Lmaoooo, a kidney too

twilit radish
#

But why x)

quasi tide
#

Imagine - giving up your kidney to not use the CMC and still use the CMC anyway

fathom aspen
quasi tide
#

That'd be like the only thing I do for a couple of days. If I bought the GMC that is

twilit radish
fathom aspen
#

300 * ๐Ÿ’ต , here it's all yours now

twilit radish
#

Lol

twin juniper
#

hi, i'm teleporting a char via teleport blueprint on server. is there a way for a client to catch a pre teleport event so that i can spawn a fx at exact moment before the character is teleported on client

verbal sundial
#

When I open and close doors, the old door location stays there. I'm able to walk through it, but the old image is still there. Any ideas why?

fathom aspen
#

I'll believe this statement since it's being made by a handsome face girl

#

Well it's obviously not Good Looking

fathom aspen
#

No clue how you're handling collisions, but I wouldn't care for collisions as long as things are not looking quite right

fathom aspen
twin juniper
#

I dont know where that notification is in blueprints

fathom aspen
#

It doesn't existโ„ข๏ธ

#

Any CMC code you want to mess with is found in C++

#

I mean the other way would be to reliable client RPC, spawn the FX, then server RPC back with the teleport function but I can already smell a bunch of issues with this

fathom aspen
#

Also belly is empty, so that's really hardโ„ข๏ธ

#

Hope? More like hopeless despair?

#

That's not new, I've always been

mortal mica
#

what's the correct way to set a replicated property on a spawned actor, that I need to use in BeginPlay... if I just set it on spawn ("expose on spawn") it just doesn't get replicated before object creation on the client

fathom aspen
#

Right, not if it's an unmapped property

#

The correct way is to have it bound to an OnRep function that gets called when it replicates

mortal mica
#

so you mean have whatever behaviour I need to do in BeginPlay be done in an OnRep function instead?

fathom aspen
#

Not what I said. I said, any unmapped property that you want to guarantee that it has replicated to client has to be bound to OnRep

#

OnRep and BeginPlay are two very different events in time

#

On BeginPlay you get replicated properties that are the so called anciently POD types

#

float, int, etc.

mortal mica
#

what if I don't need to keep replicating/updating that value, it's just one off for spawning

#

is there a better way than an onrep var?

fathom aspen
#

That has nothing to do with the OnRep though, and no there is not

#

And what you would want to do is make it COND_InitialOnly

mortal mica
#

roger

tranquil yoke
#

Anyone knows how Engine decide local Role and RemoteRole for an actor, where is that code ?

fathom aspen
#

LocalRole and RemoteRole are also set to Authority and None in ctor of AActor

tranquil yoke
#

I am looking for non owned one, I will check that out.
I am trying to override the Roles according to my needs, where i am replicating actors over the BeaconNetDriver.
Where I am having this issue.

#

I hope this makes sense

fathom aspen
#

You caught me in the weakest point of my day (was heading to sleep), so nothing makes sense to me atm braindeath

#

But good luck

tranquil yoke
#

@fathom aspen good night thanks for clarification, try to have a look in your morning.

timid moat
#

Hi!

#

Thanks!

prisma coral
#

Hey guys, are object references supposed to become invalid after using a run on server custom event? I am trying to spawn an actor from the server based off of data stored in an object. the object is always valid when i access it locally but as soon as I try from the server it just returns null even if i pass it through the event itself as an input. I am mega confused as to why this even happens
Cheers

#

I have triple checked the objects validity with a print string

obtuse pendant
#

hey folks,working on a prototype for a multiplayer game(almost ready) C++..wanted to implement a chat system if anyone has implemented a chat system could u plz let me know how u approached or share ur codes so i can get started with mine

bitter oriole
#

Send server event with string, multicast the string back to everyone

#

The multiplayer part here is not complex

timid moat
#

Hi!

#

Do you know if anything has changed with the sessions in Unreal 5?

#

Thanks!

plucky prawn
sweet ore
#

hi
i want the player when press left mouse on other players show thier name on top right of the screen
so i need the same text to change to players names
i tried many things didnt work with me
anyone knows?

plucky prawn
sweet ore
#

i have the name variable working fine

#

when i press print the currect name

#

but when i try to press to show it on top text it give me my own name

#

not replicated

plucky prawn
#

you still have not provided any useful information at all. what class is this in? how is it being set? what function/event are you printing this in? what are the replication settings for that variable?

sweet ore
#

i'm telling you that i have the naming system working so when i press to any player it give me his name in print i just need to show it in the text when i press

#

i tried calling this (any many other things)

#

instead of print

#

and it give me the name not replicated only my own name

plucky prawn
sweet ore
#

i have the same get playercharacter 0 in the print

#

and it is working

sweet ore
prisma coral
plucky prawn
#

if its a UObject then you will need to check out the blog post from Jambax about replicating UObjects

prisma coral
#

alright thanks ill check that out

sweet ore
#

@plucky prawn thank you for noticing me i tried this and call it and it is working

twin juniper
#

hi guys iam trying to spawn player as per there team i added tags to player start and iam spawning its working fine player are spawning but either spawning tea a player or team b player

#

here the code

#

UClass* AMainGameMode::GetDefaultPawnClassForController_Implementation(AController* InController)
{

TArray<AActor*> playerSpawnsList;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), APlayerStart::StaticClass(), playerSpawnsList);
float randomNum = UKismetMathLibrary::RandomFloatInRange(1, playerSpawnsList.Num());

if (currentPawnToAssign == nullptr)
{

	for (playerListNum = 0; playerListNum < playerSpawnsList.Num(); playerListNum++)
	{
		GEngine->AddOnScreenDebugMessage(0, 5, FColor::Green, TEXT("Started"));
		UE_LOG(LogTemp, Warning, TEXT("STARTED"));

		if (firstPawn != nullptr &&  secondPawn != nullptr && playerSpawnsList[randomNum]->ActorHasTag("Asura"))
		{
			currentPawnToAssign = firstPawn;
			GEngine->AddOnScreenDebugMessage(0, 5, FColor::Green, TEXT("Asura"));
			UE_LOG(LogTemp, Warning, TEXT("Asura"));
		}

		if (firstPawn != nullptr && secondPawn != nullptr && playerSpawnsList[randomNum]->ActorHasTag("Dev"))
		{
			UE_LOG(LogTemp, Warning, TEXT("Dev"));
			currentPawnToAssign = secondPawn;
			GEngine->AddOnScreenDebugMessage(0, 5, FColor::Green, TEXT("Dev"));
		}
	}
}
return currentPawnToAssign;

}

#

I added this code in game mode

#

its looping in for loop but dont know y its taking only one if statement

#

can any one help me with this?

bitter oriole
#

Knowing what the logs output would be helpful