Reference to other Actor + Keep Simulation Changes = Crash

Hello,

I posted this a couple of months ago or so, in the beta. I heard the beta questions were moved here but this one definately didn’t make it through.
Back then I got an answer saying the issue had been identified and resolved in the latest internal build at the time. Then we got the public release, I tried this again and the problem is still there.

On to the situation:

I have a C++ actor-extending class called PlaceActor, displayed as a simple box mesh. it represents a “place” that characters can live in, like a house. I’ve then set up some basic AI characters that look for an available place to live and grab it as their own, by assigning a pointer Actor var in the PlaceActor to be himself.

Now, I want to simulate this behavior and then save it by using the lovely ‘Keep Simulation Changes’ feature.
When I simulate, the AI guy goes find a home and if I click the home PlaceActor then I see the pointer (which is editor-exposed) to be correctly set as the character that now lives in it.
I then select the PlaceActor and press ‘K’ to keep the simulation changes, and the editor crashes. I tried keeping the simulation changes for both the PlaceActor and the Character as well, same result.

Making a simulation without keeping any simulation changes still works perfectly. Making it so that the pointer to the character isn’t assigned in the code and then keeping the simulation changes for the PlaceActor also works perfectly, meaning the issue is definately at that point.

hope this can be resolved.

thanks

Hi ,

Would you mind providing a sample of the code specifically in regards to when the place actor is activated and saved? This will help us to address the specific problem you are having. Thank you!

hey , thanks for giving this a shot.

this is the relevant code:

// EliumPlaceVolume.h
UCLASS()
class AEliumPlaceVolume : public AActor
{
	GENERATED_UCLASS_BODY()

	//morestuff

public:
	UPROPERTY(Category=EliumWorldPlace, EditAnywhere)
	class ACharacter* PlaceOwner;

	void ChangeOwnership(ACharacter* NewOwner);

	//morestuff
}

// EliumPlaceVolume.cpp
void AEliumPlaceVolume::ChangeOwnership(ACharacter* NewOwner)
{
	PlaceOwner = NewOwner;
}

then I have an AIController-extending class that does an FActorIterator to move to the closest AEliumPlaceVolume, and calls ChangeOwnership(GetPawn()); onto the volume.

this is what I get in the Simulation if I select the Volume:

as you can see the property is assigned correctly, as it points to the character inside it.

Pressing ‘K’ and then stopping the simulation causes the crash.

Hi ,

The AI that you are using to find homes, are they placed in the level already or are you dynamically spawning them? Further, could you post the crash logs and callstack so we can have a look? Thank you!

hey ,

the AI characters have already been placed in the level, not spawned dynamically.
I will post the crash logs when I get home.
About the callstack, I cannot see it because I still don’t know how to run the engine in debug mode. I just found a thread explaining how do to it, so I’ll try that as well

finally got a chance to try to debug it again. but as I’m running from the installer version of UE4 and not the full-source GitHub version, I cannot properly see the problem. it says “launchengineloop.cpp not found”

the callstack looks like this:

and the crash log:

hope this is enough :slight_smile:
thanks

just ported my project over to v4.1, and the issue is still there. this is the callstack copy-paste from the Crash Reporter:

We apologize for the inconvenience.

Please send this crash report to help improve our software.

bedbeafee521b5bcf289e7796508690b

doesn’t seem too useful? :slight_smile:

Looks like this was fixed up in changelist 2049802, so you can manually integrate that change, or it should be included in 4.2. Sorry for the trouble!

hello,

sorry to bring this back but I’m having problems with this again.

I’ve been updating some of my old codebase lately to v4.5.1 and just tried my AI guys again.

like last time, my AI guy goes and buys a house and keeps a reference to it. and the house also keeps a reference to him, the new owner.

for the EliumPlaceVolume (the house) the owner is stored like this:

UPROPERTY(Category = EliumWorldPlace, EditAnywhere)
		class AEliumCharacter* PlaceOwner;

and this works if I simulate, select it, keep changes (press K) and stop. back in editor mode the property still properly shows the character owner

now the problem. the character keeps a reference to the house like this:

UPROPERTY(Category = "AI Life", EditAnywhere)
		TArray<class AEliumPlaceVolume*> HomePlaces;

and this once again makes it crash if I simulate, select the character, press K and stop simulation.

like last time, while simulating the property looks to be correct (but crashes after ending the simulation)

I know this setup might cause a circular dependency, which I’ll figure out later. but anyway for now I’m only doing either the house, or the character.

thanks for the help

and the callstack. callstack or it didn’t happen:

MachineId:5E59BB914BEE0D76E23AC9B7D71FFFF5
EpicAccountId:5995de499815485bb9fa22c54a11a89c

Unknown exception - code 00000001 (first/second chance not available)

Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.5\Engine\Source\Developer\MessageLog\Private\Model\MessageLogListingModel.cpp] [Line: 70] 
Critical Error GameplayDebuggingComponent //Game//Maps//UEDPIE_0_eTestMap.eTestMap:Persist

KERNELBASE + 43896 bytes
UE4Editor_Core + 3174852 bytes
UE4Editor_Core + 1677215 bytes
UE4Editor_MessageLog + 241173 bytes
UE4Editor_MessageLog + 241423 bytes
UE4Editor_Core + 1077733 bytes
UE4Editor_UnrealEd + 4172422 bytes
UE4Editor_UnrealEd + 1898852 bytes
UE4Editor_UnrealEd + 6486374 bytes
UE4Editor!FEngineLoop::Tick() + 3524 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launchengineloop.cpp:2129]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\launch.cpp:133]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.5\engine\source\runtime\launch\private\windows\launchwindows.cpp:201]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

I don’t get why this was accepted as an answer again? should I make a new post for the same problem?

no problem, it was just me :slight_smile:

I already pasted my callstack up there. is there any other relevant log I should post?

Hi ,

That was my mistake, I didn’t see the new posts up above so I thought that someone had accidentally opened this back up. Can you post your crashlogs here so I can have a look?

Yes, if you could, go to this filepath:

\Unreal Projects\PROJECT NAME\saved\logs\ and pull the saved logs from the time of the most recent crash it may help to get to the bottom of what is occurring. Thank you!

ok here it is.

thanks for your support :slight_smile:link text

Hi ,

Do you have a sample project that you would be comfortable sharing with us so we can see this on our end. We attempted to recreate this on our end but have thus far been unsuccessful.

should I just send you my project? I don’t know if I have the kind of time to make a new project with a minimal implementation. but also I don’t want to publicly post my files. is there a private way?

otherwise I’m thinking maybe I should finally get around to have a github version of UE4, but I don’t want to have to maintain 2 engines :frowning:

Hi ,

You can send me a private message on the forums with the link that way no one else will receive the information.

okay, sent you a PM

thanks

Hi ,

I received your PM and have passed the information to a co-worker who has more experience with C++ to take a look. I will let you know what is found.