UnrealInk icon indicating copy to clipboard operation
UnrealInk copied to clipboard

Engine crashes with multiple Story objects in memory!

Open dimanjy opened this issue 4 years ago • 3 comments

I'm using an Array of Story objects. One Story for each NPC in my game. Each Story initialization takes place only when I'm starting my conversation with next NPC. But when I'm returning to the previous NPC (switching the pointer of the Story Array to the previous array index) - the Engine crashes with Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000

mono_2_0_sgen
UE4Editor_Ink!UMonoBaseClass::MonoInvoke<bool>() [d:\unreal\exampleprojects\blank\plugins\unrealink\source\ink\private\monobaseclass.h:47]
UE4Editor_Ink!UStory::CanContinue() [d:\unreal\exampleprojects\blank\plugins\unrealink\source\ink\private\story.cpp:121]
UE4Editor_Ink!UStory::execCanContinue() [d:\unreal\exampleprojects\blank\plugins\unrealink\intermediate\build\win64\ue4editor\inc\ink\story.gen.cpp:281]
UE4Editor_CoreUObject
UE4Editor_CoreUObject
...

Is there any way to manage more than one Story object at the same time?

dimanjy avatar Oct 14 '21 20:10 dimanjy

I'm also seeing this problem. I was hoping for each NPC to have its own story describing its interaction with the player. When there are multiple NPCs with Story objects in a map, the Unreal editor crashes. For me, it was throwing an exception from MonoInvoke when I was trying to add an observer callback.

warrencouvillion avatar Mar 09 '22 15:03 warrencouvillion

How long are your Ink stories? Are you using multiple StoryAssets or one large StoryAssets? We found out that loading long stories multiple times leads to crashes, maybe exceeding the stack size in Mono. Using multiple, smaller StoryAssets might be a solution.

mrcsbmr avatar Mar 11 '22 18:03 mrcsbmr

How long are your Ink stories? Not too long. The longest .ink file is only 200 lines long, with a lot of comments and blank lines.

Are you using multiple StoryAssets or one large StoryAssets? Multiple StoryAssets.

warrencouvillion avatar Mar 11 '22 21:03 warrencouvillion