Dungeon Generator
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Dungeon Generator
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
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Dungeon Generator
Updated to fix some bugs that were causing blocks to be placed incorrectly. Should be working correctly now.
Example of a 30 block dungeon (just counting the internal blocks, I have no idea how many border blocks there were)
Example of a 30 block dungeon (just counting the internal blocks, I have no idea how many border blocks there were)
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Dungeon Generator
That's frickin' awesome... I can't imagine what it would be like to get lost in a dungeon that inconceivably huge. Would definitely need some kind of help to get through it.
I wonder about giving the player an ability to leave chalk-marks on the walls, or maybe a pet guar that leads you to the exit.
I wonder about giving the player an ability to leave chalk-marks on the walls, or maybe a pet guar that leads you to the exit.
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Dungeon Generator
Or a cyanide pillInterkarma wrote:That's frickin' awesome... I can't imagine what it would be like to get lost in a dungeon that inconceivably huge. Would definitely need some kind of help to get through it.
I wonder about giving the player an ability to leave chalk-marks on the walls, or maybe a pet guar that leads you to the exit.
Question - have the required shaders for builds changed with the latest updates?
edit: Also, can you think of a way to find a dungeon (any dungeon) that would use a certain block? In other words, I have a block index / name, and I want to find any dungeons that use that block
Yeah, it's far larger than would ever be useful I think, it just made for a good screenshotNystul wrote:woah! this looks huge
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Dungeon Generator
LypyL wrote: Or a cyanide pill
Yep, much shorter list now! The only shaders you need are Standard, DaggerfallBillboardBatch, DaggerfallTilemap.LypyL wrote: Question - have the required shaders for builds changed with the latest updates?
Sure, just use API to brute-force iterate over the maps. This isn't the most efficient way to do this (takes a minute or two), but it's easy enough to follow.LypyL wrote: edit: Also, can you think of a way to find a dungeon (any dungeon) that would use a certain block? In other words, I have a block index / name, and I want to find any dungeons that use that block
Code: Select all
const string searchForBlock = "S0000999.RDB";
List<string> mapsContainingBlock = new List<string>();
MapsFile mapsFile = DaggerfallUnity.Instance.ContentReader.MapFileReader;
foreach (string regionName in mapsFile.RegionNames)
{
DFRegion region = mapsFile.GetRegion(regionName);
if (region.MapNames == null || region.MapNames.Length == 0)
continue;
foreach (string mapName in region.MapNames)
{
DFLocation location = mapsFile.GetLocation(regionName, mapName);
if (location.HasDungeon)
{
foreach (var block in location.Dungeon.Blocks)
{
if (block.BlockName == searchForBlock)
mapsContainingBlock.Add(string.Format("{0}/{1}", regionName, mapName));
}
}
}
}
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Dungeon Generator
Thanks for the info!Interkarma wrote: Snip
-
- Posts: 13
- Joined: Sun Jun 28, 2015 9:12 am
Re: Dungeon Generator
Jeeze that is a work of art! I'd love to crawl through that beast.
That would be awesome, and I would legitimately love to see something like this added!I wonder about giving the player an ability to leave chalk-marks on the walls
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Dungeon Generator
https://drive.google.com/file/d/0B8_oQw ... sp=sharing
Daggerfall: Descent
Just put a copy of the arena2 directory from Daggerfall into "Daggerfall_Descent_Data" and launch
Brakes - Space
Get unstuck - F1
Change Camera - f2
Toggle Free Look - f3
edit: Updated
Daggerfall: Descent
Just put a copy of the arena2 directory from Daggerfall into "Daggerfall_Descent_Data" and launch
Brakes - Space
Get unstuck - F1
Change Camera - f2
Toggle Free Look - f3
edit: Updated
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Dungeon Generator
Going to check this out today. Will get back to you later and let you know how it goes.LypyL wrote:https://drive.google.com/file/d/0B8_oQw ... sp=sharing
Daggerfall: Descent
Just put a copy of the arena2 directory from Daggerfall into "Daggerfall_Descent_Data" and launch
Brakes - Space
Change Camera - f2
Toggle Free Look - f3
edit: Updated