#multiplayer
1 messages Β· Page 549 of 1
im using interfaces instead
accessing a controller via playerstate via gamestate
definitely sounds like you're doing something you shouldn't be
yh i realized that now lol
i access the playerstate in the playercontroller, calling it from there now
Does anyone have experience with SteamSockets? Experiencing the same issue as this person after upgrading to SteamSockets. Everything else working as intended.
https://answers.unrealengine.com/questions/958816/steamsockets-cannot-connect-to-dedicated-connectio.html
Hi there. Dumb question: But how do i switch maps in a local mulitplayer session without using seamless server travel? I want to test my multiplayer functionality within the editor and not on two machines which using the steam online subsystem.
Yeah i know. That was my point. So how do i switch maps then without clients getting disconnected from the session?
You can't, you have to test outside editor
Steam itself doesn't allow for two connections on the same machine anyway
I know that too. I just wanted to know if there is any way to test my functionality when switching maps (e.g. Lobby to Battle Arena 01) in the editor. But ic, it's probably not possible...π
You could play "standalone", that should work with the default net driver AFAIK
but new editor window and PIE still don't work that way IIRC
@supple vapor Oh my! I'd completely forgotten about that function! I recall using it now - thanks for reminding me π I'm a fool! haha
@scenic gull it is advisable to use seamless travel and use stand-alone editor
But make sure to make a travel map if your lobby is very big
The travel map should be empty
This would reduce strain on the CPU
And make everything run more smoothly
Seamless travel means the clients does not disconnect whiles non-seamless means clients would disconnect from the server and reconnect which can bring sometimes complex issues
Is it possible to find stats about how saturated the server currently is? With RPC calls and such?
I am trying to implement physics movement replication and I would like to know if the server will be able to handle 5-10 players
how do I get UChannel of a Actor on server ?
Hi, I just started working on adding multiplayer support.
Can anyone comment on the effects of network-prediction (specifically using GAS)?
Is network-prediction more or less a standard or is an option?
GAS has it more or less integrated
and its required before you can call your game production ready imo
Hi guys, are there commands to adjust the packet loss etc in the editor? I have tried a few but nothing seems to happen
PktLag etc
trying something like Net PktLag=0 in the console seems to do nothing
Does anyone know how an RPC call can cause the client to be called "-2"? This is from a print done after a RunsOnServer RPC
Aha, it seems like this happens when you run an RPC from something isn't capable of having RPCs, like a widget.
I personnaly tested PktLag
and it does work
@gusty slate Hi shinzo, i tried following that but not sure if it changed anything, are there any confirmations on screen or any other things i can do to see the change?
thanks
Hey guys, when it comes to replication for components OnBeginOverlap etc.. how does this work exactly, i assume that flagging the component to replicate will mean that it will automatically handle this for the server and clients?
Overlap events aren't replicated, that's just done locally
Flagging the component to replicate just means that it's replicated properties will be replicated, and it will handle RPC's
hello guys! i need help for push my didicated server in the docker desktop because i will use Kubernetes+ Agones from google cloud server services for hosting my dedicated game servers...NB : my game multiplayer for (android)
just wondering how i'd go abouts creating a "Killed by X"
Hi! Would anyone have advices for me on a good way performance-network wise to get all players positions and get feed that to some material. I need a black and white map of their positions. Thanks!
@chrome bay Thanks for the info, so if for example i am doing a check one characters fist overlapping another character, would i have to do anything for this to network correctly? Imagine i send the GAS an activate message when this happens.
yeah, you would send a message to the clients announcing what happened
thanks guys, i assume that's if the overlap occurs on the server i.e. HasAuthority()
but what happens if its the client?
@sweet marsh That depends on your implementation. By default any overlap events will occur both on the server and on the client, but independently. So the proper way to handle that is to play any visual effects on overlap, but afterward use "Switch Has Authority" and then do stuff that is gameplay critical (e.g. doing damage) when it has Authority.
what is a net index and where is it used?
void BuildFromNetIndex( int32 StaticNetIndex )
{
Value = (StaticNetIndex << 1 | 1);
}
int32 ExtractNetIndex()
{
if (Value & 1)
{
return Value >> 1;
}
return 0;
}```
(From FNetworkGUID)
It's important to note that just because the overlap happened on the server, doesn't mean that it'll happen on the client or vice versa.
I don't see anywhere in the code ever call BuildFromNetIndex or ExtractNetIndex
@fringe dove This is just a guess, but in order for things to be replicated by Unreal, they need a number to refer to the same thing, so the net index is likely the number they use to talk about entities
I thought FNetworkGUID was the number they used though
I'll see if I can find a reference somewhere one sec
I think the 'Static' may be a hint it is for map objects?
@tame linden thanks Dave, i was wondering how that would work with GAS as well, would I still need these checks when sending a gameplay event as GAS should check for this right? Itβs a little hard to figure out as technically the overlaps occur from a character, and his movement is replicated by the movement component so technically the overlaps of his fists should be fairly accurate.
FNetworkGUID is the structure they use to wrap the number it seems. So once Unreal gets a packet saying "I have object # 31313" they can use that to construct an FNetworkGUID
looks like in FNetworkGUID::Make:
CORE_API static FNetworkGUID Make(int32 seed, bool bIsStatic)
{
return FNetworkGUID(seed << 1 | (bIsStatic ? 1 : 0));
}
so I guess if it is a static actor in the map, the least significant bit is set to 1
and the 'NetIndex' or 'StaticNetIndex' is the guid shifted right by one, if and only if it is static
@sweet marsh Honestly not sure about GAS, I haven't really used it much. Generally I'd say you shouldn't risk it and you should pretty much always do the "Switch Has Authority" thing for critical stuff that should only be done by the server. Otherwise it can lead to desyncs and stuff. For example, if OnOverlap you spawned a replicated object, the server would spawn one (which would be replicated), but so would the client (locally only) so the client would see 2 copies but everyone else would see one copy. Whatever GAS function you're using may be Authority only though which solves this, you can tell because it has a lightning bolt symbol on it in blueprints.
basically though, I'm trying to refer to an object in an RPC that may not have been replicated yet; can I pass FNetworkGUID in the RPC instead of the object pointer (which may end up null on client)?
and then lookup that object from the GUID once it replicates
@fringe dove I think you have that mistaken slightly, I think the net index is always shifted left one (to make room for the static bit), unless I've got my operator order mixed up π
Oh dude I would LOVE to have that ability, I have no idea if that's possible, but I could definitely use that π
TBH not that big a fan of Unreal's networking system because you can't tell when anything will be ready to use (networking wise) :/
the guid is shifted left (to add the bit), but the index is shifted right (to remove the bit)
Ahh I see what you mean
lots of stuff could benefit from async continuations
where you could say "don't do this until everything needed is replicated"
but preserve all this context
Do you have a function for taking an FNetworkGUID and getting the corresponding object?
Like a function name or whatever in the engine?
I'm not sure, I guess that's what I'm looking for next
you can lie to the engine and convince it the actor is loaded from the package
@winged badger Whaaaaat? What do you mean by that?
Engine/Classes/Engine/PackageMapClient.h
238: UObject * GetObjectFromNetGUID( const FNetworkGUID& NetGUID, const bool bIgnoreMustBeMapped );
269: TMap< TWeakObjectPtr< UObject >, FNetworkGUID > NetGUIDLookup;
416: virtual UObject * GetObjectFromNetGUID( const FNetworkGUID& NetGUID, const bool bIgnoreMustBeMapped ) override;```
we spawn a procedural level on each machine separately, with matching names
is 'PackageMapClient' only for looking up static guids from the map?
override IsNameStableForNetworking and IsFullNameStableForNetworking to return true for prefab actors
we set bNetStartupActor and bNetLoadOnClient true manually
hey, i'm having issues with characters not getting attached to vehicles upon entering them or even getting detached due to netcull. is it reasonable to crank it up so that all ~24 players are always replicating on a 8x8km map?
and those actors, when replicated map ther NetGUIDs and replicate just fine
Huh interesting! I'll definitely need to look deeper into IsNameStableForNetworking!
@fringe dove Honestly not sure
takes about 10 seconds to get full net addresable level with 33k actors and 2,2k replicated actors
all networked and working
so that's basically for procedurally generating static guids?
for a kind of deterministic level layout
we are not generatign GUIDs except to resolve actor to actor references on the level
but the stuff on the level itself is procedurally generated at runtime?
that's very interesting! so basically if the name is considered stable for networking, it will be used instead of a generated GUID allowing procedurally generated actors on client and server to "connect"?
and within blocks, a door and a door terminal will be linked
for example
name stable for networking gives you net addressable actors, ofc if you don't match names exactly, clients get booted
we replicate a seed to spawn the level from
sorry for this newbie question, but is "being net addressable" the same thing as "replicating"? Or is it more low level?
we set bNetStartupActor and bNetLoadOnClient true manually this part convinces the engine those actors are static
and if a client receives a static NetGUID for an actor it doesn't have yet, it will assume it didn't get around to spawning it yet, and queues it up for lalter
it is not
net addressable = pointer to an object can be resolved over network
ah ok I see, thanks for these explanations it's super useful
all actors loaded from the package
are net addressable by default
because they have their implementation of IsFullNameStableFOrNetworking returns true, and they are guaranteed to have matching names from the package
I see, makes sens
what's the "NetPushId"?
Hey all you smart people. I'm trying to set some Widget data from cpp code. The issue is that since the server doesn't draw its own widget, i'm having trouble figuring out how to make it work.
Singleplayer is working fine, but as soon as I run the dedicated server, everything breaks, and GetUserWidgetObject is returning nullptr.
yes dedicated server cannot access widget and UI stuff it's considered client only as the server has a null renderer
you should be able to rethink how you organize your code, your UI should not be necessary for the server to work
Hi,
I am still quite new and have messed up a setting that I can not find anymore.
I think I have set the bones to not replicate their positions over the net to save some performance following some video a long time ago. Now I can not find it anymore. I might totally be miss remembering so this is kind of a long shot type of deal π
@tame linden thanks for the information Dave Iβll have a look into it tomorrow.
does PostLogout get called when a server travels for everybody who is travelling with it or only when a player disconnects?
i seem to recall seeing in the past that its called when it travels
Anybody used the SocialToolkit system at all?
is there a difference in performance with multicast vs multicast reliable?
I am trying to get my equip and unequip working, I have it working like this, but they say using multicast will cause performance issues in the future and to not use it. is my code ok? Im new to this but it only seems to work like this, is there any way else to do it so it doesnt use multicast so I can save on performance?
im using a varest and sending a post request. I cant tell what im missing, i used a normal html request on this php, and it worked fine. so ik its in the code
note: i originally used a get request and the output was fine
are there any guides on setting up an ad-hoc connection for doing local multiplayer say between two phones or tablets?
Has anyone encountered an issue where your Game and your dedicated server have different steam appid's?
Sorry to ask this again, but why would a PlayerController from LevelA not be destroyed after a SeamlessTravel from LevelA to LevelB?
No, different classes
Even BeginPlay is called on the old PC, and it throws errors because it's state is HasBegunPlay
Happened only recently?
Same GameMode parent classes? Also not mixing child and the Base version for GameMode and GameState?
Hi guys! Im sorry to bother you all. I'm having an issue and there's no much information online, been trying to figure out this. I'm doing the Blueprint Multiplayer Tutorial Series by unreal engine in 4.25. Im using this node for my hosted server ( im the server admin) Event OnPostLogin but it's being called 4 times and it's creating me 4 different players. I'm using the Switch Has Autorithy node but that node is also being called 4 times on my end, so im getting in a server with 4 pawns instead of only one, been stuck with this for almost 2 hours and I'm not really sure what the issue is, if im the server, there should be only one player connected to the server right? Correct me if I'm wrong and thanks in advance!
@wise shale do you have a default pawn set in game mode?
UHealthComponent::UHealthComponent()
{
PrimaryComponentTick.bCanEverTick = false;
SetIsReplicated(true);
}
I get an error by UE4
SetIsReplicatedByDefault is preferred during Component Construction.
even though I have it set in the constructor
Any ideas for a fix?
@wicked brook Yes I do
@wicked brook I set it to none on the map world settings and in the project settings, the Event OnPostLogin it's still being called 4 times
how many clients you running?
only one
And im running it on standalone version, and using the project file/launch game
And im still getting the same issue
The RespawnPlayer is where the actor is spawned, and it's being called 4 times
add a counter to your post login and print string to make sure. I had some other stuff spawning i had forgot about one time
Still the same
This is how I added the counter just in case
How do I make sure im only running one client, just to scratch that out
try printstring each new player also see what it shows
hmm
do you have a loop somethere creating the player controllers?
one thing you can try also is start from post login and detach everything behind. then run the print strings. See if it still does 4 times. If not move down the line til you find it
The one that is starting everything is that Event, the Post Login
I have this as a player controller class, but I dont think that has anything to do with it
there's no loop, Ive detached everything that resembles any kind of loop
and it still gives me 4 players
@wise shale that usually happens when you manually go and execute logic that engine does on its own, without disabling the engine code
for starters, don't use PostLogin for spawning players, it works only after hard travel, use HandleStartingNewPlayer, which executes after both seamless and hard travel
HandleStartingNewPlayer also calls RestartPlayer() in its default implementation, so you can override it without calling Parent and not have to put your default pawn class to none
EventPostLogin is a function on the GameMode, so any authority checks there are redundant, its always authority
Hi @winged badger ive tried to use event handle starting new player but im still getting the same result, it's being called 4 times
its called once per connecting player, unless you did something unspeakable
connecting player includes the listen server host
and all clients
That's the freaking ue4 lobby tutorial
High changes that they indeed did something unspeakable
Tired of mentioning how bad that tutorial is
Replicated PlayerController Array in the fucking GameMode.
switch has authority in a gamemode

