I have a multiplayer shooter game (UE 5.0.3) running on a dedicated server. As the client, when I do a line trace from the gun to a specific blueprint (called BP_StreetLight), the engine crashed with the errors below:
So the BP_StreetLight is a blueprint with a simple static mesh component with a spot light component, and is placed in the map through the editor before cooking (i.e., it is not spawned at run time). Since it’s placed like this, I don’t need to replicate the mesh. When I do the line trace on other actors around the map, there is no crash; the crash only happens when I do the line trace on the static mesh in the BP_StreetLight blueprint. Note that the crash only happens when I’m playing through the dedicated server (not when I’m testing as a client in the editor).
Interesting… Have you tried running as standalone and seeing what is printed on the server log when you fire this line trace? I’ve had a similar experience with bp actors placed in level on dedicated servers. Despite being in the world and not spawned by the server they still were not replicating even though you can see them on the client side and partially interact with them.
The result in interacting with these actors sounded similar and I had network globally unique identifier (NetGUID) warnings throwing up on the server logs at incredible rates/tick and the thread became saturated and crashed the process.
In short, in my case, they needed to be replicated over the server regardless of placing them in level before hand.
Yes I have tried looking at the server logs when running standalone, and the reported errors are the ones I posted in my original question above.
I actually noticed that the same crash happened when I shot (i.e., line trace) at another particular blueprint. I guess the fastest thing to try is what you suggested (replicate the blueprints that are causing the crash). I’ll test this out…
So I tried setting the blueprints to replicate, but something interesting happens…The actors disappear (on the client side) when playing on the dedicated server! I even tried making the blueprints “Always Relevant”, and that didn’t help.
So it’s a very weird error…Not sure how to resolve this…
You may need to create some kind of server and or multicast event when spawning the actors. Setting them to replicate in the panel isn’t necessarily the only thing you need to do to replicate certain actors over the dedicated server completely.
Is there a way you can just place the static meshes and lights into the level without making a blueprint on them or do they have actions contained inside them? You can still find the types of object on client side very easily without bothering with replication if they are simple stationary items.
So I noticed that it is not the BP_Streetlight blueprint that is causing the crash explicitly. It is a blueprint that contains a spline (which uses the BP_Streetlight to place the actor in the level) that is causing the crash. So I need to debug and find out what in the spine blueprint is causing the crash. I’ll keep you updated @Humanasset !
If I have 2 or more players in the game session, the crash only happens on the first player that created the game session. For all other players, the crash doesn’t happen…
This bug seems to get weirder and weirder with time
If you are still receiving the same error and the server is crashing, the assertion failed would occur on the NetGUID.IsDynamic() check. When it returns anything other than true it halts the program operation and crashes. Given that it is the server crashing and the client remains intact, is something going on with that BP. Your client may see the BP, but it would be interacting with a non-replicated object and cause problems.
You could try breaking down the BP into smaller components and work up replication from there until you get the desired affect. It may be something specific within that BP that has a static NetGUID which is causing the crash. You can mark the components to replicate, but may have to run some other server events to make them work.
Actually, the assertion failed error is occurring in the client logs, not the server. Apologies for the misunderstanding. In that case, I suspect it is something possibly not related to replication? (because other clients that enter the level after the first one don’t have this crash). The crash seems to occur with the first client that enters a fresh game session.
My apologies. That is interesting… Have you checked and tried “net load on client”? I’m not sure I could help much more without seeing it all setup. Have you tried printing out the hit to the log and see if it’s in scope or “accessed none” off the first trace or any of the subsequent traces from the other clients?
Things like this, I usually try and print every single thing I can and work my way back through. You could also highlight everything and press F9 and step through the debugger if you haven’ tried that.
After some testing, it seems that when I package the game in “Development” mode, this error was occurring. When I packaged the project in “Shipping” mode, the error went away. So this may be a bug in UE5 in the way the level maps are loaded in the dedicated servers when packaging in development mode.