Dear community,
For some reason I found myself with the problem that my blueprint that builds the level based on a seed number, cannot read the SeedNumber variable from the SaveGame when the game is packaged.
In the Editor the BP has no problem to read out the SaveGame and everything works as wanted/intended.
I already made an answerhub topic, but there doesn’t seem to be any interest there to find a solution:
As I initially thought this was more Android related, it seems to be occurring also when packaging it for Windows (.exe). So the problem doesn’t seem to be platform depended.
The weirdest thing about this problem is this:
The BP generates the level (when packaged) based on the seed that was entered in the Editor before packaging. Still ignoring whatever was entered in the SaveGame variable.
So:
In editor I set SeedNumber (for InitialSeed) to i.e. 1337.
I press play, and the BP generates the level based on seed 1337.
In the game, I can go to the Game Menu, change the seed to i.e. 80085.
I press the “Play” button in the menu so that it opens the Map with the BP in it, and the BP generates a level based on seed 80085.
This is as it’s made and should work.
Then when I package the game. No matter what, the BP will ALWAYS generate the level based on seed 80085. It will never be changed no matter what is entered in the SeedNumber variable in the savegame.
I’m confused by this! In theory, the SeedNumber variable should be unable to generate the level based on seed 80085 according to my own analyse, and here is why:
-
First time you launch the game, it creates the SaveGame file with the default inputs set in the variables. For the SeedNumber this is simply “1”. So, it should generate the level based on seed 1.
-
Everytime when I package my game, I delete every SaveGame file in the Editor directory and in the Windows Profile (C:\Users<username>\AppData<gamename><savegame-name>). This should render the packaged game unable to ever find back the seed entered in the editor (80085). Yet it renders the BP level based on the last SeedNumber entered in the Editor-player.
I’m becoming really clueless on how to solve this problem. It works in Editor, but not when Packaged. The SaveGame is being stored and updated with data is changed (such as SeedNumber). The Game Menu and Ingame HUD are able to load the SeedNumber, only the BP that generates the level can’t.
Does anyone had similar issues? How did you solve it? Or does anyone have a idea on where to search for the cause of this problem?
Thank you in advance.