(gamemodes only run on the server for those that dont know, making that switch pointless)
That's in the official tutorial? I sort of want to be sick in my mouth.
some of the older official template projects have even worse stuff than that
MP isn't easy at the best of times.. won't help if there's a bad foundation there :/
once you get into it, you'll find out that Unreal4 multiplayer is one of the easiest multiplayers to get up and running
for sure
Hey guys, do you have to set replicates on ACharacter or is this done by default?
More over how exactly does the client / server behaviour work, for example, I'm a client and i punch another character (the server) the BeginComponentOverlap is fired and an impulse is applied to the server. Now should this code be wrapped in a HasAuthority() ? Does this mean that whenever a client fires a BeginComponentOverlap the server will confirm that the overlap happened? Or would it actually mean that the code does not run at all on a client, in which case how would you actually handle a client firing that method as the resulting punch from them is important.
Apologies for asking a fairly simple question, just attempting to get my head around this
Overlap events aren't really "replicated" in that sense.
If you have an Actor replicated to Server and Clients, then its Collision Primitives are also existing on everyone.
If you now have a second Actor that is also replicated to Server and Clients, with Collision, and those Collision Primitives overlap, then this happens on every instance.
So it executes on Server and all Clients.
Using HasAuthority would then only be used to discard either authority or non-authority executions.
There is no confirmation happening
@sweet marsh
Note here though: Authority does not always mean Server. It can be that you always use it in a scenario that results in the server being the authority, but that doesn't mean that this wouldn't return true elsewhere for non-server,.
If you want to filter for the exact player who's owning the character that performed the punch, then you can filter for "isLocallyControlled"
I see, so would there be a reason why some of the hits seem unreliable in my game, for example on client 2 every punch lands where as on Client 1 only 50% seem to? Ahh ok thanks
But then you still need to send the data to the server, as you actively block their call for everyone but their own character
No, that should not be the reason
If Client 1 and Client 2 perform the same thing in a 0-ping and 0-packageloss environment, then it should be the same result 99% of the time
1% counting for floating point errors and such shite (which is much lower in % but well)
Hm ok, not sure why that is happening then. I am using GAS, and also notice that my custom task sometimes fails to finish as well, e.g. it adjust characters movement speed and then doesn't reinstate it,
anyway will continue looking into it thanks @thin stratus
i have question freinds! for mobile multiplayer is the same steps like pc games multiplayer or i need others steps and methodology? my Android game app alpha version in the store
Hello, we are a small indie team that has hit a huge roadblock setting up our Dedicated Multiplayer server (which runs on playfab) game up on steam. this is some of the issues we're getting.
LogOnline: Display: STEAM: Loading Steam SDK 1.42
LogOnline: OSS: Creating online subsystem instance for: Steam
LogOnline: STEAM: [AppId: 0] Game Server API initialized 0
LogOnline: Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
LogOnline: Warning: STEAM: Steam API failed to initialize!
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
LogOnline: OSS: Unable to create OnlineSubsystem module Steam
LogOnline: OSS: Creating online subsystem instance for: NULL
If anybody has any knowledge on how to properly troubleshoot this, or has had experience please contact me! I am looking for a consultant to help my team out!! Pleassee thank you!
@vestal thistle do u have steam running on your dedicated server?
Same GameMode parent classes? Also not mixing child and the Base version for GameMode and GameState?
@thin stratus I have the same Base class for GameMode GameState and PlayerController, but different inherited classes for Lobby and InGame.
Structure looks like:
ACustomGameModeBase : public AGameModeBase
ACustomGameState : public AGameStateBase
ACustomPlayerController : public APlayerController
Then for each mode Lobby and InGame there's a separate inherited class (e.g. LobbyPlayerController : public ACustomPlayerController and InGamePlayerController : public ACustomPlayerController)
Pretty sure you, overall, want the AGameMode and AGameState
The Base versions are more for very simple non-multiplayer games iirc
Hmm, that decision was taken a while ago by other people so I'm gonna investigate that
Reason they took it is because we're building an RTS game and most of GameMode and GameState built in things apply to FPS or Fighter games
Hey guys, does the execute command ServerTravel Map_XXX works in UE4.25.1?
How do I set the camera rotation and base aim rotation on ai so their looking in the right direction
I heard set focus is supposed to do this but it doesn't work
Hey guys, This is my blueprint for the server applying damage to a target player. it doesn't really work, as in the only way the server updates the health is when i tab in to the window really fast back and forward and shoot really fast.
Why isn't it updating as expected?
I have to actually tab in, tab out, tab in and CLICK CLICK CLICK for it to print a change in value for the health..
@swift cargo does it happen with other variables or just health
And have you tried doing it by using the apply damage function ?
@foggy idol Only "Health" and i've tried using apply damage before but i think its the same result.
Try using a different float to see if it gives that same. Problem
If it doesn't then it might be a bug
@swift cargo
What do you mean by different float?@foggy idol
Like make a new float ant name it test then set it to replicate
Then use that in place of the health variable and see if it works
@swift cargo
How would that change anything? @foggy idol
you think its broke Because the names are the same as other things?
Renaming didn't do anything.
I think the variable might be broken or something
And I'm not saying you should rename
I'm saying you should make a completely new variable @swift cargo
I'm having some issues with event copy properties in the player state. I can get it working just fine with a float or linear color variable, but it will not copy a class reference on the client.
I'm sorry @swift cargo I'm all out of ideas

