#multiplayer
1 messages · Page 655 of 1
@empty bluff think rep notify is best for that - so server/client only send/receive its state when he's acctually near by and yea as mentioned above - for performance increase you can look at 'object pooler' at unreal marketplace for reference
anyone know how I can display the status of my AWS server (online/offline) on a website or discord?
This is a UE Discord, not an AWS Discord, ask in #lounge.
Read the #rules and #more-resources channel as well please.
"everything about local and online multiplayer" I'm hosting my UE4 game on AWS, I'd say that qualifies as multiplayer related lol
so yeah was worth a try. thanks tho
ue4 encompasses a lot of things outside of ue4, in fact most of multiplayer relies on non-ue4 related applications.
Sure but you are not asking a UE question, hence it does not belong in this channel.
Please ask in #lounge.
@grizzled flicker you should be able to make an http request to your ec2 instance at a route of your choosing, perhaps an open port to your ue4 server, its basically a health check
also, I feel like that
is kind of pedantic
lol
yeah its aws but its still kind of related
🤷♂️
the genre is programming and the sub genre is multiplayer. it mentions ue4 0 times. It's also not possible to make a multiplayer game without using 3rd party programs/scripts... AWS, PHP, databases, Steam.... many many other things lol
is it possible to store and replicate AInfo* inside the GameState ?
Sure it is, AInfo is an Actor after all.
for some reason when i retrieve it as a client it is null
but when i call a rpc to retrieve it, its not null
AInfo is a good "manager" base class if you need replication support.
Is the Actor set to Replicate?
but non-pointer objects are replicated fine
AInfo is replicated by default right ?
but for the benefit of the doubt, i called SetReplicates(true) in the constructor
Have you given it the Replicated markup in the UPROP?
On the GameState?
And then also created the DOREPLIFETIME for it?
if I do SetReplicates(false) on a player's pawn (on the server), is there a way for the local player to know that the pawn is no longer being replicated to them?
Theres no event that im aware of that handles letting the Actor know its not being replicated anymore.
Its RemoteRole will have changed though.
If you look at SetReplicates you will see that it changes RemoteRole to ROLE_None when disabling Replication.
RemoteRole is a Replicated property.
If you dont want to re-enable Replication for that Actor again, you can call TearOff instead.
This will permanently destroy the ActorChannel though, it wont be able to Replicate again.
does the local player know the current RemoteRole after calling SetReplicates(False)
Well the Local Player wont be Authority so if it calls SetReplicates locally, it will just fail.
void AActor::SetReplicates(bool bInReplicates)
{
if (GetLocalRole() == ROLE_Authority)
{
const bool bNewlyReplicates = (bReplicates == false && bInReplicates == true);
// Due to SetRemoteRoleForBackwardsCompat, it's possible that bReplicates is false, but RemoteRole is something
// other than ROLE_None.
// So, we'll always set RemoteRole here regardless of whether or not bReplicates would change, to fix up that
// case.
RemoteRole = bInReplicates ? ROLE_SimulatedProxy : ROLE_None;
bReplicates = bInReplicates;
// Only call into net driver if we just started replicating changed
// This actor should already be in the Network Actors List if it was already replicating.
if (bNewlyReplicates)
{
// GetWorld will return nullptr on CDO, FYI
if (UWorld* MyWorld = GetWorld())
{
MyWorld->AddNetworkActor(this);
ForcePropertyCompare();
}
}
MARK_PROPERTY_DIRTY_FROM_NAME(AActor, RemoteRole, this);
}
else
{
UE_LOG(LogActor, Warning, TEXT("SetReplicates called on actor '%s' that is not valid for having its role modified."), *GetName());
}
}
What I mean is, if the remote role updates locally after calling SEtReplicates on the server
Yes it will
Is it not possible to replicate render targets? I'm trying to replicate a 8x8 texture generated on the server to the client but the client reads null.
Both the actor and the render target is set to replicate
And are always relevant
You can't replicate the render target itself, no. That wouldn't make sense - render targets are inherently tied to resources on the local machine.
You can take a snapshot of the render target and replicate that.
Oh that makes sense, so instad of setting the render target to replicate, if I create a variable and set its value to the render target each time it changes and replicate that would it work
a simple texture variable
@dire cradle I would suggest you don't do that
Replicate the information that is required to have a rendertarget been filled instead
So the location and rotation of whatever records to it
Sending the render target over net the whole time sounds shite
But in case you still want to do it, i assume you'd need to grab a frame from it, turn that into bytes, send the bytes manually and reconstruct the frame, probably all C++
It doesn't update in real time only when needed, it's a 8x8 grid that just displays which player owns which sector
Would it still have a large impact?
Yeah but why can't the player reconstruct that based on information of the game?
oh wait
Someone is making that image/render target already
yeah I guess that makes more sense
The others can do too
There's no reason the server needs to generate the image for each client when they should probably have the info necessary to do it themselves anyway.
Yeah, that's more or less what I wanted to say, but I haven't had my second coffee yet.
Speaking of

