Forum Archive

Go Back   3D Realms Forums > 3D Realms Topics > Duke Nukem
Blogs FAQ Community Calendar

Notices

 
 
Thread Tools
Old 03-30-2007, 10:00 AM   #1
el_supremo
Random maze map generator
I've written a program (for Windows) which creates a duke3d map (called maze.map) consisting of a 10x10 grid of rooms connected as a random "perfect" maze. The starting point is the room in the northwest corner and the object is to reach the nukebutton in the southwest corner. The problem is that the program also sprinkles lizard troopers and pigcops in your way, so this is no walk in the park. It also sprinkles random ammo, weapons and health powerups around.
Some of the features of the maze are configurable from the command line - e.g. the size of the maze can be increased up to about 22x22. Above that the number of sectors exceeds the 1024 limit.
Version 1.1 is at:
http://members.shaw.ca/el_supremo/randroom.zip
The file is only 25kb.

From the Windows command line, basic usage is just:

Code:
randroom
duke3d -map maze
See the readme.txt and randroom1312.bat files in the zip for other examples.

It's time to play with yourself - single player only.

Pete
el_supremo is offline  
Old 03-30-2007, 10:26 AM   #2
DeeperThought

DeeperThought's Avatar
Re: Random maze map generator
This is a very appealing idea. Would you consider making a version that generates more sophisticated maps? Perhaps your program could lead to a Diablo II style Duke TC with randomly generated dungeons, or perhaps just portions of maps could be randomly generated. If you aren't interested in developing it further, then maybe you could release the source code?
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 03-30-2007, 10:43 AM   #3
el_supremo
Re: Random maze map generator
Quote:
Would you consider making a version that generates more sophisticated maps?
I'm slowly working at adding more stuff to the map - with the accent on *slowly* :-)

Quote:
maybe you could release the source code?
If I stop developing it myself I probably will.
I was thinking that it would be nice if it were built in to the Duke3D menu so that there would be a "Random Game" along with "New Game" and "Load Game". I may even try that with JFDuke if I can get it to compile.

Pete
el_supremo is offline  
Old 03-30-2007, 12:26 PM   #4
Geoffrey
Re: Random maze map generator
Cool It'd be awesome if future versions can use predesigned rooms. I'm sure some mappers would love to lend a hend to create some blocks and corridors and such then
__________________
"if we fill survival with particles then we can compete with modern games" - James
Geoffrey is offline  
Old 03-30-2007, 01:51 PM   #5
Hellbound
 

Hellbound's Avatar
Re: Random maze map generator
DeeperThought - you are the Diablo2 maniac, aren't you?

sorry for offtop

And I LOOVE the idea
Hellbound is offline  
Old 03-30-2007, 03:03 PM   #6
C. M. Dratz

C. M. Dratz's Avatar
Re: Random maze map generator
Quote:
Originally Posted by el_supremo View Post
I've written a program (for Windows) which creates a duke3d map (called maze.map) consisting of a 10x10 grid of rooms connected as a random "perfect" maze. The starting point is the room in the northwest corner and the object is to reach the nukebutton in the southwest corner. The problem is that the program also sprinkles lizard troopers and pigcops in your way, so this is no walk in the park. It also sprinkles random ammo, weapons and health powerups around.
Some of the features of the maze are configurable from the command line - e.g. the size of the maze can be increased up to about 22x22. Above that the number of sectors exceeds the 1024 limit.
Version 1.1 is at:
http://members.shaw.ca/el_supremo/randroom.zip
The file is only 25kb.

From the Windows command line, basic usage is just:

Code:
randroom
duke3d -map maze
See the readme.txt and randroom1312.bat files in the zip for other examples.

It's time to play with yourself - single player only.

Pete
A smart idea...I'll have to check it out.

Quote:
Originally Posted by DeeperThought View Post
This is a very appealing idea. Would you consider making a version that generates more sophisticated maps? Perhaps your program could lead to a Diablo II style Duke TC with randomly generated dungeons, or perhaps just portions of maps could be randomly generated. If you aren't interested in developing it further, then maybe you could release the source code?
Yeah, and randomized Guild Wars, too! Diablo's randomized dungeons were interesting...in the Demo (I was into War Craft II and of course Duke Nukem 3D on Kali at the time. I never played II.
[Edit: I just used the Maze generator and it spit this map out. Just kidding...it's a maze map I was working on a while ago, which I haven't finished. ]
Attached Files
File Type: zip Maze052D.zip (9.2 KB, 5 views)
__________________
Best Regards,
Chris. Dratz
Last edited by C. M. Dratz; 03-30-2007 at 03:37 PM.
C. M. Dratz is offline  
Old 03-30-2007, 03:17 PM   #7
DeeperThought

DeeperThought's Avatar
Re: Random maze map generator
Quote:
Originally Posted by Hellbound View Post
DeeperThought - you are the Diablo2 maniac, aren't you?

sorry for offtop

