* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Random dungeon generation  (Read 2404 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 284
  • Post Rating Ratio: +8/-0
    • View Profile
    • 8times8
  • Gender: Male
Random dungeon generation
« on: August 13, 2015, 11:56:59 am »
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.
« Last Edit: August 15, 2015, 12:26:20 pm by Keoni29 »


If you like my work, why not give me an internet?

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3150
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Random dungeon generation
« Reply #1 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?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Random dungeon generation
« Reply #2 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. :)
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Keoni29

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 284
  • Post Rating Ratio: +8/-0
    • View Profile
    • 8times8
  • Gender: Male
Re: Random dungeon generation
« Reply #3 on: August 15, 2015, 12:22:52 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.

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:
« Last Edit: August 15, 2015, 12:26:47 pm by Keoni29 »
If you like my work, why not give me an internet?

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Random dungeon generation
« Reply #4 on: August 15, 2015, 06:13:35 pm »
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Keoni29

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 284
  • Post Rating Ratio: +8/-0
    • View Profile
    • 8times8
  • Gender: Male
Re: Random dungeon generation
« Reply #5 on: August 15, 2015, 06:16:10 pm »
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?

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Random dungeon generation
« Reply #6 on: August 15, 2015, 07:14:49 pm »
THis would be great if you could implement items in your map generator :P
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline CKH4

  • Extravagant Sushi
  • Super User
  • Join Date: Jan 2015
  • Location:
  • Posts: 872
  • Post Rating Ratio: +3/-2
    • View Profile
  • Gender: Male
Re: Random dungeon generation
« Reply #7 on: August 15, 2015, 07:25:44 pm »
Wow this is awesome, I can't wait to see the code.
  • Calculators owned: TI-83+, TI-84+


Offline Keoni29

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 284
  • Post Rating Ratio: +8/-0
    • View Profile
    • 8times8
  • Gender: Male
Re: Random dungeon generation
« Reply #8 on: August 19, 2015, 07:29:32 am »
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.

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?

Offline CKH4

  • Extravagant Sushi
  • Super User
  • Join Date: Jan 2015
  • Location:
  • Posts: 872
  • Post Rating Ratio: +3/-2
    • View Profile
  • Gender: Male
Re: Random dungeon generation
« Reply #9 on: August 21, 2015, 11:08:57 pm »
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+


Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Random dungeon generation
« Reply #10 on: August 22, 2015, 01:34:27 am »
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.

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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline CKH4

  • Extravagant Sushi
  • Super User
  • Join Date: Jan 2015
  • Location:
  • Posts: 872
  • Post Rating Ratio: +3/-2
    • View Profile
  • Gender: Male
Re: Random dungeon generation
« Reply #11 on: August 23, 2015, 10:13:04 am »
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.
« Last Edit: August 23, 2015, 10:21:30 am by CKH4 »
  • Calculators owned: TI-83+, TI-84+


Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17827
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: Random dungeon generation
« Reply #12 on: August 23, 2015, 03:39:49 pm »
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline CKH4

  • Extravagant Sushi
  • Super User
  • Join Date: Jan 2015
  • Location:
  • Posts: 872
  • Post Rating Ratio: +3/-2
    • View Profile
  • Gender: Male
Re: Random dungeon generation
« Reply #13 on: August 23, 2015, 03:55:38 pm »
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+


Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3150
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: Random dungeon generation
« Reply #14 on: August 23, 2015, 08:54:48 pm »
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...


 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games