How to work around this bug when packaging?

So, there is this bug.
A custom AIController gets reset to the standard AIController when closing and reopening the editor.

It’s not that much of a problem to go through every single AI Character Class and reset the AIController. But what if I want to package my game? I tried this and apparently AIController instead of MySpecificAIController gets used.

Is there a way for me to package my game correctly?

I recall a bug like that, pre 4.7 I think. Which UE4 version are you using?

–mieszko

Hey mieszko,

I use 4.7.2.

You might recall the bug I linked in the first line; it’s from August '14. It seems like the issue has reappeared.

One important thing to note: My Character is derived from a Parent Character which is derived from the Character class. It does not matter which AIController the Parent Character has set, but the bug did not happen before I had this Parent-Child relationship.

Yeah, it looks like it’s been reintroduced. I’m guessing it has something to do with fixes to circular dependencies. I’ll escalate this so that it gets addressed as soon as possible. Thanks for reporting!

You’re welcome!

Hi Deventico,

We’ve been unable to reproduce this issue. As it may be specific to a cyclic dependency issue unique to your assets, is there anyway you could provide us with a stripped down version of your project with the problematice asset and its dependencies?

Also, to help us confirm this is related to the recent cyclic dependency issue fixes, could you try disabling bDeferDependencyLoads in BaseEngine.ini (set it to: bDeferDependencyLoads=false). If that resolves your issues, then it is definitely related.

Thanks!

Hey Mike,

thank you for investigating!

when I set bDeferDependencyLoads=false, the engine crashes upon startup. I attached the error log. When I set it to true again, it doesn’t crash anymore.

I’ll upload a stripped down-version later.

So this is a sign that you do have a cyclic dependency, and that our stuff is working (mostly). If you get us assets to investigate, then we’ll be able to better narrow down the issue.

We’ve already made some fixes in this area that will be in the next release, but I’d like to confirm that yours is not a unique issue that we haven’t seen.

Oops, forgot to upload the error log.

Here it is

I’ll strip down my version soon, I’m just a bit busy right now.

Ok, so the upload just finished.

I basically deleted just about everything that’s not a blueprint, but the critical AI Controller and the Characters compile fine and the bug still persists.

You can find those blueprints in Blueprints/AI. The AIController that the Characters should have is called Follower_AI_Con. The Base Class for Characters is Melee_Character. Here the AI Controller stays the one it should be, there is no issue.

The two ‘broken’ characters are the children of Melee_Character: Barbarian and Sword_Fighter.

If you run into any issues with the project, let me now.

Good luck and thank you again!

Seems like you’ve left out some source code from the project. The visual studio solution is there, but none of the source.

If you’re worried about securing your code, you could close off the google drive link and only share it with mike.beach@epicgames.com.

Sorry, I must’ve missed that folder. We mostly programmed with blueprints, C++ is currently only usd for a few things regarding ServerTravel.

Here you go.

I’ll close the google link however.

Great news! We already fixed your issue, just this week.

This was fixed by this commit: https://github.com/EpicGames/UnrealEngine/commit/5b06ef7cd541deb6dc0c57fc7ed19868ba7a1916, and is slated for a release in the near future.

If you cannot wait until it is released, then you can temporarily integrate the change and build the editor yourself (it sounds like you’re already working in code).

Thanks for working with us to narrow down the issue!

Oh, I should mention: that if you do integrate the change into your codebase. Then DO NOT take the change here that was made to UObjectGlobals.cpp (only take the change to BlueprintSupport.cpp).

The UObjectGlobals.cpp changes caused other issues that we’re later fixed up in a different change.

Great! I’m glad, that it’s solved.