And I LOOVE the idea
I swore I would never play that game again, just like I will never play WoW or smoke crack. But making a game like that is another matter entirely. In this case, it would have to be a fork of EDuke32 (or I suppose it could be a fork of JonoF's port, but that code is so outdated I can't imagine why anyone would bother, unless JF makes a comeback in which case it will rule once again).
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline  
Old 03-30-2007, 04:25 PM   #8
Dopefish7590

Dopefish7590's Avatar
Re: Random maze map generator
^^^^
crack?

sry for off topic

its a very good idea


edit: i tried it... quite kewl but repetitive. this has quite abit of potential
Last edited by Dopefish7590; 03-30-2007 at 04:34 PM.
Dopefish7590 is offline  
Old 03-31-2007, 06:12 AM   #9
Rider

Rider's Avatar
Re: Random maze map generator
Quote:
Originally Posted by Geoffrey View Post
Cool It'd be awesome if future versions can use predesigned rooms. I'm sure some mappers would love to lend a hend to create some blocks and corridors and such then
Yeah, that'd be aweseome! You could then devide those blocks in a few categories (High-tech, neat-urban, dirt-urban, sewage, alien etc...) and allow the user to define what kind of map he wants, by selecting the categories used.

Being a Duke mapper myself, I'd like to lend a hand in creating such blocks... I'm not much of the type to finish a map, but I think this could be great fun
__________________
Duke4.net - Duke's OTHER home.
HeadbangersFM - The station that keeps your head banging!
-------------
She's pretty, not "damn-she's-making-my-noodle-dance-samba"-pretty, but still very pretty... - Micki!
Rider is offline  
Old 03-31-2007, 07:28 AM   #10
arno

arno's Avatar
Re: Random maze map generator
I tried it under Wine and it works well! Great idea!
arno is offline  
Old 03-31-2007, 08:03 AM   #11
Reaper_Man

