I'm just wondering before i begin trying to create randomized terrain, if anyone has a previous work or asset i could look at and maybe use as a concept. I'm looking to generate something similar to a dungeon first and then maybe try outside environments which to me sounds more difficult.
The end goal would be to create multiple interiors comprised of rooms(and hallways) varying in shapes and sizes, with doors separating each section, and a randomized outside wilderness, without taking forever or lagging crazy
to me, this is an important step in making lots of maps have greater replay value, please help out, thank you.
I'm creating random dungeons including doodad placements in my map "Dia blo - Mortal Shroud" playable on US, EU and HotS beta.
For my cathedral I'm using rectangles with randomized dimensions as rooms and try to place them. I use the starting point as a doorway, so every new room is connected to the old one. Bigger rooms have a chance to spawn 4 pillars.
Basically you start with a random room placed somewhere in the dungeon area and then you try 2k times to add a random room to a random wall.
^ cathedral
For my catacombs, I'm using the same concept, just with different dimensions and a variance in the door wall side to create wider pathways. In addition to that I try to place rooms within free areas within rooms. In the end I try to add a lot of smallest room sizes which creates the unique look with the edges and corners.
Using a 2D array instead of units on the map for the cellular automata generation greatly improved the performance in my map.
I even created a system can add rivers to my caves with walkable bridges, but I don't recommend creating rivers with a scale of 1x1 as I did as the terrain modification via actors isn't great or customizeable in that scale. I "fixed" a few spots with bridge tiles for now...
Doodads at walls
For doodads at walls, I'm "simply" looking for correct spots. Every room I create has a marker unit in its center that saves data about its dimensions and its door count.
After the dungeon was created, I throw these markers into a system that randomly fills rooms with a random theme. Then it reads out the info, searches all potentially usable spots and picks random spots to create something there. In the end you will find libaries, shrine rooms, sleeping halls, work places, statue rooms, torture rooms...
Lag & solutions
You will most likely create a ton of lag ingame, if you attempt to create multiple dungeons with units forming walls. The unit limit is 15k, I think, but 9k can kill most computers already.
I'm using approx 1k of units per dungeon level and added a system that "unloads" levels. In the end I will always have approx 2k-4k units on my map.
Also, I'm hiding the snapshots in the "unloaded" dungeon regions (=building image in fog) because 4k of these on the map created a lot of lag.
"Unloading" means that I'm saving the data of the units in the dungeon into the global data table and read them out again when the dungeon needs to be loaded.
I found out that saving is faster, if the key already exists in the data table. So, if the amount of data in your dungeon can grow, you should try to create a few buffer slots. 2 million entries in the data table is no problem. Just loading and saving takes some time.
I recently added clusters or classes of unit types that I store a specific amount of custom values. At first I saved all 64 custom values, but only saving up to their upper border improved the loading/saving performance due to less load.
Outside areas and D3 and D2/1
I have not much experience with "outside" areas, but that can be made fairly simple. For example, Diablo 3 uses a set of huge squares that they place inside their static outside area. As you can see, the work amount to create these areas can be considerably different. It depends how in depth randomness you want to use. D3's inside dungeons are only huge random area parts added onto each other. Diablo 2 and 1 used a similar system, but they used much smaller tiles than D3. That's why D3 looks mostly the same... everywhere. However, D3s system should be generated very, very fast.
wonderful very informative, ive played your map prior to this thread, couple of questions, can you upload a concept map? also what exact unit do you use or find least laggy? And if you could clarify what u were saying about the 2d array, youre just suggesting for "outside" using bigger than 1x1? The map didnt calculate where it needed bridge tiles correct? Are you the same ahli from SEN back in the day?
Thank you for being on top of this. If anyone else wants to add feel free.
So what is blizzards deal, you can't use starcraft or any other copyrighted game name in a map? Is that why its called "dia blo"?
also what exact unit do you use or find least laggy?
Well, the biggest difference is its model. My dungeon exists out of structures because I'm using the footprints. Without footprints for everything the pathing is terrible because units will try to push more than walking around.
And if you could clarify what u were saying about the 2d array, youre just suggesting for "outside" using bigger than 1x1?
If you generate a dungeon, you need to store the data of the dungeon while it is constructed. For my cathedra/caves I'm creating units for walls, floor and use their HP value to store info about its type... like 1 is floor, 2 is wall, 3 is doorway.
I used a 2d array to store these values for my caves. It's faster to read the data out of the array than searching the unit and reading its life value out.
Someday I might improve my cathedral/cave generation code with that, too.
The map didnt calculate where it needed bridge tiles correct?
I hardcoded the positions where I cover smaller areas to avoid situations where you would stand within lava. The real bridges are randomly added to parts of the river to ensure that you can reach everything. My algorithm detects that it needs to add a bridge within the last created parts and adds one.
"No, but I will answer every question (if I notice them). :D"
Idk why people are reluctant to release concept maps. this makes it a lot harder on me because im like 100% visual learner vs auditory. Im trying to visualize what you did you know what i mean?
So do you have 4 separate areas that generate the different levels?
If no1 is inside the dungeon does it freeze all the units/walls/doors/doodads and create a data image of the dungeon to save on unit lag?
Anyway youve already given me enough info to attempt it, thank you so much.
"No, but I will answer every question (if I notice them). :D"
Idk why people are reluctant to release concept maps. this makes it a lot harder on me because im like 100% visual learner vs auditory. Im trying to visualize what you did you know what i mean?
So do you have 4 separate areas that generate the different levels?
If no1 is inside the dungeon does it freeze all the units/walls/doors/doodads and create a data image of the dungeon to save on unit lag?
Anyway youve already given me enough info to attempt it, thank you so much.
Well, my code for the dungeons is long and a bit messy. So, someone might write a less confusing code.
The core concept for a dungeon based on rooms is quite simple:
1. create a first random room.
2. pick a random wall and try to add a random room to it.
3. Repeat step 2.
So, everyone could write his own dungeon generation system based on this. You could read about roguelike games that do the same thing, too. That's how I learned the basics.
The dungeon generation code is pretty much one of my core systems and something that makes my map unique. If people want that feature, they need to learn and work for it.
Atm, I've 3 different functions that create the areas with their specific look.
I'm starting timers when a person leaves a dungeon. When the timer runs out, the units within are paused and unloaded. I transfer all of the required information to recreate the dungeon into the data table. I always have 2 dungeons unloaded.
Yes, I'm doing that to lower the performance costs of my map. If I wouldn't have done it, I couldn't have had the amount of dungeons I have now.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm just wondering before i begin trying to create randomized terrain, if anyone has a previous work or asset i could look at and maybe use as a concept. I'm looking to generate something similar to a dungeon first and then maybe try outside environments which to me sounds more difficult.
The end goal would be to create multiple interiors comprised of rooms(and hallways) varying in shapes and sizes, with doors separating each section, and a randomized outside wilderness, without taking forever or lagging crazy
to me, this is an important step in making lots of maps have greater replay value, please help out, thank you.
@TheOGZell: Go
I think this is what your looking for http://www.sc2mapster.com/forums/development/triggers/46167-monthly-ish-triggering-exercise-beta-key-editon/?page=2#p24
I'm creating random dungeons including doodad placements in my map "Dia blo - Mortal Shroud" playable on US, EU and HotS beta.
For my cathedral I'm using rectangles with randomized dimensions as rooms and try to place them. I use the starting point as a doorway, so every new room is connected to the old one. Bigger rooms have a chance to spawn 4 pillars.
Basically you start with a random room placed somewhere in the dungeon area and then you try 2k times to add a random room to a random wall.
^ cathedral
For my catacombs, I'm using the same concept, just with different dimensions and a variance in the door wall side to create wider pathways. In addition to that I try to place rooms within free areas within rooms. In the end I try to add a lot of smallest room sizes which creates the unique look with the edges and corners.
^ catacombs
For my caves, I'm using a http://roguebasin.roguelikedevelopment.org/index.php?title=Cellular_Automata_Method_for_Generating_Random_Cave-Like_Levels as a core algorithm. I'm throwing a few generated dungeons away when they aren't connected. This dungeon generation is the slowest.
^ caves
Using a 2D array instead of units on the map for the cellular automata generation greatly improved the performance in my map.
I even created a system can add rivers to my caves with walkable bridges, but I don't recommend creating rivers with a scale of 1x1 as I did as the terrain modification via actors isn't great or customizeable in that scale. I "fixed" a few spots with bridge tiles for now...
Doodads at walls
For doodads at walls, I'm "simply" looking for correct spots. Every room I create has a marker unit in its center that saves data about its dimensions and its door count.
After the dungeon was created, I throw these markers into a system that randomly fills rooms with a random theme. Then it reads out the info, searches all potentially usable spots and picks random spots to create something there. In the end you will find libaries, shrine rooms, sleeping halls, work places, statue rooms, torture rooms...
Lag & solutions
You will most likely create a ton of lag ingame, if you attempt to create multiple dungeons with units forming walls. The unit limit is 15k, I think, but 9k can kill most computers already.
I'm using approx 1k of units per dungeon level and added a system that "unloads" levels. In the end I will always have approx 2k-4k units on my map.
Also, I'm hiding the snapshots in the "unloaded" dungeon regions (=building image in fog) because 4k of these on the map created a lot of lag.
"Unloading" means that I'm saving the data of the units in the dungeon into the global data table and read them out again when the dungeon needs to be loaded.
I found out that saving is faster, if the key already exists in the data table. So, if the amount of data in your dungeon can grow, you should try to create a few buffer slots. 2 million entries in the data table is no problem. Just loading and saving takes some time.
I recently added clusters or classes of unit types that I store a specific amount of custom values. At first I saved all 64 custom values, but only saving up to their upper border improved the loading/saving performance due to less load.
Outside areas and D3 and D2/1
I have not much experience with "outside" areas, but that can be made fairly simple. For example, Diablo 3 uses a set of huge squares that they place inside their static outside area. As you can see, the work amount to create these areas can be considerably different. It depends how in depth randomness you want to use. D3's inside dungeons are only huge random area parts added onto each other. Diablo 2 and 1 used a similar system, but they used much smaller tiles than D3. That's why D3 looks mostly the same... everywhere. However, D3s system should be generated very, very fast.
Nice work.
wonderful very informative, ive played your map prior to this thread, couple of questions, can you upload a concept map? also what exact unit do you use or find least laggy? And if you could clarify what u were saying about the 2d array, youre just suggesting for "outside" using bigger than 1x1? The map didnt calculate where it needed bridge tiles correct? Are you the same ahli from SEN back in the day?
Thank you for being on top of this. If anyone else wants to add feel free.
So what is blizzards deal, you can't use starcraft or any other copyrighted game name in a map? Is that why its called "dia blo"?
No, but I will answer every question (if I notice them). :D
Well, the biggest difference is its model. My dungeon exists out of structures because I'm using the footprints. Without footprints for everything the pathing is terrible because units will try to push more than walking around.
If you generate a dungeon, you need to store the data of the dungeon while it is constructed. For my cathedra/caves I'm creating units for walls, floor and use their HP value to store info about its type... like 1 is floor, 2 is wall, 3 is doorway.
I used a 2d array to store these values for my caves. It's faster to read the data out of the array than searching the unit and reading its life value out.
Someday I might improve my cathedral/cave generation code with that, too.
I hardcoded the positions where I cover smaller areas to avoid situations where you would stand within lava. The real bridges are randomly added to parts of the river to ensure that you can reach everything. My algorithm detects that it needs to add a bridge within the last created parts and adds one.
Yes. Also, SEN still exists.
The map editor didn't like "Diablo". So, I added a space.
"No, but I will answer every question (if I notice them). :D"
Idk why people are reluctant to release concept maps. this makes it a lot harder on me because im like 100% visual learner vs auditory. Im trying to visualize what you did you know what i mean?
So do you have 4 separate areas that generate the different levels?
If no1 is inside the dungeon does it freeze all the units/walls/doors/doodads and create a data image of the dungeon to save on unit lag?
Anyway youve already given me enough info to attempt it, thank you so much.
Well, my code for the dungeons is long and a bit messy. So, someone might write a less confusing code.
The core concept for a dungeon based on rooms is quite simple: 1. create a first random room. 2. pick a random wall and try to add a random room to it. 3. Repeat step 2.
So, everyone could write his own dungeon generation system based on this. You could read about roguelike games that do the same thing, too. That's how I learned the basics.
The dungeon generation code is pretty much one of my core systems and something that makes my map unique. If people want that feature, they need to learn and work for it.
Atm, I've 3 different functions that create the areas with their specific look.
I'm starting timers when a person leaves a dungeon. When the timer runs out, the units within are paused and unloaded. I transfer all of the required information to recreate the dungeon into the data table. I always have 2 dungeons unloaded. Yes, I'm doing that to lower the performance costs of my map. If I wouldn't have done it, I couldn't have had the amount of dungeons I have now.