BenPyton / ProceduralDungeon

This is an Unreal Engine 4/5 plugin to generate procedural dungeon.
MIT License
527 stars 64 forks source link

Question: Is there a way to despawn and respawn individual rooms #16

Closed SevenToaster509 closed 1 year ago

SevenToaster509 commented 1 year ago

I just wanted to know this, as I wanted rooms to despawn as the player moves through the level, but when they come back the rooms respawn.

BenPyton commented 1 year ago

Hi Andipog,

Currently, the plugin doesn't support room's despawn/respawn.

The simple occlusion culling I've implemented is just a visibility toggle of the static actors of the rooms. I made that to keep the collisions of the hidden rooms so the pawns (like ennemies, etc.) can navigate outside of the player's room.

However, I think you can easily add the feature in the code : where I toggle the visibility of the rooms, you can instead load/unload the room's level instance. But I don't know if it will reset the actors inside.

If you just want to reset the actors of previously visited rooms, you can use the room's player detection. When the player enters, you would reset the actors like enemy spawners to respawn enemies for instance. I can't check right now, but I think you can do that in pure blueprint.

I don't know if that answers you question. If not, feel free to explain more what you want to do.

SevenToaster509 commented 1 year ago

Yes, I think you kind of answered the question, thanks, also how can I turn off the red box around each room? I think it's messing up reflections.

BenPyton commented 1 year ago

The red boxes are just a debug view, they are not displayed in shipping builds.

You can disable them in the editor by unchecking the Draw Debug field in the plugin settings.

SevenToaster509 commented 1 year ago

Oh ok, well thanks for the help!