Structure Variables get corrupted

Just got my project corrupted so hard that the editor will not start anymore, even with the intermediate folder deleted. I added several variables to a structure in the last session.

Sadly guys, I think the only way to ‘Clean/Fix’ a corrupted structure is to delete it, and reimplement.

Yeah, I don’t remember exactly how I manage to make it work back, I think I created a copy of the blueprint or in the same blueprint, but I deleted the variable and created it again.

A tip: Don’t use an Array direct from a Struct in to a For Each.

Branching, complex structs (structs within structs) can create some problems, but I think we kind of found a way to replace them when they get damaged without much trouble (Blueprints). Most of you probably figured it out as well by now, but in case you haven’t…

Symptom: the project no longer finds the structs as variables, and where they are already present, they no longer “break”.

Cause: Changes in related structs, renaming, or unknown;

Before doing this, make an archive of the project.

A
0. duplicate the damaged struct (not necessary to make a new one, the duplicate will be fine);

  1. try replacing references automatically while deleting the damaged struct;
  2. if it works, fix up redirectors, rename the duplicate, etc;

B
0. if not:

  1. force delete the damaged structs (you may need to close/open the project); this may throw some errors, ignore them
  2. rename so that the duplicate ends up with the original name; with a little luck, the previous, apparently failed “replace reference” will do the trick, the system will recognize the duplicate/identical name struct as the original.
  3. replace the struct variable type in your data source at the most root level - first time it is used as “struct within struct”, and not just a collection of variables and enums;

C
0. if the project is still damaged,

  1. replace by hand everywhere (worse case scenario)
  2. select again the default values

Bump this as not fixed. Editing a variable in an underlying struct caused the entire project to become corrupted. Trying to set it right was uneffective, had to go back to a previous version.

I can confirm the problem still exists in 4.22.0-5660361+++UE4+Release-4.22. Variables of certain structs randomly null themselves when you close and reopen a project.

I have this issue aswell and unfortunately it hasn’t been fixed yet…

Couple of year later, but thank you very much. You are my hero! Great step by step plan and can confirm it works.

It says it’s fixed but structs always keep getting corrupted for me. ue5.1
After all these years waiting, I think I should give up and use a lot of arrays to replace my databases

2 Likes

I ran into the same exact issue in 2022. Changing default values of a struct shouldn’t corrupt every single reference in the project

5.1 Still happening. UE folks, any words at all on this? Come on…

1 Like

BP structures are the only feature you should ignore in unreal engine. If you don’t want to have problems. =(

1 Like

The structure corruption bug has cost me an entire custom inventory system and a year’s worth of work. I wish i had known structures are this fuckdd up back when i started using them. I should have known they are too good to be true, being so easy to use.

Are there any alternatives? I was recomended data tables but dont they also rely upon a struct for the row structure? What if I modify that struct? Would the data table break too?

2 Likes

New to UE, on 5.3. I am on my first big project and did not know about this bug. Now my entire project is broken because of trying to change one struct. I am going back to Unity.

Hi, if you are here about your structs getting corrupted after a post-creation modification, i’ve managed to totally fix this issue by only migrating every content folder to a fresh project. It is tedious of course, but better than nothing i guess. Somehow this procedure will fix the modified structs references and connections. Let me know if that works for you too!
Engine Version : 5.3.2

Note that this may only work in case you only added a new variable/s to a struct. If you are removing or changing type of a variable inside a struct you should be aware that some problems may persist in your blueprints even after migrating.

Bumping thread because the problem is really bad still in UE5, it is the third time my project has been corrupted by structs. It usually happens with the main character blueprint, which can have many child blueprints, other things referencing it, being one of the most complex asset in the project, and usually it happens when modifying existing structs, especially one like an item property struct with many variables. If you’ve built inventory systems then you have probably ran into this issue.

The editor tends to give you an early warning that something is going wrong when loading the project and you see a single warning “Failed to load /Path/SomeStruct.SomeStruct Referenced by SomeBlueprint”. But when you click the error it takes you nowhere to fix it, and there are no compile errors, it’s green flags. This error will continue to linger and the project will work fine for quite a while, until one day it has a meltdown over that structure. The problem then gets worse when you try to fix it, resulting in the blueprint thinking it has variables which don’t appear in the editor anymore and cannot be removed, and now you’re going to be rebuilding that whole blueprint. It’s a total ■■■■ show and each time it costs 4-8 hours to patch up.

It looks like this problem or a related one was marked FIXED in UE4, but maybe it’s time to revisit that because it seems to still be a problem. Common wisdom is “do NOT use structs” but this is silly if you think about. Structs are a basic paradigm, they are as important as floats, and we need them to work!

Thanks :slight_smile:

agreed it should be fixed but it never has so i just use DataAssets.

structs are fine for small simple ones but i wouldnt nest one to save my life :slight_smile:

something ive been meaning to look into but havent is using structs of FInstancedStructs to have dynamic data without having to change the base struct

Whew, this one haunted me for a long time. Here’s what finally fixed it for me:

nachomonkey/RefreshAllNodes: Unreal Engine plugin that refreshes and compiles all of your blueprints. (github.com)