Page 1 of 7 1 2 3 4 5 6 7 >
Topic Options
#158160 - 08/30/09 04:29 PM Dungeon Object Beta
Looki
Extension Developer


Registered: 08/27/06
Posts: 2636
Loc: Duisburg, Germany
Hey there! LB requested a maze generation a couple of weeks ago.
In his (and mine) opinion, Pathfinding Object's maze generation is too limited and buggy. So I sat down and tried to program a maze generator, but failed.
Now, about 5 days ago, RickyRombo requested such an extension again - and z33z, author of the Pathfinding Object, posted a link to an open-ource dungeon generator.
It really impressed me, so I tried to program an extension that implements the library. It was really easy, and I'm really happy with the results.

Here are some screenshots and explanations.
All these were generated using the inbuilt painter for the Overlay Object.

<-- A classic maze. Very random structure, many deadends.
This was generated using the default settings.

http://clickteam.info/looki/Pictures/Dungeon/1.png
The same maze with rooms. Rooms are always rectangular.
The red rectangles are doors.
http://clickteam.info/looki/Pictures/Dungeon/2.png
Many small rooms, doesn't take much longer to generate.
http://clickteam.info/looki/Pictures/Dungeon/3.png
No deadends at all.
http://clickteam.info/looki/Pictures/Dungeon/4.png
Not very random, but not very sparse either.
http://clickteam.info/looki/Pictures/Dungeon/5.png
Super sparse.
http://clickteam.info/looki/Pictures/Dungeon/6.png
Random and sparse. Pretty boring.
http://clickteam.info/looki/Pictures/Dungeon/7.png
Bigger mazes are possible, too! Even mazes 5 times as big are generated quickly on most computers.

http://clickteam.info/looki/Pictures/Dungeon/8.png
No thick walls, but a grid.
http://clickteam.info/looki/Pictures/Dungeon/9.png
Yay, colors.

Notes

If you enter 10x10 as size, the size will be 21x21.
The formula is pretty easy, (X*2+1). (X-1)/2 to convert it back.
Internally, the maze is stored in blocks with a wall at the top or left side, walls don't have their own block, that's why.
There are convertion expressions for those who don't want to use formulas.

The painter only works with Overlay now.
I'll add image export (BMP,PNG...) later.

Just look at the example to get some idea how it works.

Get the latest beta here. Have fun testing!
http://clickteam.info/looki/Extensions/Beta/Dungeon.zip

smile


Edited by Looki (08/30/09 05:51 PM)
_________________________
Lukas Meller
Developer - AquadaSoft

You can get my stuff at clickteam.info!

Top
#158167 - 08/30/09 05:24 PM Re: Dungeon Object Beta [Re: Looki]
cel


Registered: 09/18/06
Posts: 166
Loc: Dublin, Ireland / Covilha, Por...
Wow, cool

Could this work with the raycast extension and make random mazes to be displayed by raycast? That would be cool...

Also a way to have keys to open certain doors? Doubt it will be possible...

Anyway, excellent work

Top
#158170 - 08/30/09 05:28 PM Re: Dungeon Object Beta [Re: cel]
Looki
Extension Developer


Registered: 08/27/06
Posts: 2636
Loc: Duisburg, Germany
Hey! I'm sure you'll be able to combine this with the Raycasting object.

That key thing would require a lot of logic and math.. not sure if I can do it.
_________________________
Lukas Meller
Developer - AquadaSoft

You can get my stuff at clickteam.info!

Top
#158172 - 08/30/09 05:46 PM Re: Dungeon Object Beta [Re: Looki]
gerald999


Registered: 02/21/08
Posts: 365
Loc: On, Canada
OMG, this is awsome! cool
Must figure out how to implement into a game
_________________________
Gerald





Top
#158173 - 08/30/09 05:46 PM Re: Dungeon Object Beta [Re: Looki]
dragonguy


Registered: 04/03/08
Posts: 2879
Loc: RULE BRITANNIA!
Iv'e always tried to do this type of thing using fastloops but failed due to lack of know how.

My algorithms weren't very good but they did the trick and created the maze.

Now thanks to you it's a Jillion times easier. wink
_________________________
I'm the Original Dragonguy!

Email or PM me, all game related ideas & job seekers welcome, terms & conditions may or may not apply.

Top
#158188 - 08/30/09 07:00 PM Re: Dungeon Object Beta [Re: dragonguy]
DanielRehn
Extension Developer


