x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] [Crash]: MovedComponent None not initialized deleteme 0

Dear Friends at Epic,

I spawn and delete a lot of Characters during runtime in my in-game editor.

I spawn these characters with their Blueprint.

During editor mode, I set custom gravity factor to 0 for all characters so they can be moved around to any height above the landscape

When Game mode starts, the gravity factor is restored to 1 and the characters fall from their editor location to the landscape.

The Context

I run my game only from independent instance, the editor is never loaded.

I am iterating over all Characters to change their gravity during game time using ObjectIterator

Here is my iterator code

 for ( TObjectIterator Itr; Itr; ++Itr )
 {
     //Evolver is Valid?
     if( ! Itr->IsValidLowLevel()) continue;
     if(Itr->IsPendingKill()) continue;
     //~~~~~~~~~~~~~~~~~~~~~~~
         
     Itr->SERVER_SetGameMode(EnteringGameMode);
 }

It is only during this process of iterating over actors and setting their Game Mode to active (does some AI related things and changes their gravity to 1) that the crash occurs.

When Crash Does Not Occur

The crash only occurs if some characters have been recently spawned / deleted / and new characters spawned,

Then when these characters begin falling when gravity is restored, or even if I take out all my custom gravity code, but the characters are moving around because they are jumping off each other,

when they first begin to move, that is when the crash occurs


My Set Gravity Function

Here is how I set gravity during starting Game Mode, this code is only related because it causes the characters to start to move.

 void AVictoryPlayerCharacterBase::SERVER_SetGravityScale_Implementation(float TheGravityScale)
 {
         //Rep
     RepGravityScale = TheGravityScale;
     OnRep_SetGravityScale();
 }
 
 void AVictoryPlayerCharacterBase::OnRep_SetGravityScale()
 {
     if(!CharacterMovement) return;
     if(!CharacterMovement->IsValidLowLevel()) return;
      if(CharacterMovement->IsPendingKill()) return;
     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
     CharacterMovement->GravityScale = RepGravityScale;
 }


The Crash

I can create as many actors as I want and then delete them and all is well

Then when I go into game mode, all is well.

But if I create a lot of actors, delete a lot of actors, and then create more very quickly,

Sometimes, when a character begins to move, they instantly disappear permanently,

