#multiplayer
1 messages · Page 198 of 1
Oh yeah?
If those are already Subobjects, then that's probably not the case for you
Well I'm using actors currently
E.g. if you do UStaticMeshComponent* const NewComponent = NewObject<UStaticMeshComponent>(...); then that needs to be marked as NetAddressable and be stably named
Riight
But isn't that the same thing if I want to link up actors that were spawned locally?
Gotcha
we fake the actors
Ultimately they might follow the same rules though
to make it seem like they existed on the level
Kaos I really wanna know how you do that lol
Do you not get issues with based movement in multiplayer?
no
So you don't replicate. What faking are you doing then?
Can you give me the 1'000 " view version?
we just set 2 options i think
on the actor
and ensure the name matches client and server
Chunk->bNetStartup = true;
is one I guess
is SpawnParameters.NameMode = FActorSpawnParameters::ESpawnActorNameMode::Requested; the other one?
And then you're saying you don't need to enable replication, because the names are the same?
//These two bools trick the UE4 networking system into thinking this actor came from a level package.
Actor->bNetLoadOnClient = true;
Actor->bNetStartup = true;```
So what is NetLoadOnClient for if you don't replicate?
SpawnParams.OverrideLevel = InLevel;
//SpawnParams.Template = InTemplate;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
SpawnParams.bDeferConstruction = true;
const bool bIsReplicated = InClass->GetDefaultObject<AActor>()->GetIsReplicated();
APrefabRandomizer::ActorID++;
//This keeps the name the same, so we can reference actors by a stable name, crucial to tricking the UE4 network system
SpawnParams.Name = FName(*FString::Printf(TEXT("RNDPFI_%s%llu"), *GetNameSafe(InClass), APrefabRandomizer::ActorID));
UE_LOG(LogPrefabricatorService, Warning, TEXT("Spawning Actor from class: %s, Chosen Name: %s"), *GetNameSafe(InClass), *SpawnParams.Name.ToString());
UWorld* World = InLevel->GetWorld();
AActor* Actor = World->SpawnActor<AActor>(InClass, SpawnParams);
Actor->SetActorTransform(FTransform::Identity);
Actor->Tags.AddUnique("Prefab");``` we dont use chunks
but this is what we do to spawn the actor
client and server side
we are not chunks or w/e
Wow, ok interesting
but we have pre-designed buildings of different shapes
which fit in the map, randomly
right
Nice, ok
Lemme get my hands dirty here
I'm assuming you don't have to do a lot of deleting and then recreating your actors? Otherwise you'd having naming conflicts?
we also skip all replication of actors till all clients and server has generated the level
yeah like i said
Ok yeah
the level is created once
Gotcha
but the same concept applies for your chunks and stuff
you want them to exist as if they were loaded from the map
so you dont replicate 100's of actors
Right
needlesly
That's very similar to my current approach
Yeah the naming issue is solved now
then its plain sailing
Did that a few days ago
as long as both client and server matches
its all good
just use bNetStartup
(tbh this is all you really need)
Good news!
I was at that valley of despair right after the peak of mount stupid I think haha
Oh, sorry, we don't do GIFs in here huh? My bad
hey, I try to rework my in item / inventory system. and have some problems. Its Uobject based. New Items loot are added and updated on client and server, but if I add more of the items it doesnt update the amount (i modify the quantity with a item base function)
Does Modify Quantity get called?
What does the Modify Quantity function look like?
its a function on the uobject item base
so it should update the item within the array
hm
wait
I ve printed the value
and it is correct
but the values on blueprint doesnt
wait
ok, the server holds the correct data but on client the quantity is not updated
my item array is a array of uobjects, it seems that changes on the items are not detected. Maybe someone has an idea?
God damn. I call the function "spawn Cards" 1 time. I even put a print string in there to say hello every time its called. WHY is it spawning exponentially more cards every round?!?
NEVERMIND! Just playing around with the For Each Loop functionality..
hi
i'm working on a 3D inspection system where when the interact with the desired object, a new actor is spawned (spawn is not replicated) and then this actor set up a scene capture to only displays a set mesh on a ui along with some information about the object.
everything works fine in standalone but for whatever reason, no matter what i tried (is locally controlled, is locally viewed, switch has authority, is server, event that only happen on client, etc) the static new static mesh set for the spawned interactable after the interaction is always replicated on the ui.
i figured it was because the "get static mesh" node i get from the active interactable (that doesn't replicate either) from the static mesh component is set to rep notify by default but i don't know how to work around that.
any ideas?
I also tried "relevant to owner only and set the owner of the spawned actor to the player local player character
is it uncommon to do a splitted interaction logic (for server / local)?
this way?
server interaction is for server stuff (items, inventory, stat base stuff) the local for client side (widget handling, npc dialogues, some effects)
So I've traced my PlayFab headaches to a conflict with the Steam subsystem. Apparently if my dedicated server is running Steam online subsystem, it cannot be joined directly via IP.
So I need Steam OSS to be __OFF __for my dedicated server builds / instances, but __ON __for my game client instances.
On the client, I still want to collect the steam session token and pass that to playfab for authentication. But the server is using API keys and I don't need a steam token or ID.
This feels like a silly question, but is there a way to configure my builds to use different DefaultEngine.ini files depending on the target?
If you want to connect to Dedicated Servers with IP, you need to turn off the Steam Socket Subsystem
[OnlineSubsystemSteam]
bUseSteamNetworking=False
This will allow Clients to make IP connections
While still having Steam available
Oh hell yeah!
This goes into the DefaultEngine.ini
Thank you Matt, trying now!
Should I still keep this DefaultPlatformService=Steam
Yes
and I can use the same DefaultEngine.ini both client and server builds?
Yes
Amazing, sounds like this is what I'm looking for.
Are line traces supposed to work on a server? I am calling LineTraceSingleByObjectType and it works on a client, but on the server it is returning false all the time
Ah dang, that didn't work. Unless I messed up my DefaultEngine.ini
The overlay still triggers on the client, which is good. But the client cannot connect to the server using open [ip]:[port]
If I set DefaultPlatformService to null and bEnable=false; then I can connect to the server via open level, but my steam overlay does not trigger on the client.
DefaultPlatformService=Steam
bUseSteamNetworking=False
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=<removed>
AppId=<removed>
ModDir=<removed>
Description="Pumpkins Game"```
Attention to detail mate. Can you spot where you went wrong?
I bet you could hear my head thump the desk from there. I put it in the wrong section.
I bet that would have taken me days to find otherwise too. Thanks again, re-deploying now.
so I have an issue where the character appears to rotate between two positions at once, resulting in this flickering. It appears on autonomous proxies, and I was thinking theres some sort of rotation setting conflict or smth but im unsure. any ideas?
else if (CharacterOwner->GetLocalRole() == ROLE_AutonomousProxy && IsNetMode(NM_Client))
Isn't the IsNetMode(NM_Client) check redundant in this case? Wouldn't the local role only be Autonomous on clients ?
Yes
thanks
Does sequence matter when setting bools in the config, or would capital letters throw it off?
I've tried this and it's still not letting me connect via IP while using Steam. Unless maybe my Advanced Sessions plugin is screwing with the (netdriver?)
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bUseSteamNetworking=False
bEnabled=true
SteamDevAppId=<removed>
AppId=<removed>
ModDir=<removed>
Description="Pumpkins Game"```
You need to read your Logs at this point.
That flag set to False should disable the SSS and allow IP connections to be made
I see this: GameNetDriver SteamNetDriver_2147482461 shut down
And then a few lines later I see this: SteamNetDriver_2147482371 bound to port 8080
Can I infer based on the difference in display names, that the game is shutting down one steam driver but then launching another?
Weird that I would even see any with that bool disabled.
The NetDriver is a different thing to the Socket Subsystem
You should always have a NetDriver
So thats just saying that a SteamNetDriver was bound, which is good.
I wonder what happens if you set DefaultPlatformService=Null
Just so you are aware, you can have as many Online Subsystems enabled as you like.
So you can have Steam enabled without having it being the primary NetDriver
I think steam stops working for client if I set that to null, but I will test.
Each deployment takes about 25 minutes for me.
This allows you to do things like use EOS as the NetDriver but allow Clients to access the Steam Overlay etc
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemRedpointEOS.EOSNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="BeaconNetDriver",DriverClassName="/Script/OnlineSubsystemRedpointEOS.EOSNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")
[OnlineSubsystem]
DefaultPlatformService=RedpointEOS
[OnlineSubsystemSteam]
bEnabled=True
bUseSteamNetworking=False
This is our setup
EOS is the primary service
But Steam is enabled
We dont use the Steam Socket Subsystem
As we want to enable IP connections
I feel like EOS is the next step, just trying to get PlayFab auto-scaling proofed before going that route.
We have both Listen Server and Dedicated Server support, we use GameLift, but also have a PVE element that is Listen Server based and utilizes Sessions.
EOS handles Sessions for us and Gamelift is obviously Dedicated Servers.
The Redpoint Plugin is very much worth the money
I believe they also have a Blueprint plugin that exposes its features
But thats a separate Plugin
So you would have to buy both if you are stuck in Blueprint world.
If you can manage C++ then just the Redpoint EOS plugin is enough.
I'm stuck in blueprint for now; trying to see how far I can get.
Weren't at least some of the red point plugins free if one doesn't need support? Can't recall
I think they have a free version, not sure what limitations it has though.
I think I am very close with PlayFab. I've got the REST calls connected for my player data, they have a BP plugin that helps with async management.
PlayFab in theory also has a plugin that allows it to work in BPs. But can't say it's a good implementation
I cant remember if Gamelift had a Plugin. If anything all it did was wrap the API, not expose it to BP.
Its been so long
Since I implemented it
Is a client side rename of an actor taking 27ms normal 👀
Might be a fluke, but man, why is it taking so long?
Most of the time it's half a ms, but sometimes it spikes. Might be more going on than meets the eye I guess.
No luck, setting DefaultPlatformService=Null just breaks the steam connection for the client; server still can not be connected to by IP.
I can cheese it by setting bEnabled=false cutting the server build, then setting to true and cutting the client build.
But I feel like there must be a better way.
Is it just a wrapper or do they add extended features too?
Match State Changed from EnteringMap to WaitingToStart that's the last state change that I see in the server logs.
Does the server need to be in a specific state to accept connections from IP?
I'm really feeling like this might be my advanced sessions plugin biting me.
Go and read their Website, they add a lot of functionality.
smells like blend space shenanigans
Entirely up to the design of the game.
Like if all dialogue doesn't have to be in sync and all the data it need is available locally without change then there wouldn't be a need for networking at all
I ended up printing some of the aim offset values, and was using a version of the GASP. Its not really setup for multiplayer at all, and I didnt' realize that the client was setting the AO value as well as the server. I reoganized a little and voila, its working all fine now
Got it, thanks
I do yes because in some cases I want to generate chest items for the player before they open the chest, which is handled server side. Then it visually opens the chest which is also server side
There is a local event that says “hey chest got open, here’s the inventory for your widget”
Another use, checking if the player is allowed to open a door or interact with this based on some logic. Which would be controlled by the server
Did you pass REN_ForceNoResetLoaders
If not you probably flushed async loading
Which caused to it block
I'm having problems on connecting to a listen server after, seemingly, successfully joining the session (OSS Steam) and successfully obtaining connection string. Pastebin includes server and client's logs related to network activity. I'd be happy to be pointed about anything that I'm failing to catch about either resolving or identifying the problem. Using 2 steam accounts on 2 different pcs on same local network right now. Changing subsystem to Null or client using the open <lanAddress>:<port> command works perfectly fine to successfully connect to the server
Guys I have a problem, it turns out that I am doing a mechanic where my pawn controller is automatically moved towards a point but it turns out that only the server manages to do it fluidly and if it jerks when I execute it from my client it conflicts with the server and the movement He does it with jerks, how do I fix that?
Apparently this is only an issue when the game is launched from editor (as standalone), works perfectly fine on builds. But it would be nice to be able to test session/lobby related stuff without requiring to package after every change
Is anyone able to help me with setting up multiplayer on lyragame for steam?
I need an is impostor bool to be randomly selected like among us and stored in ThirdPersonBP how can I do that.
I need 1 imposter and it must be replicated
doesnt have much programming knowledge but i guess it would make sense to get a random player from the AllConnectedPlayers array and then set its isImposter bool to true
Hi All
I was following a tutorial on inventory systems. When i drag an item from inventory to the world, spawning of that item actor is done inside character bp. (https://youtu.be/8HGAoXRsQCI?list=PLV98WIslM9wsH20l2UxDQJUDStPT-ImlM&t=1289 Tutorial Timestamp)
is there any other way i can do this without putting the spawning code inside character bp. Can i put that code inside game mode and call it maybe?
Hi All and welcome back to episode 18 of our Multiplayer replicated inventory component in Unreal Engine 5. The Purpose in doing the inventory as a component is that we can easily add it to any character or project we like in the future!
If you are new to the channel and like the content please like and subscribe :) And as always let me know i...
I didn't! Good to know!
Edit: Yeah, that helped massively!
You should be able to do that as well, but in that case keep in mind a client cant directly access the gamemode blueprint or even call a server function on it, you would need to call a server function to spawn on the player's player controller, that could then route the call to the gamemode on the server and spawn your item
Is secure to pass uobject from widget to widget on multiplayer??
Widgets are local only, so that should be fine
Hi everyone! Is there a way to set an actor to replicate (or not) at the time of spawn?
Weird question but does anyone know if there's a way to DC from an instance without closing the connection? Got an interesting case where it looks like a player has somehow managed to do that... I've got two logins (one initial login, and one login later) with seemingly no disconnect in between. Dude said he crashed but I've never seen a connection remain active after a crash 🥲
Nope, not out of the box. iirc needs Engine modifications that no one has ever done yet.
Yeah just call SetReplicated on it. Needs to be on the Server of course.
Makes sense, does it need to be deffered spawn, or does regular work just fine?
Only thing I can imagine is that you have an InactivePlayerState that you aren't aware of
Just fine
using the photon sdk and a custom netdriver, you can do the first step of host migration, selecting a new host when the current one leaves and have everyone connect to the new host.. but it's photon only
afaik, deferred spawn is different only in a sense, that it allows you to modify the actor properties before certain actor functions would be called (i.e. before BeginPlay)
if that is not critical for your case, then both would work equally fine for you
But begin play isn't called anyway, especially if you're setting things in the same frame as spawning the actor
I don't think that's correct.
According to the actor lifecycle diagram here https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-actor-lifecycle
When you call SpawnActor. it will go through the whole chain of calls up to BeginPlay, before returning from the SpawnActor call and proceeding to the next line of your code, and with SpawnActorDeferred, the call chain will stop after AActor::PostActorCreated, and will return control to your code, where you'll need to call AActor::FinishSpawning for it to pick up from where it stopped and proceed to run construction script, initialize, BeginPlay, etc for the actor
What actually happens when an Actor is loaded or spawned, and eventually dies.
but if you set the actor to be replicated in the same frame as spawning/finishing spawning it, I think effectively there will be no difference for your case from client PoV
Thank you for the clarification!
quick question , when making an MP game , is it better to test it on standalone mode or listen server mode ?
Doesn't matter most of the time
It's usually much faster to test in PIE with listen sever
If you are planning on making a dedicated server game though you'll need to test differently
no , just player hosted
because sometimes i have things working in standalone , but not in listen server and vice versa
and got confused on which mode wld be suitable to test as accurate as possible
As accurate as possible would be separate dev packaged builds
But in general things work the same in PIE listen server especially if you use separate process (but I find most things work fine even without that)
got it , thank you
You're welcome! Yeah it's an easy mistake to make and a costly one at that
Does anyone have any idea why a line trace would generate a hit when run on a client but not when run on a server? The object that should be hit is placed in the editor and is replicated. The line traces are using the same start and end coordinates according to my debugging. But the server line trace just always returns false
question regarding the fast array serializer, when it says "the order of the list is not guaranteed to be identical between client and server in all cases", is there an example of what cases might make the order become out of sync between the clients and server or can just general use cause it
From reading the code I think just general use can cause them to get out of sync
general use
It's useless to keep the order in most cases when using fast array anyways, like for an Inventory, you will generally do the sort client side in the widgets (sort them alphabetically or per categories etc)
but if it's really needed you can just have an index stored in the entry
yea thats what i ended up doing. was hoping since the inventory is dirt simple and there would be no reordering other than removing/adding that they would keep in sync. not a big deal
You need to keep order for what ?
make ui bindings simpler. basically delegates that fire off when an item is added/removed and to make life easier just have it contain the item data and the index of which to modify in the UI (such as add a thumbnail to a specific box or remove it based on index)
better have an unique identifier then
my items have a FGuid for that
and for my QuickBar i have a simple array of struct that have the ItemGuid and SlotIndex
the pointer to the item (doesnt get destroyed, were talking very few items). ive never tried doing anything with a guid, ill have to look into that and make a decision there
Actually nvm I do this a bit differently, I have a Fast Array of FItemEntry replicated and the client representation of the item which is a UItem (it stores the FItemEntry and utilities functions), I actually broadcast it through delegates when doing changes
ah gotcha. ty!
void FLyraItemList::PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
{
for (const int32 Index : ChangedIndices)
{
FLyraItemEntry& ItemEntry = ReplicatedEntries[Index];
check(ItemEntry.PreviousCount != INDEX_NONE);
if (ULyraControllerComponent_Inventory* InventoryComponent = ItemEntry.ParentInventory.Get())
{
if (ULyraItem* ItemInstance = InventoryComponent->FindItemInstanceByGuid(ItemEntry.ItemGuid))
{
bool bItemChanged = false;
bool bAmmoChanged = false;
// See if Count changed
const int32 CountDelta = ItemEntry.Count - ItemEntry.PreviousCount;
if (CountDelta > 0)
{
ItemInstance->ItemEntry.Count = ItemEntry.Count;
bItemChanged = true;
}
// See if MagazineAmmo changed
const int32 AmmoDelta = ItemEntry.MagazineAmmo - ItemInstance->GetMagazineAmmoCount();
if (AmmoDelta > 0)
{
ItemInstance->ItemEntry.MagazineAmmo = ItemEntry.MagazineAmmo;
bAmmoChanged = true;
}
// If anything changed, tell the client
if (bItemChanged || bAmmoChanged)
{
ItemInstance->OnItemChanged.Broadcast(bItemChanged, bAmmoChanged);
InventoryComponent->RecentlyChanged.Emplace(ItemInstance);
}
}
}
ItemEntry.PreviousCount = ItemEntry.Count;
}
}
USTRUCT(BlueprintType)
struct FLyraItemList : public FFastArraySerializer
{
GENERATED_BODY()
bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParams)
{
return FastArrayDeltaSerialize<FLyraItemEntry, FLyraItemList>(ReplicatedEntries, DeltaParams, *this);
}
UPROPERTY(SaveGame)
TArray<FLyraItemEntry> ReplicatedEntries;
UPROPERTY(NotReplicated)
TArray<ULyraItem*> ItemInstances;
........
that's an example @ocean geyser
But yeah before that I was just sending the guid and fetching the item in widgets directly but it's not a big deal and just more code for nothing.
and your above reminded me i forgot the case where an item might be swapped out which needs updating on the ui, thank you lol
Do you simulate lag? Client and server don't neccesarily see the same thing when latency is introduced.
I'll say that I do not simulate lag since I don't know how to do that.
Net pkt lag in console command
But I can sit still while next to the object and it never will be found no matter how long I wait
Is the collision settings the same in server machine?
Make sure the channels can be traced against in server machine
How would I check that? The only settings I know of are on the object properties
You can print or log it . You should get server:
Or client:
With print string
Though if you never change the collision settings anywhere, that's most likely not the issue
Share your code? Did you run the trace on the server too?
Hey, I'am about some Basic rework of my Item / inventory and Interaction System. Through some dialogues with people here, I will rework my complete Interaction System to Work Serverside ( after pressing a Key IT calls Server Events that handle Interaction stuff) because IT seems better for the Most cases. But I also have some Interactions that Open Widget Menus, and I struggle with Handling this Kind of stuff. Because it relates only the Client that is interacting and I don't know how I should Display the Widget for this specific Client. maybe someone has a Tip or food for thought?
I need an is impostor bool to be randomly selected like among us and stored in ThirdPersonBP how can I do that.
It's something in a uasset file. I wasn't having this problem in the last commit, and the only diff in the cpp code at this point is all the extra logging I've added. I'm just going to revert my changes and pick up from the previous commit
right now this is how I spawn players in gamemode when they enter the map
One Idea that I have is to make two Interaction (Interface functions, one call in Server and one call local) but I don't know If this is a legit way
You may not need to do everything server side. Seeing as widgets are entirely client side, there's no reason why you couldn't have a client interact with something that then displays a menu. The only time where it may need to be done on the server is if the interaction itself changes something with the gameplay that you want to ensure that the player is allowed to do, and/or needs to be replicated to everyone else.
As an example, I personally wouldn't care if somehow a "dead" player tricked the system to be able to speak to a character and read the dialog it has there. I would care if the dead player were able to choose an option in that dialog that unlocks a door. I could easily make it so that any gameplay related logic would need to be RPC'd to the server and the server can then verify if that player is able to make that action.
tldr: you design it so that the widgets will show as you need them and when the conditions for them are met based on what values the client has. Any important choices would require an RPC to the server of some kind indicating the choice made, and the server can validate if the player can make that choice and then replicate and do whatever else is needed from that choice.
Yeah Actually I make the interaction localy but it seems laborious in most of cases where the server should handle stuff (loot, actor changes, spawning actors...) Showing Widgets are rather rar, there will be npc dialogues but actually not planned to be gameplay relevant. The Problem of actual Server Side Interactions for this Actors are that within the Actors I cant send Server RPC because the Client isnt the owner, so I send it to PlayerController or Character with Actor Reference and handle the Server RPC there. With the Interaction System Handled by Server this is much better. Visuals can be sended through multicast or repNotify. Or With my Idea I can setup Interaction Local for some pure cosmetic or widget based stuff
A other idea is to set the widget by the server and send a change for display the widget which is loaded with bool repnotify
You build a component that you utilize on your player controller that performs the interactions. You make the RPCs generic. All the data about the interactions can be replicated from the actors that you want to perform interactions with. You'd send RPCs through the component with reference to the actor you're interacting with and the interaction you want to perform.
ok, a interaction controller that handle it
how relevant is the point where I send the Server RPC? for Latency?
So, the Interaction Interface is on the Actor I want to Interact. On Interact Event (Actor) I send a generic Call to PC "Interaction Controller" Component that handles the Interaction and do the Server RPC
right?
Not sure what you're asking here. You'd send the Server RPC when the player has made the choice that has gameplay consequences that you need the server to validate.
I don't know where your logic flow starts from here and what the goal is.
Ugh. I reverted and am now back to a previous problem. Objects placed in the editor don't have an owning NetConnection. I can't remember what I did to solve this
Oh wait! I had to adjust where some code ran.
Make sure it ran on the server instead of the client
Very much appreciated brotha!
Maybe I overthink some stuff actually. I will consider this stuff. I want to do a "simple" and reusable solution. Your Input helps so far. I will also take a look on my actually interaction system. Its based on a tutorial I've done
If your intention is to have a system where you just press a button and it starts interacting with something in the world and that opens a door, widgets aren't really involved. You'd only need a simple system for something like this. Input > Get Actor To Interact With > RPC To Server with Actor > Server calls interface on actor.
It's a bit more complicated if you're throwing widgets into the mix. If you want to have a mix of both systems, where you want to dynamically choose whether a widget is shown or not, then you'd have to have some means for the client determine if a widget should be shown, so then you'd need to define some information about the available interaction that could take place, and then your interaction system would look more like:
Input > Get Actor To Interact With > Interface with Actor to get Interaction Information > Decide based on interaction information if action should immediately call an RPC or show a widget
yeah thats something I also think about. for example I have an Interface Option where I can choose if Interaction prompt is shown or not
so I can say has "server rpc or local"
thanks datura, you help me alot
yeah this seems a good solution 🙂
I have a semi-client authoritative model for my physics drive spaceship pawn where I am essentially trusting the client's simulation within a margin of error. Right now this is happening by naively copying the transform from the client to the server (as well as linear velocity). This works, but I get the jitter seen here when viewed from another client (remote ship is visible in the left window). Is this because of variations in the timings of when the server receives/processes the transform copy?
In some talk many months ago (maybe even last year), I asked an epic person about the physics control component and replication. I distinctly remember a response that it should be possible.
I was wondering if anyone has heard of or knew about resources relating to the replication of the physics control component, so that physics can be simulated and at least roughly in sync? 🤔
(looking at it as a solution for recoil)
Overview of networked physics in Unreal Engine.
this seems to be related to physics as a whole, and not the physics control component specifically
Not sure how much different it is
well, it's specifically an article on getting physics based pawns to sync properly, with several WIP methods of doing that
right, I get that, and I think it's definitely helpful to know, but I'm not skilled enough to generalize that knowledge to the physics control component exactly
That's why I'm hoping someone somewhere has some kind of info on it
I messed around with it a bit, but couldn't get it to behave well
this article is also very useful
I implemented that and it kinda sorta worked, but I will still getting positional desync at times
do keep in mind that it's a WIP tech for the engine
I probably need to learn more about the physics control component itself also, maybe if I keep reading on both ends that I will eventually get something to click
so hard to know whether it's you that's the problem or the engine
for my purposes in my space sim, it wasn't responsive enough, and also was not preventing desync reliably
yeah that makes sense
and you're talking about the Physics COntrol component specifically?
No, I'm just referring to the stuff in the article.
oh I see
if you're just trying to model recoil it might be overkill
if I can get it working, it'd be significantly easier than animating all that stuff myself lol
I am going to do it procedurally via control rig otherwise
but it's just a bit difficult to make it look really nice that way
is there any way to give a client authority over a specific actor's simulation?
someone here that worked with uobject based item / inventory and replication?
I have a toggleinventory func on player controller and i get the error "only local player can be assigned to widget" when i tried to open the inventory on client window
In the interest of sharing learnings, my netdriver problem was the result of using wrong double-quotes in my DefaultEngine.ini
I was using:
+NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName=“OnlineSubsystemUtils.IpNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)
I should have been using:
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
Im glad you found the issue
You are connecting with IP now?
With Steam enabled
Yup! Your suggestion of using bUseSteamNetworking=false was what I needed to do, but I guess the snippet that I copied from somewhere was using the wrong quotes.
Server is using IpNetDriver and Client can connect to PlayFab container instance using IP, and client also has Steam overlay. Thanks again.
Your earlier comment about attention to detail couldn't be more true. I want to say I'll learn and do better, but I feel like this is going to be a recurring problem for me.
Yeah, OK. Making my object interaction run on the server is what unconvered the bug where the server doesn't find the object to intereact with
Dont copy paste, type it out 😛
OK! I know why the line trace is failing on the server. It's starting and ending locations are wrong. It's like it's never moving from the initial position. Let me guess: cameras on the server don't move, do they? I'm starting the line trace from the position of the camera because I want interactions to be focused on what the player is looking at.
Not sure on your setup, but when I had a similar issue it was because the actor I bound my camera to didn't have replicated movement.
I turned on replication for all components, and now I can see the server line trace coords are changin, but they still aren't the same as on the client
Yep. I changed from using the camera location to using the pawn's eye location as the starting point of the line trace and now it works. Lesson learned
hey guys back again with another probably simple question that i cant find an answer or info about. Im trying to end a match ( free for all) when a player reaches a set score. Im just not sure where to place the logic or the entirely sure how to go about it. Do i place that in the game state and trigger it when a player state reaches desired score ? ive tried creating a custom event in the game state and calling it when any player state reaches score and using the player array to loop through and just do a simple print string but it doesnt seem to function on all only on a connnected client
are you calling it locally ? on the player that owns the widget? widgets arent replicated
becasue the replicated actor OWNs the copy of the widget. its a unique instance of it for each player
its created for that client
where is this created ?
no authority should only do it on the owning client
you have to call a multi cast from the server to act on all
because the server owns it youd have to set ownership to the client . im new to multiplayer but my understadning is a client cant change something on the server if it doesnt own it
that im not sure. sorry man hopefully someone else a bit more knowledegable can chime in and help. i dont want to provide you with bad information.
have you plugged a print string into the cast failed pin to see if its failing to set the owner?
So your actor owns the widget, and the server spawns the actor.
You need to get a message to the client they they need to do a thing with their version of the widget. Maybe the server can send a multicast to all of those actors, who can do a thing with their widget.
Unless I misunderstand your issue.
I have some questions about game servers vs p2p and what I should use with ue5
-
Are people who choose to go on steam just hosting their own game servers and using steams API for them? Or are they just opting for steam's p2p?
-
Is it even possible to integrate steams p2p as your connection solution in ue5?
-
Can you go on steam and just bypass their whole networking thing altogether and use EOS with either a listen server or dedicated one?
My game is simple. It just spawns 2-player competitive turn based matches that last 5-15 minutes a piece. I really don't want to do P2P because I don't want to subject people to easier cheating and/or IP address leaks. But I really am just at a loss for which direction I should even start heading, the more I read the more lost I get lol
P2P is a bit of a misnomer in Unreal.
There is no actual P2P in the context of Clients connected to Clients
There is only ever Dedicated or Listen type servers.
Yeah I realize that but steam has their own P2P solution
Thats just the Socket Subsystem. Its just how traffic is managed.
Focus on wanting either Dedicated or Listen Servers.
P2P really has little to do with that choice.
You absolutely can host your own Dedicated Servers and have them discoverable through Steam
Its basically the same process as if you were doing Listen Servers
hm.. okay. Would a "listen server" then count as a dedicated server from steams PoV?
A Server is a Server
Steam doesnt care.
Steam is just a mechanism for connecting people.
Same as EOS
You connect people together via Sessions
Those Sessions just facilitate the discoverability of Servers
Either Dedicated or Listen
is there any build-in method of using the unreal replication system for a client-authoritative pawn? (that gets replicated to the server)
okay.. sorry I'm pretty ignorant on this topic so thanks for educating me.
If I go with a listen server, and then steam sees that as a dedicated server, then players on mobile which don't have steam installed would be able to play with players on PC with steam installed?
If so I'm a little confused on what the value of integrating with steams networking APIs are at all in that case
I'm so lost on the end to end integration, is there a good place to learn this stuff haha?
I don't think I even know what I don't know
All the videos I've found are like "How to add multiplayer with steam!" and they just pick one. I don't see anywhere that explains the difference between UE5s listen/dedicated server and how that relates to p2p vs dedicated servers and what the implications are for each, their discoverability across platforms, etc etc.
They mobile clients wont be able to discover it, because they would need steam to discover it.
@boreal scarab You should check out the Redpoint EOS Plugin.
It manages cross platform play really well.
EOS is designed to allow cross platform, which is what it sounds like you want.
Also, a Listen Server is a Player
So you want a Player on PC with Steam to be able to host for Clients on Mobile? Is that right?
Ahh okay. I'll check that out. With Redpoint EOS could I still launch on steam and just ignore their networking stuff?
Eh, I don't necessarily care who is hosting. I just want players from mobile and PC and console to be able to connect to eachother.
What do you mean by bypass their networking?
Yeah you want crossplatform, you need EOS.
"Ignore" I think is the better term heh. I'm looking at steamworks documentation and they have a section on steam networking. I wasn't sure if I launch on steam, and take advantage of other parts of their api, if I would also have to hook into their networking apis
Ignore Steamworks
Its abstracted away from you in Unreal
Via the OSS
Again, Redpoint Plugin takes away all of the guesswork especially with Steam.
ohhh! Okay that's huge, I didn't realize that Redpoint had steam integration capabilities built in
It doesnt necessarily, it utilizes the Unreal OSS for Steam
OSS = Online Sub System
Steam has an OSS
Facebook has an OSS
Occulus has an OSS
etc etc
These are Unreals abstraction layers around things like the Steamworks API
So that its generic
To work with in Unreal
So how does stuff like.. achievements and trading cards and store presence and stuff like that work? All that kind of stuff is there too?
Depends on the OSS
Sometimes they dont have all the features implemented
But Steam Achievements certainly work
I see, so redpoint just has an abstraction layer with an interface and if the platform you're working with implements it then it'll work
i'm sure that's an oversimplified explanation but hopefully mostly correct heh
Go and read their documentation, it might make more sense than me trying to explain it
okay will do. Thanks a lot!
Which linux distro do people use for deploying and running their game server binaries to? CentOS? Debian? Ubuntu?
Ubuntu 20.04 LTS
Hey, is there much performance difference between calling a multicast rpc and just calling each client rpc independently?
From the server if not clear
It's pretty much the same thing performance wise
Try not to overthink it
Thanks. Yeah I have to switch, but was making sure I wasn't saturating the bandwidth more
There is potentially additional serialization cost
But I doubt any perf difference will be measurable. Just use the most appropriatte one.
I need an is impostor bool to be randomly selected like among us and stored in ThirdPersonBP how can I do that.
right now this is how I spawn players in gamemode when they enter the map
There's probably alot of different ways but getting a random index for array of your controllers probably the best and store in playerstate?
anyone knows how to make this work on clients? From what Ive seen, it sounds like you need to directly edit the cpp code of the engine
player state knows who its controller is and vice versa
seems like this fixed my issue
Even better
I have a toggleinventory func on player controller and i get the error "only local player can be assigned to widget" when i tried to open the inventory on client window
maybe try "is local controller " if it turns "yes" toggle inventory if Not , do nothing
show code path from input to spawning and displaying the widget
I don't see a problem here
what does the inventory widget do when toggled?
@rain condor how do you create the widget?
i have a feeling that's where you pass a non locally controlled PC as the owning widget or something
I created on player controller too
I saw that hahah
I called it on spatialInventoryWidget
I mean that's just a name and doesn't tell me much. Show the part where you call create container
you are passing player controller variable here
how is it set?
and why do you have a pointer to a player controller?
seems weird, you should always just get the local player controller
I need player controller to called the func
Where is this bp? what is the base class it's derived from?
where do you actually create this widget at runtime?
show it
getting there 🤣
Controller begin play is already fishy enough, understand that servers have copies of every client controller
ok that's the issue
So i have to created on toggle inv func?
or gate by IsLocalController or whatever
Just have Is Locally Controller check, on true, follow through with your logic
if you have 3 players, your server essentially made 3 inventory widget in his machine with your previous logic
Hey guys I got a strange problem: I am not able to connect to a server map on a linux server from Unreal Editor. If I make a Windows build everything is fine. The error message in editor output log
Does BeginPlay not run on Servers? I've got an Actor item in my level, and according to my log messages it's BeginPlay is only being called on clients, not on the server
show code
The first print string prints, but the second one does not
This is on an ActorComponent that defines item properties, for what it's worth
ACK! No, it's on an Actor. It sets a value in a component, though
I'm trying to set the value only server side and have it replicate down to the clients
So what about my basic question: Does BeginPlay run on servers or not? An internet search says "yes" but my testing says "no"
If it is supposed to run on servers then I know I need to dig deeper
yes
where are you seeing the prints
In the Output Log
Can we make matchmaking system like PUBG, Fortnite but with the listen server?
Like making the first guy that we found a host and other a client. Also is it possible to switch host when the actuall host leave the match?
I have a Board that consists of Grids made up of Tiles, which can host CombatUnits. From the GameMode, I have the server setting up a Board for each player with variously positioned CombatUnits. The player can then pick up and move the CombatUnits to a different Tile (which happens only for the autonomous proxy). Once time runs out, the next phase begins and the units are given AI, which puts them back to their original positions before beginning combat. Ideally, the updated unit position would be seen even when done by a simulated proxy, and the unit position would persist through the combat phase.
The CombatUnits, their reference to their Tile and vice-versa are all replicated, as is the hierarchy from Tile through Board. There's clearly something I'm having trouble wrapping my head around
The first is somewhat trivial. Pick players, pick a host, Have host start game, have clients join in. Bit of work required, but not so bad.
The second, host migration, is a massive undertaking that is generally not advised in Unreal. Possible, but has a lot of caveats and a lot of work.
Hello, does anyone know if it's possible to run an AIController on clients? I'm looking to stand-up a load testing framework where I can launch dedicated servers in the cloud and then spin up headless clients that connect to these servers and send inputs over the network the same way a player would. The launching of the dedicated servers, matchmaking, etc isn't the issue. It's having a client that can be scripted to send inputs over the network, or in other words an AI that isn't server controlled but client controlled.
Why must it be an AI controller?
Good question, I suppose it doesn't need to be an AI controller as long as I can easily script the inputs using things like behavior trees.
I would probably start with a component that can be placed on a playerController.
The first problem is to figure out if calling or emulating inputs is possible.
If it is then there's no reason a component on playerController couldn't spoof a player.
State trees are usable everywhere.
Yea ok maybe this isn't as novel as I was making it out to be. I had first imagined a custom player controller (or component that lives on a player controller) that would just do something silly like execute a server RPC at some cadence. That's a version of a client-side controlled bot. Easy enough. Next step is figuring out the best way to iterate on that logic that dictates when to call said RPC and do other interesting behaviors, and I think state trees or something similar are the answer there. Thank you for your input @dark edge it's much appreciated!
Having a bit of a brain fart moment, any suggestions on how I can make an actor that I'm spawning via SpawnActorDeferred invisible on clients until I send down an RPC later?
Not sure what deferred spawning has to do with it. But SetVisibility is replicated.
They can also be invisible by default.
Well whack me upside the head with a wet noodle. You were on the right track.. For some reason my "print string" calls were printing the to screen, but as far as I can tell, not to the output log. I'm getting BeginPlay running on the server after all.
But now I have to wonder why the initial value being set in BeginPlay is not being replicated. I suppose formal replication won't happen because BeginPlay on the server will run before the Actor is create on the clients, but why would the initialized value not be set on the clients? That's the underelying problem I'm trying to solve. On the server I NewObject create the InvItem property in BeginPlay, but on the client that property remains unset until I do something on the server that updates it's value. Then I see a log message from OnRep_InvItem
ahh host migration is the real problem restricting me from implementing the first one.
Btw can we use any old pc as dedicated server? If yes then how much players it can handle once?
As long as your world has begun play, anything you set on server during actor's BeginPlay will be replicated to clients in the initial package that instructs it to spawn the actor. As long as that something is set to replicate.
The NetTick happens later during the Tick, so even if the Actor is replicated the very same frame it was spawned in on server, that will still hold true, and as new replicated value was set before the packet to instruct client to spawn that Actor is sent, it will always, without exception work.
I'm onto something. I had changed some of the interaction code and I just realized I had not updated the UI components that call it. Working on that now. Seems they were calling the wrong function
It's never what you think it is
That is not an answerable question. Too many variables affect this. Depending on the game and the machine the server is running on, and the amount of optimization you're able to put into it, the number is anywhere from 4 to 4,000. Though realistically more like 4-100.
When i pay 100$ to steam i have to name my game right lol?
im fairly sure you're allowd to rename it later
Yep! The problem was in the interaction UI widget. Everything else was a red herring that led me astray.
Onward to the next bug!
------------------------------3D widget issue :
i set up a 3d widget in lobby , when the host is alone in lobby , he can interact with the widget , but when another player joins , neither of them can interact with the widget
or is there a way i can make the 3d widget interactable by every player ?
You have to enable widget interaction component on player that wants to interact with the widget
yeah , i did that
but the main issue is that , clicks are not registered
the widget has level button list , that any player can chose from to start the chosen level , as i said if the host is alone , he can interact and the clicks on the widget are registered , and it shows the chosen map , but once another player joins , neither of them can interact with the widget
Hi guys, sorry but newbie question. Help appreciated. In a packaged game hosting and joining worked… once. Never again. Tried all troubleshooting steps (VPN, changing port, changing firewall).
Sounds like you never destroy the session
I found a host migration plugin written in C++ it works really well. It will test your ability to save and load stuff however, and my project uses GAS so I've been able to transfer all the GAS over between session destroy and rehost.
I only have 2 PCs and it works fine there, I have yet to have a third person connected via steam to see what happens to a client rehosted as a client again
anyone know why this displays 0/4 players in the server browser? (before anyone says it im switching to steam subsystem this is a prototype)
I also can the listing and cannot join level despite the the on succsess firing
nvm I needed to ?listen in options
What's the right way now to disable steam when using editor builds?
I used to have steam configured in Project/Config/, and then overrode things to disable it in Saved/Config/; that way when I did a deployment I didn't accidentally disable steam, but I could toggle it through the project Saved. Now some time from 5.0 on editor launches are wiping out custom changes to Saved/Config/WindowsEditor/Engine.ini for me.
What I had before in the Saved/ engine ini was:
; append this to Saved/Config/WindowsEditor/Engine.ini to disable Steam subsystem for editor without screwing up packaged builds
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Null
[/Script/OnlineSubsystemUtils.IpNetDriver]
ConnectionTimeout=6000.0
InitialConnectTimeout=6000.0
[OnlineSubsystemSteam]
-bEnabled=true
bEnabled=false
[PacketHandlerComponents]
!Components=ClearArray
[OnlineSubsystemSteam]
bEnabled=false
and I think before UE5 it was in Saved/Config/Windows instead of Saved/Config/WindowsEditor
Hello how are you? Question: I use this method to change the speeds of my character. I was thinking of doing it with rep notify, it's more efficient, isn't it?
is this rubberbanding on client?
That will cause rubberbanding
No one had that problem before?
Neither is the answer to do a networking sprinting. If you are using cmc you need to use cpp. There is a guide by delgoodie for cmc in youtube and its very formative.
are there any special considerations for drop-in multiplayer vs a lobby where all clients get servertravel'ed at once?
What do you mean "special considerations"?
as in if you must do additional work to make it happen. currently trying to debug why my multiplayer works within the editor, but fails with deployed builds
There's a lot of work in general for multiplayer to work packaged vs in the editor. I only know how it works for dedicated servers. But to answer yeah there is additional work. If you want help I'd recommend posting specifics or like screenshots or like a lot of more details so other people in the server can help you debug.
Will do, I will probably hack it for a while to get a better idea of how to ask specific questions.
anyone here expierenced with steam subsystem, is it normal on the same machine with two instances to not be able to connect?
Need two different machines and accounts afaik
also it says my ping is 9999
You cannot test Steam on the same machine
ok good to know
Also you can't get the ping to session out of the box , it is not implemented.
noted
do you have anygood resource for a work around
The only work around is to implement it your self. There is an attempt on the internet if you scour enough.
yes I saw on the forum, there wasn't much.
at least it sorts geographically i guess
|| you changed your pic didnt you? Laura in disguise
||
She converted me to the church of Red panda
Maybe she will come back one day if we establish red panda sanctuary
Need the 🐐 back
Ohh thanks for solution. Can you share the plugins link?
Hi, im having trouble seeing my server i created on my pc from a different one. Must be a firewall issue, right? because it works within the editor
these ones in gamemode. IsSus bool in third person bp.
this is in thirdperson bp
this one gameuı
I randomly select the killer among 4 people and when I print it in third person character, it gives 3 false 1 true, but when I write it on the screen with ui, it writes false in everyone. what is the reason for this.
is something wrong about my choosing system
is there any built in way to compensate for projectile firing lag?
i want to spawn a projectile immediately for a player with high ping
i want to learn client authoritative multiplayer how do i accomplish this?
basically from my understanding the server no longer will check if you're in the right place, or check if you have ammo or health, it's up to the client
Even tho it's written in C++ the whole plugin is designed to be used entirely in BP. I struggled with getting it to work properly when I was trying to implement it in C++
It's rather easy to set the basics up, and then it comes with a bunch of util functions for polish design with it not just the basics
the author of that never heard of subsystems?
Does everyone do everything the same way you would do it?
this is a common pattern, though I don't know why you needed to rush to that plugin's defence
I don't see a reason to force user to change their GI to theirs one tho
when the author could just make a subsystem
though that single PDF does make ask questions, like how does it pick the new host? the saving is a little manual, but I get how that part works. it just makes a save game and sends the data over multiple RPCs to the new host
surprisingly tons of marketplace things force own base classes instead of making it a subsystem. maybe due to online tutorials never coverting them
but that thing may use some overrides that required from GI
I want to sort the server rows I created from top to bottom according to their pings and number of players with different buttons. I can search their names but I thought it was not enough.
ah it's just ping, but curious that it picks the host that is closest to the average ping rather than the player with the lowest ping
how can I do that
absolutely, it's so common now. this also asks you to reparent your game mode and player controller, makes me wonder if they could just be components you add to your existing GM/PC
I see. Closest to the average ping of the whole lobby so it picks the most central person instead of the person closest to the old host
This is the start transfer
So we have to use blueprints only if I use this plugin for host migration?
Oh if its possible to impliment it in c++ then how you did it?
I wouldn't recommend implementing in C++. When you reparent your GameInstance and GameMode there's specific BP only events he wrote that fire off in the right timing for everything. It needs to be done in Blueprints
He does have 2 void delegates he did make in C++ tho. HMS_PreSaveActor and HMS_PostLoadActor there are BP events inside the Migration Interface Component that you can handle BP logic when it saves data and when it loads after migration
or you can bind callbacks to the native versions if you need presave and post load native functionality
okay thanks for the info, btw does it work with any specific subsystem? like EOS or steam, or it's subsystem independent?
if the server spawns in a non replicated Level instance actor (not placed in map) and the level instance has actors marked as replicated and net load, will they spawn for clients without the actual level instance actor data being replicated?
I use advanced sessions only. The author says it can be used with any online service, but I can't confirm that I have only tried Steam Advanced Sessions and it works with that.
okayy
so its just a save system with hosting support?
a save system that can pick a new host
this part is pretty weird
and send the save state to that new host
which is just serialise it like a save game, compress the raw buffer, and send that in chunks using RPCs
it'll reload the map though since it'll have to travel
the multiplayer support for most plugins are atrocious
usually just a bunch of multicasts for data
or set replicated vars on both server/client
this one sorta makes sense but it's not as seamless as it makes out
it'd be impressive if it managed to do it without a hard travel
yea, was just speaking about plugins in general
oh yeah, I'm sure the BP-only slop that's regularly featured in the free for the month category is even worse
save systems made in BP is my worst nightmare
the complications people go through by not using reflection
I have a multiplayer game with a steam session. When I host a server on one client, and another client joins, the host can see the remote client move, but not the other way around. Is there something I need to do to configure the remote client to receive updates from already loaded pawns?
(for clarity, this works fine when I start 2 clients in the Listen-Server netmode in the editor. it's only when I launch two standalones and then host/join through steam)
Good day to one and all!
Who has dealt with the problem of launching the game through PIE which connects to a dedicated server? (Dedicated server is built).
Who solved this issue on Unreal Engine 5.4.2?
The problem is that when trying to connect via PIE to a dedicated server, the connection between the client and the server is broken (kicks the player).
If you build the client part, then connection to the dedicated server without problems.
Or if I disable replication of some moments, it connects via PIE to the dedicated server (built dedicated server) without problems.
anybody?!
What if you try it with 2 standalone games?
So just uproject file rightclick launch game
You shouldn't connect with PIE to a built dedicated server
Package the client or at least only use standalone
I actually figured it out. It was due to some weird stuff I was doing to have a client-authoritative pawn. It worked fine with a dedicated server, but not on a hosting client.
Do I have to collect the client part every time to check? This process will be difficult
in PIE I`m use Standalone
You usually test PIE dedicated server by just setting it to Play as Client
If you package the server you should also package the client
Absolutely, but I have a DSS plugin that does not allow this feature to be tested as a Client
On version 5.3.2 I had Unreal editor crashing, in 5.4.2 kicks the player without crashing the editor )
The test runs on a clean project
what is the rep COND that reps only once and only for owner ?
i only found COND_InitialOnly whichs doesnt keep it to the owner, and COND_InitialOrOwner thats does something i dont fully want
Can you even have a non-reliable variable?
That's what I thought.
And the whole point of unreliable rpcs is that they don't get sent again until they are acknowledged. They're just lost if they get lost.
Running into a problem with client travelling
[2024.07.12-21.02.15:948][554]LogSpyderweb_EOS: Display: Client Traveling to [EOS:000203cba214457ba8dd2640935427fa:GameNetDriver:26]
[2024.07.12-21.02.15:948][554]LogSpyderweb_EOS: Display: On Join Session complete - Client Travel Successful
[2024.07.12-21.02.15:949][555]LogGlobalStatus: UEngine::Browse Started Browse: "EOS:000203cba214457ba8dd2640935427fa:GameNetDriver:26/Game/UI/Menus/MainMenu/MainMenu"
I'm trying to go to a different map, with the main menu being the default game map in the project settings
if(SessionInterface.Get()->GetResolvedConnectString(SessionName, ConnectString) && !ConnectString.IsEmpty())
{
SessionInterface->ClearOnJoinSessionCompleteDelegates(this);
if(APlayerController* controller = UGameplayStatics::GetPlayerController(this, 0))
{
UE_LOG(LogSpyderweb_EOS, Display, TEXT("Client Traveling to [%s]"), *ConnectString);
controller->ClientTravel(ConnectString, ETravelType::TRAVEL_Absolute);
UE_LOG(LogSpyderweb_EOS, Display, TEXT("On Join Session complete - Client Travel Successful"));
Here is how I'm setting the Lobby map for the Listen Server:
const FName LevelName = FName(*FPackageName::ObjectPathToPackageName(LobbyMap.ToString()));
GetWorld()->ServerTravel(LevelName.ToString() + "?listen");
I'm using a soft object ptr
I want to sort the server rows I created from top to bottom according to their pings and number of players with different buttons. I can search their names but I thought it was not enough.
how can I do that
Hey i was wondering how i could make a decent looking crouching system for true first person in the 3rd person template
Using the default crouching system is pretty weird since the camera just snaps down and adding camera lag smoonths out the movment of going down but the camera clips through the head and it just looks awful
@topaz holly when replying
I've got a replication timing issue and I'm wondering if there is a standard way of handling this. I have an inventory system. It will send a broadcast message when the inventory changes, such as an item being added or deleted.
I also have a UI element that displays the contents of the inventory. It subscribes to the broadcast.
The problem, it seems, is that the UI element is receiving the broadcast message and updating it's display before the inventory component actually replicates, which means the UI does not update to show the new contents.
What I need to be able to do is have the UI detect when the inventory has been updated. I see no Post Replication event I could hook into though. What's a good way to handle this?
How is your inventory replicated
You should be using a rep notify for this
Rep Notifies can only notify you of replication events on yourself, not on another object
Uh no?
The rep notify itself will only trigger on teh object the variable is on, but that rep notify can call other things.
Like your ui update broadcast.
Hmmm. Wait. I think I see what your mean.
Oh but wait. The reference to the inventory component is part of a UI Widget. I though UI widgets didn't exist on servers, so how could it replicate?
If you're storing your inventory in a ui widget, you're doing it wrong.
You should have complete separation from the display of data and where it is stored.
The inventory component is part of the PlayerState (or an Actor in the case of a container). The UI Widget is created with a reference to the inventory component so that it can read the inventory
Right, so the inventory component needs to have a rep notify trigger when it gets updated?
What's the problem?
But widgets don't exist on the server, so how can they have any replicated variables?
The replicated variables are not on the widget.
They are on the inventory component.
Unless the inventory component is also a widget, then see my previous message about inventory being on widgets.
Have event delegates on the component that the UI listen for
Trigger these delegates on the Rep Notifies
Ah. So I think what you are saying is the define a RepNotify on the inventory contents, then have that trigger the broadcast to notify that a change has occured. Is that what you mean?
I think so, that seems correct
OK. Let me go try that.
Just make sure the UI subscribes to the inventory event, not the component triggering a ui event.
Thank you both. That works. And I hadn't even thought about manually unsubscribing. wouldn't that automatically happen when the UI Widget is destroyed? It is not permanently kept around
Yes
Thank you again.
I love how programming works. I thought to myself "I'll make my first serious project something simple, like an inventory component." The actual inventory management took very little time. The vast majority of what I've done for it is learning replication and UI stuff to build a test environment. 😄
Working with data is typically fairly straight forward. Representing that data in a meaningful way... Much more difficult in my opinion XD
I think I'll learn Z-Machine coding and stick with text based interactive fiction games. Much simipler. 😉
Who's ready for Zork 2024: Return to the Great Underground Empire?
idk where to ask
what happens to assets on a server build? Like say I had a subsystem that would load me a bunch of primary data assets and inside it had a mesh reference that wasnt a soft pointer (intentional) would these meshes also be loaded on a server and eat up ram?
or does the asset manager have some kind of check if headless to not waste resources loading them
I'm having the weirdest bug of my life, I couldn't find any mentions of it online, for some reason on both PIE (as client) and rarely in game (When certain people host listen servers), upon spawning the player, it's as if you only half posses it, you can look around somewhat, however there's no pawn control rotation, you can't move, and your movement component does nothing, yet it registers some inputs as you can see by the camera shake which is tied to the input value of the movement inputs, this issue has been happening on and off for a few months and I've tried everything, I've made new gamemodes, made new player characters, I've used the default player on a basic gamemode with no function, I've migrated the code to a new project, used new maps, everything, but for some reason this keeps happening, I can't figure out the cause but any help would be appreciated as I have very little time to solve it, thanks in advance
Meshes would be loaded, up to you to handle code in a way that prevents that for dedis
hi guys
i have this api from GPT :
curl https: //api.openai.com/v1/audio/translation
-H "Authorization: Bearer $OPENAI_API_KEY"
-H "Content-Type: multipart/form-data"
-F file="@/path/to/file/german.m4a"
-F model="whisper-1"
when i request to server . i got error massage "can't pars multipart from data"
so what i have to do ?
That's not really a question for here
Hi, does anyone know what the problem might be? Every time I try to run the listen server in the editor, it crashes with this error:
LogWindows: Error: appError called: Assertion failed: InstanceIndex < GetMaxInstanceIndex() [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Public\InstanceDataSceneProxy.h] [Line: 48]
How do I deal with replication of an actor to a joining client happening before the actors components are initialized? The actor has a widget component that should update it's texts from the replicated properties, but when the replication happens, GetWidget() still returns a nullptr.
Why doesn't your widget initialise based on the existing values? Looking at the source of WidgetComponent, the widget is created in BeginPlay
so at that point you'll have any replicated vars in the initial bunch
and then OnReps should fire delegates for updates
OnReps for variables received in the initial bunch will fire before BeginPlay
I see, I only have the OnRep updates right now. So in BeginPlay of the component I also need to update the values once. Somehow I thought that would be covered with the OnRep 😅
why is it that way round?
Rep notifies can fire before BeginPlay if you're unlucky
yes, mentioned here
woops
Yeah, didn't know that yet, thanks!
but yeah, in general I wouldn't have gameplay actors or components have a direct dependency on the UI, usually it's the other way round, and even further you have MVVM in the engine now
(but it's experimental)
Hello, everyone! I'm trying to implement online multiplayer with EOS since before our game only worked with LAN connections. Can NULL and EOS be active in the Plugins at the same time? Is there a problem with that?
why doesnt component collision automatically replicate when set on server?
is it the only property with this quality?
if not, how can i find out what properties do and dont replicate
Hey, since today I got a warning after test with 2 players (play as listen server) "Not enough login credentials to launch all PIE instances, change editor settings" all seems to work bit its annoying
I'm still running into the problem with the client travel to the lobby menu
FString ResolvedString;
SessionInterface->GetResolvedConnectString(SearchResult, NAME_GamePort, ResolvedString);
UE_LOG(LogSpyderweb_EOS, Warning, TEXT("Resolved Connect String [%s]"), *ResolvedString);
if(IsValid(GetWorld()->GetFirstPlayerController()))
{
GetWorld()->GetFirstPlayerController()->ClientTravel(ResolvedString, TRAVEL_Absolute);
}
It's returning to the Game Default Map
I've tried it with the other overload:
FString ResolvedString;
SessionInterface->GetResolvedConnectString(SessionName, ResolvedString);
UE_LOG(LogSpyderweb_EOS, Warning, TEXT("Resolved Connect String [%s]"), *ResolvedString);
if(IsValid(GetWorld()->GetFirstPlayerController()))
{
GetWorld()->GetFirstPlayerController()->ClientTravel(ResolvedString, TRAVEL_Absolute);
}
It's still getting the default map:
[2024.07.13-15.23.16:415][331]LogSpyderweb_EOS: Warning: Resolved Connect String [EOS:00023cd3814d420c891eae915d39e8d4:GameNetDriver:26]
[2024.07.13-15.23.16:415][332]LogGlobalStatus: UEngine::Browse Started Browse: "EOS:00023cd3814d420c891eae915d39e8d4:GameNetDriver:26/Game/UI/Menus/MainMenu/MainMenu"
I've tried to disable seamless travelling as well, but that hasn't worked either
If I'm calling a NetMulticast that sends 1 Param through is it better for bandwidth for me to broadcast USkeletalMesh* or int32
Could it be the fact that you are getting the level URL from a Soft object Ptr? Everywhere else I've seen a server travel, I've not seen this being used
Maybe, but I didn't think that would be an issue. I've been looking through Lyra to see if I could spot how they handle it
I found this, I'll try replacing it with:
if (UAssetManager::Get().GetPrimaryAssetData(MapID, /*out*/ MapAssetData))
{
return MapAssetData.PackageName.ToString();
Profile it, see how it scales up. Only way to tell for sure
a game to be played with P2P lobbies. It will be released on Steam and Epic Games. It will support crossplay. Online services, online subsystem ...plus. EOS, EOSSG, etc., what exactly do I need to use, I'm drowning in the documents. Could you please provide a recommendation or a page that explains it well?
does anyone know why this setup doesn't replicate movement? the client simulates and moves, the "server" location moves with the client and tracks well. But none of it is replicated on other screens 🤔
where is this being called? and is it being called from the server prior to the multicast?
I can't believe I'm struggling so hard with saving and loading data on clients off a savegame object
My game saves and works wonderfully on the server but any actions the clients take it just doesn't work idk bro sometimes this is just dumb
What savegame data do you need on a client?
A local variable that really only matters on the player
it rolls through UI on clients and saves to disk since I'm not dedicated server
The saving and loading system works if you're a lobby host and return as another host
anything you do on client save or load to disk is not working properly
I almost had it solved yesterday but I lost it when I changed too many things at once
Should work fine. But that depends on what it's for and if something is overwriting it due to networking.
I am having an issue with Steam lobbies with the packaged game - when I package as development, steam works as intended. But it doesn't work when I package for Shipping. Is this because I'm using the steam development app ID (480)?
You're a godsend you fixed my issue. The only place my network does anything with the savegame system is on clients in my host migration system. I put in my savegame my map I want to save only if locally controlled on the save function and it works perfectly now. Host or client join midgame whatever the data all saves and loads now
You're a genius my friend

It's impossible to test more than 1 machine savegame objects because you only have 1 save file on your disk it doesn't make multiple save files for editor testing
Trying to troubleshoot this from just packaging and using 2 PCs is rough sometimes especially with the savegame stuff
It's so bad I spend so much time making complicated changes everywhere and the answer the whole time was this little branch here
Anyone know if it is possible to show collision on clients, similar to the show collision command? I have some weird issue with hitboxes being desynced.
Haha. Happy it worked. 😄
@terse karma hey dude thanks for taking a look. This is inside a character blueprint. And no I don't think it is. It's turned into a bit of a mess to debug haha. But basically I don't think I've managed to get any movement on the server yet, only the client. Any help is greatly apreciated
if you want to call a multi cast event it needs to come from the server. Its not replicating most likely becasue of that. If you instead create a Run on Server RPC and then call the multicast from the server event the multicast would work. I cant say the rest of the code would work but if you place a switch has authority first then if server run event. if remote -> run on server -> multicast -> do your thing
not unless the collisions actually exist on the client
also you don't need a debug for it, there's an option in the collision component to turn on the collision for it
alternatively there is "draw debug box/sphere/etc" nodes
Ty, I saw that there was a setting for the collision component to be drawn in game. I still have the issue that overlap events are not generated for the client unless the host is looking at the actor, and I cannot figure out why. All of the overlap happens at the server, and as long as the host character is looking at the client character things work normally. However, if the host character turns around, overlaps stop registering.
can anyone help me with my respawning requirements? I'm looking to only spawn player(s) if they are dead and my round ends. I believe I am needing a way to compare the length of players to the length of alive players. Or check if any connected player has died and if so and only then respawn my players
you iterate player array in gamestate
any player that is dead should be flagged either on their PS or pawn
then you respawn those that are flagged
server only
If it's a listen server, it will run locally if you're running it on the server (because that's the "client" you're playing as)
If you're doing it on the local palyer, that is.
Just 1 player?
With 1 player on a listen server, there is no other client and nothing will ever be replicated.
When you asy "run on owning client" you are saying "run locally" because the server is also the one and only client.
i put some effort into convincing epic to get rid of that node recently 😄
GetPlayerController/Pawn[Index] is the cause of about 90% of bugs that crosswire different players
so suggestion was to replace it with GetLocalPlayerController
it really has only one good use imo
GetGameMode->GetNumPlayers->For (0 to NUmPlayers - 1)->GetPlayerController{loopIndex]->Do Something with PC
or iterating every player controller from server
its good for that
you always use a relative reference rather then a static one, if you have a choice
from Pawn, you'll use GetController, from widget GetOwningPlayer, from PlayerState GetOwner Cast to Controller... etc
hard ref is bad if you let them get out of hand
i've seen project where size map for PlayerCharacter blueprint is basically size of every asset in the game combined
but
as long as someone is playing the game, your PlayerController will be loaded
now as long as it doesn't hard reference half the project, you're fine
as far as loading goes at least, plenty of other ways to mess things up
components do help, so does the use of c++
all c++ classes are always loaded by default, so casting to the c++ base and calling a function on it will not cause the inherited BP to be loaded whenever you do that from another blueprint
you can start small
RPCs, not really
Replication Callbacks do
As someone who's doing that for a very big system, I'd recommend doing a full rewrite with a fresh project, using the lessons learned from the prototype
nope, RPCs work the same
that's repnotify maybe?
but blueprints don't have replication callbacks
repnotify runs on server in BP but not in C++
they have property changed callbacks masquerading as replication callbacks
so if you set a varaible on client locally, that has RepNotify on
why isn't that the default way to do UI?
its "replication callback" will fire
are there built-in property changed callbacks like in UPROPERTY or something?
there is something called IPropertyChangedTracker
never explored how it works under the hood, as i prefer a Setter function then rely on integrated callbacks
easier to debug that way
Yeah I was just curious why it didn't seem to be commonplace. You'd think that the ability to subscribe to an OnChanged for any variable would be a great base feature of an engine, although there's probably some serious performance reasons why you wouldn't have that as baseline.
That sort of interface does exist, but it was made for UMG MVVM (and originates from other more general MVVM frameworks)
having to do that for all properties would be bad for performance which is why you have to opt-in and write a bit of extra code to emit those notifications.
yep will do, was just making sure
@terse karma thanks a bunch I'll try this later 👍
In blueprint if you run the increment or decrement function on an integer set repnotify, that will trigger the repnotify (assuming it's run as server) correct? I expect it would, but wanted to verify since it isn't explicity stated
with BP, it will trigger RepNotify anyway
even if its run locally on client, but only for that client
Is it wasteful to have single RPC? Like:
UFUNCTION(Server, Reliable)
void ServerDoAction(int32 ActionID);
As opposed to have multiple RPCs? Like:
UFUNCTION(Server, Reliable)
void ServerDoAction1();
UFUNCTION(Server, Reliable)
void ServerDoAction2();
If I understand correctly, in the second version, the RPC header is utilized better and basically includes without additional bandwidth overhead the action ID, whereas in the first version the action ID is an additional parameter. But maybe I'm wrong, so I just wanna verify this. Thanks.
I'd probalby use a uint8 instead of int32, but sure.
You gonna have more than 256 actions?
Nah sure it's just for the example. I'd use the smallest possible int size.
Which indeed shouldn't be higher than uint8.
But still, option 1 still has more data that needs to be sent, or am I wrong?
By a single byte, sure.
(that's nothing)
You would hope, at least, it's not sending parameters by name, but encoding them in the minimum space possible.
Yeah I just wondered why GAS chose to take approach 1 to activate abilities, but I guess that it's still better than replicating each ability.
Option 1 is also a lot more extensible. You can have anything send any action without relying on the PC, for instance, to add a method for it.
Yes that can be good
And one more question if you don't mind. I tend to go split my character/player state code into multiple components (5 and possibly even more soon). Almost all of them have replicated stuff, both RPCs and replicated properties, so they are replicated. Is it terribly wasteful bandwidth wise?
Can anybody help me about it
I do hear that component replication is bad because it relies on the actor channel and takes extra data to make the distinction that it comes from a component.
But I don't know the specifics.
As as it's not sending reliable rpcs 5 times a tick, you're probably okay.
Thank you for all your help! I will consider going for a more monolithic character class and remove some stuff.
We're experimenting with unreliable rpcs. It's quite fun writing a probalby useless system for it 😄
With how much Unreal brings to the table it really is hard to make a system that isn't useless
Heh. The opposite really. There's probably a system which is already better!
Or a plugin on the marketplace or whatever.
I would say that the benefits from using components and modular logic are greater than the drawbacks on the networking
It depends on how they're used.
I wouldn't want to spam unreliable rpcs at the server from a component (for view orientation updates, etc)
Hi there, so im having a small issue here which i don't know what is the best way to get over it
so what i have is in the game state i create my tribe map to store all the tribes info
and that is being set on the server and the issue i found is if the players gonna search on that tribe they need to restart there clients to be able to see it / know about it
so here is my question
is it okay to do a multicast in this case as there is no repnotify for maps or what is the best approach to it
here is a video with the issue incase i wasn't clear in my post
i think the multicast is not the best thing here as i would need to do so with every event i set the tribe map inside it
so is there a way get the tribe map to be shared on both the client and server whenever its updated
I'm doing a launch mechanic (launch character; client locally execute launch and then Server RPC that executes the the launch in the server) with the basic CMC. The issue here is that I get so many corrections with a minimum amount of lag (even with average).
Is out there anyway to solve this?
I think an issue is the forward vector is going to be slightly different so the movement component on the server would be likely to correct. Try sending the client forward vector through to the server RPC and pass that as a param into the launch function?
Idk in the end just usually when I'm doing vectors predicted I send those through to the server from the client
does the epic online subsystem have a similar thing to the steam dev app id (480) that anyone can use?
It does still happening, i think is because the little lag causes different entry points of displacement
My jump pad is replicated just fine when I launch ... I don't call an RPC for it tho now that I look at this
I have just a small launch pad mesh with an overlap box on it, the overlap event is bound on server and clients and it launches me perfectly around my map how I have it set up
I dont understand why then
Did you test it with 200 pak loss?
No I haven't
I can do that later tho I haven't tested much of my game with more than 50ms honestly
I think its thje speed, am just testing anormal movement with high speed and jumping causes corrections too
Here without launch
The CMC has built in prediction of movement. If you end up doing something on the server, the client won't be in the right position and the server will then have to correct it.
The way to do this is either stop using the CMC and build your own movement system/component or learn how the CMC works and build in the move you're attempting to do within the CMC so it gets properly client predicted.
It won't be functional within blueprints alone if you're wanting to still use the CMC. It must be done within C++.
A custom movement will have to include all the movement prediction and compensations... I though LaunchCharacter was a dedicated Character function to work with CMC somehow 😦
It is, but you can only execute it on the server. You can't execute it locally on the client first.
And you'd probably still end up with some corrections.
In this point, would be mad to just go for client authoritative position and let it be? How "easy" is to hack such system with client authoritative?
All one would have to do is spoof an RPC and they can basically move anywhere on the map.
I feel like I'm gonna do my best to anti cheat this but if people are gonna use cheat engines to hack it all you can't stop everything
In multiplayer it's a little different - you can allow clients to cheat locally, but that doesn't mean it actually has to modify the actual state of the game that the server has authority over.
eg. They can set their health to 50000, but the server is the one that knows their health is only 100.
You can stop anything that the server is in control of.
Crap
Though I've read in forums that cars in Fornite uses client authoritative and anticheats in the server because of physics complexity for example
"Wall hacks" for example - the reason this works on a lot of games is because the location information of all the players nearby are usually sent to everyone. So someone is able to read the locations in memory and then place overlay images to point out those locations. To fix this, you can make it so the server only sends the locations of enemies players that are actually within view of the player. Now the person doesn't have the information so they have no idea where the other players are.
So this is a matter of competitive games
For example, GTA is so damn broken in hacks because of this issue?
GTA is broken like this because they allow the clients to do too much to the game state.
The very first online game of GTA5 I entered, I all of a sudden unlocked a whole bunch of "findables" or whatever you wanna call them, basically levelling me up instantly to 20.... And that's probably because they allow clients to send an RPC indicating that player X picked up item Y.
Do you recommend spending time in learning CMC and doing all the hassle for this? I've checked some of the code out there, but honestly, seems so damn coupled and complicated that I thought to skip it
Yea but such things conflicts with things like "you cannot save your game locally, it needs a server that checks that you actually did all the valid steps to achieving something, which implies constant server connection and database"
I'm not sure if it's P2P or Client-Server either which plays a big role... If it's P2P then all rules are out the window.
"seems so damn coupled and complicated". It is 
Mover is a better approach to this? Or is still quite new?
It's too new imo, there's like 0 documentation
whereas I'd say CMC is like 10% documented
Such an advantage hahahaha
yes but the community has a lot more information on CMC so it get's bonus points
The trouble is, if you're going to make your own movement component and you want client prediction like this CMC already has, along with all of its features to help with making movement realistic (gravity, friction, acceleration, etc.) then be prepared to make something as large as, if not larger, than the CMC.
I'm pretty sure almost no one knows how mover 2.0 works here yet at a confident level
And from what I keep hearing, it's not ready for prime time yet either <_<
I had lots of issues with it stuttering in a multiplayer test I did a few weeks ago
Thank you for the info!
Hi, why is auto possess player not automatic even i already changed it? When I press play every player's possess is Player 0
Hey I'm having issues with NetMulticast function not executing on clients at all, only on server. UFUNCTION(NetMulticast, Reliable) void NetMulticast_RegisterPrefabCallback(const FName PrefabName, const FPlaceableObjectInfo PrefabInfo); called from UFUNCTION(Server, Reliable) void Request_SaveAsPrefab(AActor* InGroupActor, FName PrefabName); Am I misunderstanding NetMulticast? I'm calling it from an actor component attached to the player character, both component and character are replicated but when I call the function from the server, only server executes it.
I want to send an rpc from server to all connected clients with a FName and a ustruct.
When are you calling it? Keep in mind, that if you are calling an RPC immeditaely after spawning an Actor, it may not have been created on the Client before the RPC arrives.
Both actors exist when calling the RPC. On Button press from Client 0 I call Request_SaveAsPrefab and inside that I call NetMulticast_RegisterPrefabCallback, hoping the netmulticast function would execute on client0 and client 1
Tried doing it from blueprints and same result
Does the output log mention anything?
Did you forget to call Super in a function like BeginPlay or something like that?
Can somebody tell me if this is a silly approach in terms of security:
I need to pass a variable (EntityId) from Dedicated Server A to Dedicated Server B. I do not want the client to be able to mess with that var
I just realized that I can have the sever open ip:port against a player controller.
So would I be able to attach EntityId as a parameter on that server-side console command; then read that parameter on the receiving server without the client knowing about it?
Just use Beacons, form a connection between the 2 servers. The Clients would have no way of interacting with that in any form.
Alternatively you can just setup a traditional Socket connection
Beacons sound interesting; my limitation is BP but I see some plugins.
Going to consider beacons for future, but I feel that that'll conflate my scope quite a bit. I'm in PlayFab for hosting and I don't quite understand their port management system.
In the interest of simplicity, would it be semi-safe to pass EntityId as a connection parameter; if the open command is initiated server-side. Or am I misunderstanding that command?
Thinking of implementing player sprinting and such and went looking through Lyras code (very confusing LOL)
Is Lyra using gameplay tags for character movement replication for things like sprinting, crouching, etc? Or are these purely client-sided?
I doubt that works how you are thinking.
It sounds like you might want to save that ID off into an external database and have the new Server read it in.
If you are limited to BP, these types of things become very difficult
A perfect example of why BP only projects are never a good idea in multiplayer.
Is there a way to trigger an event when all connected players have loaded the map after server travel? I can’t do anything like checking the length of the player array because there might be any number of players.
Do you mean, one event? Or events for each Player?
one event to take everyone out of spectate mode and possess their characters at the same time
There is no single event that triggers when ALL Players are "ready".
Since Players connect at different times
How do you expect that to work exactly?
You would need to implement that yourself.
they would all already be connected to the server, but will load the map at different speeds. I’m just wondering if there’s any way to know when all clients have finished loading after the server changes maps. Just trying to figure out the best way to get a fair start to a match.
There are events for when an individual Player finishes loading.
Typically BeginPlay in the GameState is a good place to start.
Its on you to figure out when "all" players have loaded.
Since that is arbitrary
Thank you!
Does UE have smooth position rollbacks?
I just enabled network emulation, set it to bad, and started running around. It's rolling back the player location, but it does it in such a janky way
Just straight up teleports the player rather than lerping to where they should be
are you aware of how bad "bad" network emulation actually is relative to the average game connection?
that much packet loss is extreme
yes it will exceed the built in limits for character distances from the server and force corrections
you can try tweaking network smoothing settings if you like but "bad" network emulation is more for testing if things still... work at all
rather than being a smooth experience
UCharacterMovementComponent::SmoothCorrection might be a hint, I'm not sure exactly how it handles extreme positional corrections on an autonomous proxy
ah that's just for sim proxies
Is that like this stuff?
There are also some tweakable params for thresholds of how far a client can be "off" before it corrects
yep that stuff
those are the params
he was mention the func
appears to be done in ClientAdjustPosition_Implementation
Ah alrighty ty
Is there are a visualization tool for this stuff?
Sweet yeah, that's working well thanks. Feels like that distance should get increased a bit.
Just tested with AD spamming and the characters sometimes teleporting.
Guessing the red outline == no smooth or ssomething
Sorta related, so..
I've got this code right for the player character, binding actions and whatnot.
Given the character has replication to true, would I be wanting to test for authority here?
Or rather, the role**
So does UE auto-handle setupinputcomponent/beginplay/etc in regards to the actor role, or do need to manually check "if is autonomous proxy" "if is simulated proxy"?
uh, it depends
the player controller only exists on authority and the owning player
beginplay runs for everyone
you can just breakpoint and see where it gets called by watching {,,UnrealEditor-Engine.dll}GPlayInEditorContextString
So inside of the begin play here, before casting the controller, i'd probably just wanna check the role of the actor right..?
Cus it's doing a cast and trying to bind the mapping context. But that, and binding actions seems irrelevant for simulated actors on a client i would think.
(im just assuming that when a character is simulated, UE is just setting the position/velocity/rotation)
casting to something that is null is fine, that's even an indicator that unreal uses to figure out if the pawn is locally authorative etc
IsLocallyControlled etc is probably what you want
i need other actors in my world to react to changes in the playerstate. I want the actors to bind to events happening in the playerstate to accomplish this. What is the best way to know that a new player joined the lobby and thus their playerstate is initialized for the actors to bind to its events?
I know there is onpostlogin in gamemode but that is only on the server and not the client. I could send an event to gamestate from gamemode which clients could receive but i feel like that would be subject to race conditions because it would happen right when the client joins
what is the most elegant solution to this? I couldnt find anything on the actor lifecycle docs about this
BeginPlay in the PlayerState would be fine
Have the PlayerState call a function on the GameState which notifies of their presence. Actors can then freely bind to an event on the GameState
yes that seems like a great way to do this, thanks!
ooh right yeah, you said controller wouldn't be valid on simulated entities so it's not even gonna bind anyways. Thank you
once the actors learn that a new playerstate is initialized from the gamestate, they could bind to the playerstate itself as well through gamestate event too right? that way i can keep playerstate related code in playerstate
Sure, however you want to do it, the key is that the PlayerState notifies the GameState that it came into existence.
Seen UE has a bunch of different networking plugins, are any of these worth using..?
I've tried to find out info on NP but there's not much from epic directly. Iris docs say it might not be effective for smaller player counts.
Best to just leave plugins how they are, until you come across a particular problem you are trying to solve.
Dont go randomly enabling plugins because you think you might need them
Really the main thing is just that horrible TP that occurs at high ping.
Can just increase the no-smooth distance but I worry that might introduce some unforseen consequences
Why are you so concerned about that? Are you really expecting that the majority of your players will be playing with high ping and therefore that smoothness is needed? Sounds like you have a different problem if thats the case.
Do you even have an audience?
Why focus on a feature improvement at this stage that likely no one will even notice.
Focus on building a game people want to play
Instead of obsessing over tiny details
Well, not everyone has a great internet connection. I play games like OW and my ping* sometimes randomly shoots into the hundreds, usually for a few seconds.
That game handles it really well. I get it's not the most pressing feature, but with networking in particular, it's sort of something that needs to be planned out early on
could be present on a listen server though
as it is a player that is the authority as well
So if this current code ran on the host client in P2P, it could actually get the controller? As their client is also acting as the server?
I'll add in IsLocallyControlled then thanks
P2P in unreal?
a listen server is still a server, p2p implies neither is the authority
everything replicated goes through the server
clients don't talk to one another
There is no such thing as a "Host Client".
In Unreal.
A Listen Server is a Server, its literally in the name.
The Host is the Server.
It is not a Client.
Just because they have a graphical interface doesnt make them a Client.
Think I've just got my terminology wrong, I'm thinking host client == with 5 players, 1 of those players client acts as the server.
that's listen server right..?
Yes, stop referring to it as a Client.
Its not a Client acting as a Server
It is the Server, its not acting as anything.
how much ping/packetloss are you emulating and what type of game is it?
Im currently testing it with these settings, and it's a 4 player Co-op first person project
That packetloss value is astronomical
At most you should only test with like 1
Also, it should only really be tested to verify that your game can recover into an acceptable state
Real world, you are never going to have consistent packet loss
Okay thank you, i'll drop that down. Wasn't sure what a good avg percentage for it was, UE has it defaulted to 5.
Really just aiming to test the latency as that's something I feel can be a lot more variable
Yeah well even a latency that high is a bit rediculous
Is this round trip or just client -> server?
:O Oh my gosh, I know its experimental, but I tried SirKai's modified mover/network prediction plugin repo, it's incredible!!
No severe teleporting issues with the default movement component, AND it doesn't have the jitter from the base mover plugin.
Even with these settings it's really, really smooth. Sure there's latency, but the client sure doesn't feel like its bad
bro is it possible to make a match making system like pubg, fortnite but by using listen server? Like and find some amount of player for match and make one player host
Yes i guess so.
Hi, I think I'm doing something really stupid here but I seem to be unable to get the NetDriverDefinitions working with my own Driver, or any other driver really. Using 5.4.2 here, has anything changed there from previous version?
If I change the lines in BaseEngine.ini, it works fine. But in my project's DefaultEngine.ini it just seems to be completely ignored.
Using cmd line args also works, e.g. -NetDriverOverrides=DisplayClusterReplication.DisplayClusterNetDriver
Might be worth sharing what you actually wrote into the ini file.
I've tried a few variations, but the main part just comes from nDisplay itself, which writes it automatically. This one e.g. does not work:
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/DisplayClusterReplication.DisplayClusterNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName=DemoNetDriver,DriverClassName=/Script/Engine.DemoNetDriver,DriverClassNameFallback=/Script/Engine.DemoNetDriver)
Even the variation copied directly from BaseEngine does not seem to be read correctly. Even tried it on a blank project and everything, I'm quite sure I'm just absolutely blind and it's something completely obvious
Hello guys, a question, I am trying to achieve a mini mmorpg with the unreal server, what language do you recommend to request the account data from the database to the client? I still have doubts about PHP, I think it is not recommended. The idea is to make several APIs so that they return the server address, corroborate account data, and also return exp, inventory, etc... thank you very much
There are several "web service" type languages. I guess what a lot of peeps do is use TypeScript for example. Not sure what the most common way is, but I would probably start with that. There might also be options like "go". But I only ever wrote these APIs that communicate with the Database in TypeScript.
You'll notice that 10 people will tell you how 10 different languages and frameworks are better than the other 9.
That's why you need to come up with an 11th language that unifies the good points of the others!
/xkcd
Hey gamers, I've got a Board that consists of Grids made up of Tiles, which can host CombatUnits. From the GameMode, I have the server setting up a Board for each player with variously positioned CombatUnits. The player can then pick up and move the CombatUnits to a different Tile (which happens only for the autonomous proxy). Once time runs out, the next phase begins and the units are given AI, which puts them back to their original positions before beginning combat. Ideally, the updated unit position would be seen even when done by a simulated proxy, and the unit position would persist through the combat phase.
The CombatUnits, their reference to their Tile and vice-versa are all replicated, as is the hierarchy from Tile through Board. There's clearly something I'm having trouble wrapping my head around
Hi all, so I'm new to making multiplayer games and I wanted to test out how to do splitscreen multiplayer before diving into development, how can I go about all players having a gamepad instead of it being one person on mouse and keyboard and the rest on controllers? I'm using the third person template without any changes btw
Any ideas why REPNOTIFY_Always doesnt call OnRep functions on client ?
Did you call it on the server?
Call what ?
oh theyre back. or maybe not, idk. Thought for sure cat had the same pfp
What is the way that I can make the players automatically join and see each other in the session with the create and find and join sessions?
now they find the same session ID and join it, but they don't see each other
I need to do the extra step of traveling with the ip address
Is there a way to replicate timers started through the world timer manager?
I have stored the player controller in an array on Gamemode with OnPostLogin event. But now I have no Idea how am I going to know that which index shoud I use to access the player controller I want to use!
I am new to mulitplayer I'll really apreciate your help. Thankyou
Sessions and actually connecting to the Server are two different things.
Which gets confusing if devs throw both topics into one question :P
You usually wouldn't need the array or rather the index.
The way to handle this is to ensure that you always have "relative" or "context-based" information
It's a bit depending on what you are doing, so I can only give you a generic example.
E.g. if you handle Damage in your Character Blueprint, on the Server, and the Character dies and needs to be respawned via the GameMode, you can call "GetController", on the Character, to get the "relative" controller (given you haven't unpossessed the Character yet).
It seems there is a problem with client traveling to the server after finding the session
What Subsystem are you using?
Your on rep function(s)
what happens if a replicate a TMap through a structs NetSerialize function? just Ar << MyMap, I know it is going to atomic replicate the entire map every time but I only intend for it be an initial only payload so it doesnt matter about atomic replication. Does it work fine and can I rely on the key being the same on both ends?
Depends what it's keyed with
Not 100% sure you can just << but it might work
Keep in mind if you do it won't call NetSerialize on the internal properties
what do you mean by that?
Is long as one reflected thing changes it will run that function and serialize anything you put in there wont it?
its a map of gameplaytag to struct, the alternative is I do .Array() and send it as that and then on the other end, convert it back to a map? I jst want to make sure its valid to send a map like that, what is the issue with them anyway, just the delta serialization?
What I mean is that just using the << operator won't reach into internal NetSerialize() functions. A GameplayTag is a good example:
FGameplayTag Tag;
// Serializes tag as a string
Ar << Tag;
// Serialize tag as it's network int
Tag.NetSerialize(Ar, Map, bool);```
Yeah so in which case, you shouldn't use << Serialize the number of items in the map, then add each one individually
oh wow I had no idea about that gameplay tag, are you certain?
I would argue that you should alter your setup if it requiers you to replicate TMaps
100%
Not just tags, any struct that has it's own specialist override for NetSerialize
You can NetSerialize a TMap so long as it isn't keyed with objects, but you have to do it more manually than just <<
If only << would check if WithNetserializer and fall back to it somehow. Pretty sure it could pull the PackageMap out of the Ar somehow. And the bool is wasted anyway xD
Yeah
it makes the most sense as I need random access a lot, aside from networking its a fine call in my opinion
as I said, it only needs to happen once, is it safer to do a .Array() and serialize it that way and then reconstruct it back to a map?
Psuedo-code:
int32 Num = Map.Num();
Ar << Num;
if (Ar.IsSaving())
{
for (auto Itr = Map.CreateIterator(); Itr; ++Itr)
{
Ar.NetSerialize(Itr.Key(), Map, wah..);
Ar << Itr.Value()
}
}
else if (Ar.IsLoading())
{
for (int32 Idx = 0; Idx < Num; Idx++)
{
FGameplayTag Key = ;
FStruct Struct = {};
Ar.NetSerialize(Key, Map, wah..);
Struct << // or whatever
Map.Emplace(Key, Struct);
}
}
ok thanks
whats that pseudo for
Ar.NetSerialize(Key, Map, wah..); I just dont see that func on FArchive
Oh my bad, should be Key.NetSerialize()
ah yep, I see
off topic, do you use iterators much? I would have gone with for(auto& [tag, struct] : Map), is there any benefit to an iterator? I just ask because I might need to use them more
all the time, Iterators can do other stuff like removing the current element etc.
If it was an option I'd use index based for loops everywhere tbh but C++ constantly tries to be smart
EOS.
This mimics the problem I'm facing:
https://forums.unrealengine.com/t/eos-client-disconnect-when-join-session/651927/8