When spawning an actor using the Spawn Actor From Class node that has a Set Replicates node in the construction script, the editor crashes upon attempting to run a dedicated server with 2 players.
Found in 4.10.4. Reproduced in 4.11 Preview 6 and Main CL 2884405.
Crash Reporter Bugg: [Link Removed]
Source Context:
2830 if (RemoteRole != ROLE_None) 2831 { 2832 GetWorld()->AddNetworkActor(this); 2833 } 2834 } 2835 2836 void AActor::PostNetInit() 2837 { 2838 if(RemoteRole != ROLE_Authority) 2839 { 2840 UE_LOG(LogActor, Warning, TEXT("AActor::PostNetInit %s Remoterole: %d"), *GetName(), (int)RemoteRole); 2841 } 2842 check(RemoteRole == ROLE_Authority); 2843 2844 ***** if (!HasActorBegunPlay()) 2845 { 2846 const UWorld* MyWorld = GetWorld(); 2847 if (MyWorld && MyWorld->HasBegunPlay()) 2848 { 2849 SCOPE_CYCLE_COUNTER(STAT_ActorBeginPlay); 2850 BeginPlay(); 2851 } 2852 } 2853 2854 UpdateOverlaps(); 2855 } 2856 2857 void AActor::ExchangeNetRoles(bool bRemoteOwned) 2858 { 2859 checkf(!HasAnyFlags(RF_ClassDefaultObject), TEXT("ExchangeNetRoles should never be called on a CDO as it causes issues when replicating actors over the network due to mutated transient data!"));
1. Open the editor
2. Create a new actor blueprint
3. Give the blueprint a boolean variable that is public and expose on spawn.
4. In the construction script, put a Set Replicates node and connect your boolean variable to the In Replicates pin. (See Screenshot)
5. Compile & Save
6. In the level blueprint, place a Switch Has Authority->Spawn Actor From Class (Spawn the actor you created in step 2). Ensure to set your boolean variable to true on the Spawn Actor From Class node. (See Screenshot)
7. Compile
8. Hit the arrow next to the Play button and set number of players to 2
9. Set Run Dedicated Server to true.
10. Press Play
Result: Editor Crashes
Expected: No crash would occur.
Assertion failed: RemoteRole == ROLE_Authority [Link Removed] [Line: 2789]
UE4Editor_Core!FDebug::AssertFailed() [d:\sean.flint_z5610_streammain\engine\source\runtime\core\private\misc\outputdevice.cpp:430] UE4Editor_Engine!AActor::PostNetInit() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\actor.cpp:2791] UE4Editor_Engine!UActorChannel::ProcessBunch() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\datachannel.cpp:2106] UE4Editor_Engine!UActorChannel::ReceivedBunch() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\datachannel.cpp:1955] UE4Editor_Engine!UChannel::ReceivedSequencedBunch() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\datachannel.cpp:273] UE4Editor_Engine!UChannel::ReceivedNextBunch() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\datachannel.cpp:626] UE4Editor_Engine!UChannel::ReceivedRawBunch() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\datachannel.cpp:357] UE4Editor_Engine!UNetConnection::ReceivedPacket() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\netconnection.cpp:1078] UE4Editor_Engine!UNetConnection::ReceivedRawPacket() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\netconnection.cpp:533] UE4Editor_OnlineSubsystemUtils!UIpNetDriver::TickDispatch() [d:\sean.flint_z5610_streammain\engine\source\runtime\online\onlinesubsystemutils\private\ipnetdriver.cpp:197] UE4Editor_Engine!TBaseUObjectMethodDelegateInstance<0,UNetDriver,void __cdecl(float)>::ExecuteIfSafe() [d:\sean.flint_z5610_streammain\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:852] UE4Editor_Engine!TBaseMulticastDelegate<void,float>::Broadcast() [d:\sean.flint_z5610_streammain\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:921] UE4Editor_Engine!UWorld::Tick() [d:\sean.flint_z5610_streammain\engine\source\runtime\engine\private\leveltick.cpp:1105] UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\sean.flint_z5610_streammain\engine\source\editor\unrealed\private\editorengine.cpp:1354] UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\sean.flint_z5610_streammain\engine\source\editor\unrealed\private\unrealedengine.cpp:370] UE4Editor!FEngineLoop::Tick() [d:\sean.flint_z5610_streammain\engine\source\runtime\launch\private\launchengineloop.cpp:2657] UE4Editor!GuardedMain() [d:\sean.flint_z5610_streammain\engine\source\runtime\launch\private\launch.cpp:142] UE4Editor!GuardedMainWrapper() [d:\sean.flint_z5610_streammain\engine\source\runtime\launch\private\windows\launchwindows.cpp:126] UE4Editor!WinMain() [d:\sean.flint_z5610_streammain\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Networking |
---|---|
Affects Versions | 4.10, 4.11, 4.12 |
Target Fix | 4.11.2 |
Created | Mar 1, 2016 |
---|---|
Resolved | Apr 14, 2016 |
Updated | Nov 22, 2016 |