@swift cargo why not try onrepnotify for your health variable?
@crude coral I'm not sure how to use that. i know how to start it but i dunno what to do with that.
ok wait i will send you example and i think will work with you
ok thanks
i need open just my project example where i have it so please wait me for open my project example
mhm
so the problem for you is the health of the client not update? is that?
Its hard to describe, basically it doesn't always update the health value for anyone. it only sometimes works when i tab IN and OUT really fast while clicking to fire.
you testing with dedicated server? and 2 players?
i can see the event ?
all the event and not just the call for deal damage
because i think is authority issue
for server dealdamage event you need call applydamage event and not set the health variable
health setup
calling server health event
your linetrace event replicated and run on server or is simple event?
the picture you send it to me is for the linetrace yes?
yea
ok so the start event of all this picture you send to me is envent replicated or no?
Yea it is.
this where my line trace and the start event is replicated and run on server
now you see my other picture about (health setup)?
try to do the same setup with health repnotify and you not need to do anything with the repnotify function just leave it empty
im happy your helping me, but i think im figuring it out right now. ill use your pics as reference though.
and create event like i do (modifyplayerhealth and add after it has authority
nice!
@swift cargo is ok now? you figure it out?
i got the Server to actually deal damage, but i need to make the client able to deal damage as well.
it's okay.
When the player is the Server it works, when the player is the Client it doesn't work. i dont know how
@crude coral
The auth doesn't make a difference btw.
but you not do like i send you from the first picture
i know.
try make the same and will work because it work for me
with dedicated server and without
where you have the linetrace you call the replicated event you do it and not the unreal event (applydamage)
because the unreal event(applydamage run just on server)
ah ok you link authority when is server and when client
but you can make new event for be more clear and not spaghetti π
and your variable health can make it onrepnotify if you want fire others events when health changing
with capture is windows application
ah! sorry you mean the line between events and variables??
just click two time
on the line
Indeed
@swift cargo have nice time and welcome always
I will never understand how people can live with blueprints that are not organized readable (Atleast as readable as blueprints can get)
Triggers my programmer asperger syndrome every time
@warped stream hi yes for blueprint need allways organize them because easly be chaos
guys anyone have idea how add image of unreal dedicated server to docker desktop for create container and then push it to kubernetes+ agones?
i look for some help 5 days now and in this 5 days of looking for help i help 3 persons lol but can't help my selfπ«
Im poping a qeustion I asked before, so the Execute Console Command (BP) using the command servertravel Map_XXX is working un ue4.25.1? Im not able to use it and sometimes my client + server crashes
@wise shale it works for me. You have to make sure the map is set up as server build for it to work i think
How can I call a Server RPC from the Client PlayerController to the GameMode and then have the GameMode return data back to the Client PlayerController? I notice you can't have return functions on an RPC
Do you have to use delegates for this or something?
Trying to think of the best way to get a response from this function here
Think it got lost up there, but does anyone know of any guides for replicating attached UActorComponents? I'm having trouble getting mine to replicate its variables. Running on 4.25
@fossil veldt Use a Client RPC on the PC
@swift cargo you should not use Get Player Character
You will always get the Servers character behind the authority check
Same with get player controller
You are already in the character bp
So pass "Self" for the character
And use "GetController" and cast it to PlayerController for the Player Controller
@wise shale Should work just fine
disconnect the specific player pin
i have 3 map : main menu map, transition map, and the game play map...and what if i want the main map be run on server like the game play map too? on unreal project settings for maps there is just one default server map not two!
dont know how events work 100% on ue4 networking but when i use the same event to respawn 2 players with nearly no time between, the first respawn doesn't completely finish as the second one is triggered changing some of the events variables. How can i make it so each time an event is triggered on the server it cannot be overwritten before it is finished or is "independent"
Hey, how are you? How can I make a character selection system replicated on the server, in this case a Multiplayer?
@empty matrix https://www.youtube.com/watch?v=VzV1cecL2oE&list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ&index=20
In this video we create the visual layout of our Character Selection screen that can be accessed by both Clients and Servers inside of our Lobby Menu. This allows us to choose between 8 different characters as well as default to a null selection. By the end, we test out that w...
This series at least for me was a bit all over the place so if u get frustrated watching them im sure u can find a forum on ue4 to help you. If u still cant do it then pm me and i can help you out π
@light fog : you have idea about docker , kubernetes and Agones for hosting unreal dedicated server?
@light fog: I've already done this tutorial ... But it never worked the way I wanted. Can you help me?
dont know what any of them words mean hahaha. Im working on listen servers atm so can only help out with that sorry π
@empty matrix yeh just give me a call whenever im free now π
@light fog : thank you!
@empty matrix No problem man π Just dont really like messaging too much back and fourth questions
@crude coral Np sorry couldnt help out
This is the Unreal Engine 4 Agones Game Server Client Plugin.
@light fog i think you know AWS gamelift..so if yes Kubenetes + Agones is other solution for game server from google cloud like the AWS gamelift from amazon
hmm how come you decided to go for ageones?
theres a lot of documentation on aws and even good youtube tutorials
Hey, how are you? How can I make a character selection system replicated on the server, in this case a Multiplayer?
@empty matrix : i can send you link from youtube will show you step by step a character selection system for multiplayer if you want..because what you ask can't get it with messages here
Yes! Send it to me
ok
I made this blueprint, It worked once
i send you the link in private message
so hey everyone
I'm trying to make my character controller and pawn controller multiplayer-ready
I don't understand why my server (aka the editor) sees my second player rotating but the controller doesn't rotate in game for the other players
the server pitch and yaw are replicated
my server does indeed see the right variables
the clients also have the correct variables, so they are correctly "applied"
but my floating hands don't rotate and move :c
i send you the link in private message
@crude coral Okay
its widget related but i think its a multiplayer question... basically im trying to make a targeting widget that when i trace someone it turns its display on, if i look away it turns it off. i have the tracing working, but it can only seem to turn its display on. also... the reason i think its a multiplayer question is if a client looks at an enemy and it turns on the widget, it turns it on for the server, but not the client. i only want this to be client side, am i doing something horribly wrong? the widget is on the enemy class. im wondering if the better way is to make a widget on the player character and then attach it to the enemy its targeting? not sure though
you are doing something horribly wrong
you're not keeping your widget logic completely local
and you turn it off by caching the target, so next time you trace if your new target != old target and old target is valid, you turn it off
when you play as a client, the server instance of your character has no business throwing around traces for the purpose of showing the widget
right and i was pretty sure it wasnt
and ya i store the traced actor, if it changes i use an interface to disable that ones widget, enable it on the new traced actor. if i trace nothing, disable widget on the stored actor and then set it to nothing and do nothing with it
but should the widget be on the enemy or on the player?
i prefer player, because then you need only one (provided a single one at a time is sufifcient)
with 100 or so enemies, the performance savings of them not having a widget component each are... significant
i was thinking enemy so they could each have a health bar, and just have player target make their name display or something
i dont think ill have a hundred of them though
also, would it be completely stupid to make a 2 vert rectangle over the character (in the model) and have it a material value to fill it based on a material scalar? like faking a health bar with a couple polys. dunno, was just a dumb idea. not sure why my widgets hate me right now
it wouldn't, an effective optimization
keep in mind its easier manipulating a widget then a shader
i guess a lot of my problem is separating the server character from the client characters. it seems like if i want something to just run locally, it doesnt run at all on the server character
Is it possible to send a const TMap reference over RPC? I know they don't replicate but I was wondering if they are okay to send like this?
const TMap<ACPlayerState*, FSomeStruct>& StructsMap
no
ah okay, ty
Where is the option for Run Dedicated Server on 4.25?
@steady briar thats what IsLocallyControlled is for
@red sand It is now listed as "As Client"
Is it fine to increase your GameState NetUpdateFrequency to something like 30.0f if you feel OnRep properties sometimes aren't getting through in time?
it would not need any such silly limit if replication worked sensibly 
Do you mean I should be doing something better or that the replication system can be unreliable?
I have an OnRep enum that goes through MOST of the time but I noticed that sometimes on a real connection overseas it doesn't potentially because of other things going on at the same time, but it is the thing that enables UI for clients, so if it doesn't make it through, no UI is shown
OnRep should always be called
it might take a little longer sometimes but it does not get dropped
There's a 2-3 second window in this case
And other things are getting spawned
I'm trying to figure out why though because it still should get called
I noticed with other actors simply bumping up the update freq works perfectly
Otherwise they can be dropped for multiple seconds
The bandwidth usage is nothing crazy either it feels like an artificial limit
it is an artificial limit, because unreal networking is made in an extremely stupid way
they try to reduce the cpu usage with this
Oh I see! interesting
Any way to remove / lessen that limit?
Other than the usual bandwidth .ini limits
just set the frequency higher
Ok will do on the gamestate
Thanks!
Wanted to make sure I wasn't doing something dumb and that's a fine thing to do
I wonder if we'll get push model but actually going all the wayβ’οΈ sometime
The weird thing is that I have ForceNetUpdate() called on that property though
I felt that was a definite push that will get through now
But I guess not without a higher update freq
It seems it still prioritizes higher net priority actors even if there's plenty of bandwidth to go around
For those who wanted the network character selection I think you can find it on the unreal engine official page on YouTube
why does server not fire the event while multicasting?
the print "Hello" doesnt print
this is inside of player pawn
When do you call that ServerRPC?
beginplay
nice
thanks
i guess the issue is ping right?
im more lost now actually
but you didnt even say anything
Are you filtering this call?
Cause BeginPlay calls on everyone already
- BeginPlay is too early
BeginPlay calls before the Client has ownership
Because Possess happens afterwards
If at all you'd need to hook into the OnRep_Controller function via C++
Is there a way to restrict the Broadcast() call of a Dynamic Multicast Delegate to the delegates owner?
Or at least, it's owners class
OnRep_Controller would provide me with an event which fires when pawn gets possesed?
It provides you with a point in time in which the Client's Pawn has a valid controller
DECLARE_EVENT() seems to mark the broadcast events as private members, only accessibly by the owner.
Which happens after possess
You can also use OnPossess in BPs
But that only calls on SErver end
If you need to pass the player name to the server, do it on connection
Half sure you can use ?name=XYZ in the connect string
Although if you only use BPs
And use JoiNSession
Then you won't get a chance to pass anything into that string
:D gg Epic Games and their BP Multiplayer shite
@chrome bay No idea. Also not sure what you are trying to do
:D
Never had the need for that I think
Haha well it's not strictly necessary, I'll just skip it
check it
i fire this on beginplay
so i see no issue why that would not fire on server
cuz it works on everyone else
its so simple
and i still think it should work
i fire this on beginplay
so i see no issue why that would not fire on server
I just explained why
Needs owning connection
BeginPlay is too early for that
RPC
"If Owning Client"
There is no owning client on BeginPlay
Only post possess
thank you for the info
i think i need to sleep on it
i really dont want to put a delay node
You shouldn't
Delay is never the answer to this
Unless it's a frame issues and you delay by 0
But that's not the case here
"OnPossess" -> ClientRPC -> ServerRPC -> OnRep Name Variable
And in the onRep of that varibale you set the naem
Acceptable BP only solution I would say
very elegant
Is there any way to know if a player currently has a spectator ?
are there more optimized ways to search an array with thousands of variables, than a for each loop? i think a for each loop running multiple times for multiple different people with thousands of entries will lag out the servers real quick.
I know you can get the player's steam name from their player state, but is tthere a way to get their steam avatar?
pls help my camera in game only goes left and right not up and down and my character wont walk straight
for android multiplayer i upload the build of apk +main.obb for both the 32 bit and 64 bit and now my alpha app in the goodle play store and i download it from google play and test it with emulateur on my computer so the game working fine from the main menu i click the start play then transition level after that player spawn on the gameplay map (world coposition map) the player spawn in the lobby island is separated tile from the gameplay map and when the number of players begin 70 they all attached to big plane for choose the location where each player want go....i want know when the player in the main menu and click start play he need call the level name (gameplay map)or call the server IP(dedicated server) ? i hope you can undrestand what i mean...
i need some help for undrestand if android multiplayer strategy is the same for pc multiplayer (the dedicated server)
my game ready for google play store but what i need to do for the clients connect to the dedicated game server ( my dedicated server i want host it with kubernetes+ agones the google cloud game servers services)
@clear copper If you use the advanced session plugin then you can get their avatar along with several other things
i saw that one but i've heard people say you should avoid plug ins that aren't on the marketplace. makes sense, they were probably rejected for a reason
is that one reputable?
@clear copper I have had no problems with it and it seems pretty widley used with multiplayer
hmm ok
i guess i'll take a look at it
do you have the nodes/method i'd use to get the avatar and name from the plugin?
ah nvm i found something on it
ty
@shy kelp A TMap could be faster. That is hash based.
But only if the container is very big
@clear copper Don't think it was rejected?
It exists for quite a while. You can't get the Avatar without c++
@shy kelp Just "Map" in Blueprints.
Oh ok
It's a Key, Value Dictionary basically
Isn't map a dictionary
Yeah
@clear copper np
Has faster access time if it's bigger vs a huge Array
I don't see how that would work for searching tho?
You'd need to change it so you can just search by the key directly @shy kelp
@foggy idol Coolio
Unless that's not an option
idk your actual data
But if you just compare one specific part of the array element
It's a strict array
Then you can just put that as the key maybe
Ahhhhhhh
Hm
What exactly are you trying to achieve?
It's a struct array with player info and stuff to search in the gamestate
It's contains private messages and global, which is why it might get big
@crude coral This should be similar to PC networking as you'd connect directly to the IP of the Server or?
@clear copper Don't think it was rejected?
@thin stratus I can't find it on the epic launcher am I missing it?
Otherwise, if it's ServerList based you'd need to use a subsystem that supports that or use google directly.
@clear copper No, sorry, I don't think it was ever submitted and thus never rejected or?
Like, I know the changes go rejected on source pull request, cause Epic wanted it to be a Plugin instead
ah ok, i figured they would've tried to submit such a popular plug in
And it's free, so not sure why one would submit it to the marketplace
lots of free stuff on marketplace, but it makes it easier to add to engines and keep updated i would imagine
idk lol
Yeah but that didn't exist when the plugin came out
just what i had seen in some forums
@thin stratus is question ?
Marketplace developed very slowly
@crude coral I'm not 100% sure, sorry. Check #mobile maybe? Networking is not easy, specially on lesser used platforms
Or let's say, "lesser discussed platforms"
@thin stratus mobile tell me to check multiplayer lol
Yeah i figured
it's just not very often discussed here, if at all
I would guess you handle Mobile the same as PC if you want to connect to dedicate server?
@thin stratus i want undrestand if peoples download my app from google play store and then click for play from the main menu so the call will be for the IP or calling just the level name?
Well what do you want to do?
@thin stratus if peoples call the level name each player will have his own session i think and he will stay in the lobby waiting forever there and never the rest of the players coming (69 players) because each session need 70 player for the plane take them all to the locations
That is not how you do this stuff though?
You are talking about matchmaking or?
Where people queue up and then get matched together?
Either way, if you just do "open levelname", then people will just open that level
If you do "open <ipaddress of server>" then they will connect to the server.
But for that they need to know the server address
@thin stratus i do the staff for multiplayer the game session need 70 player in the lobby for trigger the plane and attach all the players on it
And 70 players on UE4 is not easy to achieve?
Yeah then they have to connect to the server
@thin stratus yes! so how can that happen and connect to the dedicated server?
What do you mean "How can that happen"?
There is documentation on how to connect to servers
@thin stratus i mean if the game play map( default server map in unreal )included inside the client game so he will create session for him self just no?
@thin stratus i run the dedicated game server in local with my computer and working ok...the problem i want that happen on the internet
Why is there a problem?
Buddy, you need to learn this stuff before making the game
You connect to Dedicated Severs either via session or via ip
This is pretty basic stuff, please read up on it
I won't explain the basics here
Connection via IP works the same on Mobile as it does on the PC
You need a backend for the DedicatedServer setup
@thin stratus the game ready but i need push the dedicated game server on docker desktop for make container and push it to kubernetes+ Agones the google cloud game server services you undrestand me? possible do it?
Well yeah
open <ipaddress>
That's all you need
Get the IP of your server
and call open <ipaddress>
Clients will connect then
How you get the ip is up to you
e.g. open 127.0.0.1
Im still strugling with this "bouncing" behaviour in the camera.. right now I have a 100ms network simulation, even if I have none, there's still "bouncing"..
That will connect to the server
@thin stratus i know how can get the ip but that will be sure the clients will connect to it?
That's how you connect to an ip, yes
@fast mason Do Server and Client have the same character movement speed?
@thin stratus you have idea about kubernetes + Agones ?
@thin stratus you just put me to think.. 1 sec
@thin stratus yes the same movement speed
I didn't ask you
@thin stratus ah ok sorry
:D stop pinging/tagging me in every reply
hahah
yeah the thing is.. I have a AIController spawned server side and a Invisible Character following it in client side
checked, both have max speed 600.
Hm, not sure tbh
That setup is always a bit wanky
Epic's Character Movement is meant to be autonomous if you possess the character
If yo ujsut control it via an AIController, it can't predict anymore
is there any way to "properly" do this?
Not sure this works out of the box
Hm, not sure
Possess the Character and somehow fake the input via the normal AddMovementInput nodes
I mean, NCSOFT did this with lineage and UE.. but maybe since they have their own server implementation..
You could have the NavMesh on the client too
ANd only use it for the path
And use the path info to guide your player by hand
Then you would keep the prediction stuff
navmesh is on the level placed..
for my problem i need some one have idea about Kubernetes + Agones and google cloud game servers services i think
Maybe, then go to their forums and ask there though
This here is the UE4 side of things
I would change the "someone" for documentation xD
but agones have plugin for unreal so sure is there some one can help
Yeah, the docs and the peeps who did the plugin
I have never had anyone here ask about this
This is the Unreal Engine 4 Agones Game Server Client Plugin.
@thin stratus do you think that I should go with a custom server approach or should I dig other ways to solve the point and click mechanic ?
effort appart
I would write down what the system needs to have, then check how UE4 works there and then try to solve it accordingly
I'm working just with movement.. but this specific case doesn't work multiplayer out of the box
"custom server approach" is vague af
haha yeah, oh that..
ok, so finally fixed it disabling the smoothing network movement
Hello @everyone, how can I make a Solo, Duo and Squad system?
Is it possible to replicate the camera rotation to all players ?
I'm trying to use SAVEGAME info to have everyone in a server have their own name. have any idea how to do that? i can't get mine to work.
is pawn being possesed on server?
I'm trying to use SAVEGAME info to have everyone in a server have their own name. have any idea how to do that? i can't get mine to work.
@swift cargo what have you done so far?
@foggy idol here is easy solution https://www.unrealengine.com/marketplace/en-US/product/smooth-sync#:~:text=Smooth Sync will Sync your,the network using Unreal's networking.&text=This product contains a code,on a per-project basis.
@serene meadow Client makes his own name in a text variable and saves it. when the client begins play they set a nameplate above their heads using their info, i make a custom event thats runs only on client but when the client joins the server the client sees his own name on the server player.
im really confused overall on what i should even be doing, im using tutorials but i dunno if something changed.
@empty matrix you can make a variable of integer type named for example "team" and use it to check if the team is the same or different while doing damage for example
Hello everyone, how can I make a Solo, Duo and Squad system?
@empty matrix really depends on what do you want to implement on each mode
then you can
@empty matrix you can make a variable of integer type named for example "team" and use it to check if the team is the same or different while doing damage for example
@shrewd tinsel Have a Tutorial?
I mainly need it for whan players are spectating
@empty matrix nope
Because the pitch doesn't work
@serene meadow Client makes his own name in a text variable and saves it. when the client begins play they set a nameplate above their heads using their info, i make a custom event thats runs only on client but when the client joins the server the client sees his own name on the server player.
@swift cargo maybe you can set a player name variable in the player state (wich will be set to the one in the save game) of each player on the server, that is replicated so it can show to other players
How do i do that?@serene meadow
you can set camera's transform for everyone except the owner to the same of the owner, however, it would flicker, because it would refresh at the speed of the owners frames per second, like 60fps, so if other guy has 144hz he would see strange things, this is why you need interpolation, and interpolation is hard to do so i suggest spending 20 eur for very good plugin, it is really easy and you can do basicly everything with it
yeah i needed the same exact thing
but i got that plugin for free when it was on free for the month event π
@empty matrix you can make a variable of integer type named for example "team" and use it to check if the team is the same or different while doing damage for example
@shrewd tinsel Could you record a tutorial and send it to me? it is very complicated
yeah 150$
And I want to add a list of the same team on the HUD
yeah 150$
@shrewd tinsel hey, hard
Is there any other way?
tare you can actually make it with timelines so its smooth but it wouldnt be very precise
I made sure I got everything
@shrewd tinsel hey, hard
@empty matrix i think he was talking to the other person
i was talking to victor
oh ok nvm
im using teams as integers right now in my project
@serene meadow I can make it work flawlessly with Get player name and shit like that but i want a custom name based off of save game stuff
@swift cargo like once the player loads in you load and set the name ?
@serene meadow I can make it work flawlessly with Get player name and shit like that but i want a custom name based off of save game stuff
@swift cargo you can just switch the Get Player Name to a replicated variable that has the value of that saved name
im confused but ill follow.
If that's what you want > @swift cargo like once the player loads in you load and set the name ?
@foggy idol then you can just setup an event in the player controller to load the name then set it
https://i.imgur.com/mP2MTcf.jpg
@shrewd tinsel I want it when the player selects the mode: Solo, Duo and Squad.
you can have any ammount of teams if you make a variable 'max teams'
Call the event in the player controller from begin play in the HUD blueprint
Because at that point the player has successfully loaded in
If you still don't understand I could show you an example @swift cargo
OMGGGGGGG
@shrewd tinsel I have it
@foggy idol Sure
The solution to all my problems was in my library π ππ
Ok @swift cargo
Lemme just open discord on my laptop
My brain is so fried
i've been trying to do this for like 6 hours
its so simple
but its impossible for me to understand.
Why can't i just have custom player names based on a clients savegame variable?
This is the begin play in my HUD BP
congrats @foggy idol
thanks @shrewd tinsel
anyone know if i can replicate interface call?
@swift cargo are you using C++ if not then i suggest Getting the Advanced Sessions Plugin
this is in my Player controller . I Used on Posses so i could store the name in the player even if the character dies and respawns
@shrewd tinsel c++ or Blueprints?
C++ interface's Confuse me but i can do BP
@swift cargo are you using C++ if not then i suggest Getting the Advanced Sessions Plugin
@foggy idol I Said this because you would also want to set the player name in the player state but it can only be done through c++
i am using the advanced sessions plugin...
Your calling it in the characters begin play
i used the begin play in the HUD BP because it isnt called until the player is done loading
What do you think i should do?
the one in the character could possibly be called before that
make a variable in the player for the name
then set it from the player controller on posses
??
wait lemme do it then post screen shots
@foggy idol blueprints, i guess i need to make a rpc event or something to get it working?
how do you do it?
this is in the player controller BP
@shrewd tinsel it depends. in my case weapon pickups can be done locally or on the server. do you plan to call something locally or on the server with the interface
for example i use render custom depth to highlight weapons and pickups locally
im still so confused
on ?
just everything
ok
i've been legit trying to do this stupid shit for like 6 hours
lemme try my best to explain it
make a string variable for the name in your player BP
okay.
now make a string variable for the name in your player controller
??
player bp
player controller
isnt that the same ?
how can you make somethin IN the player controller?
what?
i have a Blueprint for a player character
wtf is a custom player controller?
ok
so a player controller is like the soul while the player character is the body
create a new blueprint of type player controller
name it as you see fit
@swift cargo
Why? i have one
so now you have a player name variable in your character and in your player controller ?
Yea.
BOTH?
yes
wait
Where is the player controller?
im so fucking lost
holy shit
Where is the character?
ok calm down
@swift cargo player controller bp is empty just camera inside
yes
yea i know.
its icon looks like this
not mine.
ignore the name
like ?
thats the character blueprint
Yea
So how is the player controller and the character different?
how can i have 2 varibles in the 2 different things
the character blueprint and the player controller are completely different things
ok
@swift cargo in your game mode setting you can see character bp and player controller bp
yea
thats my player controller icon
where is that?
so i am now going to assume that you dont have this
thats my player controller icon
@foggy idol
im so confused
why do i even need that? i have never seen it in ANY tutorials
playercontroller
its needed for things like voice chat and a bunch of other stuff
and i get what you mean
when i started using UE4 i never used it
Because in situations like when you need to respawn the player the player controller doesn't get destroyed
So do i just remake my player in THAT then?
and if you want to do anything multiplayer its a must have
noooo
the player controller is like the brain
and the character is the body
i guess
both exist
what do i do with it now?
ill explain how to link it to your character later
for now we need to start with making one
open it up
yea
both
done
make sure reliable is ticked
yes
ok now go back to the Hud blueprint
ye
this is where you want to load your custom name from the saved game
do it on begin play
good now right click and search for "Get owning player controller"
yea
drag from it and cast to the player controller you made
now from the cast call the event we just made
yea
hover over the functions tab you should see where it says overidde
yea
select on posses from the list
yea
yea
okay.
ok back the cast
Select Your character from the dropdown
i make this event in my Player controllerbp?
yes
if you still dont know how dont worry just remove all the inputs and leave it
well add them soon
i cant get switch has auth from the cast
done
yep
connect it to authority on the has authority
yea
now duplicate the name node you just set
yea
connect it to that set name on server event we kept aside
i think
ok
the target is my firstpersoncharacter
Is the net pktlag 1 way or roundtrip?
@foggy idol ok.
mhm
Are you Using the Name For anything ?
Like for a name tag or something#
because i noticed a text render
ok then
Set text for the render with the value from begin play?
okay.
did a function get created ?
good
yes
now use the name to set the text render in that function
yea
open it up
and change the player controller to the one you made
also change the HUD bp to the one we just worked on
i have one for the menu and one for the game, so ill make one for the game
put it in the one for the game
also at the end of this https://cdn.discordapp.com/attachments/221799385611239424/724018375403241562/unknown.png add the set player name from advanced sessions to the custom event and to the end of the authority
i dont have the plugin right now so i cant send a screen shot
Drag the target to the custom event
yes
but also call set player name on the authority side
and you forgot to plug in the string on set player name in the custom event
Hello everyone, how can I make a Solo, Duo and Squad system?
waittt
Set Up A Print on tick to see if the name variable is being set
because thats the setup i use and it works for me
hmm
send me a screenshot of the setup in the player controller and in the HUD blueprint
waittt
in the player controller
add a print on posses
to see if its possesing the pawn
and are you testing with a client