When i create a First person shooter blueprint project, set “Static mesh replicate movement” to true of all physical boxes in the example map. Now i set the number of clients for playing editor to 2, it crashes. If i reduce the number of boxes from 14 to 8 it dont crashes anymore.
I took a look into the engine source and found out, inside of the NetworkDriver.ServerReplicateActors(float DeltaSeconds), the ensure(ConsiderList.Num() < ConsiderList.Max()); fails (Line 1959), before the engine wants to add another actor to the ConsiderList. I would say, something with the NetRelevantActorCount is not right: NetRelevantActorCount = World->GetNetRelevantActorCount() + 2; (Line 1810).
Why is there a 2 as magic number?
At a glance, it appears the reason for a +1 to the ConsiderList allocation size is to allow for potentially adding the WorldSettings on 1857. I’m not sure where the other +1 comes from, but that 2 should be a variable so its significance is clearer (although maybe it should just be clear to me). I am surprised that any network relevant actors (checked on line 1945) wouldn’t have been included in the round up on line 1800.
Have you logged what your NetRelevantActorCount is set to on line 1800 and then World->NetworkActors.Num() on 1879? Maybe some of that output will explain why 8 and 14 pass and fail, respectively. Let me know, I’m curious!
Thank you for bringing this to our attention. I was able to reproduce the crash and have submitted a report about the issue to have one of our developers investigate further (UE-3444). Unfortunately we do not have a suggested workaround yet.
I am also reaching out to a developer to find out what we can do about the magic number you found.
I am still having this issue in 4.6.1. If I place enough static meshes that replicate movement, the NetworkDriver will crash during play. Interestingly, if I convert the static meshes to a blueprint and replicate the blueprint movement, I can place as many as I want without a crash.
That is the same way, we work around this problem. But with blueprinted ridged body actors we had some problems if we placed them directly in the level. The replication dint work correctly. to be totally safe, we no have a factory blueprint that spawns the blueprint at begin play.
This issues is still being looked into to find the best means to fix it without impacting other aspects of the engine. It would be difficult to give an exact time frame for when it will be fixed but we are still investigating it.
The ticket that was submitted for this issue is still open. I just tested it again in 4.8.2, and unfortunately the crash is still occurring. We do not yet have a timeframe for when this will be resolved.
The workaround is to create a simple blueprint which only has one static mesh component and use this instead. you can have as many as you want this way.
If you need a more detail description on how to do it, let me know.