@Subsense Thank you for using DA.
#1
There are 2 ways of doing this. One way is to make the level streaming system keep the level state in memory (UE4 feature). So when the level is streamed out, it is hidden from the world (and hence does not render anything there) but keeps the state and data in memory. This is the easiest way and doesn’t require any change from your end. When the level is streamed back in, it will retain all your monsters in it with their health, and other state. The demo game uses this method to remember if the monsters in the room have been previously cleared or not
The other way is to save the state when you want to not just hide the streamed out level, but also unload it. In this case, I have a serialization framework that you can use as shown in the video below
To choose one of the above two methods, Select the Dungeon Actor and use this checkbox to control if you want to unload the chunks when they are hidden
https://i.imgur.com/oAk8UGm.png
Like mentioned above, if you leave this unchecked, you won’t have to do anything and your state will be restored when you walk back to the module again. If you do unload, then use the serialization framework like this:
https:///watch?v=438-hZD5wC8
#2
You can save this data in the game state (e.g. difficulty) and when your NPC spawner actor gets initialized, you can query the difficulty and spawn accordingly (3x more NPCs).
You can find an example of this in the demo game where, in the spawn room, you can step on a pressure pad and set a flag on whether you want NPCs to spawn in the game. I set this flag in the game state and whenever a player enters a module, the logic checks this flag before locking all the doors and spawning NPCs. It can be extended to spawn different NPCs or the number of NPCs.
Having external configuration variables to guide the generation of the flow dungeon is a useful feature and I’ll add it in the future