Maze generator and map rotator

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Ok, I've hit a wall, and I'd really appreciate it if someone who's interested in this thing and knows some python could take a few minutes (well, it'll be more than a few) to give me a hand. I can also give them access to the cvs repo on my machine where it's kept if they want to hack directly.

Here's the problem:

I implemented a culling algorithm a few days ago hoping to be able to make mazes with more grid squares in them. I also wanted to reduce the one-path tendency where there would be one path that ran the circuit of the maze, and whoever was on that path closest to the zone would win every time.

The idea is that after generating the initial maze, the program goes back through the maze looking for single-square dead ends and eliminating some arbitrary percentage of them by ripping down walls until it's no longer a dead end. Then I added culling one path squares. That's a square with two walls, it has one path through it, and to have one path through it it needs an entry point and an exit point. Then I added culling two path squares.

It worked, a few revisions ago. Now that I've added circles and laying out spawn points with it, I decided to change the command line invocation by having you specify all culling in one place. Previously it had three different switches, and I wanted to consolidate them into one comma-separated switch. Then the culling broke. Now the culling will work to some extent, but not the extent it's supposed to work.

Here are the test cases.

1. Disable all but one type of culling (currently culling 1 path squares). Run the script and look at the report at the end. It shows how many of each type of square was initially generated and how much it finished with. What it shows now is an increase in dead end squares when culling only 1 path squares. This doesn't make sense! Culling works by removing walls, and after the initial set of squares is made, you can't add more dead ends without adding walls, and culling doesn't add walls.

2. Enable all culling types and set each one to 100% (1.0 on the command line). You should end up with a square grid, empty, and with just a zone and 8 spawn points.

Attached is a tarball with the script in it, because even though I now know how to gzip stuff, I still don't know how to tell gzip to leave the old file in place.
Attachments
mazer.tar.gz
(6.78 KiB) Downloaded 85 times
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

bump, for philippegc. The map rotator is at the very top of the thread, and I haven't modified it since I posted it here. At least, not in a way that matters to anyone who wants to use it.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
Post Reply