#multiplayer
1 messages ยท Page 36 of 1
its somewhat predictable what happens next
i say somewhat because physix is not deterministic
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.
chaos is only "out" since 4.22 i think it still doesn't work ๐
In C++ one can also set the Velocity of the Component to the one of the Actor in PostReceiveVelocity or so
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
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
guess i could also make a death zone where it destroys the physics object once it hits the deadzone?
?
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
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"
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?
no its not
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
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
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
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?
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.
That usually happens because the actor you are trying to RPC from has no net connection
and how would i give it net connection
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
idk how to give it a owner
SetOwner is one way
would i make the client spawn it?
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
what if theres more then one client
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)
i cant make all the clients own it tho??
No
No, just one client
I dont mean I want to see them dead by animation, I mean.... literally SEE, like bHiddenInGame
so it wont be replicated for all clients only the one??!!
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.
any vidoes on this bc thats confusing af to me lol
im new to replication so im clue less
Well the answer is not that different, you want to hide pawns when that OnRep_Died fires unless bDied is true, which means "don't hide dead player if I'm dead"
What specific game mechanic are you trying to do?
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
Can't get it to spawn or can't get others to see it?
A replicated actor spawned on the server will be there for all to see.
i can get it to spawn on the server but cant get others that join after to see it
You already been pointed to them: #multiplayer message
That's not how you spawn replicated actor
That's not spawning a replicated actor on the server, that's multicasting which gets everyone to spawn their own copy.
That is not how you'd spawn a replicated actor
a food system that will have a set food amount and when you eat from it it will - from the food amount and add food to your hunger bar but when one player - from the food amount other players dont see that happen
Do you already have a replicated food variable and is it shown in your hunger bar?
This should get you back into context: https://vorixo.github.io/devtricks/stateful-events-multiplayer/
Show your variable replication settings and how your hunger bar is updating
im not trying to replicate the players hunger im trying to replicate the food amount
im not really sure how i could show you what i mean without you in vc
discord dont let me send vids
But it does let you send screenshots to your code
This bit is enough to say you are doing things incorrectly
thats what people in vc said to do lol
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
its just a float that get - on event tick but that dont seem to be the problem
is it a replicated float?
no bc hunger dont need to be replicated between characters
why
unless you want client to be able to say what its hunger is no matter what the server thinks
its replicated now
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
mean this?
As long as that's running on server only then you're good. On a timer I'm assuming?
thats in the player character
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
on all players
Serverside or clientside or both? Do you know that every replicated actor exists on both sides?
Show what triggers that
this?
You should do the Hunger thing on server only
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
okay done all that
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
yeah that made 0 sense to me ๐
still dont see how all this is going to fix the problem ๐
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)
you still there?
starting to think im never going to be able to replicate this lmao i have had it like this for like 2 weeks now
Test the first stuff on tick, does it work?
you update Food on server
you update UI on client
Food is a replicated variable
yeah the players food bar works it just the food itself that dont
You set it up the same as on the player
replicated variable
it can literally be the same thing if you make a food component
it is a replicated float but that dont work
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
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
OK show the code path from input to talking to the food station
you presumably walk up to it and press a button right?
show that
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
That's a little goofy
i know but its simple and i dont need to over complicate it
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?
This will crap out as soon as more than one character exists
the actor has the box collision
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
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
I'm working on stuff.
You should do
E -> RUN ON SERVER EVENT -> do the logic
your input is never making it to the server
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?
Game mode doesn't exist on clients. If that begin play is in the controller, or any other replicated actor, then that fires on the client machine too, and when running on the client, it can't get the game mode.
Don't store player info in game mode
This if for all the players connected to the game mode
the actual player information is in the controller
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.
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.
dose UCheatManager support RPC ?
not sure if it has replication out of the box but it's fairly attached to each player so you could pass it off to something that does pretty easily
just my guess though, never looked into it
I'd assume it's not, but it should be easy to manually RPC
omg i feel so bad for wasting your time i was falling asleep and thought of doing all that stuff i had in the the actor to - the actors float in the player character and it works fine xD
and im about to move the box collision into the player character
You can also just do a trace on demand when you want to interact with something
I do a sphere trace -> filter -> sort by some metric -> choose the thing to interact with
ty for telling me all the stuff i need to go fix to lol
okay
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
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 ?
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 ๐
Players can't see others player controllers, so you can use the playerstate, when it's replicated you can display your values
Thanks for the reply, I tried using playerstate but I got the same problem, clients still can't see other players names there, only host
Then your code is wrong
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
Do you check if your playerstate is valid ? Do you bind your delegate before your broadcast ?
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
What do you mean by "multicast" then ?
This one, and calling Server_SetPlayerName in the begin play
You don't need rpc you just need properties
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
And where do you check if your data are available here ?
Currently here I don't
You need to wait for data to be replicated before displaying them
playerstate onrep etc ..
So how I can manage that? I didn't use playerStates often
You can make a delegate and broadcast when the data you need are ready
Form where I should broadcast, and when?
From PlayerState::OnRep_PlayerName
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
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
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!
Hi, I tried that one on PlayerState::OnRep_PlayerName and It's not working, I'm just getting default string value, "no name"
wierd no clue but set component replicates to true on the mesh does something?
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.
Pinging random peeps is against #rules . I only help when I want to
sorry was thinking you didnt see it.. ok wont happen again
Never ping a Wizard
mh , tough one
yes just learned it ๐ hope i dont het the wrath spell now
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
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.
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 ?
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 "
in the pinned resources, there should be a cople of compendiums that are very good to get a good grasp of the basics of the system
thnx very much :d
I recommend you this one very much: https://cedric-neukirchen.net/
also the one from WizarCell
thnx a lot i appreciate it
np, have fun
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
It depends how they were switched into spectators. You just switch them back (undo)
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
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
now that makes sense
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
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
Debug and find out why
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
It does that only if you go into NAME_Playing state which you shouldn't be going into
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()
Anybody know why it fails to cast? I'm trying to get asceses to the players state. this is in a widget
Probably depends on where and what event this is being executed on, either that or you haven't set the Game Mode settings to use that particular playerstate class.
You will need to do that at some point, note that changing to state NAME_Playing calls BeginPlayingState which does nothing by default, however you can override it and do w/e you want
On construct
Of what?
ah! i think that is what i am missing
of the widget
Also note that this function will be called on both server and client, considering you have to change state on both sides, so be careful to check authority before you RestartPlayer
I already made the player state part of the game mode
I think i haven't even spawned my character yet, so its just going to go back to inactive
Are you creating this widget on begin play of something? In multiplayer it's not guaranteed that the playerstate is valid on BeginPlay of the player controller on a client.
I have a hud class that creates the widget
maybe the player state hasnt had time to spawn yet
ill add in a delay
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
Do you have a default pawn class?
yes
it used to spawn in before i set the gamemode to bStartPlayersAsSpectators = true;
Check what it's doing in RestartPlayer - if it's even called.
i don't think its even called, double checking
If it's not called, check what it's doing on state change. ๐
It was the delay thanks man
i am sure i've done something stupid and i can't see it, but its right in front of me
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.
Delay for 5 minutes. If they're still not ready, their connection sucks too much, kick 'em. ๐ง
Thank you for this ill do some research into that
๐คฃ not a bad fix
ok so if i have this right BeginPlayingState() must contain calls to gamemode to restart the player? it isn't implemented
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
is there any built in method for implementing p2p networking in unreal?
Outside of listen servers, no
Does UE create a session by default ? I just make a find session without creating one and there is an existing session
then what is solution for that?
you literally cant. a player need to act as a "Host" aka listen server for p2p to work
Unless there is a crazy reason for p2p, I'd just go listen servers
okay
Just to clarify. There are multiple definitions of p2p out there. If by p2p you mean one player hosts and the other players join. This is built into the engine
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
P2P, listen server and dedi are three very distinct architectures that are equally common
Unreal just doesn't do the first one
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
Doesn't GTA do P2P?
Almost every game does some
How many games kick all players when you lose network?
Uhm... that's not how that works
Pretty sure RDR2 online stuff and For Honor do P2P as well.
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
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
For Honor definitely launched with P2P
Destiny has been doing P2P for 10 years
Pretty sure they've since changed it
Everyone does some P2P because servers are expensive
Usually with at least a layer of dedicated servers for player state
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
If I was going to make a MP game today it would 100% be peer to peer
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
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
Now now, show respect to the dead. Let's not bring them up in conversation ๐
Got a plan? ๐
Why before february?
crypto mining?
Yup. Totally a Laura thing to do.
I paid $730 for a 6600XT
Kicking myself but I had to play Elden Ring and things were spendy.
it has the fundamental problem of n squared number of connections
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.
Child Actor Component?
Your alt is to spawn a replicated actor and to literally attach it to the other actor (all happening server-side ofc)
Yep, was just wondering if there was something dumb that I could fix with a tickbox or something
We hoped that was the case since long, but turned out that there were none ๐
So this is a pretty prevalent problem? ๐ฎ
Damn, ok good to know
Should probably be removed honestly.
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?
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?
What's not working about it?
how to transfer all clients with server to new level?
i dont know what to do after server travel
@bitter oriole what do i put for in URL if I dont openlevel?
The map name
The "URL" field of ServerTravel
just the map name?
Yeah the map name
Yes , with travel args if needed
Same as GetWorld()->ServerTravel in C++
is it same as this one?
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
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 ?
Yes
It just doesnโt work
That is very descriptive and helpfulโข๏ธ
Debug and find out what's not working/executing
That could happen for a couple of reason at least:
- ServerTravel being called client-side.
- bUseSeamlessTravel turned on the departing GameMode and you traveling in editor
I recall having issues with the former a while back and having to switch to the latter
made sure that the servertravel is running on server side
i dont fully understand what the second one means
That's a setting in GameMode in Class Defaults
i turned it on, was i not suppose to?
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
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
If it brings you back then something is workingโข๏ธ
Have you debugged your code?
thats true
what is the cost of a multicast vs server rpc?
They serve completely different purposes
Server RPC is client to server, multicast is server to clients
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
yes there are no warnings or errors currently showing on compile
My handsomeness seems to be helping ๐คญ
Figure out what they are and how you fix them. You also share them with us
I have not tried it yet, so that should mean something 
what am i suppose to share if there are no errors showing on log?
Sometimes I have to make a sacrifice for our father in heaven to forgive us sinners
Ah there are none, I thought you said there are ๐
But still I would debug what servertravel is doing behind the curtains
i shall take your advice wise man
... wise handsome man
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
Respect level is now at 1000
Honesty it should be preferred over non-seamless when possible
is running servertravel on server enough?
you mentioned that it cant be tested in editor
how about standalone mode?
instead of packaged
As said, I do standalone
Any idea why GetResolvedConnectString(NAME_GameSession, StrServerURL, NAME_GamePort); returns 10.21.21.2:0 ?
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
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
bool GetResolvedConnectString(FName SessionName, FString& ConnectInfo, FName PortType = NAME_GamePort) this one from OnlineSessionInterface
And you are using Null OSS?
Yep
You should probably explicitly specify the port 7777 when you host
If you're not doing so
But if someone change the port ? Would be better to not hardcode it
I mean you want to pass it as a param or something
There is an option for port iirc
Oh, yeah i will use a param then, thanks !
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
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
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...
It is still the same, though they introduced a new replication system
And in your context you're not using the new system
could this explain why
void BeginPlay()
{
if(HasAuth())
{
// Spawn Weapon
}
}
Isnt working on the client because 5.1 has a new networking system?
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โข๏ธ
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
Does the weapon actor have bReplicates set to true?
Have you defined a GetLifetimeReplicatedProps() function on the actor that owns the weapon and correctly declares the weapon property var?
yes
willing to bet it's relevancy related
you mean net relelvancy?
yee
tried it too no result
Impossible to say then really without being able to debug it
how would you debug this?
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
the character holding the gun, does it replicate movement?
its derived from ACharacter class so yes
I didnt think ACharacter has replication turned on by default
I tried to assign a key to spawning the weapon but the results are the same regardless of the time, Server spawns client doesnt
just checked it was turned on so wasnt the issue
does android in unreal support dedicated multiplayer?
ok I finally managed to figure it out why... On beginPlay because of the new input system where you need to initialize the context first I did a cast check and returned if cast failed so anything after that wouldnt go through
sorry for bothering you guys with these dumb things ๐
Are you trying to run a dedicated server on an android, or are you wanting an android device to connect to a dedicated server?
"wanting an android device to connect to a dedicated server"
like oculus quest 2.
I can't fathom why it wouldn't work.
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.
Like, your app on your device is a client, the server is something the client would connect to.
not dedicated. But listen server maybe?
Like we create sessions in unreal engine
for multiplayer.
Technically it's possible.
My question is that, is multiplayer supported for android devices?. Like for PC
Technically or exactly?
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...
how it will work over internet?
Like dedicated server. Not local/LAN server
is there any proper documentation/article for android multiplayer?
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.
So what is best idea?
I know the QUALCOMM chipsets is not equivalent to intel architecture CPU's
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 ?
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....
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?
Yes
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?
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.
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.
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
how to make a Server_XXX() virtual so that I can override it in subclass ?
You override the _Implementation method
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.
What're your hardware specs?
If you're using seamless travel, then PlayerState is the place.
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Travelling/
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)
But why that outdated doc when we have this: https://wizardcell.com/unreal/persistent-data/ 
Read the link I sent and you have all the info you asked for + you can start preaching about this stuff
have you profiled?
a 2070 super, ryzen ... 5090 i think? either way, shouldnt have any issue running 3 third person templates
its a third person template, so... no, profiling it did not cross my mind
@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
They actually have a wrapper struct so they can use it in blueprint USTRUCT(BlueprintType) struct FBlueprintSessionResult { GENERATED_USTRUCT_BODY() FOnlineSessionSearchResult OnlineResult; }; Note that this struct is only usable in blueprint and not in your code since the struct is defined in the engine files. So if you wa...
hmm, anyone got any idea why this happens? im seeing all tutorials on this pixel streaming plugin to just run 2 clients and it should work, but im getting this... im running a TURN server and a STUN server (default from https://github.com/EpicGames/PixelStreamingInfrastructure/tree/master/SignallingWebServer/platform_scripts/cmd)
specifically the Start_WithTURN_SignallingServer.ps1
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
EOS, works fine with Android.. using it as we speak.
early on with EOS it was a bit of a task, but its alot easier today..
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?
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.
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
I dont think you should use the level BP, ive got my 'spawn players' event on my game mode since the game mode class is only on server
Anyone knows the max Array size (for say bytes) that can be replicated? Assuming whole array has to be sent ofc.
You can call the possess node basically anywhere, you just need to ensure you're running on the server when you do it.
looking for blueprint coder to code/or implement GUI, Playercontroller .no, quest system, ability systen, inventory system
Please don't spam. As I have already told you in #ue5-general
You just wrote instructions
Wrong channel. Check #instructions. And yeah no cross posting read #rules
Yeah, it's a link that takes you to the channel that you need to read in order to find help for your project.
And even if you could ask for hired or volunteer help in channels, GUI stuff has nothing to do with Multiplayer. ๐
65535 bytes is max size of an array and I think the max size that can be replicated (according to some testing Authaer did last year at some point).
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.
That sounds like enormous size to be replicated in one go, unless UE does some magic and chunk it into multiple RPCs.
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 ๐ )
I know what I'm doing, I wanna tear unreal apart
Okay, I got it working this way instead(thanks, better optimization), but the line trace still shows completely different results on client/server.
If you followed my way, there shouldn't be any line trace data on the client.
Server Spawns "Fire Spawner" > Server's Copy of "Fire Spawner" does the line trace and spawns the "Fire" actor where it hit. Client doesn't do anything in this situation other than receive the replicated Actors and play the sound effect on begin play.
Hmmm it is showing line traces on client tho wtf..
Post your updated code.
How long is your timeline?
like 30 seconds i think
And the New Track 0 is firing periodically?
20 seconds with an event track
firing every .5 seconds or so
maybe everyh second
yea every .5
Also, are you actually spawning the Fire Spawner on the server?
"Executes on All" is not spawning on the server. That spawns a copy on all clients.
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?
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
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.
Interesting, thanks for the insight. I've always just used timelines because it was more familiar. Might have to try a timer.
But yea, i've heard timelines are just slightly more performant ticks lol.
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.
Ahh maybe that was it.
So timer is the most performant way to do repeating time-based events?
This way or that way doesn't really matter so much when they both end up requiring stuff to change every frame.
Interesting, thanks for the info. ๐
would hosting game session in game instance instead of game mode cause any issues?
Don't timers run on tick though?
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! ๐
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.
That's a hot tip. Yeah I can't store that information locally. I'll probably just go the REST API route then
Feel free to use save game for client settings though like video and audio, mouse, keyboard bindings ... etc
Yeah that makes sense. I'm familiar with Postgres/MySQL so I can just implement one of those probably
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.
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.
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".
When you say your other clients can't find the host, I presume you mean not at all? What settings have you got in your DefaultEngine.ini for Steam OSS and what settings are you creating your sessions with?
If it's fire that does a damage tick every half second or whatever, use a timer.
If it's meant to be continuous or on the order of many a second, use tick/timeline
Yea not at all, Iโm using the advance session plug-in
Is there a way to set NetUpdateFrequency at the field-level, or the component-level, rather than an entire Actor?
no
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.
how to get clients player controller ?
from where?
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
how to get clients player controller on server ?
again, context
From where? As in, in what class?
you can have 10 clients and want one specific controller
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?
if I run event as run on server veriables I use on that event are server veriables or client variables ?
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
anything coming out of ServerRPC is evaluated on server
I code in C++ so that is perfect. Should I run this with an authority check for server on tick?
Convenient, and no, I just run it everywhere ๐
Ohhh I understand because velocity is already replicated, so the local client and proxies just set the bool based on the replicated velocity.
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
You're welcome! Fortunately, no need to play around with the CMC 
Hehe not yet anyway... Until I add climbing and sliding lol xD
Oh boy, good luck! That reminds me I need to check into ladders at some point ๐ฌ
You got this! :D
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
also i just tried replicating all the variables that didnt work
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 ๐
yeah but its using a widget component on an actor with replicates enabled so i thought that wouldve been good
and rpc is repnotify right
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
okay ill try again
They do for a listen-server player ๐
If you're the host, then yes ๐
But technicalities ๐คซ
I would add to the notes that you should read the following: #multiplayer message @rough dock
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
thanks ill watch it
It's watch + read ๐
Why would I bother, if UE can send it in one go :P?
vori meant you do if it's bigger than the max-size
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
I know at least two, but they involve adding extra code, like any other way that would exist out there
that's the thing, you cant if it exceeds maxbunchsize XD
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.
With a middle-backend? Sure!
ah middle-backend? like Server1 <-> middle-backend <-> Server2?
Would that mean a lot of translation of rpc's and so on? Also wouldn't there be a quite hefty delay?
yes
but for notifcations and such it's not a problem
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 ๐คทโโ๏ธ
for that... you'd be better off building your own networking model from scratch, main advice is to explore how wow does it
This is outside the scope of Unreal's multiplayer. You wouldn't use any of Unreal's facilities for that
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)
yeah I guess. do you know if Iris will add anything of it?
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
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?
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.
You'd forget entirely about Unreal's network layer, and build your own from scratch
sounds like fun
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
In this scope, is overlapping worlds excluded? How would it work with really large worlds were servers host overlapping parts of the world?
fun, complex and time consuming ๐ depending on scope ofc
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
This is particularly difficult in Unreal because you'll need to hard travel to a different server with a blocking screen. If you're using Unreal's networking, you want to stick to the underlying assumption that one server = one unique map, and changing server = one big loading screen
Well definitely, but in that case I'd jist go with http or websockets and call it a day
And IMHO that would be the technically correct choice by some margin
Idk, it would certainly be relatively easy and straightforward
Well that sounds complex :D
I mean, IF you know what you need and Unreal cannot do it... Certainly I'd think it a lot before doing my own net module from scratch
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
Yeah, and it's quite flexible anyway, if you don't break the mold too much
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 ๐ฅณ
The game industry isn't particularly secretive really when it comes to that
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
Okay your right. That is actually a good point.
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
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.
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
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
Is there a engine out there that focuses on MMO?
How many MMOs do you think get released these days?
Sure, probably on the order of one per MMO
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
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.
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
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.
Literally the first time I've heard anyone say UDN wasn't that good
UDN?
Private Unreal forum where Epic engineers can provide direct support
$$
Not millions, but we already have a player base. We'll def. not blizz or amazon ๐ but we're alright.
Okay then we are doing a traditional MMO. Wish us good luck ๐
I haven't seen that tutorial. I'm glad you're challenging me, because it def. don't help me being negative. Ty!
$$ open lots of doors, although I am always surprised at how far you can go for free in this industry
IMHO the single biggest barrier to a MMO experience is the players, you need to keep them engaged for years with relative stability at fairly high counts for most of what constitues an MMO experience (competing between teams for raids, etc)
Weird, I've never heard anyone say it's good. I've only been at two studios that had access though.
Maybe I should spend some more time there
Yeah totally agree with you there. Luckily my company has years of experience in the MMO space. I just like to discuss it with others as well ๐
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
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 ๐
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
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?
Yeah
That's kinda how they work historically
Fairly dumb clients compared to shooters where the client and server work more symmetrically
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
Even shooters seem relatively "dumb" clients to me, besides prediction stuff
Well that's true, at least movement/combat which is the meat of it usually
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
not really. depending on the engine and stuff usually you let the client tell you what they saw/did then you verify it. i think it was like idtech that would basically rewind some server state and confirm that a shot for example was actually possible
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
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)
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
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
Why not use a simple replicated variable?
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...
as i said, if you really need access to this specific enum in bp, you are out of luck. your best bet would be to make your own enum to mirror the values there, then you will have to convert/map to and from each enum. its not a nice solution but its pretty much the best solution short of editing the engine code and running a custom source build
ye but dont though
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.
@bitter oriole it still sends only on server
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++.
how do you replicate a variable from client to server in umg bp?
so that all players see the change
Same as in C++, using a server event.
yea, problem is- it's not replicating the variable.
the change does not happen server side.
What's the class used here?
A widget should not be replicated, so it won't be able to send RPCs.
i see.
Normally only your player controller or possessed pawn is able to send server events
so i need to cast to the pc?
how would the other clients/server be able to then see the update in their widget?
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
thanks for the help.
imma see what wonky thing i can make work ๐
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.
my wonky solution as a beginner would be to adjust the scale.
if everything is smaller, you would need less speed to travel at apparent faster speeds.
not sure how well this would work.
Try to add a real time economy, tied to actions like shooting, on top of that one ๐
do you mean an artificial client-side delay? Yeah I have that in mind for RTs combat/spells when we need them, bcs there are certain situations that we could leverage in that way
Adding an economy is also way, way, way harder in non-technical ways than it is technically
Very true. I'm glad that's not on my table either.
I ofc need to understand how to tie it together with the gameplay
Like, Amazon literally had to rollback the entire game a few times last year because they messed it up
lol which game btw
New World
Made in lumberyard. I wonder if they released their network solution somewhere now that Lumberyard is open source. ๐ค
We have thought about that too, but we rather not want to go that route though. ๐
It likely wouldn't be particularly valuable in itself
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
yea, i can imagine it would be a real pain to go through with.
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 ?
I know we had this same issue. Not hundred percent sure here, but I think having two Auth roles over same replicated actor will create problems for you. Even maybe a round robin? ๐ค
I think we went around this by adding a third role, SimulatedAuth. This created a load of engine source changes though. Think we abended that idea in favour of something else.
What is that something else ?
This compendium helped us a lot.
I don't really remember sorry. But I think we made our own connection setup mimicking a client connection and ditched the Online Beacons
I think having NetRole - simulated on BeaconNet Driver is fine, but when it gets added to GameNetDriver it should be authority again
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?
You might be right. I just double checked and we did not ditch Online Beacons.
I know this was a aha-moment for us
https://ikrima.dev/ue4guide/networking/connection-flow/
And I think we override NotifyControlMessage method in Beacon and setup our own connection flow. Hope that helps.
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.
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
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.
these are in my config
If you want Steam, the Server also needs to use Steam
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
How to make that server is using also steam? Also can server and game run both same computer? When game is published someday some people would want to host own community server and same time play it.
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
The reason why I would override NotifyControlMessage is to be able to distinguish a connection between C2S and S2S. The reason why we altered engine source was to add a new NetRoles to give the "client" that connects in a S2S connections will have a hybrid role between simulated and authority. We called it SimAuth.
If you know how to avoid adding that role that would be nice.
I'm so new at this xD But where to find those .dll files? And put them there?
They should be in that folder or not?
Like
.dll files
I don't remember how that exactly works
Been ages
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
There is also only that api.dll Could it be because im using that new ue5.1 source engine?
Well, then just try that one dll
Again, been a good chunk of time since I had to do that
haha np. Thank you for help I try that!
@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.
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
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 ๐ค
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
hi does somebody heare know why when i create sessions gets created with "ERROR" status??
amazon gamelift
@tranquil yoke Are you trying to avoid engine source changes? I know we decided that was inevitable for us.
Thanks
I understand I will have to make engine changes...
I have done lots of so far to support actor to be replicated via 2 net driver at the same time
I just don't want to over do it.
Because I think my use case is kind of simple
Can there be more than one session on a dedicated server? If so, how do I know which one to join?
Thanks!
I think there "can" be multiple sessions on the same server, but there should not be. Should be one session per server. At least I have never heard of anyone using multiple sessions for a single server.
One could argue you could want multiple sessions if you set up the server to run multiple worlds. ๐ค
@kindred widget @sinful tree Thanks!
Yeah. I'm used to the ARK model. ๐ Each world is just a different server.
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?
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
I assume you have set up your AttributeSet with proper OnRep functions per Attribute, right?
Because no, you don't have to bind on the server and notify the client. That's very wrong :D
That's actually only partial UE. If you need persistent Data like this, then you'll need a Database setup in your backend and store the room data.
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.
Are you processing animations on server?
set โMesh Component Update Flagโ on your skeletal mesh to โAlways Tick Pose and Refresh Bonesโ
yes i have db to store the data but not this what i mean
i mean the room it self how to give it to every player
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
i have id for every player but i'm stuck in giving rooms
i need to create only one level?
Create a base, empty level and spawn the room contents dynamically.
thanks i will try it
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
Do you even want to use a database?
You could use a save game instead.
Depends on the scope of your game.
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
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
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:
- Does the server need to run 50 instances of the game?
- Is it possible for a single game instance (rather than 50 instances) to orchestrate 50 games?
- You need 50 server instances
- 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.
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++
What does server instance mean? Did you mean each of the game instance runs on a separate operating system?
Server processes then?
50 copies of the engine running.
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
Need a bit more context than that.
Function B must be call both client and server but it called from function A has authority
On 1 specific client or on all clients?
local client
There would be no point binding input on the srever, the server doesn't have input?!
now it work only in server
AbilityHandle i set when owner has authority
If you want to run a function on a client, make an RPC UFUNCTION with the Client specifier.
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? ๐ค
yes i did but still bind on the server
Anyone using Steam sockets? Is there a big increase in ping for players?
I wonder why UE does not simply offer chunking built in. It seems trivial to just split things and send multiple RPCs.
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
I'm using this code to create a session, start it and then find and join, but it doesn't find any: https://cedric-neukirchen.net/2021/06/27/ue4-multiplayer-sessions-in-c/
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...
Any idea about what it is happening?
Thanks!
Thank you very much!
If you have to ask that question you aren't going to be making something that needs 50 instances anytime soon
Start small
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
@fathom aspen GMC is 30% off if you wanted to try it
I'd recommend using EOS
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?
RPCs
on input on client -> call serverside RPC, do things, call clientside RPC from server, etc...
Check out the pinned messages
somewhere. But it doesnโt answer my question.
Do clients get AWorldSettings?
Already bought it, didn't got to look into the forbidden knowledge just yet tho ๐
Yes it's replicated
You spent an arm & a leg and haven't even tested it out? Jeebus
Lmaoooo, a kidney too
But why x)
Imagine - giving up your kidney to not use the CMC and still use the CMC anyway
For the fun pain?
That'd be like the only thing I do for a couple of days. If I bought the GMC that is
Can you for fun give me 300 dollars too? ๐
300 * ๐ต , here it's all yours now
Lol
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
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?
I'll believe this statement since it's being made by a handsome face girl
Well it's obviously not Good Looking
I see nothing fancy about it, but you spawning two instances of that door and animating one instance
No clue how you're handling collisions, but I wouldn't care for collisions as long as things are not looking quite right
I have not been punished enough by CMC to tell you the exact answer, but I would imagine Teleport would notify the client of the teleport before that happens for them, so it's where you spawn the FX you want
I dont know where that notification is in blueprints
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
Also belly is empty, so that's really hardโข๏ธ
Hope? More like hopeless despair?
That's not new, I've always been
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
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
so you mean have whatever behaviour I need to do in BeginPlay be done in an OnRep function instead?
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.
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?
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
roger
Anyone knows how Engine decide local Role and RemoteRole for an actor, where is that code ?
By default, inside AActor::PostSpawnInitialize and it gets overridden for other notable actors like the client-onwed ones in a bunch of different functions inside UWorld::SpawnPlayActor, and in APawn::PossessedBy and for non-owned inside UActorChannel::ReplicateActor
LocalRole and RemoteRole are also set to Authority and None in ctor of AActor
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
You caught me in the weakest point of my day (was heading to sleep), so nothing makes sense to me atm 
But good luck
@fathom aspen good night thanks for clarification, try to have a look in your morning.
Hi!
I've created a session, I've started it without any error, but when I try to join it, I can't find it. What could be the reason for this? I've used this code: https://cedric-neukirchen.net/2021/06/27/ue4-multiplayer-sessions-in-c/
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...
Thanks!
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
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
Send server event with string, multicast the string back to everyone
The multiplayer part here is not complex
is your Item type set to replicate?
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?
what things did you try that didnt work for you
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
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?
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
sorry you are right i'm getting the variable from the player not from casting
its just an object class with a few variables in it I couldn't find any replication settings in there I just kinda expected it to pass on through like any other int, etc
if its a UObject then you will need to check out the blog post from Jambax about replicating UObjects
alright thanks ill check that out
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?
Knowing what the logs output would be helpful

