Random dungeon generation

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
nyenye
Citizen
Posts: 62
Joined: Fri Dec 02, 2016 1:44 pm

Random dungeon generation

Post by nyenye » Tue Jun 06, 2017 7:01 pm

I've made this little tool/lib for a little project, and I thought maybe someone could use it to make something cool, or just take a peak at the code.

This is a basic dungeon generator, inspired by Zelda NES, where every door leads to a room of equal size. There are no pathways. A Dungeon instance, is aware of the 'start_room', and the 'end_room', and have each room on a matrix of customizable size.

It's been made thought so every room will own it's entities (be it enemies, items, or furniture), so you can have many entities, but only update the ones, on the 'active_room'. Remains to be implemented though.

It's under MIT license so do whatever you want with it.

That's all.

Github: https://github.com/nyenye/DungeonGenerator
Attachments
dungeon_generation.gif
dungeon_generation.gif (233.09 KiB) Viewed 2586 times
dungeon_generator.love
(4.63 KiB) Downloaded 72 times
Last edited by nyenye on Wed Jun 07, 2017 9:52 am, edited 1 time in total.

User avatar
yetneverdone
Party member
Posts: 349
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Random dungeon generation

Post by yetneverdone » Wed Jun 07, 2017 8:16 am

nyenye wrote:
Tue Jun 06, 2017 7:01 pm
I've made this little tool/lib for a little project, and I thought maybe someone could use it to make something cool, or just take a peak at the code.

This is a basic dungeon generator, inspired by Zelda NES, where every door leads to a room of equal size. There are no pathways. A Dungeon instance, is aware of the 'start_room', and the 'end_room', and have each room on a matrix of customizable size.

It's been made thought so every room will own it's entities (be it enemies, items, or furniture), so you can have many entities, but only update the ones, on the 'active_room'. Remains to be implemented though.

It's under MIT license so do whatever you want with it.

That's all.
Awesome and very useful. It would be great if you would upload it in a github repo

nyenye
Citizen
Posts: 62
Joined: Fri Dec 02, 2016 1:44 pm

Re: Random dungeon generation

Post by nyenye » Wed Jun 07, 2017 9:52 am

yetneverdone wrote:
Wed Jun 07, 2017 8:16 am
Awesome and very useful. It would be great if you would upload it in a github repo
Uuups... forgot to add the repo. Edited post.

User avatar
yetneverdone
Party member
Posts: 349
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Random dungeon generation

Post by yetneverdone » Wed Jun 07, 2017 12:49 pm

1. On the basis of the classic Zelda game on NES, would your dungeon generator provide an overview of the whole dungeon and only apply a camera view to the current active room? Or could each room be like a gamestate, where entering/leaving a room go to the next room?

2. Is it possible that you will add more api or document the current functions that work?

nyenye
Citizen
Posts: 62
Joined: Fri Dec 02, 2016 1:44 pm

Re: Random dungeon generation

Post by nyenye » Wed Jun 07, 2017 7:09 pm

yetneverdone wrote:
Wed Jun 07, 2017 12:49 pm
1. On the basis of the classic Zelda game on NES, would your dungeon generator provide an overview of the whole dungeon and only apply a camera view to the current active room? Or could each room be like a gamestate, where entering/leaving a room go to the next room?
What I had in mind is that you would only need to call update() on the dungeon object; which in turn will call update() on the current room; which will cal update() on all of its entities. The same for a draw() call.

About the camera, maybe leaving it a position (0, 0) and drawing the room with an offset, would suffice. Maybe not :P

When the player exits by a door, maybe calling a onExit() function with the door as argument, which would lead to update current_room, to the new one.
yetneverdone wrote:
Wed Jun 07, 2017 12:49 pm
2. Is it possible that you will add more api or document the current functions that work?
Yes, gotta work on that. Will update when I have it in better conditions.

Thanks for the interest.

nyenye
Citizen
Posts: 62
Joined: Fri Dec 02, 2016 1:44 pm

Re: Random dungeon generation

Post by nyenye » Tue Aug 22, 2017 4:54 pm

Added some docs so it's easier to understand, and use/modify.

https://github.com/nyenye/DungeonGenerator

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests