#multiplayer
1 messages · Page 174 of 1
Im thinking to do a vault where the server is authorative, just plays a multicast animation and teleports the player after that to a new location with a linetract. Just like they did in ArmA III
I'm just giving an example of one way of doing it.
Everything you've said is doable with CMC.
I guess my approach is even easier, or do you think it can be done with root motion easier?
i mean the vault precisely
Could someone explain why my pointer varies in size when replicated? void Server_SendShootEvent(float x, AActor* y);
I am just trying to figure out some performance metrics before I move forward
So Sprint can be done easily okay, vault i can jank something, and now for the animations, how is the easiest way to sync them up on latency to get rid of that stutter with latency?
what do you mean sync them
I give you a example, because i can't explain whats causing this, one sec
unless you're doing movement driven by animation, there is no "sync". You make an animation graph that responds to movement.
I know its not actually replicating the pointer per say but some NetGuid right? So why would its size vary?
because the actor may not have been assigned a netguid yet, so it needs to send the path (assuming it has a stable path and isn't a runtime created actor) to assign the guid.
Its average is 53bits and max was 248, sorry if that wasnt clear from the image
Okay that makes alot of sense, in this test case, its an empty level with static pre placed assets, I assume because they arent replicating its sending the path?
it will send the path once and from then on it should have a guid it can use instead.
though it may need to re-send the path a few times, depends on when the guid gets ACK'd
Wow okay, thats really great to know, really appreciate that
Who's view is this?
Client 1, Client 2 is being watched and Server auths the sprint, settings : 200/5
Looks like out of sync movement speed.
That looks like you are either playing with some very bad network simulation settings or you have implemented sprint incorrectly.
Or both.
IE you didn't set it on one of the machines.
I set the emulation* to 200 latency and 5 packet loss
200 is a bit brutal
Which is pretty bad. But honestly you probably just did what Authaer said - you didn't implement sprint correctly.
All clients must know other clients' movement speed to simulate them correctly between net updates.
If you are setting it on every machine, you need to up the uh.. I don't remember the name, the correction radius.
Yeah you cant use RPCs for movement
With the CMC?
the issue here is that only the owning client and server learn that the walk speed is changing
so every other client is mispredicting the client's movement between net updates.
Yes. Especially if you're only working in blueprint - you sure as hell aren't making custom saved moves.
Fair but the client will also predict sprint speed wrong as well when performing movement
Ay fair, but that's gonna cause rubberbanding
Eh, with the right network settings it'll be minimal.
And again, not really any choice from blueprint.
just use the GMC
Pardon, forgot this one to screenshot :
that's a bad way to do things
that should not be an RPC
it should be a replicated property
Oof. State in an RPC
You've probably dropped that RPC entirely on other clients so they never see the movement speed updated.
seeing as you're running with pretty bad packet loss
Holy this would explain it.
Oh actually i think the problem is somewhere else, i did not rpc the stamina change in my stamina drain function.
...also sounds like an incorrect use of an rpc
Any pointer where i can look up how to do it properly?
In this tutorial I'll show you how to make your own multiplayer third-person shooter, complete with replicated procedural aim offset, particle effects, sounds, blood spatter, health, death, respawning, and more. I'll also walk you through a few key aspects of replication in an attempt to help you start thinking about how a multiplayer game is se...
Somewhat like this, might be newer ones but this works (as far as I know)
@sour dragon The basic idea is this.
You RPC the player's intention. Server sets state, everyone gets it and locally changes their CMC values to match.
If you set this up and you're still getting rubberbanding while a client holds shift and runs, then you need to increase the SmoothUpdateDistance properties here a bit.
Thank you both, will try to recreate it 🙂 !!! regards
I suppose there’s bunch of ways to replicate and which one is easiest and more fun i got no clue 😅 but I do follow and try out and use what works
What's the difference between
starting a dedicated server with in the editor with 2 clients
and
starting the dedicated server from command line and joining two clients from command line ?
i have a problem that i spawn items on game mode when the game starts, so starting the dedicated server with in the editor works perfectly and all clients can see all items on correct locations
but starting from command line and joining later from command line every client sees items at the center 0.0.0 location in the level
maybe this is happening because
When we start a dedicated server with 2 clients from within the editor, we are essentially running the server and clients within the same process ?
and running from command line the server and clients are on different process and the world location for the spawned items are incorrect for clients?
I mean from menu level to server map. In between I want loading screen. More or less with seamless way Is it possible? Any tutorial or article from community?
you need to run loading process on different process if you don'l want your screen to freezed untill the new level loads
Download Lyra. Steal their CommonLoadingScreen plugin. Create a LoadingScreen Userwidget and set it in the CommonLoadingScreen project settings.
Thank you
There technically shouldn't really be a big difference. Are you able to share how you're spawning and setting the location of the spawned items?
for (auto& Element : SpawnLocationTable->GetRowMap())
{
if (const FST_ItemGroupLocation* OutRow = reinterpret_cast<const FST_ItemGroupLocation*>(Element.Value))
{
SpawnTransform.SetLocation(OutRow->Location);
// Set other transformation properties as needed
// Spawn each item using the specific spawn location
for (auto& IDElement : ItemsIDs)
{
// Use the spawn location from the data table
SpawnLocation = SpawnTransform; // Use the specific location from the data table
// Spawn the item with the specified location
switch (SpawnType)
{
case EItemType::E_Weapon:
{
APickupWeapon* Weaponitem = GetWorld()->SpawnActorDeferred<APickupWeapon>(PickupWeaponClass, SpawnLocation, nullptr, nullptr, ESpawnActorCollisionHandlingMethod::Undefined);
if (IsValid(Weaponitem))
{
Weaponitem->SN = GetRandomSN();
Weaponitem->ID = SpawnID;
Weaponitem->Ammo = 0;
Weaponitem->Amount = 1;
Weaponitem->SetReplicates(true);
Weaponitem->FinishSpawning(SpawnLocation);
ItemObjects.Add(Weaponitem);
}
}
break;
// Handle other item types similarly
}
// Add the spawned item to ItemObjects
}
}
}
return ItemObjects;
error log in client console:
[405]LogActor: Warning: SetReplicates called on non-initialized actor BP_PickupWeapon_C_9. Directly setting bReplicates is the correct procedure for pre-init actors.
[405]LogDataTable: Warning: UDataTable::FindRow : '' requested invalid row 'None' from DataTable '/Game/Items/Weapon_Table.Weapon_Table'.
i fixed these two issues now about those warnings, but still the items are spawned at the center of the level
// For the SetReplicates warning
if (IsValid(Weaponitem))
{
Weaponitem->SN = GetRandomSN();
Weaponitem->ID = SpawnID;
Weaponitem->Ammo = 0;
Weaponitem->Amount = 1;
Weaponitem->bReplicates = true; // Set bReplicates directly
Weaponitem->FinishSpawning(SpawnLocation);
ItemObjects.Add(Weaponitem);
}
// For the UDataTable::FindRow warning
if (WeaponData)
{
if (const FItemWeapon* OutRow = WeaponData->FindRow<FItemWeapon>(FName(IDElement.ID), ""))
{
// Handle the found row appropriately
}
}
I am trying to replicate the removal of instances in a PCG spawner blueprint but I am receiving this error:
=== Handled ensure: ===
Ensure condition failed: TestObject->IsSupportedForNetworking() || TestObject->IsNameStableForNetworking() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\NetDriver.cpp] [Line: 6752]
Attempted to call ProcessRemoteFunction with object that is not supported for networking. Object: /Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap.ThirdPersonMap:PersistentLevel.BP_TreeSpawner_C_UAID_D85ED3541EC43DED01_1401064167.PCG_Tree_01_1 Function: MC_RemoveInstance
Stack:
[Callstack] 0x00007ffa5c5ca447 UnrealEditor-Engine.dll!UNetDriver::ProcessRemoteFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\NetDriver.cpp:6752]
[Callstack] 0x00007ffa5b8fc5df UnrealEditor-Engine.dll!UActorComponent::CallRemoteFunction() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:769]
[Callstack] 0x00007ffa9688730b UnrealEditor-CoreUObject.dll!UObject::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2010]
this doesn't always happen so I am very confused on why this is happening. this is my setup:
- a blueprint actor with Replicates set to true, that contains a
BoxComponentand aPCGComponent - the
PCGComponenthas a graph that spawns some static meshes of trees, with my custom component:UTerraResourceInstancedStaticMeshComponent(inherits fromUHierarchicalInstancedStaticMeshComponent - when I hit one of the trees, I call a method in this custom component class that runs on the hitting client and on the server. I check for authority then call a multicast that is defined on this same component
then the game crashes on the multicast call, but not always 
seems like you're trying to call an RPC on a component that isn't setup to replicate
The error indicates that your tree spawner (BP_TreeSpawner) tried to call a rpc and wasnt allowed to
when I first got this error I enabled the Replicates on the BP_TreeSpawner and it worked. but then it randomly crashes so I am not sure how to debug this
on the error message there's this: BP_TreeSpawner_C_UAID_D85ED3541EC43DED01_1401064167.PCG_Tree_01_1 so I think it is not referring to the actor itself, but a component of the actor (PCG_Tree_01_1)?
Heyo! I've got a question about replicating spawning an actor and attaching it to a socket, i followed a tutorial online about implementing a bow and arrow in my game. But it was for single player. Now after some fiddling, I have the bow replicating on the server side and the Client see's the server's bow when spawned and destroyed, however the client side is only seeing the actor spawn and destroy locally, also when the server has the bow out, the client can no longer destroy the bow. Any thoughts on this ?
I'm using two functions setup in the AC_BowMechanics BP and calling them via the BP_ThirdPersonCharacter
I think i'm doing the logic wrong, and not calling the functions on the server from the client at all, and just doing it locally, but i'm unsure as to how to get the client to call the functions from the server as well.
Disregard! I figured it out haha
i had to make new server events have them call the functions. 🥴
Hey peeps, wondering if shooting projectiles with RPC is enough and wont cause desynch or should I be using something like GAS?
If you shoot projectiles with an RPC to the server, the the actor will spawn on and be moved only by the server and should be an accurate representation of how the server sees the object. However, this can appear "laggy" to the client that is performing the shot as they would have to wait the roundtrip ping time to actually see something happen after they've requested to shoot. GAS doesn't really fix this issue for you. GAS does have client prediction of activation of their abilities, but it doesn't predict projectiles that would need to exist on the server while being spawned on the client first. Unreal Tournament source code apparently has what you'd need to properly predict projectiles so that the projectile can immediately spawn on the client, then spawn on the server, then have the client's projectile catch up to the server's projectile.
im also using smooth synch plugin and its amazing and has saved me from having to fiddle with CMC in c++
thank you
regarding smooth synch, should I check the replication box and should I check the auto activation box?
I uploaded Dedicated server on AWS & use EOS for Matchmaking system. Now iam struggling with in-game server regions change. Can someone give me the process or code of it?
Any idea why this doesnt work
ive never once had this issue, but the session always fails to create
the components of the actor do get replicated using the actor channel of the owner of the components.. but you need to also mark the componentes as replicated if you want to hold replicated data on them
yeah I think the issue was that the NetMulticast was being defined in the component itself so I had to mark it as replicated too, that makes sense 
nice! :)
i didnt follow up tonight because i went to sleep! but glad u got it sorted
Hello
I have an issue I have a dynnamic IP and I was wondering how could I make a " global server" so you can always enter into it
can unreal do DNS? and introduce name rather than IP ?
hey guys, I saw a post above a bit about rubber-banding, is this the same that's happening in my game? You can see the client window and the Host(red) has smooth movements, but the Client's(blue) is jittery and ugly. The host sees the same ugly movements as well. I played the other day with my coworkers and that was one of the biggest issues that needs to be addressed. Any ideas what to look into?
How's your movement being controlled? Is it through Unreal's Movement Component?
Yes
I know there's a bunch of network smoothing properties in the movement component that might help
well I tried upping Network Max SMooth Update Distance and Network No Smooth Update Distance to something like 1000, didn't do anything
Not sure if I need to put less than 0.1s on those Network times or something else
Under character movement is Orient Rotation to Movement ticked off?
lemme check
Orient to movement can cause that jitter too
I see I've set these I guess a long time ago
GetCharacterMovement()->bOrientRotationToMovement = true;
GetCharacterMovement()->bConstrainToPlane = true;
GetCharacterMovement()->bSnapToPlaneAtStart = true;
bOrientRotationToMovement try to disable that and test it
🎉
hey guys, I defined a custom pawn as a drone and will spawn it during gameplay, but I have an issue accessing it when testing with clients. drone spawns but clients access to null! what shoud i do?
You should possibly share your code (:
Could anyone VC who has extensive knowledge on multiplayer networking, I have a significant networking issue where when anyone joins a lobby, it doesn't connect them to the same world level as the host, this is causing some issues (note: It just keeps them in the main menu like nothing ever happened)
You'll want to share stuff like your Client and Server logs
I managed to fix it, so in short I’ve already got multiplayer games on steam, I used the same system I’ve always used but it wasn’t working oddly
Adding “listen” to the map option fixed my issue. I’ve never needed to do that but it’s good that it’s fixed!
The player hosting the Game always has to use "Listen" as an option when Opening the Level that is ultimately meant to be joined.
It doesn't need to be part of future ServerTravel calls though.
Voice chat is not working on server travel 😔
Does anyone know how I can fix this
@thin stratus do you know any way I can use voice chat after server travel
Hello, i got it working so far that i got a replicated sprint, now i tried to make it that when the left shift is pressed down for longer than 5 seconds, it keeps the sprint speed. But now i want to implement that when the W Key is released it always defaults to the normal walk speed. So as long as left shift is pressed for longer than 5 secs > go into 1000 walk speed, if released go into 300 , if released and in sprint loop (hold down longer than 5 secs stay in 1000. How would i get around knowing when the W key is released?
So to break down the problem and dont talk too much : If W Key is released at any time, fire the "Player Wants to Sprint" value with Bool ticked off
So something like this :
Could just RPC the key up with sprint off I think.
Got it working this way, but im pretty sure its jank 😆
Basically no client prediction. If you have 50 ms, it will take 50 ms to tell the server to change the movement speed and another 50 ms for the server to reach back to you
For movement you do need one, otherwise it's unplayable
Imagine pressing shift and start sprinting 1 sec later
You should test with lag to see if something works or not
Yeah im going to emulate lag now and see how it works out
Im just learning this stuff so i guess it will be jank and not perfect but thats why im learning
First thing i actually try to do networked
anyone know good tutorials on saving game for multiplayer, I've got a save and load game system but the clients load the hosts save file not their ownn
It actually works on Client 1 but on Client 2 the sprint does not trigger at all
This gets complicated fast. Gamepaly systems should normally rely on the host only. The host should load the game, and all of that should be replicated back to the client.
For more client based things like control setups, or client specific settings, you would load and save those individually.
Edit actually it works on both but not on client 2 with packet loss and lag
Works now, was because of the default walk speed.
Is this caused by the missing client prediciton that you were talking about where it just goes from 300 to 700 in a instant?
I wouldn't call that working 😔
That will be frustrating for players
I'm gonna hit the hay, but you probably should look at delgoodie cmc guides in youtube. It goes over sprinting in multiplayer.
Without Lag it works fine
Yes but then that's fake test because in real world there is always lag
Yeah i know, but what is the problem here
Somethings are not doable in blueprint
ive never had to do that for some reason but thank you for the explination, it absolutely applies to this project
good to know, thank you very much
I mean i can do some things in C++ if necessary even if its just boilerplate, but the problem is when i want to add something like the autosprint mechanic, then everything falls apart
Start with normal sprinting first then you can easily improvise to make it auto sprint
My only advice is to look at delgoodie cmc videos
He compacted a lot of stuff that you need to know when working with cmc in network environment
I looked into his vids already some days ago, but the problem is im still not a C++ programmer
Alright ...then im going to do it
Good luck, but don't look for blueprint alternative
They won't work for multiplayer cmc. The reason are stated in the video
Acutally there is something else I would like some assistance with, May I DM you the pictures?
No, please post your issues here and allow others to help too. I don't have time for private support (:
Why is unreals possession framework so messy 🙃, somethings are client only, some are authority only, some run twice for some reason and others are redundant race condition calls on the case one arrives before the other
Most of this actually just comes naturally from the Authority setup and replication rules though
what variable type is the same as 'Blueprint Session Results' in CPP
😈
Should I edit my message to say " I don't have to for free private support (: "?
Guess for proper stickers I would need to give Discord money
I'm not sure learning from an uppity panda is going to work too well.
Hello guys, do someone know how i can get the output log of my failed visual studio build of unreal
Where does that uppity now come from? :/
Salty ?
But uppity is not salty
When I see salty, I think "panda has been embarrassed and is now getting angry"
Apologies if this is your company name 😂
Na, Panda Studios was my wife's company name. The "Salty" part comes from my end being "salty" during competitive games. I can't handle losing that well in those :D
Uppity means "self-important" or "arrogant" which is not really the same.
Eh. They're related!
Can't you see the logs in Visual Studio itself?
Not the full log
First time I hear that saying anyone though. Everyone so far understand what the Salty part means. Def not self-important or arrogant.
It's more related to the reason why you're salty.
I like my food well-seasoned of course.
You should be able to see the full log though. Not sure where those are stored otherwise.
It just says error Error MSB3073 The command ""C:\Program Files\Epic Games\UE_5.2\Engine\Build\BatchFiles\Build.bat" MultiplayerBlueprintLobbyEditor Win64 Development -
hi guys,
When Seamless travel set to true on Lobby Gamemode game crashing on servertravel in standalone launcher.
Before Calling any Seamless Functionality its crashing
and no error in the log except this How to fix it ?
You'd need to install the Symbols of your Engine Installation.
You can do that in the Options of your Installation in the Launcher on the specific Engine Version.
They are a few gigs big, but they allow you to actually see what code in the Engine is causing this.
So far it seems to happen inside the Chaos Module.
Hi , I will check it and see if this helps .. Thanks
No worries, Ill consider posting it soon, I am currently still trying to find the fix myself !
I am trying to make a system where all connected players have their individual profile here, but the issue is that the information is sourced from the game instance and I am having troubles getting that data to everyone
so from the hosts point of view, it shows 2 players connected (me and my friend) however it justs shows the same info twice
(on my friends side it just shows herself twice as well)
Ive tried getting the data on the player state but its clearly not working
I thought player states were replicafed across all clients and the host
Replication is only one way, from server to clients. If clients have data that they want to share with other clients, they must call an RPC to the server with the data on a replicated actor that the client owns (like player controller, playerstate, or their controlled character), and then the server can set the RPC'd values in replicated variables on replicated actors which will then share them with other clients.
I think I understand
So should this in theory work (this is the player state)
Yep, assuming the GameInstance has the player info before begin play fires.
it does
So how would I go about getting all the different players info into an array?
I was running this in the game state
im not sure if thats even the right place to do it
You wouldn't need to do this. Each playerstate can contain their own player information.
but I want to make it an array beacuse I have a system that uses that array of info to make child widgets of the information
You have the PLayer Array which is the array of playerstates. If you have that then you can get the value from each playerstate.
ahh I understand
so then would this work? (its in a widget)
For reading the array for values, yep.
Though technically you woudln't need to cast the gamestate
Just get gamestate and get the player array.
You only need to cast if you have custom variables or functions you want to access or call.
"server travel" works smoothly in the game engine, but when rendered, it does not work on real computers, the client returns to the lobby again.
how can i solve it
Unfortunately the issue is still there
my side
her side
any ideas?
(im host, shes client in this image)
the game still knows that there are two player states, it just wont transfer the information
How are you updating the data in the widget?
ill show you
I have an event that runs every second to update it
here is how it works
If you're only pulling the data on construct of the widget that might be before the data has replicated.
but furthermore the event is run every second, so it cant be that
this is the event that sets the info on the server (playerstate)
Seems slightly wasteful to constantly construct and deconstruct the widgets, but anyway, check what the values are on the playerstate on the server.
Ill keep that in mind, also how should I go about checking those values?
You can try putting a print string in the RPC
ahh yes, Ill do that now
It gave me the right number, however I also noticed that for a split second the second Info tab had loaded up my stats instead of my friends stats (it must of done this the other time too)
Likely ties back to this - Begin Play fires on both the client and the server, and because this is playerstate, it'll fire for for each player on each client.
any ideas on how to fix it based on that?
can I find out which player the playerstate is local too and only run it for them?
Yep. You can "Get Player Controller" on the playerstate, check if it is valid, and if it is locally controlled.
yeah, Ill do that
I have question regarding Mover 2.0, can someone explain to me on a low level how it will work for Blueprinters. So will blueprinters also be able to have Client Prediction and Lag Compensation, and if yes. How will the application of those things look like. Is it like a component that sits in the Character class that replaces CMC and has more or less the same functionality and uses similar nodes such as WalkSpeed,Deceleration etc? Will the integration be like a fire and forget solution where just the pure existence of the new Mover component will handle what i do inside the Character BP (so will it apply those network features) by itself or do i need to actively use nodes for stuff such as lag compensation etc... ? A example would be a vaulting system. Is that already properly replicated, compensated and client predicted as soon as i add my nodes or do i need to add new networking nodes that we did not use before?
so perhaps this?
No, you need to ensure the player controller is valid first before attempting to access if it is a local controller.
Just use the other Isvalid
understood, yes as the other one already has the branch internalized
and you don't need the instigator, just the controller, you can check if it is local or not.
it didnt let me, it auto made that haha
got it
so something like this then?
once again, host has itself and an empty slot
and client has nothing
@sinful tree Could I have a system where the player blueprint gets the info from instance, sends it through the run on server thing and use that to get it on the player state?
do you think that could work?
If the server has the right value after the RPC, then there should be no issue with the data getting to the server.
I am able to confirm that the values are correct, so im still stuck with this situation
Do i need to add any conditions to the variable perhaps? (playerstate)
Just replicated should be sufficient.
That doesn't matter.
Player Controller is created on the server and replicated only to the owning player (no other clients)
Well, technically the "Get Player Controller" IsValid? is what blocks clients. A client would only ever have their own player controller available so for playerstates other than the owning playercontroller's, this value would return null. The local controller is for ensuring the server isn't executing it since they have all controllers.
That being said, if you know for certain that the value is on the server's copy of the playerstate correctly, then the issue isn't with setting the data to the server.
Like if you connect a print string directly up to this and print out some of the values, you should see 2 of them appear in the log, with the data from each game instance.
Understood
On the host I did see two
im going to do another print string
"server travel" works smoothly in the game engine, but when rendered, it does not work on real computers, the client returns to the lobby again.
how can i solve it
results from just me in the lobby, 36
when my friends join, if I get any number that is not 36 then Ill have my results
one sec
I can 100% confirm @sinful tree that the data is correct
it is correctly getting the data and sending to the server
this appears to work perfectly then.
this (in the widget) must be what isnt working
but also to note, the client doesnt see anyones stats
the host still sees their own
ill show you
that was it
I took the info and printed it
its different for both players and it did show me the correct values
Ok, but then why is it not saying "Server: 88" rather than just 88?
I didnt know it was meant to say that, but im not sure why
do you think thats where the issue lies?
Standalone print
elaborate please
In a multiplayer game when you use the print string node, you'll see "Server: " or "Client0: " "Client1: " etc..
Somebody can help?
I understand, so what should I do?
So that likely means you aren't playing in a multiplayer environment.
but how was it hosted and I was able to get my friend to join?
any ideas?
ill show you the game creation page
this always returns as "Session worked"
as in its successful
Ah. Then the print is normal. Only does this in PIE testing.
oh, I wasnt in the editor, I was running it on steam so my friend could join
I just kept uploading the build
I can run it in the editor too one sec
I cant get the second PIE to join the game
as its built for steam and I cant invite myself
Are you pulling any data from steam? If not, you can just open level as a listen argument on one PIE session and then do Open 127.0.0.1 on the second.
there is steam data being pulled yes
Oof And not templated?
I tend to put things like that behind some sort of generic system. So that it'll work regardless of whether I'm in PIE, EOS, Steam PSN, etc.
im not sure what that means, but what I do know is that steam is physically built into the code, I had to convert the project into a hybrid and I would also have to phsically go in the config and turn off the steam subsystem
or remove it
The only thing you should be changing between builds largely is the ini settings. Which net drivers to use and whatnot. And Editor won't use the same ones, it'll use Null.
Helps with iteration. 😄 Less cooking and updating Steam to test minor things like a UI change.
I have new information guys
ill send the picture
both numbers are returning as server
Which you'd expect from that print 🙂
So here's the thing.... If you know for certain the server is getting the values for both, (you're getting 2 prints with different values on the server instance) then the replication should be working just fine as this is the playerstate, and you're constantly polling the playerstates for the values. Your only other test you can do is see if the values are coming out here correctly.
ill test that now
Which technically you already are in your widget.
The issue is the white widget not initializing with correct data, right?
correct
also PIE doesnt display ANY data at all
on those widgets
I don't see any error with what you've shown so far. What about the stuff in that widget?
Well this is it right here
that image shows how im going about getting the information
Also for note, I'd recommend switching this to a listview and just passing the playerstate as the shown object. You'll end up with a ton less widget creation and avoid bugs like a right click menu dismissing itself when your timer runs.
Er, TileView, not listview.
But no, I mean inside of the widget itself.
I saw where you were passing arguments to the widget, but what about the widget's construct event?
The child one I mean that is displaying the data.
The WB_Level's construct event
I would start with that.
pain
Not sure that should be ticked.
Either way, if you know for sure the values are good here on both instances, then it's no longer a replication issue. Now it's just a matter of ensuring your widgets are displaying the data correctly.
Ill get that info now, one moment
we can rule out replication
I wonder why the widgets themselves were not working, think it was the tick thing I had?
Ill try it with construct
It's probably part of it. It may take longer than a single frame to retrieve that data and that node may stop executing if executed again.
Ahhhh
that makes a lot of sense
hence why for the host, I saw myself but the client didnt see anything
I would even more strongly recommend a tileview here. Just make it update on object set.
And I agree with Authaer in terms of formatting this a bit better - you can pass a playerstate to a widget with a TileView.
what does that mean and where would I start?
Not much. Your main widget just needs a tileview instead of the hbox.
Then your child widget nees an interface added and a function implemented.
Sec
Start in the child widget. Go to it's Class Settings. Add the UserObjectListEntry interface.
You'll get this function to override, you can cast the passed object to your playerstate.
Oh I understand, So I should make an interface for it
There already is one.
Ahh so I can use that
In the parent. You add a Tileview. Set it's EntryWidgetClass to your child type. It won't show up unless you have changed the child's interface and compiled it's BP.
Then in the parent, the timer you have is changed to this.
Much easier handling than managing manual widget creation.
this still isnt displaying
but I know for CERTAIN that the correct informatino is entering the create widget thing
Ill come back and take a look at this soon
I would start by sequencing some stuff in the child
Sequence, request the avatar and set the avatar after that comes back. Then do everything else immediately.
okay Il try that
imagine its not working simply because this is failing
and it never got to do the rest of it
wouldnt that be funny
wait a sec
I do want to thank you guys for the help though, its been a good learning experience I could say
(one moment, ill upload this for my friend)
Good news, it works, thank you guys
(the avatar thing I can fix)
is there a good guide anywhere on profiling a linux dedicated server build (build on windows with cross compililation, then deployed onto a linux server). I'm not entirely certain exactly what is using the most CPU (I think updating the skeleton/bones) but I'm not certain.
maybe ask in #linux
or #profiling
thanks
no one really knows. For now its mainly c++, still in beta, and some of the smarter people in this channel are playing around with it, releasing interesting pieces of info here and there. If your after a blueprint solution, from everything I've read, mover 2.0 is not for you yet. The future, who knows...
Damn so GMC or go home ?
Absolutely not understandable why Epic is abandoning Blueprint Networking, improving Networking and the Movement for C++ users, making it easier. Just to absolutely screw blueprinters over in the end when we need it the most. If i knew C++ i would not use Blueprints. I mean did nobody ever tell them that their customers are using third party plugins for the most basic thing because they can't implement their own system properly?
they're not abandoning anything
proper movement prediction and replication has never been the realm of blueprint
and mover isn't even remotely production ready, not sure why you're so worried about using it when it isn't done.
CMC still works perfectly fine for what it's good at. Properly creating new movement modes requires C++ but blueprint has never been suited for the kind of complexity that movement prediction brings, let alone perf requirements. It's just never been a target for them.
Is GMC at least learnable in a reasonable amount of time if theres no alternative? Those 700$ hurt but if its the only way i guess i will need to go that route
What i want to add, its not like i need perfect replicated and Client Predicted movement in 2 weeks, but rather in 6-8 months, but currently when thinking about it i just need a plan for the future
From what I've seen you posting you don't even really need what it offers. CMC already replicates and predicts fine unless you need a custom movement mode, which involves C++.
Why isn't CMC good enough? No one can tell you whether GMC is fine if you can't answer that question.
Because as soon as i replicate my own functions and make them Server Authoriative the delay is the problem. A concrete example is this :
This is with a Custom CMC i built with Boilerplate Code, the sprint itself is not the problem, but the functions i call before and after the Sprint Function. They always lead to insane Delay when i simulate Lag.
Sounds like you aren't doing something predictively.
And what do you mean "functions i call before and after"
Here, is a example that is hard to explain
this has nothing to do with CMC
and everything to do with you only performing actions on the server rather than predictively
Will GMC be easier? I have no idea, I've never used it. I've heard good things. But trying to build predictive movement without understanding how to do so is going to result in frustration one way or the other.
How does one perform actions predictively? Thats the problem i struggle with, because my code runs fine UNTIL i introduce lag
Clients need to perform the same action immediately without waiting for the server.
The ideal is to predict as little as possible - the bare minimum necessary for the game to feel responsive. Basic movement falls under the "needs to be predicted" category.
This is without lag emulation, top left is debug
And this is with Simulated Packet Loss (2) and 150 Ping
Your sprint ability is clearly not being predicted.
And this is where i struggle because i went through countless Explainations and Tutorials but nobody was able to explain in a understandable way how prediction for non movement actions work.
But sprint is movement
A client - if it wants to sprint - needs to start doing so immediately and tell the server that it wants to do so.
On its own, the sprint itself is predicted, but as soon as i add code that i run before the sprint event it all breaks so basically all my serverchecks
It clearly isn't though.
In your second video you don't start moving faster until you've received a server correction.
Sure but what does that actually do, you haven't posted it.
I'm aware of what network emulation is. And for what it's worth, packet loss will result in corrections some of the time, there is no way around that with server-authoritative movement. 5% packet loss is bad.
You test with those settings to make sure the entire game doesn't break down under packet loss, not because the game should necessarily still feel good in all circumstances.
Actually im going to use milder settings for my example now that you say.
This is with the above emulation settings, nodes set up as in the first image.
So Wants to Sprint on Pressed True and Wants to Sprint Bool False on, no code behind it
...so what is actually changing the movement speed
setting a boolean does not make your client start sprinting
and what is calling that
Before you continue posting more blueprint graphs, the point I'm making is that you haven't shown how the client is setting its movement speed.
Furthermore in your latest video I'm not sure I see anything wrong.
So... still not how the client is setting its movement speed when sprinting.
Like i said, those are exposed C++ classes its all done in C++ thus not visible, i only can show the exposed BP nodes
Then no one can help you.
If you can't show what the code is doing no one can tell you what's wrong with it.
Thats the problem with Boilerplating hehe...
And again, I'm not sure I see anything wrong with the video you posted. Though I also can't see when you're pressing your sprint key.
The movement correction from the previous video could easily have been attributed to packet loss. Not something you're going to fix, you can't beat packets that simply don't want to go anywhere.
The last video i posted works fine because its with the bp exposed C++ CMC class which was modified. It has compensation and client prediction, and i can access what runs after and before that. If run exclusively without any code in front or behind it its fine, but if i add something else that is just serversided it looks like in the examples high above.
So once again, what is "any code in front or behind"
So i guess my own code is the problem, if i would keep it at just a replicated sprinting mechanic i could do it in BP as you can see above in the video. It will run fine, but if i want to modify the mechanic itself it breaks apart. I mean what i basically tried to do was just add a AutoWalk and Autosprint mechanic to the sprint mechanic
Some form of auto walk/sprint is really just going to be setting your "wants to sprint" option (which I assume is being replicated somehow).
But yes, the problem would be with your own code. Not CMC.
The SetWantstoSprint are delegates of the custom cmc, so they are basically input and output nodes. I call whats inside those functions
If you look in the screenshots above, thats exactly what i did and thats when it broke down
I just cant do it client only because if a client finds a way to hook into autorun it means he also accesses the usually protected sprint function
So im serversiding whats happening before the sprint function triggers
I'm lumping this apparently custom CMC into "your code". I have no idea what it's doing either.
It might be wrong, your blueprint code might be wrong, I don't know. There's not nearly enough detail here to help.
But it makes no sense for this to be server-only. The client only says that they want to run, if they're not allowed to then the server should simply not allow them to.
Yes they won't be allowed to sprint, but they can hook into the function and always trigger it resulting in instant autorun and autosprint functionality
My point is that the client still needs to predict this.
It cannot run only on the server.
Someone can very easily modify their game to set their movement speed to literally anything they want. The reason that doesn't work is because the server simply rejects their movement updates for not being within a reasonable range.
Being able to say "I want to run" longer than they should be able is not an exploit
it is at worst a misprediction on the client which should be corrected by the server.
Honestly im just burnt out at this point ... tried to do too many things at once and now i dont even can't thing right. You got a point
think* ... completely forgot to client side it besides serversiding no wonder ...
Hey.. I am trying to test replicationgraph with the Lyra project since that seems to have the most up to date example of it.. (I know Iris is suppose to be replacing it however there is next to 0 information about it). I just want to enable it and do some testing of some logic i want to add for my project BUT when I try to enable it in the project settings and add ReplicationDriverClassName="/Script/LyraStarterGame.LyraReplicationGraph" in the IpNetDriver section when starting the server I still receive this error:
[2024.04.22-01.46.21:953][123]LogLyraRepGraph: Display: Replication graph is disabled via LyraReplicationGraphSettings
anyone know how to enable it or have done recent testing of it?
I also got an error [2024.04.22-01.13.18:151][ 0]LogUObjectGlobals: Warning: Failed to find object 'Class /Script/LyraStarterGame.LyraReplicationGraph' which I cant figure out why it cant find it or if this is even necessary looking at the code in LyraReplicationGraph
One thing i want to ask before i go to bed. Is there any solution in BP for Vehicle Client prediction? I mean GMC etc. are not intended for this right? I heard SmoothSync can help if i take the cheating out of equation
the built in chaos vehicle plugin?
Has no Client Prediction according to forum posts, its unfinished for multiplayer
nvm figured it out... in config/defaultgame.ini bDisableReplicationGraph=True was overriding the setting in editor while packaging...
good to know, thanks for coming back with the solution
np also fix to this /Script/LyraStarterGame.LyraReplicationGraph - > /Script/LyraGame.LyraReplicationGraph' however i still dont know if thats even needed
lyra gets updated on ue5 main in case it is doing something different
anyone got any advice on on to replicate camera pitch on client side when using controller rotation?
there are like no tutorials online for this that work
you want to send the client's pitch to the server? Using an rpc on an interval could work. You could then multicast to all clients if everyone needs to see it
Greetings everyone!
is there anyway that i can make clients cant see other clients
like when a client enters an area, that client is not visible for other clients until the client leave that area
you could accomplish this a few ways. the most simple way might be to check if other players are inside the area on the tick function, and set the actor visibility based on that test
looks correct to me. maybe log on the client what the look rotation is, confirm at least that all clients are receiving data
screenshot is client
use print string to see if both clients are receiving the data
APawn::GetBaseAimRotation should use remove pitch already
so I would suggest trying calling that to see where the sim proxy is aiming
Yes this sort of works although you must look away then back at the client for the animation to update
That might be related to the Mesh Component UpdateBonesAndTickPose behavior
I'm having trouble with replicated subobjects for an inventory system, and these results are very concerning. Hopefully someone can shed some light here:
- Two actors (A and B) with "ItemContainer" actor components
- ItemContainers are just replicated TArray of pointers to replicated UObjects.
- Adding / removing items to these arrays renames (to change the outer) and appropriately assigns subobject list replication.
- Renames are also sent to the client (to change the outer on the client)
- Moving an item from A -> B works fine, the subobject is networked.
- After some delay I destroy actor A.
- Checking slightly later in B, the array still contains a pointer to the object, but the pointer to the subobject is now invalid. It becomes invalid instantly after A was destroyed by the server.
So I guess that means only the original networked pointer is meaningful on the client? Am I doing something wrong here? This seems to make working with replicated subobjects completely useless if we're expecting them to act independently of their original replicating owner. Seems like a pretty obvious way to implement an inventory system would be to use subobject replication in this way.
where do i look for this setting?
in the skeletal mesh for the character/pawn
Skeletal Mesh Component*
is this a c++ thing?
"server travel" works smoothly in the game engine, but when rendered, it does not work on real computers, the client returns to the lobby again.
how can i solve it
open your bp, go to your skeletal mesh component and change the behavior to what Exi mentioned.
I'm a bit confused on UActorChannels. I have an actor that I've replicated. Replication is perfectly fine. But of course it's not owned. As it's not owned I can't get it's UNetConnection via AActor::GetNetConnection even on the server. How are you supposed to find an actor's channel if it has no owner? O.o
- Rename does not replicate by default, you will need duplicate the uobject with new outer or find another way to change the outer
- When you remove a replicated subobject from the list it's still net referenceable until you mark it as garbage and if you don't remove it from the replicated subobject list before doing that or if it gets GC'd it will crash the game/server.
The issue is the actor channels. Rename doesn't remove the object from the CreateSubObjects array. So when the actor is destroyed, it destroys the object too.
I've just made a significant breakthrough with this!
- Renames were sent to the client manually via RPC (or set on the client locally via tick)
- The key to all of this was a note in RemoveReplicatedSubObject(), suggesting that the 'original pointer on the authority' is somehow special in terms of GC. Anytime I called RemoveReplicatedSubObject the object in question would be marked invalid on the client -- regardless of other system that might hold a valid networked pointer to it.
- The solution appears to be to use TearOffReplicatedSubObjectOnRemotePeers instead of RemoveReplicatedSubObject, however I've only just found this so I'm not sure what other issues may crop up with its use. It has however passed all of my tests and resolved the immediate issue!
Is it set relevant to owner only ?
I'm not understanding the question. It's unowned entirely. No player owns it.
You'll probably have a much easier time with this if you just duplicate the object into the new outer instead of trying to rename it.
what would happen if I set the outer to world even though some actor is replicating it?
It's more the instance of it. Put a break in uhh..
In the item itself. Override PreDestroyFromReplication. And break there. You'll see the issue pretty quickly.
UActorChannel::DestroyActorAndComponents() gets called when the actor is destroyed on the client. The object is still in the channel's CreateSubObjects array and so it's destroyed too.
I would have a question regarding listen server play rates, if i uncheck multithreaded animation, i get normal results (first part of the video), second part i set multithreaded animation to true in the anim bp and the playrate of the client is noticable slower on the listen server. Any idea? https://streamable.com/iyj6dc
just getting back - thanks again for your help! Turned out I was just stupid after checking your examples in detail. I also wired certain functions the wrong way after the input context mapping + had switch has authority somewhere where it didn't belong . 🙂
I am facing a problem where world partition does not load on clients, does anyone have experience with this?
This only happens out of editor.
Question for the networking guru’s.
How would you handle firing an automatic weapon?
Single fire is simple, it’s just one off RPCs (could do OnRep but for shooting id rather it be more responsive).
Automatic is where I struggle to figure out the approach. You have enter and exit states for the loops but how about bullets in between? Lets say client A held down the trigger and shot for like 2 seconds straight and the fire rate was .17 so he would have shot ~12 times in that two seconds, how would I handle clients accurately getting that and playing the VFX and bullet impacts correctly? I could have the client logic for the loop just play the sound and animation for the loop and wait for server RPCs to play the VFX and damage but if I had a faster weapon or slower connection that would result in bullets sounding like they’re speeding up and slowing down..
I really appreciate some ideas and any advice
just replicate 'gun firing' and 'gun stopped' and let the clients visually simulate the guns firing 'constantly' (with the sound effect etc). Meanwhile the servers spawn each bullet and sends that to the clients for the actual projectiles
hey im trying to pass on sound from the "server"(npc in world) to player character
but its null
nevermind
solvedf it
Is it logical to pass the server start time with a multicast RPC to play montage on all clients, so that animation can adjust the start position on each client according to server time in case of some noticable latency?
I’m doing hitscan anyway so any bullets are purely considered VFX. The client assumption way sounds the most appropriate but the cost of that assumption being wrong is big, i heard you shot again or I swear you shot him when really the RPC just hadn’t arrived, the other problem with assumption based is the view direction and accuracy I can represent, it’s just a replication packed thing already done by the pawn so that also will be delayed for updates and not accurately represent where I am shooting
yeah - but now your entering server side rewind terrority etc - i.e. you shot someone around the corner due to lag etc.
There is always a compromise.
If you want to avoid guns differing due to lag, you need start/stop. If you garunteed accuracy and no prediction, then individual.
Depends on if it matters that much, you pay your ping + server processing + clients ping before it starts so if you send the time then you might have a hard cut into the animation if enough time passed
Yeah I guess it is all about compromise, there is no way around the lag compensation for auto weapons reliably shooting at a constant rate.. what did you mean by that last part?
If your gameplay (and animations) allow for the cutoff at the start, then it could be a good solution. You can setup a threshold if you want over which you'd do the cut, so with low enough latency, you'd play the montage normally. All depends on the game you're making and how important timing is.
Just make sure to accurately sync a network time between server/clients, as unreal's built in version tends to be rather inaccurate.
The thing an my second question if it's stupid is, I'm sending the montages as soft object pointers. So on top of network latency, client's PC performance can also effect the start time of the animation. That's why I wanted to add start time, so if there is any delay, other players won't be walking while doing other actions
So, with ball physics in a multiplayer scenario. I probably want to interpolate its position if I'm doing an online multiplayer tennis game, no?
Is there a good set of equations I can use for that?
any advice on why none of my testers can join aka join button?
i can via my own laptop but only (I) have the ablity to make the server pop for the other via refresh button
Help will surely be greatful.
as you can see it working on the editor > vice versa on my laptop
Any advice?
Are you using null subsystem?
No normal
blueprints
just an startup for example
nothing at all
@upbeat basin u mean the defualtService NULL?
DefaultPlatformService, yes
If you haven't set anything it still should be considered as null
Which would only allow player on the same network with you to find your session
Are they trying to connect you over internet?
i am the only allow person to make the other via refresh button to shown
make the server pop on their end
Yes
and i can show u logs of my config?
because i am using other setting as well
If this is to them trying to connect you over internet, rather than being on the same network with you, then that's the limitation of null subsystem. You might need to try another subsystem
@upbeat basin Ah okay
ty (:
but its me rather setting them up to connect on my ip ?
@upbeat basin
I need to start the switch up
per say
question on starting multiplayer in bp, do i start with trying to spawn in the correct amount of characters and then designating them to contollers or aicontrollers?
This is done for you automatically. When a player joins the game, a controller is assigned to them based on your default player controller class defined in your Game Mode. If you have a default pawn class the game mode will also try to spawn a pawn for them of that class and possess it for them.
ok
First attempt on anything multi so im a bit lost
the plan is to have an 8 player smash style brawler
just to clarify again; this will work regardless of weather let say france and me in the usa? @upbeat basin
(but with 200 pings)
you
ex:
I could join rn a server in fortnite in France but I'd lag a LOT (I'm in America...)
but that fortnite not ue4
lol ok my bad
where u hook the ping up?
like for example find session node?
because i am having problem if the ping need to be set 200 to be able to work @twin juniper
what?
you can't set your ping
with the ping in ms function u can right?
sorry if to confused you but i am talking about online functionality for my game
@twin juniper
yup
so u think hooking ping ms function to max result will work?
I have no idea what max result you are talking about, but print it if you wanna know
oh okay
will do ty for the idea
so i have my join as a custom node but not replicated so ive set to muticast thinking it'll allow users to join
I am running into the issue of running Sandboxie not being able to run my shipping build (and a separate Steam account) without a 'fatal error' popping up. It will run without steam started on the sandbox, but with steam running first I get this error. Steam is properly loaded in the sandbox, so I can't see any other error. And when I run that account on a separate laptop it works. I know it is a shot in the dark, but if anyone has any ideas or another place to ask I would appreciate it.
damn why am i struggling so hard with understanding multiplayer shit
Because it's hard to wrap your head around something existing in two (or more!) places at once that can have the same value or different values depending on who is changing the value.
This has been really bugging me. why doesn't the Clint get the third person controller in the second situation but not in the first.
Are you overriding anything in your game mode?
that's all i have in my gamemode
So no overriden functions in the game mode event graph?
Just the adjustments to the classes?
correct
What happens if you move the first player out of the way first before having the second player join?
same thing
I have an issue I don't understand. On my player Actor BP I have in the event graph an input handler that displays the player inventory. it works fine both on a listen server and for player in a remote client. It is the first image below.
The second image is a function on the same Actor BP. It gets called when I activate a container to access it's inventory. If I use a remote client player, at that point I get an error saying the player controller is not a local player controller, even though I am getting the player controller in the exact same way as the regular inventory display.
What is the difference here? How do I get the local player controller?
I have my net mode set to Listen Server. idk if that matters here or not.
Did you add some playerstarts to your level?
That sounds like you're attempting to add a widget for a client on the server.
I know. But I don't know how to ensure that the input is handled locally. What I suspect is that the first input handler, being tied directly to an input event, is automatically running locally, but the second one, being called from another actor, is not
This is how it is being called. This is on the container BP
So it's getting the instigating pawn from the interact event
Which, as I now remember, only runs on the server. Ooof
So I am, in fact, calling this on the wrong object.
I guess I need to turn my function into a client RPC
Does that sound right?
Nope.
You probably want a replicated property (rep with notify!) to the container you're wanting to interact with in the player that is interacting with it.
The OnRep can check if the value is valid and that you're running on the owning client, and if so, display the widget. If it's not valid, then attempt to remove the widget.
Basically the property then becomes a toggle switch if its valid, show the inventory, if it's not, collapse it/remove it/whatever you wanna do with the widget.
I'm not quite following you. The inventory is already replicated
You want a property in the player inventory component that will contain a reference to the "Container Inventory"
That doesn't really make sense to me. Why would an inventory component need a property to point to another inventory?
There is 1 play start
So it can act as a toggle switch to hide and show the "Container Inventory" they are interacting with.
If it's null: No show / hide container inventory widget.
If it has a value: Show the container inventory widget, and you'll have a reference to the container.
This then also allows your server to control it easier too - when say, they walk away from the inventory, the server can know this and then remove that reference.
Also acts as an anti-cheat method - unless your player inventory has a reference to a specific container set there, they can't just move anything from any inventory into theirs unless the server is aware of the container they are currently interacting with.
If I change the net mode to "stand alone" the problem doesn't happen anymore.
Seems to only happen if the net mode is set to Listen Server
I had a feeling about that, I just wasn't sure. One would assume that if you're moving sessions, it shouldn't really affect anything, but.... Maybe it's because of how the engine can run all PIE windows in a single instance or something.
Honestly this is a weird setup. This would mean only one person could look in an inventory at a time (which might be something a game wants, but it's weird to encode that limitation as a hard restriction via property like this).
A client managing itself would be more standard practice - the server shouldn't know nor care when the client closes the inventory unless it needs to fire off events as a result of it (which it might, but that often requires state on the player themselves rather than the container).
It's not really that useful as an anti-cheat unless you specifically need to avoid players being able to see into chests they're already nearby and already meet the criteria for interaction with. Unless there are super specific circumstances that require you can only ever see into this one specific chest it's an odd design.
Does anyone have any insight to why my aim offset does not update on the client until they move?
Closing the inventory when the client gets too far away doesn't need to be checked by the server either - it's a waste of an RPC or replication. If the client already has the data of what's in the inventory then there's no anti-cheat benefit to forcing the inventory closed from the server.
So unless you need the super specific requirement of being able to only see into very specific chests at any time, the server shouldn't really care about which chest a client is looking at. Once a client needs to actually interact with something inside the chest, sure, but simply reading inventory is safe for most and can be entirely client-driven once the client knows they want to look at the thing.
Basically: If the data already exists on the client for what's in the chest, there's no benefit to the action of looking at the chest being server-driven. There's no potential for anti-cheat to do anything unless further authoritative events need to be fired off from the simple act of opening it.
You probably need to tell the server "I want to look at this" for cosmetic reasons (animations for other players and all that), but if the client already has all the data it needs to look at the chest it's a bit weird to wait on a round-trip to find out.
It sounds like you are saying that I don't need to make interactions be automatically run on the server, but only make server calls from a local interaction handler if the interaction does require some sort of authority, such as when transfering an item from the container to the player
It depends on what the interaction is.
Well initially it's just showing the contents of the container
Often the generic idea of an "interaction" has both a client and server component, or starts out as client-only but requires something on the server later.
Right. If you already know what the contents of the container are on the client and don't need to trigger further authoritative events (aside from purely cosmetic stuff) there's little reason to wait on the server.
OK. That makes sense. Should be a quick fix, too
Huh. Datura wrote a book, but didn't publish it. 😄
this is with camera using control rotation btw
General question here to. Is it unreasonable that Your game preform good at 100+ ping and 5% pkt loss?
like at that point visible lag and desynch is unavoible, the goal should be just not having the game break?
100 ping is fine, but I'd think 5% continual packet loss is horrible.
5% packet loss would be unplayable
For a while I was suffering with a fairly continual 4% packet loss on cable highspeed and some games would just straight up boot me out. (They couldn't figure out the problem so I had to switch to a different provider).
You should test your systems/mechanics against a small amount of packet loss to ensure they can recover to an acceptable state after regaining a good connection.
But beyond that, if the Client has continual packet loss, its not really going to be your problem.
Ping is another one of those things that depends on the type of game to some degree as well
If you are creating a Coop PVE experience for example, its less of a concern with higher numbers than it would be if you were doing a PVP Arena Shooter.
Yes im making a coop pve game, what would you recommend the highest ping at witch point i not worry?
Whatever you can manage without it degrading the experience to the point where a reasonable person would start to negatively feel those effects.
Thats not really a question anyone can definitively answer for you.
It depends on your game, your expertise, how well you can optimize and account for latency in your implementations...
Etc etc
mhm, my thought process is im gonna im gonna cap what lobbies you see in the browser based on ping
5% packet loss is a great value to make sure the game doesn't break down entirely, but it's a bad value to expect a good experience from.
Large amounts of packet loss can be useful to use as a way to reveal unforseen problems with systems you've built. Not so much for making sure the game is fun.
Taking away choice from Players can have a negative impact as well. Perhaps making it a Filter option instead.
Defaulting to a reasonable value.
But also allowing for open ended searches.
Someone in your game might be ok with 300 ping if they get to play their favorite mode that no one in their region is playing, but others are.
yeah thats a much better idea
Someone in your game might only be playing at times where they are at the peak of traffic in a different region and not their own (night shift workers?) and so cant find matches in their own region.
There is always some factor to consider when taking away choice from the Player.
Sorry to bug, but on a curious note about this. Is there anything else you can really do to help with this? EG we have a case where I'm pretty sure there's a problem with a specific actor sometimes not replicating due to connection issues and I can't repro it personally without using the editor and like 50% packet loss while spamming PIE over and over until it happens in a 1/30 chance. But there are some players that seem to end up in this state consistently. So I'm curious if there are any persistence settings to actor replication or anything that might help with this.
I can't think of anything off the top of my head, no
a lot is just trial and error unfortunately
especially with packet loss, you don't know exactly what is getting dropped (since it's random) to trigger issues, you can only hope it's easy enough to repro :/
an actor outright not replicating sounds like something very wrong though - you shouldn't be able to drop packets to prevent that without disconnecting entirely.
like, you'd have to consistently drop the packets required for that actor's creation every time they get sent to you (which is going to be constant as long as you're connected, it is relevant, and you haven't ack'd it). Doing that is near impossible unless you've outright disconnected.
only way I can think of that happening is if somehow the initial bunch is just massive
Odd. Cause I can semi consistently repro it with enough persistence. :/ Like I said though it takes some insaaaaanely bad settings. Client just hangs there with the actor missing. I thought it was a debugging issue at first but even a constant print of the count of them in the world never shows more than zero. There's only one of them at a time normally in this case.
Initial bunch could maybe be the case. It is a data actor. Houses a bunch of stuff for level generation.
I mean as you yourself said you need some insane packet loss - to the point that the game should pretty much just disconnect.
The only way something should be that consistent is if there's some reason that actor specifically keeps getting dropped. The only thing that'd make me think that is the initial bunch is so big that every send seems to drop something.
Oof. Why would that differ though? Shouldn't that be more consistent even on a good connection? Isn't that the same as the RPC limit kind of thing?
even then, without some crazy packet loss that seems unlikely - you should eventually get whichever packets were dropped even if it takes a bit
I mean it could be a low level networking issue - you're sending packets that are too large and some connections are tending to drop those larger packets. I wouldn't expect that unless you've messed with relevant network settings in the engine though.
It'd explain why it affects specific people consistently even if they have a good connection.
Or it could be something higher level - incorrect relevancy settings, for example.
Can you prove that the actor is even trying to replicate to those people? Can you prove that nothing is being received by them?
Unfortunately this isn't my implementation so I'm not 100% on the specifics of what's been done to it. But it breaks UI, so garbageman UI programmer gets to fix the networking code. 🙂
yeah can't help much there, then :/
Where can I check if it's even trying to replicate? Not aware of much other than it spawning.
Out of curiosity, is it a net startup actor? i.e. is it netloadonclient=true ?
OK! My inventory transfer is now working properly with just one minor glitch: When I transfer an object from a remote player to a contain, or vice versa, the inventory replication is happening after I update the screen by redrawing the inventory contents. I think I can solve that by having the UI widget subscribe to the inventory to get update notifications so that's my next thing to do
I want to say no. But let me double check. Need to open the project. 😄
If it is, then that would explain something
These are the only thing in C++. Waiting on editor to double check the BP class
bAlwaysRelevant = true;```
Huh. It is. I wonder why. 🤔
Fuck me, now I have to go double check instantiation code. But I'm 99% sure that's unncessary.
Oh and Thank You to @hollow eagle and @sinful tree for the assistance!
I can tell you what happens generally with them. In situations where network conditions are bad, the level the said actor is associated with can sometimes normally gets unloaded on the server but takes time to unload on client, meanwhile a destruction packet gets sent to the client telling them this actor was destroyed instead of just removed from world (since the level is still visible on client)
If you want to double check if this is the issue watch a certain property in the engine called
DestroyedNetStartupActors
Or something similar, maybe it's in World or some other place. If your actor exists there then it's it
The easy fix is to make it netloadonclient = false
The hardcore fix is to ensure client doesn't destroy the actorchannel in such situations
The better fix is to use Iris if you can since they fixed it there
I'll probably see if I can make it not a netload on client. I don't think there's a reason for it. But I have a ton of code to double check on that.
Hey, I need some help.
I'm planning to make a game where players have completely different roles, for example one player playing in an RTS style while the other one is playing in an FPS style.
I want to give the players different controllers based on the role they selected on the lobby screen but I can't find any tutorials on it, all I can find is people saying that I ought to use 1 controller for all but that seems really dirty in this case because the controllers would contain actions that have nothing to do with their selected role
the unrealy thing would be to have the differences expressed in components added after the fact to the controller
or the pawn I suppose
I'll try that, thank you 
Hey, when the host leaves a session, what's the proper way to destroy the session on the clients as well?
I read that most people just call DestroySession in the BeginPlay of their default map,
but I was just wondering if there's a better/proper way to do this, like overriding a function somewhere that notifies clients that we got disconnected and travelling back to the default map.
i am pretty sure the OnNetworkFailure event fires when a client is disconnected from a server
GEngine->OnNetworkFailure().AddUObject
Thanks!
hey i have a question
if i joina a game and send infromation to the server from the client
and another player joins the server
can he get my name from the server (is it stored for him aswell even tho he wasent there when i sent the info to the server ) ?
or will it need to be updated each time someone joins ?
you would use the PlayerState class for that since they are replicated to all clients (thats also where replicated player names are handled)
Hello there,
how could I manage this?:
- have an PawnAiController on the client
- replicate client movement to the server
I need this setup because I want to use predicted GAS abilities in my rts
@tardy fossil yeah thats what im doing but im only getting my local name
so in the player state at start
im setting the name and transfering to server
then when im killing something (this is for announcer)
im getting that name from the player state
hmmm
get player controller 0 !
😮
ok it could have been that
can I spawn a level instance exclusively for the client only
Isnt that just spawning it as a client ?
id guess so but for some reason im having trouble with it lol
think i got it, probably had to do with the overall structure of my code being convoluted in regards to player controllers and pawns
So, I'm a bit new to making online multiplayer games. What's the benefit of using interpolation in physics when dealing with online two player games?
Assuming I have a physics object like a tennis ball bouncing back and forth
If you're connected at a common 30-40 ms to a decent server, that's an FPS of about 25-33. This is assuming that this object gets replicated every single frame without fails and that the server stays in perfect sync and stuff goes perfectly. Which we all know doesn't happen. Realistically you end up with a jittery object.
That said interpolation isn't quite as good as local simulation between updates. Interpolation means it's always behind. Local sim means it might be relatively close to real, if you can keep it's velocities, location and rotation somewhat in sync.
And even then. It's networking physics. It's gonna have issues.
@mental star
Authaer has a good point. Constantly interpolating the server position will jitter with packet loss. Showing the ball travelling locally is more stable visually.
It's a complex topic, and there's probably a few valid solutions.
Physics and cheating/security aside, I thought about something like showing the ball's position locally, allowing the player to react naturally when receiving the ball and timing their swing.
The server would also have a version of the real state of the game, and even if the ball arrived at a time of the swing that's visually invalid, the server would receive the position+time of the swing and position+time of the ball of the client and test it against its own simulation.
Since this might take some time, you don't have to send the ball back immediately. You could slow down the hit impact allowing the ball to be "absorbed" for a moment, and send the ball back at a consistent delay depending on the player's latencies. Validating the state of the ball at the "end points".
Instead of using physics you could use the particle movement component, which I believe is more deterministic, calculating angles and velocity manually.
As for security, there's a lot to address, but you can verify the client's positions+times against the server with an error margin, and verify each client-predicted swing.
So, the complicated thing about this is, its a tennis game; Meaning there's going to be some potential semblance of hardcoded gravity / a ball bounce factor.
As well as potentially some projectile motion stuff acting on the ball with forces being applied via the impact on the racket etc.
That said. I don't want this to become Too complicated since I know online multiplayer physics be hard AF
IMO I'm seriously inclined to tell you to just use the projectile movement component. Physics isn't good for this kind of thing. You need some certainty and the PMC will provide a lot more for you than messing with physics.
Agreed. And most of the stuff you mentioned is already in the projectile movement component.
Right on
Just so you have more people telling you this: DON'T use actual Physics, fake it with VectorMath in your own MovementComp or use ProjectMoveComp for example. That is already enough work and you at least have more control over everything.
I have a marketplace asset which generates a maze using rand numbers w/o a seed function. It works by being placed in a level which it constructs a unique maze based on the parameters given in the BP. It wasn't written with multiplayer in mind, but my goal is it use it in an arcade style game with 2-8ish players. I have set the BP Replication options as: Always Relevant: On, Replicates: On. The rest are off. When I try to play this level directly in PIE as a listen server it works as intended. Two characters see the same maze and can run it just fine. But the problem is when I play it via another Menu asset (also in PIE) it behaves as if each Player is seeing their own instance of the maze, yet the 2nd player can run thru the 1st player's maze so I know it is aware of it, but it only sees the maze instance generated for itself. So I believe there is one true maze in the level. The Menu asset is doing GetOwningPlayer->Join Session so nothing very special, I think. Can anyone point me in the direction to keep looking?
Why are actions in the controller at all? Put them in the pawn
RTS guy has YourController and possesses RTS Pawn
FPS guys have YourController and possess FPS Pawn
Here's some interesting documentation about Networked Physics in UE 5.4 :
https://dev.epicgames.com/documentation/en-us/unreal-engine/networked-physics-overview
I mean, how stable has iris been?
Iris is reasonably stable on 5.3 if you are willing to backport a few (safely mergeable) changes.
It's absolutely shit to debug if anything goes wrong though.
Wondering how that's been improved in 5.4
Notes say that iris did get debugging improvements
but not what exactly, so changelist diving it is...
So the way unreal works is that the server always is the boss, so whats happening is that you have a client that is respecting what the server is saying even tho what is being draw on the screen is a diferent maze
you are probably gonna need those maze random numbers to always be in sync if you want all the players to see the same thing
if its a plugin in which you dont have control you might just be out of luck, multiplayer is a complex beast and its gonna be hard for any 1 to have a proper game with just bought assets, at least from the code perspective
Its a single Blueprint. So I can read and change it completely once I know what I need to change about it.
What's undesired is that it appears to run uniquely for each player.
heres what i would do, i would generate whatever needs to be generated in the game mode class and then pass that on to that BP
u just need to make sure the random generated numbers are the same everywhere
I could move the logic into the gamemode? or perhaps... its creating this asset in 3-4 phases. Perhaps I could split out the one(s) where it needs to generate the rand #s into the gamemode, as you say, and then point it to the original blueprint i nthe level to construct it?
game mode only exists in the server, so if u move things there, your clients probably wont see the map
generate the numbers in the game mode and then send those values with an RPC to your clients
Gamestate? Or Session something?
?
I'm wondering if there's an easier way still is all
i wouldnt know, i would have to take a look at your project
just mess a bit with it, its probably not that hard
generating a number and sending it through an RPC is hardly a dificult task
well I was able to get them to line up 100% only when I opened the level directly.
So I believe I did something correctly in tweaking the blueprint there, but why that change isn't working for my menu system idk
i would guess that if u open 2 clients at the same time in the map, then the number generator is just gonna generate the same number on both instances because its based on time
so if u open through a menu, some time would have passed and the number generated wont be the same, but thats just a wild guess
hmm, thats a pretty good guess though
we're taking a difference of seconds while I'm in PIE, but the rand is coming from somewhere
how do i make sure i load a sublevel for the relevant player only as well as the server? if i load it on the server the sublevel seems to get loaded for all clients
welp google told me its default behavior to replicate loaded sublevels
btw - for any of the devs who have access to UDN, can y'all get on there and talk about this PR? https://github.com/EpicGames/UnrealEngine/pull/11578
Quick question, I have this lobby system where players are set up on a platform.
But after Open Level node, the set actors disappears, how would I resetup the platform?
( the joining session does work )
but the PR in its description says it's a result of a UDN conversation
Yeah, I'm saying to get on and upvote it in UDN or keep talking about it on there.
though I wonder if this could've been implemented as something like UFUNCTION(NetMulticast, SkipAutonomous) or something
lol Salesforce is the worst goddamn platform. I logged into my work Epic account and it's just constantly redirecting me
Is there AdvancedSession plugin available for UE5.4 yet?
I am about to start production on a 4 tablet local wifi game for work. I am unsure if I need a Host tablet or not. Main reason I blieve I need it is to handle disconnect/reconnection ie resuming where a player may have accidently crashed at, so they can rejoin the game from where they left off. Is there an alternative approach that would make sense?
Unreal's networking system utilizes Client-Server architecture, meaning you need something to be the host, whether it be one of the tablets (that is playing the game too) or another computer that is hosting the game (but not necessarily playing it).
eh I guess if I rely on a players tablet and they crash thatll be it
Thanks. I was trying to abandon the additional tablet/host but I think ill stick with it for reliability
Your alternative would be to not use Unreal's networking system and develop your own P2P network communication system, or utilize some cloud BaaS system that can keep state for you.
interesting idea. We are on a budget though so i'm not sure how thatd fly. We can justify the 50+ tablets but the server hosting might be hard to convince management
i will look into this though. Probably isnt too much for a basic cloud service
TY
While I have you here. If you're still around
Our original idea was to have the 4 players take simultanous turns (2 minute intervals) that would then sync with the server and push out the updates to all the other tablets.
Or have the gameplay real-time to avoid all of those placeholders and updating every 2 mins
Seems like the original idea my team has would be more work than the real-time alternative
Host dedicated server?
Adding in a respawn system into a multiplayer game that requires client-server replication. In the code for adding players back into the game, I opted on using SetViewTargetBlend on a temp actor as a basic animation for players spawning in. The blend works fine on server, but the client doesn't see it. I assume that my replication logic is wrong somewhere, but nothing sticks out to me.
In my player controller (Server-side)
void AMyPlayerController::ServerInitiateSpawningSequence_Implementation()
{
// Check if we have a valid game mode and world
AGameModeBase* GameMode = UGameplayStatics::GetGameMode(GetWorld());
if (auto* MyGameMode = Cast<AMyGameModeBase>(GameMode))
{
MyGameMode->SpawnPlayerAtTransform(this, SpawnTransform);
}
}
In my game mode (Server-side)
void AMyGameModeBase::SpawnPlayerAtTransform(AMyPlayerController* PlayerController, FTransform SpawnTransform)
{
FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
SpawnParams.ObjectFlags |= RF_Transient;
FTimerHandle SpawnPlayerTimerHandle;
// Spawn a temp actor to take place until player is ready to fully spawn
AActor* TempActor = GetWorld()->SpawnActor(PlayerController->SpawnActorClass, &SpawnTransform, SpawnParams);
if (TempActor)
{
// Remove Spectator UI from player
PlayerController->ClearClientWidgets();
// Set view blend for spawning actor, attempting to call on client, but client doesn't see the blend.
// Server is fine here
PlayerController->SetViewTargetWithBlend(TempActor, GetPlayerRespawnDuration());
}
}
At a glance, it would seem like a better solution to have the TempActor be an Actor that is specifically designed to handle this sequence.
It should be Replicated.
Then on BeginPlay that Actor would manage the view transition on the Client, instead of the GameMode.
The Server shouldnt be handling cosmetic stuff like this for Clients.
Yeah that might work better than what I am doing here
The tempactor will probably have more cosmetic changes later on, so better to put that logic elsewhere. Thanks!
anyone got a good tutorial or advice on how to create projectiles in multiplayer with backwards tracing
What do you mean backwards tracing?
like tracing the hitscan backwards?
When asking for help. Its ideal to outline your problem in detail, so people who want to help have as much information as possible to understand what type of a solution you are looking to achieve.
"Tracing the hitscan backwards" is not much to go on.
There are plenty of resources on how to orient Vectors to achieve a particular direction of a line trace.
Try elaborating specifically on what you want to achieve.
As that question stands, there isnt much to go on.
Im trying to find the best solution to avoid delay from packet lag from when the client tells the server to spawn a projectile.
Im aware it may be best to abandon the idea of spawn a projectile altogether for a hitscan
You cant avoid latency, the best you can do is mask it with Client side Prediction and Rollback.
Projectiles and Hitscans are entirely different things
Typically there will be an "Acceptance Radius"
Which is a predefined distance where the AI would be "close enough" to consider it to have reached its MoveTo goal.
This is so that it can avoid instances where it can never fully reach the exact position the goal is located at.
That causes basically a buffer zone around the goal, where if the goal moves within that buffer zone, the AI would not consider it to have moved at all.
Then its highly likely that its contributing to the results you are seeing.
Continuous Goal Tracking just means that when the goal location is updated, the MoveTo will update, assuming its moved more than the Acceptance Radius away.
No, I just outlined what the problem is above.
Lower the Acceptance Radius.
If its to high, it will think its already reached its goal, when it probably hasnt in your mind.
AI only runs on the Server, Clients dont do any of the calculations locally.
I see now.
Need help with some multiplayer character issues. I have a host and client in a server, with a custom character which switches based off a string variable "State". Different movesets are enabled depending on the current State, like vaulting over or climbing on top of objects/walls. This works totally fine for the server host, but clients connected via Join Session aren't able to use some states without the variable resetting to its default value, "Base.Idle".
I've tested this with crouching by using print strings - When I press/hold crouch while idle, the event in image 1 on the right works fine and sets the state to Crouch. Once in crouch state, Event Tick runs execs everything in image 2. But the very next tick after in image 3, the state returns to Base.Idle. Weirdly enough, the client character still crouches ingame, but it seems to reset the state every tick.
It DOESN'T reset when I jump - Same thing as before, press jump and trigger the event in image 1 on the left, the character jumps and the state is set to Jump.Normal. When my Z movement goes negative, it switches to Air.Normal until I hit the ground again. This seems to work perfectly, despite it not recognizing any other buttons that should be changing the Jump type. For Idle/Moving, Jump and Air, the states work fine. Why would it reset for Crouch or any other state?
Why are you using so many strings for states? Do you intend to mutate the string or are you just unfamiliar with something like gameplay tags or enums?
I tried using enums at first, but it's a state and substate, which I couldn't really bother creating something for
It was initially a Unity project where I had a list of enums in a single class, but I didn't know how to replicate that in Blueprints when I switched to Unreal, so I just went with a string
although i, could've made a static blueprint, with all the enums as variables
hm.
Use gameplay tags. Anytime I see extensive string use like this, my first though is ex unity user. There are pleanty of great blogs on them.
They read like strings but are compared as simple ints behind the scenes, very fast and small.
lmao
Well at least I'm not the only one who's done this then
hierarchical labels WHERE WAS THIS WHEN I WAS SEARCHING FOR THIS EXACT THING FOR A WEEK
tysm
If you must use arbitrary strings for stuff like this, at least use FName
Yeah. There is one single case where you should ever consider using a string type property in Unreal. That case is if you need to actually do string operations. Like compressing arguments into a string or filtering characters etc.
hey question
this is withing a Widget" im trying to get the owner of Flag1 and get that players player state
is it possible to do in a wb ?
a client only have a reference to it's own controller.
withing ?
Playerstates are replicated to all clients though. They're accessible from the gamestate.
Yeah, I am only scartching the surface of multiplayer but isn't get owner return controller?
the get owner return player character*
and that works
im just trying to get the player character player state
I guess that will work then
but im not getting it to work 😛
can you get the player state thru the character?
Pawns have a GetPlayerState function, no need for the controller.
/** If Pawn is possessed by a player, returns its Player State. Needed for network play as controllers are not replicated to clients. */
APlayerState* GetPlayerState() const { return PlayerState; }
then check what owner is. A print string will do.
casting is just a type check
Then the cast doesn't fail?
show the print string
then print string from the cast failed
k
oh wait it not failing
you know what...
im dumb again
yeah..
so everything is working... im trying to sprint the player name string from playerstate.. but the string is empty
print*
so yeah it works*
ok so next issue
the cast to player controller fail,
how would i check if the actor is the same owner as the widget owner *
Bruv
you just checked the value of Flag1Millitary camp owner
remind me what it is again.
I'm toxic 🫢
read the image you posted. Where you print string previously.
does ALL network data go through UIpNetDriver::LowLevelSend? like even session packets? as in finding sessions and joining
I'm at work and UDN isn't redirecting me in a constant loop. The latest reply on this ticket is saying the PR was added to their internal tracker and that they couldn't provide an estimate on when it would be reviewed
One question about gameplay tags, or well, containers, is that I can't wire a container variable from a macro input into anything, e.g. a Matches Any Tags node. It all requires a "by ref" variable, and even though it accepts the macro variable, it isn't a "by ref" variable and gets angry at me. How do I get around this?
Well, I found a way to get around it by just remaking it into a literal, but the container doesn't have any of the tags present.
I have no idea about the BP graph side of it, I mostly work in c++. Theyre incredibly cheap to copy though, the size of 2 ints
oh damn
that's definitely better than using a string lmao
Well remaking it into a literal decided to work now
Yeah theyre really powerful, its just a container for FNames and FNames are hashed strings which hash with an int key so only one instance of that string exists in the whole project and when you compare or use it, its basically just using the int hashed value.
one last (probably) question, is there any way I can swap the parent of a gameplay tag? Like, for example, I have State1.Tag1, State1.Tag2, State2.Tag1, State2.Tag2, something like that. If the current state is State1.TagX, can I dynamically set it to State2.TagX without directly referencing it?
That's what I was doing with the string state before a couple times and I'd rather keep that system if it's feasible
You would just assign the gameplay tag to the new one, it would change the int hashed ID behind the scenes, you arent really dynamically changing gameplay tags at runtime, they should all be created by editor time so you can replicate them correctly and client A has the same hashed ID as client B, unreal handles that behind the scenes.
When you set a gameplay tag to a new value it will just change which tag it maps to in the global container
The parents should be pre defined with their children
Tags are meant to be static essentially. Think of them like hierarchical enums.
Also, tags work best when you use them compositionally. Deep hierarchies of tags or tags that exist in multiple hierarchies indicate a poor usage generally.
That's the problem ironically enough. With Unity C#, I was able to create a class with multiple enums and store any of them in a single Enum variable, and if it was currently State1.Tag1, I could just cast it to State2.Tag1
still, just outright setting them is probably more efficient
Well you could technically do that here too, but you wouldn't have any safety.
Not sure how that would work safely even in the original case though
I'm working on integrating the PlayFabGSDK with my project. However, it gives me an error [Pic1] on the line [Pic2].
This is the official GSDK file [Pic3] btw so it seems there's an issue there. Does anyone know how to solve it?
could always show your use case
Your strings before were for movement stuff right
Is it correctly added as a plugin to your project?
Yeah, it dictates what position the player is in and what moves they can perform from there
Yeah show me an example of your question before though of State1.Tag1 or State2.Tag1 where you wanted to change the parent
Jump.Normal to Air.Normal, or Jump.Arms to Air.Arms, etc. Initially a string where I replaced "Jump." with "Air.", I've just made it a switch on Gameplay Tag that sets it manually in the collapsed node Switch Jump To Air
The good news is that each sub tag is hashed independently so you don’t incur an extra cost but you could always try flip what you have, like Movement.Normal.Jump or Movement.Normal.Air etc, try find the common one and work that way, but there is no real issue the other way it just means more typing initially to set it up in the editor tags section but like I said, they’re hashed independently so no extra cost, in fact if you had Foo_1 and Foo_2 they also share Foo by itself and the int would be its own value so you pay one Foo
Huh, alright then
What I've got works and it sounds like I've made it much cheaper just by not trying to cast stuff, so I think I'll leave it as is
tysm 
"session packets" are handled by the online subsystem so no
To be honest if you care about performance tags aren't really something you want to use for a "hot path". If you have predefined list of states, can't really beat regular enums.
That said, any benefit you get is going to be trumped by the Blueprint VM anyway, so likely not worth it
Tell that to epic with lyra 😂 they have it for movement states too
hey guys, I used to use a static mesh for the arrow mesh, but I made it a skeletal mesh, because I added some bend options to it. Problem is that it is flickering like that only when facing those two directions, everywhere is fine (it's not Z fighting). I have no clue at the moment what's causing it, I know it's not the material, since I tried a bunch. Anyone else had an issue with Skeletal meshes like this before?
when i open up my server with the -log paramater, the console opens, doesnt show anything, then closes after a few seconds
hey in my minimap i use a sprite as player indicator, how can i make it so only player sees his own indicator not other players
like this i dont want you to be able to so the enemies
yep it is
I got it to work by changing the line to this:
now there seems to be a different issue. i don't think they're related to each other.
Answering my own question if anyone needs it. Creating the sandbox in the least restrictive (instead of medium) default configuration solves the problem.
when the compiler gets to line 518 here [Image1] it throws an exception [Image2]
if anyone could help it would be great
this plugin is not very well maintained i guess
yeah any context with that
well im working on integrating the PlayFabGSDK from their GitHub to my project.
it requires you to paste files into the Plugins folder and follow these steps in your GameInstance blueprint
As soon as i connect the last node (in the image) it gives this error
well you don't have to do it in BP, but you didn't show enough context with your screenshot
like, what's the callstack
i think i do cuz the image i attached in the last message is from their documentation
and here's the callstack
yeah this is impossible without digging through the callstack
looking at the value of this, and other pointers
Why does adding a Blueprint Component to a replicated actor must go on the Construction Script instead of the Event Graph?
So I updated to 5.4. Previously 5.3.2 did not give an error.
The error is:
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: Component->GetArchetype() == Component->GetClass()->GetDefaultObject() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\ActorReplication.cpp] [Line: 650]
LogOutputDevice: Error: Replicated component BP_Barrel_C_0::NODE_AddBPC_Combat-3 was added dynamically outside the construction script. This is not well supported and the component on the client will be initialized using the wrong archetype.
Moving the Add BPC from the Event Graph to the Construction Script does not give the error anymore.
But why is this?
This might be more about the Component itself being replicated or?
I'm also not sure if you actually would want to limit this to the Server. I can't recall UE having code to create the Component on the Client through replication.
Back when I added runtime replicated components I had to add them on both sides and ensure they are networkable
I only ever create runtime replicated components server-side :/
It's definitely supported, Ive no idea why that would throw an error
I don't think there's anything unique about the BPC I created though
I create the components on the Server then replicate it over to the Client
It's kind of weird and I think I get some issues with the Client not finding the Server's thing... if I create it on the Client too
The error is triggered under these conditions:
if (Component->CreationMethod == EComponentCreationMethod::UserConstructionScript && !Component->IsNameStableForNetworking())
Willing to bet it's that crappy AddComponent node that Blueprint has doing that
Hm, it definitely works just fine without any errors in 5.3.2
But actually, testing it now in 5.4.0, it shows the error, but everything still works fine
Yeah it's always worked without any issue, no idea why they decided to throw it now
You can do it in CPP no problem anyway
but ye adding runtime replicated components server-side only is 100% supported, half my stuff would fall apart if it wasn't
Hmm.. would Add BPC be better off in Construction Script anyways? Does it make more sense?
no idea tbh
I'm so confused about this now-a-days.
I know we had to create the ASC lazy loaded locally too on The Ascent
Did something change between 4.27 and now that made that redundant?
what's worse in my case is that when I add on it on server in construction script now in 5.4 like I always did, it just doesn't replicate to client
Maybe it's just ASC stuff IDK, but I've been creating replicated actor components for years now
It just follows standard subobject replication procedure
can local variables not be pass through to a server, my 'SaveGame' is valid on client but when the function is called it isn't valid
spawn it where?
on what machine
authority and ownership are separate things
If spawned on client then yes it should have authority locally
nobody else knows about it
How would a client get the rotation of a simulated proxy's controller?
Trying to replicate an effect in the direction they are aimed, but the simulated proxy's controller is not properly rotated
Nvmd, Get Base Aim Rotation works nicely
Might have been shitty information. It's not like this stuff is/was properly explained back in 4.26-7
Actually, I see this now as well.
I play in editor with two clients:
If I Add BPC in Event Graph: the component is valid for both server and client (both true)
If I Add BPC in Construction Script: server is valid but client is invalid (server = true, client=false)
This is weird but here's what I think is the proper way of adding BPC to actors with replication...
If you're going to Add BPC in Event Graph, you only add it to the Server, then let it replicate it over to the Client. If you don't, then Client will have its own copy (different from the Server's) and that will mess things up
If you're going to Add BPC in Construction Script, then you add it without a Server check (meaning adding it to both Server and Client). Then I guess UE will know this and properly create it on the Server and replicate it to the Client, as it should be.
And since there's an error message saying you should only add BPC for replicated actors in the Construction Script, then looks like the proper way is to Add BPC in the Construction Script, and remove the IsServer check
As a matter of fact, I noticed something...
When I print the name of the BPC, I see this:
Left one is using Construction Script, adding the BPC without IsServer (meaning adding it to both server and client)
Right one is in Event Graph, adding the BPC only on Server
Since they have the same name (when using the Construction Script method), it looks more like it is being replicated, I think.
what method should I use in c++ if I want to run code on an actor only when it spawns and is replicated onto a client from the server?