Characters break when packaging

Hello, I am not sure if this is the right forum for asking. Mods, feel free to move it if you want.

We have encountered an extremely hard problem to solve, which I highly suspect is a bug in the engine itself.

We have a character superclass, which contains all the basic stuff all our AI characters should have. This object works fine when we run the game in the editor, but when we package it and run it as a stand-alone application, the characters stop responding. We tried spawning them high in the air, and they do not even fall (which they do in the editor). I spent half a week tracking the problem, and I have concluded that it is specific references in the object which breaks it. Among others, variables containing references to our player controller.
The really weird thing is, though, that it is enough to have a reference to an object of that class to break it. I can remove all these refs and it works fine, but as soon as I add a ref to an object of that class, even though it is null and never called, the characters stop working.
I have solved some of the problems by creating references to the built in super classes and then casting in every instance where the object is called (which is really terrible, but I need to get around this), but there are more complicated problems still there.

This is a problem which is EXTREMELY hard to track down, since I don’t have access to debug tools once packaged. I have looked through the packaging log, and I can’t find anything seemingly relevant.

Does anyone have any input on this? We are closing in on a deadline, and I can’t seem to solve the problem.

//Jimmy

I had a very similar experience a few months ago. However my game would not package at all.

I rechecked my limited notes on the bug and i came to the conclusion that it was a problem with a derived class of Character reference being passed through an Blueprint Interface message. My solution was similar to yours, instead of using the derived class, i used its Super class instead to pass the reference and then just down cast to get what i needed.

The project i encountered the issue on was only small and i ended up scrapping that build for different reasons and starting again. The Character classes were setup EXACTLY the same in both the old and new build, however the new build did not have the bug.

I made a note of this and basically came to the conclusion that somehow the reference became corrupt in the BPVM or something, i didnt investigate it further.

My only suggestion and this could break it further, (id do this in a copy of the project) but try reparenting the class and then back again, might reset its internals.

Thank you for the reply, DevilsD.

I tried reparenting both SuperAICharacter and our subclass which we spawn, Musketeer. Sadly, to no avail.

Recreating the project is also out of the question. We have 6 people who invested multiple months into it.

As I said, I have done an as thorough investigation as I can, where I made duplicates of the objects, and then picked them apart node by node (which took ages since I needed to repack for each test).

I also noticed, after some further testing, that the cast solution did not solve the issue. If I cast the variable inside the owning SuperAICharacter, I get the same issue as if I had a direct variable reference. This means that if I in any way reference a MasterController (which is our PlayerController child class) or our Squad object (which is a data structure to handle squads of troops), it instantly stops working. It makes no sense what so ever from a project perspective, and it has to be some kind of bug or problem in packaging.

Any dev around who has any insight?

Edit: I forgot to mention that we only work in blueprints, so it shouldn’t be an incorrect class reference.

Edit2: Another thing that is worth mentioning is that we have another AI character which does not inherit from SuperAICharacter (the class where we have the problem), but rather from Character itself. It has pretty much the same functionality, but most importantly, the same references to our MasterController and Squad. This character works flawlessly. Could it have something to do with inheritance?

Tested to create a new project and migrate everything. Took a good 6 hours, but it gave no progress. Exact same problem.

The only other solution that i can think of is to recreate your SuperAICharacter class. Its obviously a problem with that class in some capacity.

Being a BP only project you can only go so far…