- Home /
Create a copy of a procedurally generated dungeon
Hello !
We are making a short project (3days +/-) and I'm in charge of developpement. We wanted to make a procedurally generated dungeon crawler, multiplayable (1v1) in which :
Each room's light can be lit or not by the player.
Depending of the light, the player (either vampire or human), gets damaged if the room's light isn't in the right position for him.
Our first idea was to have two identical dungeons, one for each player, and when a player turn on a room's light in his dungeon, the same on the other dungeon gets turned on too :
For example, the Human turn on the middle left of Dungeon A, and the middle left of Dungeon B also turns on.
That way, each player can search for the end without finding the other.
Having a short time and being kind of lost, I created a first procedurally generated dungeon (Zelda/Isaac like) which work pretty well for the moment. I followed David Leon's Zelda tutorial
However, I don't really know how I could "clone" the whole dungeon without getting references error and so on.
I also thought about making only one dungeon but I don't know how I could make a player invisible to the other.
Does anyone have an advice about how to deal with that, what could be the better way to do...?
Thank in advance ! Also, excuse me for possible english mistakes =/ Don't hesitate to ask informations if it can help!
Well, procedural generation or not, there has to be some kind of data created for the dungeon, like what each tile contains, the objects and their positions and rotations, where the player starts, and so on. This data you have to save so you can use it again to create teh same dungeon again. You can make objects invisible to each other by either giving them different layers and setting your cameras up so they do not render the other player object's layer, or add a script to each camera that uses the OnPreRender and OnPostRender functions to disable and enable the other player object's renderer.
Hm, actually the tiles are made by instantiating prefabs that contain their objects. But the other things like the tile's type and position are indeed stocked in some array. I get the idea and I think I have an idea on how to do thanks to you ! However, I went for the unique dungeon and played with layers and camera settings to make players invisible to each other. It may not be the best solution but it worked pretty good and was way faster x)
Anyway, thank you for your time and reply!