Registered: 07/10/06
Posts: 1087
Loc: Umeå, Sweden
Just tried this with the Raycasting object and it works like a charm wink
Awesome extension!

Small bug I noticed: If you set minimum number of rooms to say 1 and leave maximum number of rooms at 0 it crashes!
_________________________
/Daniel

www.phizix.tk

Top
#158189 - 08/30/09 07:03 PM Re: Dungeon Object Beta [Re: DanielRehn]
StephenL
Forum Moderator


Registered: 08/09/08
Posts: 2608
Loc: Montana
This is very cool, Looki! laugh Great job!

stephen1980
_________________________
Stephen Lanier
“Flash Extensions. Too many ideas, and not enough time to do them all right now!”
_____________________________
KlikFusion RoundTable Nivram's Examples

Top
#158199 - 08/30/09 07:42 PM Re: Dungeon Object Beta [Re: StephenL]
RickyRombo


Registered: 03/05/08
Posts: 2491
Loc: Planet Earth
Told you it was going to be famous, Looki! laugh

I absolutely love it!
_________________________
AtomicPages by KetchupMaster - A must have for any web developer!

The Click Link

Top
#158211 - 08/31/09 12:19 AM Re: Dungeon Object Beta [Re: RickyRombo]
Sheexy


Registered: 04/21/09
Posts: 5
Hey, that's awesome! Really easy to use and super easy to tweak, this is really great.

Only problem I have with it now is that when you use actives to paint the maze rooms end up looking pretty bad. Are you going to take this extension further to make tile based engines work better with rooms? Like each wall being a full tile thick?

It's mentioned in part 10 from the link z33z posted in the other thread, it's under "Converting to Tiles" in this link:
http://dirkkok.wordpress.com/2007/12/21/generating-random-dungeons-part-10/

That would make this already amazing extension immensely more useful in my opinion. There could be an "(x,y) is door?" condition so you could make each door be an active object.

I know this is just a beta so maybe you've already got that planned and didn't say, but I'm just making sure the idea is out there.




I dunno how doable this is, but it's just a fun idea I had cause this made me think of NetHack. Maybe you could work in a "room type" system? So you'd have a random chance of floors in a room being categorized as a specific type of room.
It could be like this:
Room type 1- 50% chance
Room type 2- 25% chance
Room type 3- 25% chance
and it would randomly assign room tiles that variable or something. Then you'd have a "(x,y) is roomtype(1)" condition. Then in your own code (this part isn't built into the extension of course" you'd be able to create certain items on the floor if it was that type.
example: Room type 1 = treasure room, user randomly generates treasures on the floor.
Again just a fun suggestion, if you've got the time or if it's easy to do. I imagine it'd be pretty useful.


Sorry for all that, this extension is just really exciting! laugh
Thanks for working on this!

Top
#158220 - 08/31/09 01:39 AM Re: Dungeon Object Beta [Re: Sheexy]
Looki
Extension Developer


Registered: 08/27/06
Posts: 2636
Loc: Duisburg, Germany
Thanks, DanielRiehn. Fixing it. smile
Sheexy, that second link z33z posted is a different algorithm. I I agree it would be useful - I'll try to convert the code to work with the extension.
The treasure generation is kind of supported by the library, if I'm not mistaken. Floor types aren't, I agree that would be cool. smile

Thanks for all the reviews!

EDIT: Uh, I just noticed the examples are not in Examples\Dungeon Object but Examples\! Sorry.


Edited by Looki (08/31/09 02:02 AM)
_________________________
Lukas Meller
Developer - AquadaSoft

You can get my stuff at clickteam.info!

Top
Page 1 of 7 1 2 3 4 5 6 7 >


Site Links
Forum Index

Home Page
Online Store
Tutorials
Download Center
French Forum

Quick File Links
Multimedia Fusion 2
Updates - build 249
Standard Version
Developer Version

Extension Packs
Bonus Pack 1
Bonus Pack 2
z33z Extension Pack
LIJI Extension Pack

The Games Factory 2
Latest Update - build 249
Community Links
Fusion Wiki
MFA Repository
Klikdisc
The Daily Click
GameBuilder

GB Arcade
TDC Arcade
Madword

Extensions
Neatwares Extension List
Extension Updater

Lacewing & Moo Server
Klikfarm

Money from your games
Click Chat
9 People are chatting
Game Builder

Visit the GameBuilder Homepage

Recent Download

Dungeon Master

Latest News