Cixar

XML/RSS

Categories:

/ (121)
  art/ (4)
    tale/ (1)
  bookmark/ (2)
  langlubber/ (4)
  movies/ (2)
  music/ (1)
    garageband/ (2)
  photo/ (1)
  politics/ (1)
  program/ (29)
    cli/ (1)
    javascript/ (13)
      chiron/ (5)
    python/ (6)
    swil/ (2)
    tale/ (22)
  reading/ (4)
  tale/ (25)
  writing/ (2)

Archives:

2008-Nov
2008-Oct
2008-Sep
2008-Aug
2008-May
2008-Apr
2008-Mar
2008-Feb
2008-Jan
2007-Jun
2007-May
2007-Apr
2007-Mar
2007-Feb
2007-Jan
2006-Oct
2006-Sep
2006-Aug
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar


The Sourcerer

by Kris Kowal.

The Sourcerer has moved! Please visit askawizard.blogspot.com.

Sun, 16 Oct 2005

Red vs Blue

Shawn Tice and I developed a random maze generator for the M.U.D. project. The purpose of our design was to generate a closed world of arbitrary size, where all rooms are accessible from any other.

We restricted the world's shape to square with sides that measure as powers of two. That way, we could recursively generate the world with the following rules:

  1. for all rooms larger than a unit room (1x1)
    1. the room posesses four rooms, one in each quadrant
    2. the room posesses four exits that are either passable or walled
    3. any exit that is passable may be divided in half, closed in by a wall on either side
    4. between each quadrant is a partition
    5. at most, one partition is a wall
    6. all other partitions are passable, guaranteeing that all quadrants are accessible by at least one path.
  2. for all rooms
    1. all surrounding partitions are walls if they do not lead to a room

Here's how one maze turned out:

The numbers represent the width of each room in the following diagram. Each successive maze is a more detailed version of the previous.

For the purpose of testing, we'll probably populate this maze with two warring clans, Red versus Blue. I doctored an image off of Eight Bit Theatre with Macromedia Fireworks for the purpose. For kicks, I made the layers functional.

The first image is the PNG. The original image probably belongs to Square-Enix.

this entry was posted on Sun, 16 Oct 2005 at 16:03 in program