Hot Reload errors since upgrade to 4.8.1

I’m not experiencing a crash, but a lot of my blueprints now have errors since some Blueprintcallable functions seem to not be found in the new dlls (after a hot recompile). Example of an error:

LogBlueprint:Error: [compiler ChariotAct1] Error Could not find a function named “AttachToChariot” in ‘JotunnNPCCharacter’.
Make sure ‘JotunnNPCCharacter’ has been compiled for Attach to Chariot

I always need to close the editor and recompile. It’s new from 4.8.1. We started the project in 4.5 and updated to 4.7.1 which was still working fine and now 4.8.1 where hot reload is completely broken for us.

Compiling normally do not produce any error, so I’m not blocked from creating new stuff but it’s certainly a lot less productive working this way…

The errors are not always on the same functions but it’s always the Blueprintcallable ones that are affected.

Any idea what that could be?

This is really keeping me from being productive, anything at all, a hint of a reason why it does not find some functions?

Please, some help would really be appreciated…

Some more info: for the classes that seems to be problematic, if I do a modification in them before compiling, this will be in the logs:

[2015.07.20-20.38.10:706][412]LogClass: Could not find existing class TransitionSphere in package /Script/Jotunn for HotReload, assuming new class
[2015.07.20-20.38.10:707][412]LogClass: Function ApplySphereTransition is new.
[2015.07.20-20.38.10:707][412]LogClass: Function ClearTransition is new.
[2015.07.20-20.38.10:707][412]LogClass: Function SetSpherePlane is new.
[2015.07.20-20.38.10:707][412]LogClass: Function SetSpherePlaneVisibility is new.
[2015.07.20-20.38.10:707][412]LogClass: Function SetSphereText is new.
[2015.07.20-20.38.10:707][412]LogClass: Function SetSphereTextVisibility is new.
[2015.07.20-20.38.10:707][412]LogClass: Function SetSphereVisibility is new.

Of course TransitionSphere already exists and is working properly before the hot reload. Modyfing its class will allow for the functions to still be “useable” after the hot reload, but clearly something went wrong…

Hope this can help track my problem down…

EDIT: Just adding here that BlueprintAssignale delegates seems to be always working fine, even on my problematic classes

UPDATE:
I’m still trying to track down the issue, printing hot reload info, I can see that the hot reload itself seems to be working, all functions are found and seems to be correctly replaced. The new .dll itself is valid and restarting the editor pointing on that .dll works fine.

What seems to be the problem right now is the Blueprint compiler. For some reason, FindField does not always find the function. Important note: some functions are correctly found, some other are not. For example in one class I have a function name ClearVO() that is not found after hot reload and recompiling the blueprint using it. However, I added a function called TestNPC() that is the exact same function that is ClearVO() but only with a different name, and this one is correctly found.

It does not always work as I created a new functions after that (in the same class) named ClearVO2() and this one is not found either.

I’m really confused, I’m guessing an Epic Employee familiar with HotReload and/or the Blueprint Compiler could find out the problem really quickly…

Well I found my answer, after a complete day of debugging!

Looks like delegate declaration inside the class declaration gets broken after a hot reload. For some reason, the UField linked list is broken when searching for BlueprintCallable UFunctions.

I believe this is a bug in the HotReload, since the initial compilation works correctly. However, all the functions are correctly remapped, so it’s somewhere else that the “Next” link gets nulled, don’t know where, but when I noticed this only happened on _DelegateSignature, I promptly removed them from my problematic classes solving my issue.

//Do not put this inside the class declaration, put it outside
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnMakeMeExplodeAfterHotReload);

To be fair, in the source most of those are done outside class declaration but some are not. If this is not intended to be in the class declaration UBT should warn me so!

This was pretty frustrating to debug to say the least. Also, it was working in versions of the engine prior to 4.8…

Hope this can help someone else. Oh, and if you are someone from Epic, please add this to the TO FIX list.

Hi ,

I’m looking into reproducing this issue so that I can write up a bug report and put it into our database. As you were able to find the root of the problem on your own, would you be able to either provide a project where the issue is occurring or a list of reproduction steps to reproduce it from a fresh project?

Hi ,

I tried reproducing the issue in a fresh project without success. Since then I also discovered other issues related to the HotReload and I’m really at a loss on what to do.

The particular issue above is solved using the technique I describe, but other issues arise…

Is there any known reason why I’m having such issues with HotReload? Anything obvious?

For example,right now trying to save a map after a Hot Reload result in this error: Warning Can’t save …/…/…/…/Game/Jotunn/Content/Maps/ProtoMap.umap: Graph is linked to external private object (unknown culprit) (unknown property ref)

Another example is that some of my nodes using custom Enums stop working until I do a Refresh Nodes on them.

I’m able to iterate quickly again, thankfully, but this is still a major concern. Any help would be appreciated!

After messing around with this some more, I’ve been able to hook myself to the OnHotReload() delegate of the HotReload module and force a Refresh all nodes FBlueprintEditorUtils::RefreshAllNodes(); on the level blueprint. This solves both of my new issues : the save map error and the enum not showing up correctly.

Now, I imagine something equivalent should already happen in the HotReload process, and I’m assuming that for some reason in my project this is not happening. If I could get an idea of where this usually happen, I could be able to pinpoint the exact issue…Suggestions?

Thanks for the help on this…

Hey ,

As you ran into this same error, even though you worked around it, you may want to look at this post about the saving issue you were having.

As far as your latest comment, I can’t think of where that would be off the top of my head but I’ll be looking into it and I’ll get back to you as soon as possible.

Hey ,

In that issue, it seems like it is due to an object created with the wrong outer and then associated to a blueprint Variable, thus causing the issue. In my test case, I don’t even have any variable in my level blueprint except an integer.

Here what it looks like exactly :

BEFORE HOT RELOAD:

AFTER HOT RELOAD:

If I try to save now, it will do the “Graph is linked to external private object” error.

Then I hit the refresh all nodes in the level blueprint (or in code using FBlueprintEditorUtils::RefreshAllNodes():wink: and this is what it looks like after:

Now I can save! The only issue remaining is that it breaks some links (like you can see in the image) but otherwise the game is working.

I keep thinking maybe it’s in the merge to 4.8 that something went wrong but this seems unlikely as everything else is working fine and I can work around the hotreload issue if I’m careful/force some operations on my own.

Anyway, any hint to help solve this issue is appreciated! Thanks again.

You’re not alone. I’ve encountered issues in 4.8.x that involve losing custom events and more recently switch statements losing their enum input type. These have been fixed by replacing the nodes in question and I haven’t reported the issue. Early versions had the external private object issue you report but more recently I’ve just been hitting the loss of custom events / switch issues on full reload after building blueprints based on hot reloaded functionality.

Glad to know I’m not alone in this. Trying to reproduce the issue in a new project did not work for me, so it’s nice to know that it’s not project related.

That being said, you solved your issue how exactly, just removing the switch entirely and replacing it? Is that a permanent solution? Like, do you have to do that every time you hot reload or only once? I ask because I already tried that and it just breaks the next time I hot reload.

I’m afraid that it just cleared up after deleting the nodes and recreating (permanent solution). I had the same thing happen when I ported the code over too MAC and did a hot reload there.

Order of ops on my experience:

  1. Change something (add an enum in C++, on hot reload utilize in BP switch, everything works).
  2. Reload the game from scratch (same code we just hotreloaded).
  3. Press play - oh I seem to have blueprint compile errors
  4. Delete nodes with errors and recreate
  5. All is now well in the world

With events the error was that the custom event did not exist.
With the switch statement the error seemed to be that the enum type did not exist.

In the early 4.8 builds I seem to remember that the names complained about had “hotreload” in them, couldn’t swear that has been the case more recently, I don’t run into this very often and as the fix has been trivial have been of a “move on” attitude - will pay more attention next time it happens though.

Last thought - have you tried 4.9? I haven’t checked into the new build yet but as this functionality is obviously all in flux there’s a chance of a fix.

Oh alright.

No haven’t tried 4.9 yet. We have some merging to do when switching engine version so we only do it once new versions are officially released. For some reason Merge Integrate doesnt work that well for us, so yeah, we don’t switch engine version too often.

Merge from 4.5 to 4.7 went well, from 4.7 to 4.8 went OK overall but had some issues like the hot reload that just seems broken.

Thanks, and let me know what it says if this happens again toyou.

Are you still on 4.8.1?

I concur with , if possible, please try making a copy of the project and seeing if the issue occurs in the 4.9 Preview (Or possibly 4.8.3) as there have been multiple issues revolving around hot reload 4.8’s release that have had fixes integrated. I obviously can’t know if this particular issue is fixed as I can’t reproduce it so this would be helpful.

The reason I asked if you were still on 4.8.1 is that I experienced reload issues in early 4.8 builds that sound similar to your experience that have been fixed - so if you aren’t on a later 4.8 I suspect you are hitting your head against a bug that’s always fixed.

Merging to 4.9 is not a 1 click thing for us, just grabbing and merging engine changes take at least a full day. I’ll get by with my workaround for now, but there is definetly something strange. I’ll update here if I find a way to repro in a fresh project.

I’m on 4.8.2 to be exact.

Hi ,

I understand that you must be using some sort of source control for your project and/or engine so merging would be a problem but I would suggest downloading 4.9 separately instead of merging to it, and making a copy of your project.

I would never suggest merging directly to 4.9 Preview as it is not fully tested. However, if you can try a copy of your project in the 4.9 engine, the issue may be resolved. There were multiple hot reload issues in the 4.8 release that were focused on and are expected to be resolved in 4.9.

Without a way to reproduce this myself, I need to rely on you to give 4.9 a try.

The thing is we have a modified version of the 4.8.2 engine, so to copy my project for 4.9 is not something I can really do as I need some of those modification for the project to run.