Structs are driving me crazy

Hi guys. I’m continuously running to strange problems with structs with no reason found. During the dev for the last 3 month there was multiple occasions when the project suddenly didn’t start at all, crashed on startup with ‘Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x’ on multiple addresses. After rolling back the modified struct asset the project voila worked again, modifying the same struct the same way without further hiccups. WTF?

Now an even stranger problem appeard: no modification made for the particular struct and it works fine in editor PIE. The struct is used several times, no errors, fully functioning. BUT, when trying to package the project cooking fails like:

UATHelper: Packaging (Windows): LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/Utils/Recording/SG_RecordingSave.SG_RecordingSave_C:RunRecording'. Unknown structure.
UATHelper: Packaging (Windows): LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/Utils/Recording/BP_RecordingManager.BP_RecordingManager_C:RecordingStruct'. Unknown structure.
...
~~~~
UATHelper: Packaging (Windows): LogInit: Display: Failure - 4 error(s), 64 warning(s)
UATHelper: Packaging (Windows): LogInit: Display:
UATHelper: Packaging (Windows): Execution of commandlet took:  35.24 seconds
~~~~
UATHelper: Packaging (Windows): Took 41.97s to run UnrealEditor-Cmd.exe, ExitCode=1
UATHelper: Packaging (Windows): Cook failed.
UATHelper: Packaging (Windows): AutomationTool executed for 0h 0m 44s
UATHelper: Packaging (Windows): AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
UATHelper: Packaging (Windows): BUILD FAILED
PackagingResults: Error: Unknown Cook Failure

Any long-term suggestions?
UE 5.3.2, fresh install, verified.
Cheers!

Is the base structure in c++ or is the struct created in the editor?

If you added a file by hand in vs / rider then perhaps you need to add it to the Intermediate\ProjectFiles\YourProjectName.vcxproj.filters file inside of ItemGroup.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>

//other paths

<ClCompile Include="..\..\Source\Myproject\MyStruct.cpp">
      <Filter>Source\Myproject</Filter>
    </ClCompile>
    <ClInclude Include="..\..\Source\Myproject\MyStruct.h">
      <Filter>Source\Myproject</Filter>
    </ClInclude>
</ItemGroup>
</Project>

I’ve had that screw up my project in the past when I made classes by hand (which happens in the case of structs sometimes).

Thanks, it’s interesting concept. Structs are created/modified in UE editor only (as they seems soooo fragile), other assets are modified in Rider however I always try to avoid live coding as it caused other issues. None of the structs are in the vcxproj.filters file though.

The project has a dozen of structs and always there is only one compromised at a time, but not the same one. :wink: Usually I copy uassets elsewhere, roll back in git and then overwrite one-by-one till the project starts. In this case as it’s a build error it had an error line so it’s easier. Still don’t understand though.

Thanks for the input!

The filters file does not include the structs that are made in UE editor without a C++ base.
So it might only help with code only files.

1 Like

A monster thread but there are some work arounds to make the project cook. Either renaming variables or recreating structs.

1 Like

Thanks again. Tried advises from the thread, finally it packages again. Renaming didn’t work, modifying fields type and back did the trick.

However I don’t still get it, why STRUCTs? This particular struct is untouched for at least 30 git commits… I have PTSD if modification needed on one. :wink:

It’s probably a lingering engine bug. Maybe an internal struct asset guid or other form of it’s identification gets lost along the way and needs to be re-synced in some way.

Seems like a low priority thing for epic though, seeing as it’s been present for ages.