Procedural Generation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 14

Procedural Generation

Does anyone know of any good resources for learning procedural generation. I am wanting to generate 2D dungeon like structures for an rpg. I am using c++ Thanks in advance

9th Jun 2017, 3:59 AM
jay
jay - avatar
16 Answers
+ 5
Have you read this? http://www.nathanmwilliams.com/files/AnInvestigationIntoDungeonGeneration.pdf I know I would be the last person you'll expect an answer from in such topics... But, still try this. It may be of some help...
9th Jun 2017, 4:22 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 12
@jay specifically, a grid with 'wall' and 'not wall'. if not wall has less than 4 walls around it, stay not wall. else, turn into wall. vice versa for wall. then do a check for every tile probably around 3 times. that was the basis for my generation. I added stuff ontop of that to get what I wanted
9th Jun 2017, 6:09 AM
Ahri Fox
Ahri Fox - avatar
+ 11
to an extent, cellular automata can help with some of the concepts. it did for me, in generating realistic landmasses and caves.
9th Jun 2017, 5:43 AM
Ahri Fox
Ahri Fox - avatar
+ 10
one last thing... most rougelite indie games (like binding of isaac) have a set of handmade single rooms, but connect them to eachother randomly, and adjust to make sure there is a certain rooms like the door to the next level, or a shop. try that.
9th Jun 2017, 9:28 AM
Ahri Fox
Ahri Fox - avatar
9th Jun 2017, 4:23 AM
jay
jay - avatar
+ 7
@Ahri. Yeah I think that I will end up doing each room as a square/rectangle for now and build upon it later to do something similar to what you described. I always get too ambitious with these things
9th Jun 2017, 6:13 AM
jay
jay - avatar
+ 6
That may be what I need Kinshuk. Has much more theory than what I am reading and several methods! Thanks
9th Jun 2017, 4:26 AM
jay
jay - avatar
+ 6
@Jay Nice idea! I have been working on making windows apps with C++, as well as getting better with pointers. Do you have a theme for your rpg gsme idea?
9th Jun 2017, 5:03 AM
Manual
Manual - avatar
+ 6
This version is just going to be ascii. This is the sort of thing I was thinking. This is still highly subject to change https://code.sololearn.com/cthl9sk1wlgA/?ref=app @Ahri Thanks I will have to look into that! Edit.. that was a bad idea.. takes forever to load. I will trim it to just the sample maps i drew
9th Jun 2017, 5:49 AM
jay
jay - avatar
+ 6
Will do! Thanks for the suggestion! I have got rooms auto generating. It should be not much hassle to get it to insert certain rooms. Just working on the connecting corridors now. But dindins first
9th Jun 2017, 10:37 AM
jay
jay - avatar
+ 6
Oooooo now that I have a basic version working I dont know if I want to try doing it again using BSP trees or go with Cellular Automata... I mean what I have works but it isnt great.. there are random gaps.
9th Jun 2017, 12:53 PM
jay
jay - avatar
+ 5
This isnt for serious it will be bad for sure. But we all got to start somewhere 😁
9th Jun 2017, 4:40 AM
jay
jay - avatar
+ 5
Just a simple rpg ☺ solve the dungeon, kill the dragon, be the hero (save the princess/prince) it is more of a primer for myself before I jump into sdl again than a serious attempt
9th Jun 2017, 5:35 AM
jay
jay - avatar
+ 5
Update. Decided to do BSP first. Figure I will have to do something similar to this anyway for enemy placement so may as well learn that first
10th Jun 2017, 2:38 AM
jay
jay - avatar
+ 3
Glad to know that I could be helpful. I have to study a lot of other things first to get to serious game programming...
9th Jun 2017, 4:31 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 3
@jay I knew you could do it.
9th Jun 2017, 1:25 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar