Join us on Discord!
You can help CodeWalrus stay online by donating here.

Random dungeon generation

Started by Keoni29, August 13, 2015, 11:56:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Keoni29

I am experimenting with random dungeon/world generation. The algoritm creates rooms in a 2d grid. When a room is created there is a chance that new rooms spawn in an adjacent empty spot. I used recursive code to implement this.
If you like my work, why not give me an internet?

Snektron

Looks pretty sweet. Maybe you can release the algorithm and allow user to make dungeons with it?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Very nice work. I am curious if you plan to use this in Herocore? How large is the program? It would be interesting if this could be made into a BASIC lib or something for people who wants to make Rogue-like games. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Keoni29

#3
Quote from: Cumred_Snektron on August 13, 2015, 09:59:59 PM
Looks pretty sweet. Maybe you can release the algorithm and allow user to make dungeons with it?
Here is the AXE source code and executable attached down below.

Quote from: DJ Omnimaga on August 14, 2015, 11:28:15 AM
Very nice work. I am curious if you plan to use this in Herocore? How large is the program? It would be interesting if this could be made into a BASIC lib or something for people who wants to make Rogue-like games. :)
For Hero Core the algorithm would have to be expanded with item rooms and save rooms, barriers and bosses. This is very complex and it's probably better to make a world manually in a level editor. The program is smaller than 2k with absolutely no optimizations and fast compilation. It could probably be coded in BASIC as well. No need to make a library for it.

Edit: made a screenshot:
If you like my work, why not give me an internet?

Dream of Omnimaga

Looks very nice. As for BASIC I bet it would be extremely slow, though lol.

Maybe some sort of Zelda game with random dungeons and item placements for maximum replay value?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Keoni29

I read an article about zelda-like dungeon generation after I wrote my algorithm. It incorporates item-based puzzles in the generator.
http://bytten-studio.com/devlog//2012/01/21/procedural-dungeon-generation-part-i/
If you like my work, why not give me an internet?

Dream of Omnimaga

THis would be great if you could implement items in your map generator :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CKH4

Wow this is awesome, I can't wait to see the code.
  • Calculators owned: TI-83+, TI-84+


Keoni29

Quote from: DJ Omnimaga on August 15, 2015, 07:14:49 PM
THis would be great if you could implement items in your map generator :P
What you would typically do is put items in dead ends: rooms with just one entrance. You can seal these entrances with puzzles and locks that require other items. It's up to another algorithm to generate the contents of the rooms.

Quote from: CKH4 on August 15, 2015, 07:25:44 PM
Wow this is awesome, I can't wait to see the code.
Good news. You already could!
If you like my work, why not give me an internet?

CKH4

I finally had time to look at the source and wow, I get about none of it. Maybe I'll be able to decifer some of it later. The speed is fantastic though. Good job on it.
  • Calculators owned: TI-83+, TI-84+


Dream of Omnimaga

Quote from: Keoni29 on August 19, 2015, 07:29:32 AM
Quote from: DJ Omnimaga on August 15, 2015, 07:14:49 PM
THis would be great if you could implement items in your map generator :P
What you would typically do is put items in dead ends: rooms with just one entrance. You can seal these entrances with puzzles and locks that require other items. It's up to another algorithm to generate the contents of the rooms.

Quote from: CKH4 on August 15, 2015, 07:25:44 PM
Wow this is awesome, I can't wait to see the code.
Good news. You already could!
Yep, items in dead ends is what I thought. You also have to make sure that related items are not too close to each others, though, such as for example if you scatter locked chests that can be only opened with 1 key, then scatter keys around. You would need to ensure that the keys are not right next to the chests they can open.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CKH4

#11
Quote from: DJ Omnimaga on August 15, 2015, 06:13:35 PM
Looks very nice. As for BASIC I bet it would be extremely slow, though lol.l
Nope, I made a basic one using a map of random points (although it doesn't use path based but that could be added or faked easily).

This takes about 10 seconds.
  • Calculators owned: TI-83+, TI-84+


Dream of Omnimaga

OOh that's not bad. I thought such stuff would be much slower. It would definitively be handy for people making BASIC Rogue-likes. Maybe @123outerme could implement it in Solius?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CKH4

He probably could, I'll make a thread and mention him in it in case he's interested but for now I can't do anymore work on it because I wrote it on my phone.

Also good luck keoni, I can't think of a way to encode the data for the keys and doors so hopefully you can.
  • Calculators owned: TI-83+, TI-84+


Snektron

So since we're talking about random generation anyway... A perlin noise function (and a world generated with that) on calc would be awesome O.O
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Powered by EzPortal