Dungeon Generator
Posted: Thu Jul 09, 2015 6:26 am
Current Version: 1.2
https://drive.google.com/file/d/0B8_oQw ... sp=sharing
Setup Instructions:
1. Import as custom package in Unity (Assets > Import Package > Custom Package)
2. Drag the DungeonGenerator prefab into scene
3. Play scene, set parameters as desired and click "Create New Dungeon" (or call CreateDungeon() from code)
Some basics about the settings:
Seed - Leave it at zero to get a random dungeon every time. Otherwise, the resulting dungeon will always be the same for the provided seed.
Number of internal blocks - This doesn't include the root block. So if you set this to zero or below, you will still get a root block (and 4 border blocks), at 1 you will get a root block + 1 internal block and so on
Number of exit blocks - the generator can create dungeons with additional start/exit blocks. The total # of exits can't exceed the # of internal blocks of course. Set to 0 for just 1 dungeon exit like normal.
Min Distance from root - This is a distance you want all your additional exit blocks to be at least from the root block (I'm presuming the root block will be the starting block, and others used as exits, so it's desirable to have some distance between them). The generator will always try and make the start blocks as far away as possible, and will try and brute force generate different layouts for a while until all the starting blocks are at least that far away. There is no guarantee they will be in the end (and it might impossible based on the given settings)
There isn't currently an easy way to get the player object inside of the dungeon. If you want to run around inside a dungeon you generated, the easiest way is to parent the player object to something in the dungeon and set it's position to (0,0,0) for now.
Additional information
http://imgur.com/a/LcqZh
https://drive.google.com/file/d/0B8_oQw ... sp=sharing
Setup Instructions:
1. Import as custom package in Unity (Assets > Import Package > Custom Package)
2. Drag the DungeonGenerator prefab into scene
3. Play scene, set parameters as desired and click "Create New Dungeon" (or call CreateDungeon() from code)
Some basics about the settings:
Seed - Leave it at zero to get a random dungeon every time. Otherwise, the resulting dungeon will always be the same for the provided seed.
Number of internal blocks - This doesn't include the root block. So if you set this to zero or below, you will still get a root block (and 4 border blocks), at 1 you will get a root block + 1 internal block and so on
Number of exit blocks - the generator can create dungeons with additional start/exit blocks. The total # of exits can't exceed the # of internal blocks of course. Set to 0 for just 1 dungeon exit like normal.
Min Distance from root - This is a distance you want all your additional exit blocks to be at least from the root block (I'm presuming the root block will be the starting block, and others used as exits, so it's desirable to have some distance between them). The generator will always try and make the start blocks as far away as possible, and will try and brute force generate different layouts for a while until all the starting blocks are at least that far away. There is no guarantee they will be in the end (and it might impossible based on the given settings)
There isn't currently an easy way to get the player object inside of the dungeon. If you want to run around inside a dungeon you generated, the easiest way is to parent the player object to something in the dungeon and set it's position to (0,0,0) for now.
Additional information
http://imgur.com/a/LcqZh