I have added a boolean to a struct (image attached) and any time i try to change its type to anything fitting for a 1 line text description, string or text, unreal 5.3 crashes. I’ve attached the log file because maybe someone can make sense of what’s wrong. This log file was generated just now when the engine crashed when I tried to change the boolean to an integer type.
Update: I deleted the boolean and created a new member, then switched it to text type. The engine lagged a bit and then miraculously didn’t crash and accepted the change.
Update: I just tried to move the new text member up to below the BuildingIcon member and it crashed again.
Still an issue worth looking into. Hopefully log file will help! SpaceColonySurvival.log (546.8 KB)
Hey there @WolfTechRob! Is this a hybrid C++ and Blueprint project by chance? When forcing the compile so all classes can see the struct, it may hitch just a bit regularly. That said, it’s uncommon for it to crash unless some code already relies on the struct already.
this is an extremely old and unresolved problem with blueprint structs, if you search the forum you will find best practices for modifying structs but its never been resolved.
my advice is to plan exactly what you want in a struct and hopefully never change it, otherwise if you have a crash on startup you may have to delete the offending UAsset and recreate it
This is a blueprint only project. A programmer friend of mine saw some errors in our log and mentioned something to the sound of, when adding, modifying, or re-organizing members of a struct that is referenced, this hick-up is from updating those references. The crash is a result of variables that aren’t compatible when trying to update that reference. In my case, switching a boolean to a text that was in the same place as the ConstructionTime float, caused enough of conflict to crash the engine.
So 5 possible non-solutions:
1.) Compile all blueprints that reference the struct with each step of adding/changing member type.
2.) Disconnect the references as you make those same changes to the struct.
3.) Just know Exactly what you’re struct will contain from the initial implementation and don’t plan to modify the struct at all.
4.) Keep your structs small to possibly decrease the chances of a crashes and durations of hick-ups.
5.) Don’t use structs.
Finally a suggestion:
Do not nest structs! Related to the instability of structs, another issue I just had was a struct that had 3 nested structs, got completely reset to 0s. Not even defaults! Total members that got reset is around 25, and these values were referenced by about 80 units (making an RTS, struct contained vitals, costs, and other values).
5.) Don’t use structs. lol
I am having the same issue, I removed a variable from a Struct and now if I use Make Instanced Struct to build the struct as a payload for a StateTree, it crashes the engine.
Should I create a new Blueprint struct and use that ( I can’t test it now, darn Xmas holidays, and I don’t have a PC with me)?
Would this be enough to solve the crashes?
Thanks.