other times I get this crash:

 VictorySkelBP_C_22 MovedComponent None not initialized deleteme 0
 
 Address = 0xfd219e5d (filename not found) [in C:\Windows\system32\KERNELBASE.dll]
 Address = 0xe18f1a1c (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
 Address = 0xe17fc8b2 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
 Address = 0xdfa2cb40 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf9a3a6e (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf9af5a5 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf008c3f (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf0155d4 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf007a0b (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf018746 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdef55f67 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdef5ebd6 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdfc3d8f6 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdfc5586f (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xe1729856 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
 Address = 0xe172999d (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
 Address = 0xe173a93f (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Core.dll]
 Address = 0xdfc8b58b (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdfc8fbaf (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf9464e6 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf94cbd4 (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0xdf7a818a (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor-Engine.dll]
 Address = 0x3fd38edc (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
 Address = 0x3fd2e8dc (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
 Address = 0x3fd2e94a (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
 Address = 0x3fd3a73b (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
 Address = 0x3fd3b3ef (filename not found) [in C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe]
 Address = 0x76fd652d (filename not found) [in C:\Windows\system32\kernel32.dll]
 Address = 0x7720c521 (filename not found) [in C:\Windows\SYSTEM32\ntdll.dll]
 Address = 0x7720c521 (filename not found) [in C:\Windows\SYSTEM32\ntdll.dll]

What Does This Crash Mean?

What is this crash saying?

How can I protect against it when creating and deleting actors frequently?

This is one of the only crashes I've ever gotten which does not point to a place in my source code, who is reporting this crash?

Is it a movementcomponent, is it the engine itself?

The crash is referring to the 23rd instance of the creature I am creating and destroying VictorySkelBP_C_22, who is observing this inconsistency and reporting it?

IsValidLowLevel() and IsPendingKill()

When I iterate over all actors to activate their gravity when entering game mode,

I do check:

 if( ! Itr->IsValidLowLevel()) continue;
  if( Itr->IsPendingKill()) continue;


Thanks!

Thanks!

Rama

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 01:48 AM in Bug Reports

avatar image

ue4-archive ♦♦ STAFF
49.9k 3662 1988 9113

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

What Other Checks Can I Do?

What other checks can I do besides IsValidLowLevel() and IsPendingKill() to verify a Character's integrity while iterating over all objects?

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Update

It Is Any Kind of Movement

The issue does not seem related to changing the character's gravity

any kind of movement after spawning/deleting a lot of characters causes the crash

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

My Destroy Function

 void AVictoryGamePlayerController::VDestroy(UObject * ToDestroy)
 {
     if (!ToDestroy) return;
     if (!ToDestroy->IsValidLowLevel()) return;
     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
     //Actor?
     AActor * AnActor = Cast(ToDestroy);
     if (AnActor)
     {
         AnActor->K2_DestroyActor();
         ToDestroy = NULL;
     }
     
     //Object - BeginDestroy
     else
     {
         //Begin Destroy
         ToDestroy->ConditionalBeginDestroy();
         ToDestroy = NULL;
     }
     
     //GC
     GetWorld()->ForceGarbageCollection(true);
     
 }
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

ForceGarbageCollection

Avoiding forcing garbage collection does not cause any change in behavior

 //GC
 //GetWorld()->ForceGarbageCollection(true);
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Pink Storage is a AI Controller.

My Spawn Code

 void AVictoryPower::JoySpawn_Creatures_Implementation(AEvolver* NewCreature)
 {
     if(!NewCreature) return;
     //~~~~~~~~~~~~~
     
     //~~~ Pink Storage ~~~
     APinkStorage * ThePinkStorage = VictoryPC->CreatePinkStorage();
     
     //~~~ Send to Pink Storage ~~~
     if(ThePinkStorage) ThePinkStorage->Possess(NewCreature);
     
     //~~~ No Gravity In Editor Mode ~~~
     NewCreature->SERVER_SetGravityScale(0);
     
     //~~~ Victory Transform Initial ~~~
     NewCreature->SERVER_UpdateVictoryTransformToCurrent();
     
     //Turn to Face
     NewCreature->TurnToFaceAngle = NewCreature->GetActorRotation();
 }
 
 //main spawn function
 {
     
     //PotentialBP ?
     if (!VictoryPC->SkelBP) return;
     //~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
     SpawnInfo.bNoCollisionFail = true;    //its a global var for general use
     SpawnInfo.Owner = VictoryPC; //the player controller
     
     AVictorySkel* NewCreature = 
         GetWorld()->SpawnActor(VictoryPC->SkelBP, GetActorLocation() ,GetActorRotation() + FRotator(0,90,0), SpawnInfo );
 
     //~~~ Controller not created ~~~
     if(!NewCreature) return;
     //~~~~~~~~~~~~~~~~~~~~~
     
     JoySpawn_Creatures(NewCreature);
 }
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

DeferConstruction

Adding bDeferConstruction = false did not cause any change in the crash

 SpawnInfo                         = FActorSpawnParameters();
 SpawnInfo.bNoCollisionFail         = true;
 SpawnInfo.Owner                 = VictoryPC;
 SpawnInfo.bDeferConstruction     = false; //do NOT defer construction
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

The Crash Nature

Again the crash only occurs if I spawn a bunch of actors, delete them, and then spawn some more

crash does not occur if I just

  • spawn 100s of actors -> game mode so creatures start falling/moving

  • spawn 100s then delete all of them -> game mode so creatures start falling/moving

error only occurs when I

  • spawn creatures, delete them, spawn some more -> game mode so creatures start moving.

    Summary

somehow a conflict is occurring when actors are spawned, deleted, and then more are spawned, during runtime.

Summary 2

It is only when I spawn, delete them all, and then spawn some more that this crash occurs

so there's some kind of overlap occurring within the engine between the recently deleted actors and the newly spawned actors,

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

What happens if you switch to using the Destroy member function instead of the Kismet K2_Destroy member function?

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

I will go try that now :)

avatar image Knobbynobbes Nov 12 '14 at 11:42 PM +

test post blah

show all comments (comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Dec 11 '14 at 05:23 PM by [Epic] Gribbs for the following reason:

Archived Question


3 answers: sort voted first

Hi Rama,

If possible, would you be able to make a fresh project and solely re-create the conditions under which this crash occurs? If so, we would be interested in accessing the project for testing.

Cheers

more ▼

answered Mar 11 '14 at 01:48 AM

avatar image

ue4-archive ♦♦ STAFF
49.9k 3662 1988 9113

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

How are you spawning the actors? I've seen that crash with actors that weren't fully initialized...

more ▼

answered Mar 11 '14 at 01:48 AM

avatar image

ue4-archive ♦♦ STAFF
49.9k 3662 1988 9113

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Here's my spawn code!

What do you mean by a spawned creature that is not fully initialized?

What do you constitute as fully initialized?

:)

Pink Storage is a AI Controller.

My Spawn Code

 void AVictoryPower::JoySpawn_Creatures_Implementation(AEvolver* NewCreature)
 {
     if(!NewCreature) return;
     //~~~~~~~~~~~~~
     
     //~~~ Pink Storage ~~~
     APinkStorage * ThePinkStorage = VictoryPC->CreatePinkStorage();
     
     //~~~ Send to Pink Storage ~~~
     if(ThePinkStorage) ThePinkStorage->Possess(NewCreature);
     
     //~~~ No Gravity In Editor Mode ~~~
     NewCreature->SERVER_SetGravityScale(0);
     
     //~~~ Victory Transform Initial ~~~
     NewCreature->SERVER_UpdateVictoryTransformToCurrent();
     
     //Turn to Face
     NewCreature->TurnToFaceAngle = NewCreature->GetActorRotation();
 }
 
 //main spawn function
 {
     
     //PotentialBP ?
     if (!VictoryPC->SkelBP) return;
     //~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
     SpawnInfo.bNoCollisionFail = true;    //its a global var for general use
     SpawnInfo.Owner = VictoryPC; //the player controller
     
     AVictorySkel* NewCreature = 
         GetWorld()->SpawnActor(VictoryPC->SkelBP, GetActorLocation() ,GetActorRotation() + FRotator(0,90,0), SpawnInfo );
 
     //~~~ Controller not created ~~~
     if(!NewCreature) return;
     //~~~~~~~~~~~~~~~~~~~~~
     
     JoySpawn_Creatures(NewCreature);
 }

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Can you add the following code before calling GetWorld()->SpawnActor()?

 SpawnInfo.bDeferConstruction = false;

I can't see what else you might set in your FActorSpawnParameters object from that code.

Also, where are you spawning the actors? I'm assuming you're doing it inside the Tick() function of one of your actors?

The only thing I can think that you could check (and are not already checking) is the bActorInitialized property on your AActor objects.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Thanks for helping out Neil!

DeferConstruction

Adding bDeferConstruction = false did not cause any change in the crash

 SpawnInfo                         = FActorSpawnParameters();
 SpawnInfo.bNoCollisionFail         = true;
 SpawnInfo.Owner                 = VictoryPC;
 SpawnInfo.bDeferConstruction     = false; //do NOT defer construction


I am now going to try your bActorInitialized test :)

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Actor Initialized

I added this check as you can see in my main post above, crash is still occurring.

Thanks for the ideas though!

:)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Don't delete the actor if it hasn't fully initialized! I'm not sure how safe that is. My guess is that it isn't.

But then the entire structure around destroying actors appears to be a little fragile right now. We're still waiting for feedback from Epic about that!

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

haha yea I took that code out, but that doesnt seem to have much to do with the issue :)

Because I am not even the one who needs to be doing the checking

The crash is occurring not within my GameMode code, the crash is occurring because the actors are moving, however they start moving.

It is only when I spawn, delete them all, and then spawn some more that this crash occurs

so there's some kind of overlap occurring within the engine between the recently deleted actors and the newly spawned actors,

that only becomes issue once the newly spawned actors start moving, which happens to be when I start game mode and give the actors gravity so they fall to the ground.

Thanks Neil!

Thanks for the emotional support with this Neil!

:)

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM +

Where I am Spawning

I am spawning the creatures inside of a tick function that is checking for player input.

If the right keys are pressed then the creature is spawned :)

But please note that the creatures are not instantly forced to move when they are spawned,

they have many many many ticks before I set game move to active and they start moving, plenty of time for them to be initialized

The Crash Nature

Again the crash only occurs if I spawn a bunch of actors, delete them, and then spawn some more

crash does not occur if I just

  • spawn 100s of actors -> game mode so creatures start falling/moving

  • spawn 100s then delete all of them -> game mode so creatures start falling/moving

error only occurs when I

  • spawn creatures, delete them, spawn some more -> game mode so creatures start moving.

    Summary

somehow a conflict is occurring when actors are spawned, deleted, and then more are spawned, during runtime.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi Rama,

I am trying to look into this issue (but obviously there is a LOT here to go over).

First, can you please clarify this: "I run my game only from independent instance, the editor is never loaded."

Does this mean that you are running a cooked version of the game, or are you running RocketEditor.exe VictoryGame -game?

Thanks

more ▼

answered Mar 11 '14 at 01:48 AM

avatar image

ue4-archive ♦♦ STAFF
49.9k 3662 1988 9113

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM

Dear Stephen,

Thanks for the help!

I am using this .bat file, the editor is never loaded.

 "C:\Program Files\Rocket\Engine\Binaries\Win64\RocketEditor.exe" E:\RocketVictory\VictoryGame\VictoryGame.uproject -game  -ResX=1280 -ResY=960 -WinX=0 -WinY=0 -NoVSync -log

there is no packaging involved

Summarized Core For You

In your tests please remember the problem occurs when many Characters are spawned, deleted, and more Characters are spawned, all during runtime, with no editor intermissions (editor is not even loaded)

When I do this several times, eventually I get a crash (after 2-3 rounds of spawning, deleting, and spawning)

and it only happens with Characters

and it seems movement component related

Rama

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:48 AM +

Easy Repro

repro is actually really easy despite the size of this thread

  • spawn a lot of characters, get them to move around after spawned

  • delete them all

  • spawn some more characters, get the mot move around

  • Force garbage collection using

    GetWorld()->ForceGarbageCollection(true); //true = full purge

  • repeat several times

  • all during runtime no editor loaded

The moving around part is important

the way I do it is that when they spawn, they fall from above down to the landscape

so spawning your characters in the air high above ground should be more than sufficient

Rama

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question