What template was this project based on (a blank project, blueprint first person, etc.) and do you get this same crash when working in a fresh project? Also, what exactly were you doing when this crash happened? Were you running play in editor or was it a standalone? If you could post your logs and dump file from the crash it will help us determine where to look for the cause. This link shows where inside your Project folder you can find the Log files: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums
If you add .txt to the end of the file name then you should be able to upload to AnswerHub without an issue. Also, what version of the engine are you working in? Did you get the same get the same crash in a new project?
You should be able to just take the log file from the Logs folder of the project and add .txt to it (so it looks like "FileName.log.txt). As for the other template you shouldn’t have to move any code. The process of checking a fresh project is to see if the error occurs in a project that hasn’t had anything added to it.
The crash indicated that you have a reference to the level within your GameSingleton. This will crash in development but result in a memory leak in shipping because the previous level could not be unloaded completely. It is not a good idea to hold level references (spawned actors for example) within the GameSingleton, or classes that are not within the real of a level (any global stuff that won’t get GC’ed automatically basically). The strange thing is that AStartData is handled by the engine and should get cleared in both cases, when you travel to a new level and when you close the PIE.
I guess as a work around you could clear the AllNodes list before the PIE gets closed and before you load a new level.
So how to clear this before PIE gets closed? And while youre at it whats a PIE?
And how better can i store references to all the fields on the map that i have? I need some way to deactivate them when im generating a new route.
In order to narrow down where this crash is occurring could you do the following. Starting with a new project could you copy over small portions of your code, testing the game with each import until the crash occurs. This will help determine where the crash is coming from and where to start looking to fix it.
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.
I had the same issue, fixed it by implementing EndPlay(const EEndPlayReason::Type EndPlayReason) for my actor where I removed all actor references from my game singleton when the level exits.
For my understanding, is holding actor references in a (custom) game mode class is a better choice than the game singleton? The only reason I chose the singleton as opposed to the game mode is that getting the game mode object needs access to a UWorld instance, so my static BlueprintFunctionLibrary functions need one extra parameter (the ‘world’) passed explicitly form blueprints so I thought using a singleton was more concise. Assuming that I ensure to clean up all references properly on ‘end play’ is it still a bad idea to use the singleton for storing references to important actors?
I think it is bad practice to store references in the game singleton or game instance classes, it can just lead to crashes if someone forgets to cleanup on a travel. I’m also not sure if ‘EndPlay’ is getting called when you have a disconnection in a network game for example, a disconnect or any other network error will travel you back to your default level but will it call ‘EndPlay’?
Thanks for your concern however your question (Is using singleton good/bad?) does not relate to the original error Illusive_S posted about. If you feel you are experiencing a bug then feel free to create a new post so that it can receive proper recognition, otherwise a question of “best practice” would receive a more in depth conversation on the forums (https://forums.unrealengine.com/forum.php).