Now I have another problem, this repnotify function runs on both server and the client without any problems
Update Decal is called on both successfully
But Update Map Target is for some reason only gets called on the server
Map actor exists on both the client and the server and is set to replicate
I tried tying it to Run on owning client/muticast events but it still only runs on the server
I'm out of ideas with why this isnt working
nvm restarting the editor solved it
is the gamemode set correctly?
if not the game won't know which class to spawn the player as
Anyone got any ideas how to resolve this error?
NetworkFailure: NetChecksumMismatch, Error: 'GetObjectFromNetGUID: Network checksum mismatch. FullNetGUIDPath: [79]/Game/Blueprints/Player/Weapon/BP_WeaponMelee.[77]Default__BP_WeaponMelee_C, 560967494, 3906595487'
Both Server & Client are built with the same revision but it still doesn't match up for some reason.
What does that result in?
Client won't connect to dedicated server and gets kicked back to the title screen.
Are both Client and Server also build with the same Engine?
yes
Hm, not sure then. you could try to recook the project freshly in case you work iteratively
Check #packaging in case it's some standard mistake
Is this a GameMode or a GameModeBase?
Well, check the top right corner
Says ParentClass:
Hm okay, then that's fine
Asking cause you aren't allowed to mix up Base and non-Base of GameMode and GameState
Are there any errors or warnings in the log?
Might be caused by player starts or auto possesses?
I don't even use Player Starts anymore they were causing me headaches
PlayerStarts are fine. They shouldn't cause headache :P
Video looks like the client got spawned as a spectator
Check the World Outliner, do you get a different Pawn/Character?
Also MessageLog is not important
I meant the output log
Can it be that your Client is just too far in the floor and fails to spawn?
Open your Character and check for Spawn Collision Override
Set that to Always Spawn to check
If that makes them spawn then they might be too far in the floor
Just to be sure, does your level have the correct gamemode set?
yes
You need to set the level gamemode to yours
It spawned the native gamemodebase
And you probably have a character in your scene pre-placed that your Server grabbed?
Make sure you have no characters in your level that are set to auto posses
It should look something like this, set the gamemode override to your gamemode class
and this
Okay, strange that your server got one
Isn#t that exactly what I meant?
That you have the Character in your level
That wasn't about multiplayer though, gamemodes are used regardless of it's multi or singleplayer
i repped the location of the IK full-body while MultiPlayer
but now lost the Walk/Run animation from other player's view...
it won't automatically rep the Animation, right? then what should i do? Thanks!
Animation should all be running locally
You wouldn't want to replicate values for animation/IK
ok, so in my situation, how should i do that
It should derive all of them itself
Basically all animation should be handled locally, including IK. Shouldn't need any networking
so i should rep the trigger(maye a bool) to start/stop animation
right?
ok, got it
Does anyone know what the atomic specifier actually does?
I'm noticing that UE4 is merging not-yet-sent values in my replicated property with more recent packets - aka it IS breaking up the serialization
even though I used Atomic, can anyone confirm if UE4 actually does this or not? And if there's a way to disable this behavior?
I'm fairly sure it does nothing at all tbh
If you really want atomic replication, you'd need to use NetSerialize
Damn, that's impossible for me to do
Because that would disable the delta serialization I need
If it's delta serialization I don't think it can replicate atomically by definition
I expected it to only send the values that changed
But it seems to be attaching them with previous values as well
Imagine a struct { int A, int B, int C } that's a replicated property
ugh, I don't know where I was going with that example actually
Wait, yes I do
The delta serialise will still send everything you write to the archive, it just means you have to track what is/isn't written yourself though
The engines' FFastArraySerializer for e.g. sends the whole item every time
It doesn't track or identify item-specific changes
🤔
I think Atomic only works when you're using the built-in UPROPERTY based serialization
I am
USTRUCT(BlueprintType, Atomic)
struct MY_API FMyStruct
{
GENERATED_BODY()
UPROPERTY(BlueprintReadOnly, Transient)
int A;
UPROPERTY(BlueprintReadOnly, Transient)
int B;
UPROPERTY(BlueprintReadOnly, Transient)
int C;
};
if FMyStruct is a replicated UPROPERTY in my replicated class
and I change just A and C, I expected the engine to send a packet that contains just the new A and just the new C, and the old B value remains
Ah I don't think so, if you mark it as atomic - it sends everything as one lump
If you disable it, it'll only send changed properties
I.e. whatever changed at the end of the network frame
But that means then that A, B and C may not correlate to each other, right? If the engine sends say, A's value from some time ago but B and C values from a more recent packet?
for example assume my server code always makes sure that in the property, A == B == C
it could be that an arriving packet may have a case where A == B == C is false?
Only if that was the state of the struct at the end of a given frame
Here's some info from UDN:
Yes this is correct, structs and arrays are unrolled in the replayout by default. What you can do in order to treat a struct as atomic is to force it to use a custom serialzier, see FVector or FMovement for an example of how we do this.
So yeah, if you really want to garauntee the client will never have a state the server didn't have - it has to be replicated in one bulk atomically
what does 'unrolled in the replayout' mean here?
Essentially each UPROPERTY is treated as if it is a uprop of the owning object
Ohhhhhh
Just with an extra bit of info to identify it as belonging to that struct member
Got it... this makes sense, thanks a ton for the help 👍 👍
As far as I know though, actor properties are never split across multiple packets - either all changes fit into the buffer for that frame or none of them do
So if you change two properties within the same network frame, they should either both arrive at the same time or not at all
I might be wrong but I'm fairly sure that's the case.
Can't find any solid info though
Got it, I have some self exploration to do with this new info
Hi Guys, I have a weird issue. I'm new to this whole multiplayer thing but to my knowledge running on owning client should only run on the client right? But when I run this blueprint both client print the name of the object instead of the one actually overlapping it. What am I missing here?
Also the owning client runs twice, which does not happen in the standalone run
Begin overlap gets triggered on everyone, check if authority first
But the overlapping component is inside the ownling client only, why would everything get the trigger?
is it made to be like such?
Does the component get spawned client-side?
Clients can call/run "Client" functions themselves
The component is inside the player Called VisionRange. And the actors are spawned in. The items themselves are placed in the world but replicated.
Try adding has authority first before calling run on client
So the event only runs on the server and gets replicated to the owning client
Yea that worked, but I'm still confused why without it , it does not work
The components exist on every connection, and each client will overlap themselves individually.
^this
So each client is calling that client function, as well as the server calling it too
The owning client therefore gets it twice (once locally, once from RPC) - all other clients get it once (locally)
If a Client calls a Client function, it will just run locally
But since the overlap function called a run on owning client only, should it not only be called once?
Why is the RPC calling it as well
Always make sure its the server that calls the run on owning client
I see
Blueprint gets a lot of MP stuff wrong and this is just the tip of the iceberg
But it doesn't help itself tbh
Client 1 Pawn on Client 1 overlaps. Not server, can't RPC, plays function on client 1.
Client 1 Pawn on Client 2 overlaps, Not server, can't RPC, plays function on client 2.
Client 1 Pawn on Server overlaps, is Server, does not play the function locally, tells Client 1 to play function. Client 1 plays function again.
Oh dang. I see. I still have alot to learn I suppose. Thanks for all the help ^^
TL;DR if you call once of those "Client" functions on an actual network client, it will just execute locally.
If you call it from the server, it'll run on whichever network client owns it (or locally, if it's a listen server and the owner)
Ohhhh. I see.
Thats why If calling a client function always run from the server first
Okay I think I get it now.
Yeah otherwise it will run twice
There was a great tutorial I saw on youtube about rpc functions, it's really helpful to understand ue4's replication system. It's hard to get it right by trial and error
Yea it is. Thanks again!
Is it possible to OnRep a TWeakObjectPtr? Having a bit of trouble with it.
does work yeah
Er. Forgot to specify I was trying to pass in the old value as well.
Although it is somewhat useless as it has to be a UPROP anyway
For instance, the following is causing undeclared identifier compile errors.
UPROPERTY(BlueprintReadOnly, ReplicatedUsing=OnRep_MyThing) TWeakObjectPtr<MyThingType> MyThing;
UFUNCTION() void OnRep_MyThing(TWeakObjectPtr<MyThingType> OldThing);
Hmm. No luck.
why is it a weak?
🤷♂️
could it be made a normal pointer?
Hooked to too many things. Just went around it with an on rep hard pointer and set the weak pointer that's being used by everything else.
i would have just removed the weak and updated the source code
it would not have broke bp's
Might try that in a bit.
why is the try get pawn owner cast failing?
Any tips on how to fix this?
im working on a multiplayer game so getting the playercharacter wont work
as seen in this video this is exactly what he does
@stoic lake You don't fix it. See the dropdown box up next to the play button? Change that after opening PIE to an instance that isn't meant just for editor display.
Thanks it works! Not quite understanding why it works but it does :)
Hi, are RPC the only way to have reliable replication ?
A full rebuild of both the server & client seems to have fixed the checksum mismatch, thanks!
Awesome
@stoic lake An AnimInstance is an object, like any other blueprint. But instead of being a visual one, it's attached to a SkeletalMeshComponent and has helper functions to get that SkeletalMeshComponent's Pawn like TryGetPawnOwner. In the editor you just have a display instance of this open for general purpose designing. But it has no Pawn owner to retrieve there. It would similarly fail if you use TryGetPawnOwner in an Animinstance that is on a SkeletalMeshComponent of an Actor base class instead of a Pawn/Character class.
Can net cull distance squared work at the actors location, and not the camera ?
I believe by default net cull distance squared defaults to the camera and not the actor in the world
Ya that's right.. I don't think there's any easy way to change it.. but if you were real crazy you could change the source? Idk
Hey guys quick question. I have this capsule setup inside the player camera which inherits the player rotation. In the client the capsule rotates fine. But other clients are unable to see it, even though the replication is turned on. any reason for this?
You'll need to use GetBaseAimRotation
That includes the separately-replicated RemoteViewPitch
@short arrow You can override APlayerController::GetPlayerViewPoint() to provide a different location for relevancy.
Thanks you so much this worked perfectly
How do you handle a player reconnecting to a game, to synchronise all the states ?
If you set everything up properly it's done automatically
I.E; So long as stateful changes are replicated properties etc - join in progress should work just fine.
Mhh ok but if i use properties, how can i handle the fact that notify functions are called before BeginPlay on actors ?
can someone explain to me why this code is faulty? on the right side of the screen im setting the itemheld variable to true and thats it.
its for equipping and unequipping your axe
You can't, but you shouldn't rely on order of operations in MP anyway
It's inherently unreliable
Hey guys, I want to ensure certain values get replicated with an Actor on the initial bunch. The important part is that BeginPlay or any RPCs that reach the client find the right values already set.
So far, I've used deferred spawning to set the values before calling FinishSpawning. I can't do this on pre-placed actors, so I need a different alternative. These values are not set in editor time, but rather from conditions defined on the Lobby level, so setting the values on the instance in the world hierarchy is not an option.
Is there a way to set values at run time on pre-placed actors and ensure these are part of the initial replication bunch?
I have a capsule collision that the server uses to overlap foliage instances and replicates the results (everyone has the same instance) So I assume I don't need to replicate the location of the capsule collision, only the result of its overlap
Multiplayer is so confusing...
How should I structure data so that I can display a list of player names and scores? I honestly have no clue how I should be passing data like scores around
PlayerState?
GameState
PlayerState holds the score, GameState holds an Array of Players. If you want to "update" to all clients, you can do it from the GameMode. GameMode holds all PlayerControllers. GameMode only exists on Server, GameState and PlayerState is replicated
so for something more complicated like an inventory, where does that go?
Inventory for your player?
yes
Pawn or Controller
Depends on your Inventory Lifecycle
If your pawn dies (is destroyed) does your inventory needs to be cleared aswell?
If I needed a player to reveal their inventory to another player what then?
For my project I created an ActorComponent for the Inventory. The ActorComponent is in the PlayerCharacter itself
how can I pass that information to another player then?
RPC
Remote Procedure Call
A server function which tells the server (GameMode or GameState) to reveal your inventory to a specific player
sorry I'm having a hard time wrapping my head around this
I thought the players couldn't see each other
My (probably completely wrong) understanding of multiplayer was that players can only see themselves and the GM
on the client yes, but the server knows all the players (GameMode)
But you have an PlayerArray in your GameState
I was under the assumption that for security I would want stuff like inventory stored in the GM so nobody can do any funny business
so I was trying to wrap my head around matching a player in a session to an index in my array
GM is the wrong place for an PlayerInventory
I will be very happy if I'm doing that totally wrong
PlayerController would be the better solution
because its hurting my head
Other players can't access your PlayerController
Search the internet for "UE4 Network Compendium". There is a great PDF which explains all the Game Classes for Multiplayer and how the pattern works.
thats what my little understanding is from
I think its pinned in the discord somewhere too
it's pinned to this channel
Anybody here who used a datadriven approach for a multiplayer game? I'm holding my configurations for pickups, weapons etc in a PrimaryDataAsset and I'm wondering if there is a possibility for loading / unloading dataassets on server and client without having to replicate them. My DataAssets are holding data like meshes, sounds, effects etc.
can replicated variables be passed by reference
So the thing I'm trying to wrap my head around is like. If a player picks up a (replicated) item, I should be calling something on the server, then Multicasting to the clients. But I don't know what that actually looks like in blueprints, and I'm pretty sure its not as easy as just checking the "multicast" box
Client needs to call a Server Method. Then from the Server you're calling an multicast method
If you're already on the server, just call the multicast.
what does Server Method mean in this context?
like cast to the GM and call off of that?
If your calling from a client (proxyclass on the local machine) you first have to call a method on the server, because only the server knows all clients and only the server can send / execute stuff on other clients.
Then from the server you need to call a multicast method which executes a method on all clients (or the clients you need)
does the server event need to be in the GM or can it be anywhere?
in the class you want. The class needs to be on the server. Read the Network Compendium to see which class stands for what. This will probably solve some problems.
How will I know if a class is "on the server"
classes themselves aren't specified like that
you can "spawn" a class on the server only
that's how the gamemode is handled
Please have a look at the network compendium. Some classes are only in the Server (GameMode) some classes are only on the Server and owning client. Some classes are replicated to all clients
it doesn't spawn on clients, it only exists on the server.
if a class is marked as replicated, say an actor, then when it's spawned on the server, it will also be spawned on all clients.
I'm trying to cross reference, and I have read the compendium to the best of my ability. But this is a very difficult topic to understand
if you wanna know if a method is called on the server or client, use the GetLocalRole() methods etc.
networking concepts and actual application are different beasts
So essentially as long as it isn't in a widget or something I can call server events in any replicated actor?
The reason you're being told to look at the network compendium is because the answer to your question is there. See page 62 and onward: https://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
Again, I have read the compendium and am trying to cross reference it with answers from here. I'm trying to make sure I'm interpreting it right, since i can't exactly ask the network compendium to clarify
did you read page 62 (and subsequent pages)
because it answers your question
I don't know how much more clear I can be
Every Actor which is replicated has a client and a server version. Thats the reason it's replicated.
You need to check if you're currently executing code on the client or server. Then you need to call the needed methods.
so to properly multicast an event, and pass data around properly, I should be doing something like this?
Can somone show me how to execute an event ONLY server side , and another one ONLY client side
please
trust me man I'm trying my best. I'm just a bit slow in understanding programming topics
You can call a server event from a client only if the client is the owner of the actor
multicast events can only be called from the server
assuming your client owns the actor, what you posted is correct.
awesome
Similarly, client events can only be called from the server and only the owning client will receive them.
is my authority switch correct, or should it be the other way around?
so are client events kind of like return calls? Since we cant use actual return calls in an RPC?
You could use them that way, sort of as an asynchronous return. That's not really what they are though (just one way they can be used).
ah ok
I am a bit fuzzy still on how the Switch Has Authority works versus checking if a PC is local or not
namely I don't really understand why I need to check. wouldn't a server rpc just not work if the client didnt have authority? Why do we need to check first?
and when in the PC what is the difference between the two?
these two
if you were hosting a listen server, you would have authority AND be a local controller
do the two accomplish the same thing?
no
because on a dedicated as a client, you'd be remote and a local controller. the server wouldn't return true for is local for any PCs
a client doesn't know about other PCs other than their own
when is it important to check?
depends what you're doing
authority is basically "am I the server?"
and local just checks if we're two connections from the same machine as the server?
is local controller is asking if you are the controlling client of a specific player controller
so I guess its important for casting?
?
when would I use that?
on a dedicated server, AI controllers would return true for IsLocalController(), player controllers would return false.
on a listen server, the host's player controller and AI controllers would return true, all others would return false
like I said before: depends
and how would I allow remote players to make server calls when needed?
or is that bad practice
remote players can always call server RPCs via their player controller
you can call server RPCs on any actor as long as you're the owner
so I should use Switch Has Authority if I want to skip calling the Server RPC on a listen server?
switch has authority is pretty much pointless in a server RPC regardless of setup
what is the intended use of the node then?
for telling you if you're the server or not outside of the context of RPCs
one exception might be for multicasts where you might want to skip something that's already been run on the server
but it's networking, it can be complicated. our source is scattered with HasAuthority() or checks against Role
ok well I think I have enough to go and start testing things out (and converting bad blueprints to nice multiplayer ones)
thanks everyone for the help
I don't have as much patience for doing networking in BP, usually prefer to do it in code
the flowcharts help me read personally
I also dont really understand C++ syntax so it would be another layer on someone who is already sketchy with programming, lol
No one? i'm stuck.
With a condition where you check if you are on the server (IsServer()) or checking authority
i have also tried to replace the "is server branch" by switch has authority
same result
the Client side event is called two times
i want it to be called one time
Throw in a Do Once node!
Good idea thanks , but i want to know how it works because in the future i don't want replicated events to be called two times
I would ask to see more, and I don’t know what context this is in. Is it an actor?
And is there only one instance of that actor in the world if it indeed is one
Is that the only reference to that function too?
How are you testing it? Single client in play as client mode?
I'm making a turned based multiplayer game. When I click on AI character units I want a way of communicating to the HUD that some are ally units and others are enemy.
GameMode has the information on the spawned units (and is all server side)
I've been banging my head against google to find a bridge between GameMode and client PlayerController. I need to somehow either give each unit a reference to the PlayerController or give a Team reference to PlayerController to compare when displaying the HUD.
The only standard suggestion that I've been able to find is using GameState to get access to PlayerController when in GameMode. That hasn't worked
Please someone put me out of my multiple hours long misery
Why dont the AI Units themselves know what Team they belong to?
What is a "Team" to you?
For example you could simply store a Team as an ID.
uint8 TeamId
That gives you 256 Teams
The units know, but the PlayerController doesn't
Well if the Unit exists, then the PlayerController can just iterate over them and find all of their Teams.
The Unit is an Actor, the HUD itself could find their Team.
By querying the Actor that is the Unit?
How do I give the PlayerController (which is what triggers the change in HUD from unit to unit) a Team?
Without a Team the PlayerController doesn't know if it is the same as any of the units
Depends on how you have implemented your Teams.
If it was an ID, like i posted above. Just let the PlayerState hold onto it.
Team is an object that contains an array of units
(among other things)
But since the Teams are on the GameMode how can I communicate it to the client side PlayerController?
Well for one I wouldnt let the GameMode hang onto Teams.
GameState or a dedicated manager Actor should deal with the Teams.
So that all Players have access to query them.
@lost inlet These events are in the BP_inventory which is contained by the BP_character , there is only one instance of this actor ( i have verified with get all actors of class ) , yes it is the only one reference to that event i have verified , And i am testing it With separate server and run under one process with two clients.
So you gave 2 characters and wonder why it’s running twice? Hmmm
No , there is only one character because i connect the first client to the Server world ( not the second) and the character is spawned at the beginplay of the gamestate
and i don't connect the second client online ( for testing)
I can try moving that logic around in that way. The game all works as it is right now, which makes me nervous of making large changes in structure. Is the consensus that communicating from the GameMode to the client PlayerController is either not possible or too stupid?
What’s the point of the second client at all then?
Its not impossible, but there is just a clear design issue with how you want to use your Team system and how you have implemented it.
Seems a weird technical design at any rate, how’s the game state doing all of this?
Dont be afraid to refactor systems. Especially those that have issues.
I mean gamemode sorry mistake
here the character is spawned and possessed
and in this character , the inventory is spawned server side and replicated
Uh the client is authoritative over spawning their own inventory?
Someone here said me everything have to be spawned server side , and automatically replicated
Looks like you got bad advice. Why wouldn’t the server just spawn it without an RPC?
No idea why it isn’t just a component
You only need to spawn an actor server side if you want other clients to see it.
so i should spawn it at begin play , beginplay will execute on both server and client
Otherwise, you can spawn it just for the owning client, from the server
yes, you can just check the role of the actor in begin play, and only spawn it if the actor has authority
if it's marked as replicated, then the clients will also get it after it's been spawned
Well if it was a component you can just add as a component of your pawn class, no spawning code needed
As a Object reference variable?
? I mean just as a component
In the pawn BP you can add a component from the top left
Components can also replicate
The inventory is BP clASS
And?
cannot add a BP object as a component , need to spawn it and promote to variable
???
No, you can make a BP class derived off of ActorComponent and you can add that to your character BP without having to spawn a whole other actor
Much easier than it being a separate actor you have to manually spawn in a questionable manner
how do i call an RPC from server for owning client only ? in C++
did you read the compendium?
no
if you're already on server, just have a given object call a UFUNCTION(Client) void Function() method
but yeah, read the compendium thingy
does it have C++ ?
it gives you a primer on basic networking stuff in BP and C++
😮
even though it calls it "UE++" which I hate
still pretty accurate imo
UE's flavor of C++ is not normal C++
you don't need to worry about a lot of things you normally do
i'll read it, thank you
it literally is, there are definitely other projects that use macros and code generation
i sign it
Whenever I hear UE C++ or UE++ something dies inside me
Only special things are macros but other projects have it as well (UE has the header tool which is the only non standard thing)
If I made my own GC system in non ue project using C++ it doesn't automatically turn it into BlueMan++, it's still plain old C++
That said, BlueMan++ when?
👀
I suppose most people would use some kind of scripting with libclang, I wonder why Epic rolled their own parser
but off topic
UE technically relies on some UB in places
plus the codegen is special
True, stuff like UClass are generated with the help of the UE specific build tools, and linking properties and reflection, etc...
And things like generating stuff for blueprint functions, etc...
But that's still not something that's impossible without UBT/UHT
It would still be possible with some heavy boilerplate code so I would still consider it being plain old C++
With UE specific helpers
well, also, UPROPERTY pointers can be made nullptr
thats very hard to do in iso cpp
😅
Banned
hey guys i have a problem
when i enter splitscreen, i dont see the other character on both screens ?
That's not Splitscreen?
That doesn't even look like you started it with a proper netmode
Select "Play as Listen Server" or "Play as Client" depending on what you want
Hello! I am confused with how to get playercount from steam advanced sessions
This logic doesn’t work
@mellow stag Haven't used the plugin personally, but it looks like it should work. How are you testing?
I have 2 functions here. One is C++, the other is in Blueprints
From my experience this should be exactly the same. However, when I call them on a client they only work for blueprints.
The C++ is unable to be called and multicasted from clients.
Why is the C++ not working?
does the animation blueprint run on the client or the server?
Sorry didnt mean it as an answer on your question
just a question for myself
My mistake 😆
I have a map that can be played by 2 players. How do I switch to a single player mode where the second player is a bot? I still wanna host on server for spectators.
How bad is to have thousands of always relevant replicated actors in my level?
Most likely unplayable
sounds pretty bad esp for your server cpu and bandwidth overall. Normally, the relevancy is removed or reduced by distance from what I have observed
Thousands of always-relevant actors will likely be unplayable. Why would you have that many in the first place though?
Fortnite has it, but they make heavy use of dormancy to support it.
It seems like my pawns never get destroyed when they go out of net cull distance. Is there some sort of setting I might have inadvertently changed to produce this behaviour? They stay frozen in the spot where they were last relevant.
If it's replication graph, you don't get the destroy packets until you go back into range IIRC
It changes the way it deals with that
Seem to remember seeing something like that anyway
Yeah I'm getting a vague flashback now that you mention it.
Did you change something for HLL in this regard?
Or not a problem in your usecase?
Can't actually recall, I'll have a quick look
Ah it looks like we have a console var to control it, and set it a lot higher than the default to cover our entire map
It is configurable somewhere.. one sec
float DestructInfoMaxDistanceSquared = 15000.f * 15000.f;```
Wouldn't be surprised if they nuked that in a more recent version of repgraph
I actually already have:
DestructInfoMaxDistanceSquared = abs(FVector::Distance(WorldMax, WorldMin)) * abs(FVector::Distance(WorldMax, WorldMin));
Check out UNetReplicationGraphConnection::ReplicateDestructionInfos
Hmm, but. The actors don't get destroyed on the server to begin with, so why would it send out a destruction packet?
Looks like you can set bIgnoreDistanceCulling per-actor
It's only on the client that they would get destroyed. But the server wouldn't send it, would it? Does the server go "oh you're out of cull distance, I will send one destruction packet only to you"?
Yeah relevancy closes the actor channel, or at least it should
Hmmm
Ah wait
OutOfRangeDistanceCheckThresholdSquared
That might be the one
You know what, I don't remember anymore 😄
If only there were docs 🤣
I don't see it actually being set anywhere, so I guess it's 0.0f by default, and thus ignored
This OutOfRangeDistanceCheckThresholdSquared
Lemme attach a debugger
OutOfRangeDestroyedActors never seems to populate 🤔
Remains empty
Yeah relevancy closes the actor channel, or at least it should
This is something that I can't seem to find in the source, so maybe that's not happening and the mentioned destruction really is just full on destruction, not just destruction when out of range.
Or I'm totally missing something, also highly possible.
Is "dormant" the right terminology for these actors? As they go outside of relevancy range? Or does dormant only refer to actors you set as dormant?
Because there is this thing: CVar_RepGraph_DormantDynamicActorsDestruction
Nope, not it either. Turned on the debug, nothing being printed.
Yeah it's not dormancy, that's separate - dormancy does close the actor channel but doesn't destroy the actor
If it's any consolation, I don't seem to have this issue in another project of mine. When the actor goes out of relevancy range, it's destroyed (and it is a subclass of pawn)
Mine are defaultpawns
But I can't imagine that's it
This whole thing is getting stranger by the minute
Actually. 2 things:
1 - This is also with repgraph, yes?
2 - Do you know which function gets called that sends the destruction packet that causes your pawn to be destroyed? I'll put a breakpoint and move my way up from there.
Yeah, just check HLL too - both projects are using rep graph and the actor is cleaned up/destroyed when it goes out of relevancy range
Okay, that means it should be something with my configuration 🤔
Where is the point in the code where it sends that packet, that leads to your pawn being destroyed?
Oh wait
the plot thickens
It's in ServerReplicateActors
ConnectionActorInfo.Channel->Close(EChannelCloseReason::Relevancy);
Bear in mind this is 4.25
But in ServerReplicateActors there's a whole section under
// Handle stale, no longer relevant, actor channels.
// ------------------------------------------ ```
Actors that are NetStartup are ofc not destroyed/closed
NetStartup as in, placed in world and loaded instead of spawned?
(Net Load on client)
This is indeed a preplaced pawn that I am debugging
Yeah
I'm not spawning it
Preplaced won't be destroyed, that'll be the problem
They never are
So how do you work around that?
You never want a pre-placed map actor to be destroyed because of relevancy
Spawn them 😄
Yeah
Anything serialized into the map is presumed to be required for the map to function
That's both with and without rep graph
In-map actors are never destroyed because of relevancy
But in MP, you'd rarely if ever have pre-placed pawns anyway
Special actors in the world with some modified configuration on the instance
Spawning them is a bit of a pain, but whatever
:\
Lemme retest this
If you explicitly destroy it on the server, it will destroy client-side when you come into that 'destruction infos' range
That's what the destruction range stuff is for, and that part IIRC is unique to rep graph
But yeah, pre-placed is never destroyed from relevancy
tbf was a helpful reminder for me anyway 😄
Also found that one of my net cull distances was set to 10KM instead of 1KM so wins all around
Hi, we're having a mindboggling issue. After server traveling, the client sometimes end up in the new level and never receives a gamestate (it's null). Whenever that happens, the FMOD music of the level also doesn't stop when the client returns to the main menu. So this makes us consider whether somehow the old world never unloads properly in those cases, and the gamestate we're trying to get is from the old world. But we don't know how this happens, if that's what actually happens, or if it's something else.
Does anyone have any tips on what to try to debug this?
This happens when testing it over Steam.
Are you travelling to the same level or a different one?
The engine does have one bug I know of, which Epic hasn't had a fix for until UE5. If the Server travels to a level the client is already in, it get's completely confused.
Usually results in crashes, but might create some other obscure errors too
does it happen if server is slower than client on executing travel / loading level?
I don't think so
good
It's just if the client is already in a "map01", and then you server-travel to "map01", the clients seem to get very lost
I guess the fix is ship a game with more than two levels 😄
We bugged Epic about it for a while in UE4 but they couldn't come up with a fix, apparently in UE5 it's solved but I'm yet to try that out
i'm trying to enforce lobby > game > lobby > game
yeah
because lobby > game > game > game seems weird, if players disconnect there we do not allow reconnects
and every next game with less players seems menaingless
Right sure, yeah in our case it's just a never-ending cycle of maps once you join
But yeah gave us big headaches when we only had one/two maps, or two of the same map next to each other in rotation
i've had too many troubles with players joining to already running match , maybe because i don't have enough experience with mp yet idk
It can be tedious but so long as you stick to the golden rule of using replicated vars for persistent state and not multicasts/RPC's it's usually ok
But you get all kinds of different race-conditions etc. when joining in progress sometimes 😄
i have troubles with people wanting everything be nearly realtime on client
so some things spawning were made on multicasts despite it being not very good practice causing troubles
Hmm will try to see if it happens when traveling to other maps too! But we've mostly tested by traveling to the same one. It's tricky because it seems to happen at random though
@chrome bay Omg yes you're right, it only happens when going to the same map. Thanks!
Would you recommend traveling to a intermediate map, and then back again to the level? We need to switch the game mode, so afaik there needs to be some server travel for that
It's tricky, I know we're not using a transition map but it couldn't hurt to set one up
The real problem seems to be that if the server loads the "new" map before the clients have all left the "old" one, then the clients get stuck
And they either crash straight away, or they think they've loaded the new level when in fact they haven't - and crash at some point down the line 😄
Oh no :(
But yeah it's a nasty bug, and for some reason seemingly not acknowledged anywhere public that I can find
Yeah, I googled the issue and seems like no one have run into it, for some odd reason
I think the issue stems mainly from UNetDriver::IsLevelInitializedForActor
It checks the UWorld package name, and if that world has been initialized and matches, they think they're already in the right world.
Might also be worth checking for GetObjectFromNetGUID: Attempt to reassign read-only guid in the LOG when you do get the error
This was the issue we had:
The server travels to another map (the current match ends) while the client is still loading the previous map
The client soft-locks after finishing loading the original map```
IDK, there's a few age-old reports I can find but none of them seem to have a resolution
What s the best way to display a replicated value on the HUD, by using the hud on the rep notification or binding a delegate then broadcast ?
Either tick the HUD, or broadcast a delegate IMO.
Tying them together directly makes it harder to separate/redesign later.
@chrome bay Thank you, I'll look for that in the log. And it sounds scary to use a transition map too then..
Tick ? Why ? It will process even when the value doesn t change then
Ticking HUD is rarely a bottleneck tbh, if at all - but it's considerably easier to deal with in MP
Delegates are fine too, but they have their own overhead - especially if they are dynamic.
So you think tick is better than a dynamic delegate ?
But having gamecode talking directly to HUD, IMO, is bad code design
Definitely tbh
Really depends how much work you're doing
Ok, i saw that in the GAS sample project
If all it's doing is updating a bit of text, it's not even worth worrying about
If it's rebuilding an entire panel, then probably make it event-driven instead
And for a delegate, where do you bind it ? Since you have to wait the postlogin ?
Depends I guess, what I tend to do is broadcast global delegates when certain actors become available on the client - but i also have the HUD look for them it it's own initialisation.
That way it doesn't matter which arrives first
Ok, thanks !
We do see this all over the log, but it's not isolated to the case where we loaded the same map twice
IMO a great metric for how well UI code is designed is how easy it is to remove it from the game, if you can just delete the UI and don't have to touch the game-code - all is good 🙂
But that's just like.. my opinion man 😄
Ah kk, maybe that's a separate issue - it might be unrelated but for some reason it was relevant to our report
Ah okay!
@chrome bay I notice UE4 has an own setting for 'Transition map' under Maps & Modes. Is that the one that comes with the aforementioned issues where clients can get stuck?
Ah not necessarily, we're not using one.
It might help to circumvent the issue though, if all clients are forced to travel to a different map before the current one
Ah okay, so just assigning some empty map there might not lead to the case where the server travels to the new map before all players have traveled to the transition map?
Will give it a try at least
Yeah I honestly don't know
Looking good so far, the issue isn't appearing. But I've yet to really stress test it on lots of clients
I get bad rubberbanding over internet when my characterpawns have max walk speed of 4000 for the entire game. It is still there but not nearly as bad when max walk speed is 200 for the entire game.
Anyone have tips where to start troubleshooting?
4000 is big enough to let CMC get suspicious about player is cheating
You move too fast and your distance between server updates is growing, and CMC thinks "hey this dude is cheatin"
Since client moves very ahead of server
Thats my idea though, not sure
I'm not very experienced with CMC
There are correction settings for that.
Thanks i will check that
How do i tell it that 4000 max walk speed is okay?
Mess with these. They should help with that if you set them much higher. More distance before harder corrections.
Thanks!
:no_entry_sign: Weexer#5876 was banned.
quick question, can i call an event that has no replication flags for example in the character from an actor that has no owner?
i guess no, but correct me if im wrong
For what exactly?
Depends on the use case
so i just need to call the event, when i need some replication things eg set owner then i make a function in the character for that
so i just need to know if i can call the function that is not replicated from an unowned actor
You want to call a non-RPC event from an unowned actor?
yes
As long as the actor exists on the client it should work
This works BP for movement for my character works fine on the client but when i try it for multiplayer, walking and jumping is fine but when i try sprint the animation starts and then stops really quickly and the character doesnt go any faster. and on other clients screens the player is just walking without the glitchy run animation. is this the wrong way to do sprinting for multiplayer?
You're setting the Max Walk Speed in the client,
Make sure it's the server that sets the Max Walk Speed
damn, movement in BP is brave since you can't use the CMC prediction with it
does that need to be sever replicated somehow?
Yeah
so, do i make speed server replicated or something else
Your client changes its max walk speed but the server is the one that manages movement, for the server the characters max walk speed didn't change
You need to change it on the server
You can create an Run On Server event called "Change Max Walk Speed" or something
and use that instead
It's much easier just to make a server set replicated bool or enum and change speed for all movementcomponents in the OnRep.
ok i thought there was more to it since just making the variable replicated doesnt work
is replicated the same as static in c++? in a global context
^this is useful
like only 1 instance of a replicated thing
Replicated means that the network will poll actors and their components set to replicate for their replicated marked properties, and if they've been changed, it will send the new value to clients.
though you have the fancy push model replication now if you want to manually tell the replication system a property has changed rather than polling each net update
there's a cvar to make BP properties use it
Hi there, Does anybody know, why my actors have different locations on Server & Client. I spawn a new actor, AttachToComponent and do the SetActorRelativeTransform. Actor replicates to clients but the actor is way off the location it was set
hm now the other client sees the charcter running round just fine but on the running characters client it looks like the character speeds up but is still doing a jittery sprint/walk animation
@vital karma How do you let the character run? MaxWalkSpeed?
its just always walking but it when sprint is pressed the character movements max walkspeed is set to a higher value
and the run animation is played when the players speed is above a certain thing
That's probably caused because in the owning client the max speed is still set to walking value
ok ill check if something like that is happening
is it peer to peer or dedicated server?
Try setting the movement component replicated and when setting max walk speed set it from a Run On Server event
but the connecting client runs dumb
For this I have a CharacterMovementComponent which overrides GetMaxSpeed method
Then I have a Property bIsRunning. If "SHIFT" is pressed I set the variable (if on client I will make a Server call)
the CharacterMovement Component returns another MaxSpeed if bIsRunning == true
i just have this and then the event changes the max walk speed to either walk or sprint speed
and its a run on server event
is Character Movement Component replicated?
Network Always Replicate Transform Update Timestamp?
or Component Replicates?
neither are checked btw
component replicates
is SprintSpeed and walkSpeed replicated?
Anyone here familiar with Advanced Steam sessions, I can't get the playercount to work.
nope
You see, when you run it on server and the component isn't replicated the component in the client won't update
o
Set Movement Component to component replicates and try again
the players speed increases on the client that is running but it is jittery wouldnt that mean that the component is replicating?
Then the max speed isn't getting set properly on the server
isnt that the same but with 2 events?
Just created this to test it and it works fine on dedicated
Character movement is set to component replicates
Everything else is default
ill try that one first
Ideally, you wouldn't let the client set the walk speed at all, as it opens a means for players to attempt cheating. Eg. If you let the client tell the server what the walk speed should be, then the client could potentially spoof in a value that isn't what you're expecting. So if sprint speed is supposed to be 4000 normally, a player could potentially spoof it and make it 6000, or 6000000.
^this
You'd create an enum or bool that determines if the player is sprinting walking crouching etc
and the server would set the value instead
But if cheating isn't a concern it's still fine
ive tried the second example you sent but it gives the same result, player moves faster on client but animation and movement is still jittery, for the client everything looks fine
Yeah I missed a node there
does your animation blueprint uses custom properties?
client should also set the value on its own too
like variables? or are custom properties something else
Or if the server is managing the values it would run a "Run on owning client"
wait isnt the "run on server" supposed to change the server value and propagate that down to the clients?
Variables you defined in the animation blueprint or if the blueprint is using your properties from the character pawn
then yes it is using those
When the variable is replicated yes but in this case it doesn't update it on clients for some reason
are these replicated?
yeah those don't need to be replicated
o
also i tried the SetMax event as both run on server and owning client, the former is what ive been using before and it gives the jittery movement and the other client sees the player sprinting normally, owning client gives jittery without a speed increase movement but the other client sees the player walking not sprinting
The one Datura posted should work fine in this case though
ill try that one then
it's the same only difference being the client sets the value on it's own as well
I was talking about something like this if you don't want to set the value locally
ideally client shouldn't give the values to the server
i would prefer that but cheating isnt really something im worried about, im just trying to learn multiplayer ue
altho i would prefer to be doing things the correct way and this doesnt seem like it, it works btw thanks
One of the foundations of learning multiplayer, is never trust the client.
lol ive made ch34ts before so i can understand this :D
how can i make sure that the owning actor of my movement component is replicating?
wouldnt that cause the movement component to not replicate if the owner wasnt ?
mine looks like that :)
It's also worth noting that while good net code can slow down cheating, you can't fully prevent it without client side software. Which is why things like EasyAntiCheat exist. 😄
Technically I think. Company out of Helsinki if memory serves, but I think Epic bought them out.
as epic games do
anyways seen as i dont need anticheat or even cheat protection in anyway ill go with the method of setting max walk on client and server for now, might fix it later thanks guys :D
Epic fully owns Easy Anticheat
it's also free
all you have to do is sign up for EOS and you get EAC for free
wtf is a world context obj? is it just an object that is inside a world or wut
used for context?
i thought so but then the drop down had literally every object in my project so i got confused, thanks :D
WorldContext basically is a pointer to GetWorld()
The dedicated server crashes, with the following in the log file. I see the value to adjust that it mentions in the project settings, however, i'd like to know why this is happening. It seems to happen once I have a 5th person log in. Any ideas? Thanks
How would I go about debugging this? What could be causing this? In short, i'm just not sure what the problem is.
would help to have symbols on your running server
but as long as you have symbols, look at the crash dump
you are likely doing something very bad if you exhaust UObjects with 5 players
"Exhaust UObjects" ... does this error mean that i'm creating more than 2.1million UObjects? Sorry for silly questions.
If I create 1 UObject on client, does this same UObject get created on server? In other words, if a hundred clients create 1 UObject each, does the server have 100?
that's not how it works
if your running server had the PDBs with it, you'd get a readable callstack
instead of just UnknownFunction
Great, thanks for the info, really appreciate it.
This was a packaged build running on AWS. @fading birch
I would pull the crash minidump, load it up in VS on the same build as that server and debug it
assuming you built it on your local machine, if you didn't, then you'll need to pull the server.exe and the server.pdb from your build server.
Our development servers always have the symbols since it’s easier that way
agreed same
makes it nice for sentry too
I still pull crash dumps though, as sentry unfortunately does not include the callstack info and just the trace :/
We use Linux servers too so it’s even easier, not even tried debugging a Linux server crash dump. I imagine you could though through WSL
can i just rpc to server on tick if its not reliable?
Yes?
Completely depends on context
If just the idea of sending an RPC to the server each frame on its own probably won’t
But you might want to consider throttling the rate it sends
High frame rate clients can end up saturating their available bandwidth if you do it literally every tick
and it should kinda go on its own pace to not throttle or am i wrong?
Huh? “Choose” to accept?
if its unreliable not every rpc gets through right
Yes but that’s usually due to something like packet loss rather than a software process of choosing
i see
how would i go about syncing camera rotation/ animation variables from client to server (so server can replicate to other clients) ?
A client is going to have authority over their animation?
yes, like is he aiming or sliding
Why would you do that on tick rather than that event happening?
i need to get camera to sync as fast as possible anyways
so i have now an event that sets those variables on server, then they replicate
but thats alotta rpc
but i would have to rpc reliable if i want to change those vars on event
and that would throttle network surely?
if theres 10 people sliding and aiming n stuff
did you use -clean flag?? or rebuild from Visual Studio, I'm having the same problem, we are using RunUAT for our builds
Anyone having trouble getting playercounts for a session?
has anyone here encountered an issue in 4.25 where sometimes when a client loses connection the server crashes?
Nope, do you have a callstack?
I'm not 100% sure since we have Jenkins set up to do our builds, but from what I can see, we are using
\Engine\Build\BatchFiles\Rebuild.bat
which does use the -clean flag
Hi! If i am doing a multiplayer where only the user data interacts, is it okey to make it serverless and go with a login and a database?
Am i missing something?
We are in the same page, I've deleted DerivatedDataCache Intermediate and Saved, and also I've put -clean flag, Im waiting while it's compiling
did you mean a peer to peer connection with a conection a Database server?
Not, kind of like a dedicated server.
I want to make something like a gacha game, since there is no real time interaction between players, im trying to see if i can get away with just databases
you could made your mini network interface to communicate your game client with the database server using just web request from ue4, but maybe you could get problems with lost packages, connection errors and other things to think in the connection layer, but is possible just need some work and a very good QA.
in another hand you could use Unreal Network Interface, and host the game with p2p connection
you would only really need the p2p if there's any real time element to the game at all
otherwise it's just a skin around a REST API
which you could use the HTTP library for
Yeah, i was thinking on just go with varest for the requests
P2p would mean something like cs go (rooms) instead of something like a mmo (all on the same map) right? Why would I need the P2p if there's no real time interactions?
you don't
If I have a variable in my component to toggle something, is it enough to have that variable replicated or does it need server RPC?
it depends. Is the server the one toggling it? Then you should use an onrep. If you're toggling from a client and you want other clients to notice, you'll need an RPC.
I'm not using it in toggle situation. I've some other functions that I set before and after
In chain of functions I enable it and in another chain of function I disable it.
That conversation was confusing.
you asked if you had a variable that would toggle something @summer tide
if that chain of functions is triggered by the server, then what I said before applies
if it's not, it still applies.
So I have a player that possess the second player. The second player has a component with that variable.
does the variable need to be on all other clients?
I fixed it by putting that variable in the second character. In the 2nd char I added if HasAuth ->Set Multicast else Set Server
Just be aware that if the Variable is supposed to be stateful, that you just introduced a bug
Because that Multicast won't be run by anyone hotjoining or re-entering relevancy range
States need to use OnReps
The Golden Rule
So I was testing my multiplayer game on lan and it was working fine. But when I tried to runa dedicated server on my pc, only movement replicates but not any other input. Any idea why
Other input like what?
We're seeing an occasional crash in packaged game, when client comes near to an enemy. Callstack shows that network data comes in and SerializeNewActor is called. This ends up calling LoadPackage which eventually fails.
The enemy is a BP type (BP_SpiderRanged), which is derived from another BP (lets call it BP_SpiderRoot).
The failure is due to "LogStreaming: Error: Missing Dependency, request for /xxx/BP_SpiderRoot.BP_SpiderRoot_C but it hasn't been created yet".
The problem first appeared after we created the intermediate BP root base class. The game runs fine most of the time, but sometimes crashes with this error.
Do we need to somehow explicitly load the base class somewhere? Or load all the enemy types on the client in advance?
I think maybe @thin stratus had something similar to this a few weeks back?
I think my problem was no a crash though
We had AIs not visible on Clients
Iirc it was due to SeamlessTravel and Client/Server not keeping their GUIDs in sync.
So the Server thought the GUID is still valid and only send that, but the Client had no matching GUID for the Class and thus couldn't spawn anything.
I think I forced the Server to resend or so
ah ok, quite a different issue then
Yeah, equally disgusting
I guess so
Seems like if I did that the crash would not happen
During Loading Screens for example
it is a vr app so thumbstick input works , head and hand tracking works but grabs dont show up this worked on lan
The thing is, it shouldn't even crash because of this
It should load the parent class too in that scenario
Or at least not require it
idk
yeah... should be a stall nothing more
something is going bad because of the BP root I think
Can only suggest finding a repro and getting it to crash while VS is attached
And then combing through the callstack and trying to figure out why the f it fails
yeah that would be nice 😅
In the end I was saved by UDN thread ):
bonus points if it can only crash in shipping
but if you run the exact same build you used to deploy the game with, the data will not be entirely useless
when you open the crashdump
that's tru in theory but currently I don't have easy access to the symbols
maybe I can download them again
often not worth the hassle without being able to view the state of variables etc
we configured crash reporter to send our crash reports to our backtrace
we also got a symbol store more or less working on the build machine
yeah - I have the first bit but not the second yet
but even with that
still need to roll the project to the released branch, which stays like that forever
do you use perforce btw?
ah ok, have you looked into source indexing at all? It embeds the souce file version into the symbols, so that when you open an old crashdump, VS can automatically grab the correct version of the file.
it's pretty awesome when I used it in the past
not sure if it's supported for Plastic tho
will have to look at it
its not a major pain in the arse, as i keep one copy of the workspace for juggling branches, and it sits on last release branch by default
so VS is already there
fair enough, I remember it being particularly useful during QA phase where sometimes old bugs would hang around for a while. Reduces the friction to investigate it.
doesn't seem to support Plastic out of the box though
from memory it is basically a horrendous PERL script, so good luck extending it 😂
Wait.. wut
whyyyy would they do this
i don't know, i am somewhat annoyed having to rewrite those as arrays of tags
because when i hit UnlockAll console command
i have 67 tags
Huh.. looking at FGameplayTagContainer::NetSerialize
For some reason they have a configurable size limit, just for the "number of tags" part
default is 6 bits... but whyyyy
Cause Zlo doesn't have enough things to worry about with me breaking his stuff. He needs Epic to get in his way too. 😄
Love how this is just "how it is" and there's no indication about it until you're project is inexplicably broken. Classic
Hey I need some help. I was able to run my vr game on lan without issues but when I tried connecting to a dedicated server, only the hand position, head position and thumbstick movement replicates. I am unable to replicate any grab actions. Any ideas why this couod be happening?
When you say Lan, do you mean Listenserver?
Cause Dedicated servers can also be ran on a LAN.
yes
Can you show one of the controls that isn't working? In general you should just be calling a ServerRPC doing stuff, and letting the new state replicate back to clients.
ok pardon the image quality as this is my work pc
both server and rpc call the same function
Don't do the Multicast from the input event. Only do that on the Server Event. Input should generally always be nothing more than "Gather all local variables the server needs from client for this RPC, ask server to do this through ServerRPC". This works for Listenservers as well, since the ServerRPC just gets played locally and inherently works for all clients even through Dedicated. And greatly simplifies the function lines.
Otherwise, like here, you'll end up with a client asking the server to do something, and then they'll run the multicast function locally as well. Instead you most likely just want the client to ask the server to do something, and then wait for server to tell them the new state through a multicast or replication.
but how did my code work in listen server and not dedicated?
Hard to say. Nothing here should be different between the two assuming you tested on the listenserver through a client's input.
and sadly source ue4 packaging takes longer
how do you handle displaying messages from events that end up on the server?
for example, failed to add an item because inventory was full?
if the add_item RPC is executed on the server
@modern cipherI did mine through error IDs. Server does something, can't do it. Gets the controller of the person who tried to do that action and sends a client RPC with a number. Error number is sent to the AHUD class and a small text widget is created. Widget uses error number to look up in a datatable what text to display. Error shows up temporarily and then removes itself.
Course most times this rarely happens. Client does it's own error display as well and stops the RPC most times before it's sent. The server rarely has a chance to send an error RPC back.
@rough kestrel Yes, it does
boss is gonna kill me
how do I replicate level based events? I have a task manager which is based on actor. This calls funtions on all the tasks. There are respective start task functions. From what I read server and other rpcs cannot be called on actors.
but how do I make sure that any new user who joins has changes reflected of previously called logic?
I was able to get that when I was using a listen server by calling on server and multicast.
@thin stratus ??
That's State Changes
I would handle that in the specific Actor that represents your Level Event
That one can have a Struct or so with all Information that is needed to reproduce the current state of the Event
Theoretically you can keep all your Event Management ServerSide and let the Actors that represent each event handle the replication
so basically have everything triggered by the player actors?
ok that sounds tedious 😅
Welcome to Multiplayer
Wait til you get to the UI part of multiplayer. Bindings are glorious.
LMAO
Hi. Anyone here used RootMotionSources before? It's kinda hard to get information about this topic, especially that google doesn't help. If I search for it, I always get to anim root motion, which is very different
@rough kestrel It be like that
what is the correct way of having a dedicated server with advanced steam sessions?
Dedicated servers have nothing to do with sessions
Rent a server somewhere, build the dedicated server version of your game from the engine source, put it on the server
You can then use sessions to have players find the server
so a dedicated server match will still run even after the players quit?
Just set it up for the first time today trying to figure stuff out
A dedicated server is just an instance of your game running without a screen
How it works is 100% up to you
so how could I be handling a match? reloading the level? Also what if I want to load a different map based on map choice from the main menu?
You could have some kind of lobby level that your dedicated server boots on, have players connect, pick the map, and then you'd do a seamless travel on the server toward the level you picked
You can easily join the level the dedicated server is on from (cmd) by pressing the Acute key and typing open 127.0.0.1:7000 or what ever IP and port it is on
Or using sessions, since the question originally was about Steam sessions
I mean a server on azure or aws with proper UI since console is impossible in vr 😜
Using the console is not impossible in VR. You indeed can’t while wearing the headset, but nothing is stopping you from taking it off for a second 😉
Im meaning just for like testing purposes not in production @rough kestrel
Hi guys. Im trying to use streaming levels in multiplayer. Does level unloading/loading break actors replications?