Page 1 of 1

Random dungeon generation

Posted: Tue Jun 06, 2017 7:01 pm
by nyenye
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

Re: Random dungeon generation

Posted: Wed Jun 07, 2017 8:16 am
by yetneverdone
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

Re: Random dungeon generation

Posted: Wed Jun 07, 2017 9:52 am
by nyenye
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.

Re: Random dungeon generation

Posted: Wed Jun 07, 2017 12:49 pm
by yetneverdone
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?

Re: Random dungeon generation

Posted: Wed Jun 07, 2017 7:09 pm
by nyenye
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.

Re: Random dungeon generation

Posted: Tue Aug 22, 2017 4:54 pm
by nyenye
Added some docs so it's easier to understand, and use/modify.

https://github.com/nyenye/DungeonGenerator