x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Infinite Loop] Workaround for bug causing stuck at loading 70%, 71%, or 72%

We have had a problem where unreal locks up on load (after working in a session where everything worked), and have tracked it down. This is a serious issue because you lose all your work and have to revert back to the last time you made a backup to be able to fix anything. No log is produced in this case.

Our structure is that we have an OurGameModeCPP, with an OurGameModeBlueprint inherited from it for setting custom defaults in editor We have a OurPlayerCharacterCPP, with an OurPlayerCharacterBlueprint inherited from it. OurPlayerCharacterBlueprint is the default pawn.

What we were finding is that if OurPlayerCharacterBlueprint (or any class that it contained a reference to) did a GetGameMode() into a Cast To OurGameModeblueprint, the editor would never load again (even if this cast was never executed). If we changed it to a Cast To OurGameModeCPP, there would be no problem. Note that this happens even if the cast is never executed (just floating free).

We finally tracked down the problem to this code in the constructor of OurGameModeCPP:

 static ConstructorHelpers::FClassFinder PlayerPawnBPClass(TEXT("/Game/Blueprints/OurPlayerCharacterBlueprint")); 
 if (PlayerPawnBPClass.Class != NULL)
 {
 DefaultPawnClass = PlayerPawnBPClass.Class;
 }

If we removed this code there was no longer a problem, even though this is how setting a default pawn class is done in Unreal CPP (I think many of the samples do this).

