Structs crashing Editor

Background

I’ve been having this issue for a while, working in Blueprints, but I recently decided to try and migrate my files from one project to a new one, as I wanted to move around and delete unnecessary files.

When I opened the file, my structs were broken. I had a few enums within the structs that became converted to bytes, which broke the structs.

I also use one larger struct as a parent to all the other structs (I have 8 sub structs in total, this is necessary otherwise I’d have hundreds of variables in one single struct)
A few times my editor has crashed when editing either parent or child struct.

The Error

The current issue I’m having, after opening the project and having the struct declare the error where the enums got converted to bytes, the blueprints containing my structs, it has me delete all the references to now broken structs. When I go back in and try and fix the errors, re-connect all the now orphaned pins, at some point, (I’ve gone through the process multiple times, it seems to happen at random, and not connected to any particular reconnection of an orphaned pin) the editor will crash.
Upon this editor crash, every time I try and re-open the project, the editor will crash when I try and edit the component that all my structs are on.

Steps taken to solve

I’ve taken steps to solve this myself, like deleting the derived data cache, and the intermediate and saved folders. At the moment my project will open and I can open the component back up as I rolled back to a previous version of the file, however one that still has all the broken references that I need to fix.

EDIT: I’ve also migrated the files to a new project to see if the issue persists, which it does.
The structs are not nested within a box struct, as I can’t seem to make a data table out of a box struct, nor can I make a structure with a box struct in it, and give that box struct values within that base box struct.
(The dream would be to have a new type in the blueprints creation menu specifically for box structs, and being able to add new structs to the box right there)

in case I’ve lacked in clarity, here’s some images of how I have my structs set up.
Here is the parent struct

Example of one of the nested structs (lots of variables, which is why its super necessary to have a container)

Structs are still unstable, after all these years. There are some fixes on the way:

There is one workaround that helped me deal with the most annoying issues they cause - crashing and unsolvable compilation errors. It’s more of a preventive measure rather than a fix:

Once I have a struct deployed and need to make changes to it, I make the changes and save the struct. Close the editor at this point, DO NOT save or compile any other blueprints. Let them go unsaved, open the editor again and the struct will work absolutely fine. :expressionless:

As silly as this sounds I’ve been using this method for a couple of months now and never looked back. Again, it’s a workaround, not a solution, though. Here’s hoping for major fixes soon.

Part of my problem is I can’t get that far. I’ve been editing this post, so I may have updated this after you saw and were already writing, but if I try and make a change to one of the child structs, it immediately crashes my editor.
I recently went about trying to reload all the assets from the disk, and it seems that the error is contained within my parent struct. I don’t believe UE4 is at all meant to have nested structs at the moment, especially if they’re not nested within the box struct, which doesn’t give me the functionality I need.

I don’t believe UE4 is at all meant to
have nested structs at the moment,

Yes and no. The behaviour is super buggy and unstable. I have nested structs with 7 layers. It’s a procedurally generated universe where clusters of stars contain planets which contain moons which contain stations and asteroids and so on.

In the end it’s ALL located in a SINGLE struct variable that I manage to save and load successfully. Depending on how the random generation process goes; it’s around 20k objects, each containing a separate struct for the commonly shared class data, material and some other metrics. The bottom line is these are nested layers of arrays within arrays. I even managed to work around structs storing identical structs… What I’m trying to say is that it is possible but it does not work out of the box. Unfortunately.

I had to rewrite the whole system because I got to a point of no return, just like you. Stuff was so badly broken and the circular dependencies could not be fixed. When I rewrote it, I used the method I described in my previous post. So far so good.

In addition, I stared using components whose sole purpose is to store the struct. This way, when something breaks I need to fix the component rather than the actor and the ENTIRE line of inheritance…

From my point of view, you have 2 options:

  • wait for 4.19, pray to the gaming gods, focusing on working on something struct unrelated
  • start rewriting your system, ensuring to never recompile actors straight after changing the nested struct

If there is a magic button to fix all the evil within structs, I do not know about it.

What seems to work so far, I just duplicated my structs, and edited the variables on there, and then now I’m putting them back in, which is gonna kinda suck, due to just how many references I have for each of these structs, even though I have them all within some little helper functions, makes things easier.

You can drag and drop variables to replace them - does not always work but it may save some time:

https://gyazo.com/19dc7d87dd65f39e3f0cacb00b41238d

I did happen to find some semblance of a solution, I duplicated the problem struct, and then broke it down into several smaller structs, and finished by putting the new mini structs back under the parent struct, all seems well so far.
It seems the issue was that I have so many variables within one of the structs.

Ich habe eine Struktur erstellt und sie geändert, während sie schon als Variable in mehreren Schauspielern verwendet wurde.

Ich kann mein Projekt nicht mehr öffnen. Weiß jemand darauf eine Antwort?

This is still an issue in 4.25.1 . Can we see a fix for this I mean I’m using a small struct and yet it crashes the engine.
Please solve this as the work around above still is the option to create the struct and then close the editor and reopen it. And thats only if it doesnt crash first.

Structs just bricked my 1.5yr project

Try to find the structure in saved folder. Take an older and replace it in your content. My 2 years old game was save after that action.

Maybe it helps you…

thanks i did remove the offending struct this way… but the game mode was still crashing the editor on opening because of it… luckily autosave to the rescue and managed to recover!

Yup…Here we are almost 3 years from this thread, 4.25.3 and Unreal Engine can’t handle structs properly at all, you have to Save every single time you edit anything otherwise it’s instant crash. It’s an absolute joke.

Putting Structs in Datatables seem to work much more reliably. Right click---->Miscellaneous---->Datatable

Fairly new to Unreal, and was having this issue repeatedly in UE5, basically once they reached a certain point of being intertwined, my Structs and Enums couldn’t be edited without crashing the engine 97% of the time. After 160ish crashes these last few days, I found a most marvelous workaround for both Structs and Enums.

  1. Duplicate the problematic item
  2. Move it to a different folder
  3. Make the changes to the duplicate
  4. Rename the duplicate to the original. Save everything, and close the engine.
  5. In windows explorer, find the “duplicate” that you made the changes to copy, and copy it
  6. Find the broken item, and past the “duplicate”, replacing the original
  7. Open up your project, and enjoy your updated Struct/Enum

Note: This worked on my machine (yes, i know), and may very well not even work ion it tomorrow as every day is an adventure in computerland!

2 Likes

Thanks so much for this tip, I almost abandoned all hope. This seems to work for the time being. Epic really needs to fix this issue.