"Maze" generator C source... *NEW & IMPROVED!!

General talk about the map making process.
Post Reply
User avatar
Lan
Private First Class
Private First Class
Posts: 296
Joined: Sun Jun 13, 2004 1:21 am
Contact:

"Maze" generator C source... *NEW & IMPROVED!!

Post by Lan »

This C source code generates "mazes", but they are not in any certain design. They are randomly generated, and have many configurable options. Take a look, it will be worth your time.

PS: It has support for current CVS in that the map's size can be changed.

A FEW BUGS FIXED: fixed a duplicate parser option, and a few teleporter mistakes. also, sizing mistakes and added trepan's idea of world sizing for older releases. Also fixed a bug that made boxes super thin by mistake.

A FEW FEATURES ADDED: more options--add random teleporter links or only normal links or both, allow boxes to be shootthrough or drivethrough or both, and a buch of other small dabs and improvments
Attachments
mazes.c
mazes.c
(3.86 KiB) Downloaded 409 times
Last edited by Lan on Thu Jul 08, 2004 7:58 pm, edited 7 times in total.
trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Post by trepan »

instead of using an 'options' block, you
could also have used a 'world' block.

world
size 500
end

That is compatible with the 1.10.x releases.
User avatar
Viper
Private First Class
Private First Class
Posts: 72
Joined: Thu May 06, 2004 2:14 am
Location: Titusville, Florida
Contact:

LOL

Post by Viper »

Lol this would be nice but im ignorant of how to use this too.
- viper.pimpi.org
- 5159
- email: drugskill@gmail.com
trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Post by trepan »

I had to change your lrand()
function a little to get it to work
on my linux box.
...
return (short) ((rand() % x) + 1);

not so much a maze, as a crazy
forest of blocks :-)
User avatar
Lan
Private First Class
Private First Class
Posts: 296
Joined: Sun Jun 13, 2004 1:21 am
Contact:

Post by Lan »

guu dict maze

:)

I know, but it is like a "maze wannabe". At least it can be fun with Stealth flags all over.
User avatar
Lan
Private First Class
Private First Class
Posts: 296
Joined: Sun Jun 13, 2004 1:21 am
Contact:

Post by Lan »

Viper: compile it with any C compiler, and then just use command prompt to run it. You can also just double-click the compiled exe, but this isn't very configurable.
User avatar
Lan
Private First Class
Private First Class
Posts: 296
Joined: Sun Jun 13, 2004 1:21 am
Contact:

Post by Lan »

I fixed a truckload of bugs, so redownload if you downloaded the original. I guess I just added in all those "nervous" bugs (I get nervous when showing my work to the public ;) )
Grumbler
Dev Monkey
Dev Monkey
Posts: 453
Joined: Wed Jul 09, 2003 3:06 pm
Location: Space

Python Maze

Post by Grumbler »

ok, so i tried lan's script and it is pretty cool, but I was expecting a maze.....beginning, end...etc.

well, after discussions on irc, there are other maze scripts out there(none except lan's for bzflag that I know of)

so i did a little searching and came across a python script written by a guy in russia.......Georgy Pruss. all his info is in the script attached.


i added a python print out.....it prints the ascii maze out first for reference.

so a simple

> python Maze.py 20 20 > Maze.map

will get you a 20 row x 20 col maze in a bzflag format. I wouldnt go any larger than 40x40, as the file size gets large.

I would also suggest running it through trepan's bzmapper to eliminate the overlaps and preform merges.

I added the ability to change wall height and thickness in the python script..........probably should be an option input, but I dont have the time.
Attachments
Maze.txt
Updated for random tele/box/link

Maze.py col row 0/1/2

0 = all boxes
1 = all teles
2 = mixture teles/boxes

links randomized with teles
(12.49 KiB) Downloaded 276 times
Maze.txt
Georgy Pruss Maze script, modified by Grumbler to output bzflag compatible file.
(10.81 KiB) Downloaded 277 times
.........you kids, get out of my tank...........
User avatar
sid6.7
Private First Class
Private First Class
Posts: 614
Joined: Mon Oct 06, 2003 9:58 pm
Location: West USA
Contact:

maze

Post by sid6.7 »

very cool maze on galkir there grumbler nice script
to make it...well done
Grumbler
Dev Monkey
Dev Monkey
Posts: 453
Joined: Wed Jul 09, 2003 3:06 pm
Location: Space

Re: maze

Post by Grumbler »

sid6.7 wrote:very cool maze on galkir there grumbler nice script
to make it...well done

thanks, but georgy deserves the credit. all i added was a bzmap exporter.....with some teleporter stuff at the request of learner.
.........you kids, get out of my tank...........
Grumbler
Dev Monkey
Dev Monkey
Posts: 453
Joined: Wed Jul 09, 2003 3:06 pm
Location: Space

Hex Maze Generator

Post by Grumbler »

Here is a Hex Maze Generator. I added some more control over the number of teleporters, heights, etc...........most are not switches and are horribly buried in the code.


I was only able to get this working on a Win XP box with ActiveState. My tests on rh linux kept getting hung........have not had time to debug that part.


The maze size is not symmetrical, so you should run it as:

MazeHex.py 1.5x x

its a rough estimation, but it is pretty effective.

again, thank you Georgy.
Attachments
MazeHex.txt
i dont suggest anything over 15x10(see bzflag.galkire.net:5555), it gets too big.
(14.31 KiB) Downloaded 304 times
.........you kids, get out of my tank...........
Post Reply