If I had to guess on the bug (here's where I lose my cred), it's that during the process of loading, the system loads in class definitions on demand. OurGameModeBlueprint has a reference to OurGameModeCPP which then on construction has a reference to OurPlayerCharacterBlueprint class which refers to OurGameModeBlueprint again (because it contains the cast to OurGameModeBlueprint) which isn't identified as being loaded, so it starts the cycle again. In general this reference stuff is robust, but something about child/parent classes mixing with c++/blueprint breaks it.

Anyways, if anyone else has this problem (I see several unanswered questions about this on the forums), our workaround is to put all the blueprint functionality in c++ and then always cast to the CPP class instead of the blueprint class. This has made things robust again.

-Michael

Product Version: UE 4.13
Tags:
more ▼

asked Oct 27 '16 at 03:20 PM in C++ Programming

avatar image

DigitalMage
396 11 8 25

(comments are locked)
10|2000 characters needed characters left

5 answers: sort voted first

Hey DigitalMage-

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here https://issues.unrealengine.com/issue/UE-37922 . You can track the report's status as the issue is reviewed by our development staff.

As a workaround to avoid the freeze, it would be best to simply define the default pawn in your gamemode blueprint rather than in the class.

Cheers

Doug Wilson

more ▼

answered Oct 27 '16 at 09:43 PM

(comments are locked)
10|2000 characters needed characters left

This bug still exists in 4.15.1 just FYI. I was trying to build my project off the multiplayer shootout example and this answer makes me think I should scrap the project for a pure blueprint project because the code stuff feels over my head. It was working fine a few hours ago and now I'm stuck at 71%. Thanks for the answer though good work guys god bless

more ▼

answered Apr 11 '17 at 10:17 AM

avatar image

DanzigLucifuge
91 1 5 6

avatar image Doug E ♦♦ STAFF Apr 11 '17 at 12:36 PM

Hey DanzigLucifuge-

Can you explain exactly what is happening in your case? After creating a Multiplayer Shootout project, what changes were made before you encountered this loading issue? Please provide any information to help me investigate the behavior locally.

avatar image DanzigLucifuge Apr 11 '17 at 01:33 PM

I will try to tell you everything I can remember before the load problem. I enabled the experimental plugin for editing code. I also imported some procedural midi assets and made child classes of the midi assets, did some experimenting with variables within the midi assets. I looked for a way of casting variables to and from game mode classes, but I don't think I acted on it. I don't think I did any work in BP with that.

These are the changes made hours before the load problem. I created this project a month or so ago and did so much in it that there is no way to tell it all. I did run a defrag which (I think) broke the midi assets I had in the project somehow it ruined their references to the original c++ files, said they failed to load but they were all there. SO re-importing the midi assets worked in fixing it, and I had saved and reloaded a few times since before the load problem.

The main thing I'm sure of is that I made a child actor of one of the midi assets, and it had c++ parent files.

I tried deleting the midi assets and it still locks at 71%.

Also let me correct myself, it was not multiplayer shootout project it was the Shooter game example project from the learning section.

avatar image Doug E ♦♦ STAFF Apr 11 '17 at 03:00 PM

Unfortunately the steps provided are too vague to produce a reliable repro case for me. If you could reproduce the behavior in a new project and provide clear steps on what exactly was added to the project, or provide a sample project that shows the behavior occurring, we can investigate further.

avatar image DanzigLucifuge Apr 11 '17 at 11:38 PM

I narrowed it down to the player pawns folder. I'm not sure why it caused the error. Deleting the folder caused the editor to stop locking at 71%. Moving the assets also stopped the error from happening, but in both cases the attached error was thrown on load. SO basically when this error was not thrown, the project locked loading at 71%. When I moved the problem assets the project would throw this error on load, but succeeds in loading up. I'll check in and let you guys know if saving the pawns back into the level or something like this reproduces the problem. I hope this helps!

screenshot_8.png (250.8 kB)
avatar image DanzigLucifuge Apr 11 '17 at 11:39 PM

I narrowed it down to the player pawns folder. I'm not sure why it caused the error. Deleting the folder caused the editor to stop locking at 71%. Moving the assets also stopped the error from happening, but in both cases the attached error was thrown on load. SO basically when this error was not thrown, the project locked loading at 71%. When I moved the problem assets the project would throw this error on load, but succeeds in loading up. I'll check in and let you guys know if saving the pawns back into the level or something like this reproduces the problem. I hope this helps!

[1]: /storage/temp/133872-screenshot_8.png

avatar image DanzigLucifuge Apr 11 '17 at 11:56 PM

So, repeatedly the editor crashed when attempting to playtest until I recompliled the blueprints I had to move and changed their references to eachother. I also moved something in the level and re-saved it and then playtesting stop crashing the editor. Strange issue I'm sure and I hope running a defragment on the drive this was on didn't have anything to do with the issue. Thanks again guys this Engine is the best in the world keep up the good work.

(comments are locked)
10|2000 characters needed characters left

Still in 4.19.2, editor stops in 71-72% but my problem is with widgets (c++).

more ▼

answered May 31 '18 at 03:18 AM

avatar image

The_Teco
1 1 2

(comments are locked)
10|2000 characters needed characters left

This issue raised its ugly head again today. Ended up working around the issue by using a SoftClassPointer to the game mode in place of a the game mode class itself.

alt text

Worked like a charm.

more ▼

answered Aug 06 '18 at 06:00 AM

avatar image

Kris
544 18 21 33

(comments are locked)
10|2000 characters needed characters left

This is still happening exactly as described in the OP.

more ▼

answered Oct 01 '18 at 01:31 AM

avatar image

JoeWintergreen
321 10 18 28

avatar image Kris Oct 01 '18 at 06:34 AM

Can confirm that, as I've had it happen again by accident.

Doubtful it'll be fixed anytime soon, but at least now I have found a way to proceed:

  1. Roll back to a previous working version of the Blueprint.

  2. Open the editor.

  3. While in-editor, update to the latest version of the Blueprint.

  4. Fix the offending Blueprint and resave it.

  5. Restart the editor.

avatar image robert.manuszewski STAFF Oct 02 '18 at 10:31 AM

Unfortunately we have no plans of fixing it right now as it would require pretty much rewrite of some of the basic systems of the engine. The issue there is that the native AMyGameMode class is loading the character blueprint which has the same native AMyGameMode class as its export (dependency) so AMyGameMode's Class Default Object needs to be constructed on load which leads to a dead-lock caused by internal C++ guard on static local variables when re-entering the same constructor in one callstack.

avatar image JoeWintergreen Oct 02 '18 at 11:13 AM

Could it at least be guarded in some way? Give a compile error when you try to do this in a blueprint? Currently it's a big potential-data-loss issue, as it works fine until you restart the editor.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question