Reaper_Man's Avatar
Re: Random maze map generator
There was a randomized map generator for Half-Life a while back, and worked on the same "template" concept. It worked pretty good most of the time (though you had to worry about leaks that Build doesn't have).

Good luck with the project, should be good fun.
__________________
The Once and Future King
msleeper.com :: Digital Entertainment Design
The AWOL Project :: The Best Damned TC Never
Super AI Project / Duke RTS :: Coming Soon to an Actor near you!
Artificial Intelligence 101 :: Ask AI questions, get AI answers
Reaper_Man is offline  
Old 03-31-2007, 08:08 AM   #12
Hudson

Hudson's Avatar
Re: Random maze map generator
Hey this is pretty cool!

Good job man
__________________
Staying Frosty Since 09/06/07 - I love you Katie <3
“Software is like sex; it's better when it's free.” - Linus Torvalds
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” - Calvin & Hobbes
[INSERT SYSTEM SPECS THAT NO ONE CARES ABOUT HERE]
Hudson is offline  
Old 03-31-2007, 10:34 AM   #13
el_supremo
Re: Random maze map generator
Quote:
Geoffrey: It'd be awesome if future versions can use predesigned rooms
The short answer: the current version of the program can't import other maps and would require a major rewrite to do so.

The long answer: The internal representation of the maze is not based on a "build" structure. It is just an array of "rooms" each of which can have up to four connecting "doors". Once the maze has been constructed and the weapons/ammo etc. have been sprinkled around the rooms, this structure is written out as a duke map by converting the maze to sectors/walls/sprites on-the-fly. Generating the maze is a trivial piece of code but it took me quite a while before the program converted it to a map that actually worked in duke3d - getting the walls right was particularly tricky.


Quote:
Rider: You could then devide those blocks in a few categories (High-tech, neat-urban, dirt-urban, sewage, alien etc...)
I have, sort of, done that already by adding "green" rooms to the maze (you'll see what a green room is in the next version - when it's ready). I just tag a random room as "GREEN_ROOM" and when the rooms are written out, this kind of room is decorated differently.
A future version might allow the user to describe the textures/sprites which make up various kinds of rooms and then the program would sprinkle these around the map.
But if you mean adding things like tables or altars to a room, those require more sectors and walls and that's what would require a rewrite.

The idea for the program came to me recently while I was going through the four duke3d episodes (in the HRP version) for the fourth or fifth time (I hadn't played Duke for something like 8 years and then got interested in it again when I stumbled upon the HRP version). I figured that playing a randomized map would be more interesting than shooting down the same enemies in the same places over and over again.

Thanks all for the kind comments.

Pete
el_supremo is offline  
Old 03-31-2007, 10:16 PM   #14
C. M. Dratz

C. M. Dratz's Avatar
Re: Random maze map generator
Quote:
Originally Posted by el_supremo View Post
But if you mean adding things like tables or altars to a room, those require more sectors and walls and that's what would require a rewrite.
It would be just as hard if the stuff was made of sprites, right?
__________________
Best Regards,
Chris. Dratz
C. M. Dratz is offline  
Old 04-01-2007, 08:05 AM   #15
el_supremo
Re: Random maze map generator
Hmmmmmmm. I haven't tried to build anything with sprites but adding more sprites to a room is easy.

Pete
el_supremo is offline  
Old 04-01-2007, 01:48 PM   #16
Rider

Rider's Avatar
Re: Random maze map generator
Quote:
Originally Posted by el_supremo View Post
I have, sort of, done that already by adding "green" rooms to the maze (you'll see what a green room is in the next version - when it's ready). I just tag a random room as "GREEN_ROOM" and when the rooms are written out, this kind of room is decorated differently.
That's cool!

But not exactly what I was trying to say, I meant to say that a user could define one or two themes for the map, and your program would then divide the maze into a few sections, giving each section the specified theme.

For example, the Urban theme would have parallaxed skies and would be higher (and have textures that fit this), while a sewer would be lower and have sewer-like textures.

So it's sort of like your green room functionality, but for a collection of rooms rather then a single room
__________________
Duke4.net - Duke's OTHER home.
HeadbangersFM - The station that keeps your head banging!
-------------
She's pretty, not "damn-she's-making-my-noodle-dance-samba"-pretty, but still very pretty... - Micki!
Rider is offline  
Old 04-01-2007, 03:00 PM   #17
lycanox

lycanox's Avatar
Re: Random maze map generator
Cool idea. If it only could be set up to run, each time the map gets loaded.

I got some idea for sector layouts. ( The idea of using dukes butt as an ceiling is nice, but kinda ).
I just did made an small map with several scenes like hedge, desert, cave, nature, sewer, city, slime and moon.
Its incredible how good this looks with the correct textures.
lycanox is offline  
Old 04-01-2007, 03:01 PM   #18
el_supremo
Re: Random maze map generator
Quote:
Rider: So it's sort of like your green room functionality, but for a collection of rooms rather then a single room
OK, I understand now. That might be possible, perhaps by generating a separate maze for each theme and then connecting the nukebutton room of one maze to the start room of the next. I'll put it on the "to think about" list :-)

Pete
el_supremo is offline  
Old 04-01-2007, 03:09 PM   #19
el_supremo
Re: Random maze map generator
Quote:
Lycanox: If it only could be set up to run, each time the map gets loaded
Yep, it's a pain to have to exit the program when you're just gonna run another one anyway, especially when you gotta wait for the HRP textures to load again.

Quote:
Lycanox: I just did made an small map with several scenes like hedge, desert, cave, nature, sewer, city, slime and moon.
If you attach your map here I can see if I can make the program generate better rooms or come up with a way that would allow you to specify the kinds of room it should use.

Pete
el_supremo is offline  
Old 04-01-2007, 03:25 PM   #20
Dr. Kylstien
Re: Random maze map generator
I'd like to be able to specify the room heights and have the doorways at lower heights than the rooms. Right now, the doors are huge, and the walls are hard to texture properly since they aren't multiples of 16384.
Dr. Kylstien is offline  
Old 04-01-2007, 08:26 PM   #21
el_supremo
Re: Random maze map generator
Quote:
Dr. Kylstien: I'd like to be able to specify the room heights
Try out V1.2 in which I've added optional arguments that allow you to specify the Z values for the room and door's floor/ceiling and also to specify a tile for the wall and the door.
I've also added "green" and "party" rooms and made a few tweaks to the way the program places things.
http://members.shaw.ca/el_supremo/randroom.zip

Pete
el_supremo is offline  
Old 04-01-2007, 09:19 PM   #22
el_supremo
Re: Random maze map generator
Already found and fixed a bug.
randroom.zip now has the bugfix and was changed at 2100 CST (GMT-6).

Pete
el_supremo is offline  
Old 04-02-2007, 12:19 PM   #23
lycanox

lycanox's Avatar
Re: Random maze map generator
Here is an map with some examples for skins.
Some of them do need paralaxing skies and sector tags.
Attached Files
File Type: zip SKINS.zip (10.1 KB, 4 views)
Last edited by lycanox; 04-02-2007 at 12:46 PM. Reason: wrong file uploaded.
lycanox is offline  
Old 04-02-2007, 09:00 PM   #24
el_supremo
Re: Random maze map generator
Thanks lycanox.
I don't know if I can make it give you two adjacent rooms with the same theme but I might be able to manage quite a bit of what you've shown in your skins.map

Pete
el_supremo is offline  
Old 04-03-2007, 10:59 AM   #25
lycanox

lycanox's Avatar
Re: Random maze map generator
thanks.
Perhaps it would look better if it just randomly picked one theme, walking from an moon into an dessert looks kinda strange, and might end up in conflicting sky boxes.
lycanox is offline  
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 09:24 AM.

Page generated in 0.17245698 seconds (100.00% PHP - 0% MySQL) with 19 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

Website is ©1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.