StateTree Crashing Sometimes When Compiling

Using Unreal 5.5

Recently my statetree started (seemingly) randomly crashing Unreal when I compile it. The log throws back this error:

Assertion failed: EditorNode.Instance.GetScriptStruct() == Instance.GetScriptStruct() [File:D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeEditorModule\Private\StateTreeCompiler.cpp] [Line: 1241]

I can reopen the project just fine afterwards and it usually compiles just fine a few times and then crashes again.

1 Like

More Information:

More rarely it can throw this error as well:
Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff

I also recently upgraded my engine from 5.4 to 5.5

it can be a bug in UE5.5

it is using a null pointer somewhere

Maybe the “Instance” is not instancied…

Can you back to your previus UE version?
Or maybe you can wait to EU5.6… it will be release soon.

this happen too much often… have a backup always

1 Like

Hey thanks for your response. It was probably something that happened during the update process… I think that I have managed to fix it somewhat.

I deleted the .vs, binaries, intermediate, and saved folders in the project and also deleted the global derived data cache in AppData\Local\UnrealEngine\Common\DerivedDataCache

Then I regenerated the projectfiles and rebuilt the project and now it seems to work

1 Like

Good news!!
Yes that files is recomended delete very often. I deleted it each day.
Best Regards!!

1 Like

More follow up information… the problem returned, but I believe I solved it. I think the bug arises from me using/changing parameters in the statetree that are already referenced.

I think the parameters on a statetree (correct me if I’m wrong) are stored in a struct which I know can be buggy in blueprints. So eventually when I compile them and the serialization messes something up, it leads to the null pointer ACCESS_VIOLATION (I think this is consistent with the previous statetreecompiler issue as well with assertionfailed getscriptstruct). The mini crash dump throws me a 0xc0000005 error code which also implies mismatched memory.

I have remade the same statetree without parameters and removed the old one and haven’t crashed. For people reading this encountering a similar issue you could try removing the parameters on your statetree or doing the parameters for the statetree in C++ (which I think shouldn’t have the same issues). For now my workaround is just passing the values I need from the owner of the statetree to the statetree itself (though this will require you to hard reference the owner’s class in the statetree)

IMO, State Tree has a bug that straight up crashes development. It’s a real bummer since I like it over behavior trees now.

1 Like