[rec.games.programmer] 2D Maze in 3D

jmunkki@kampi.hut.fi (Juri Munkki) (05/05/89)

I'd like to write a game where the player can wander in a maze and
see the movement in 3D perspective. The player has to be able to
rotate around the vertical axis and it should be possible to move
the viewpoint to any point in the maze. The maze does not change, but
it might contain moving objects. All the maze walls are at 90 degree
angles.

I've thought of some algorithms, but someone must have come up with
an absolutely amazing solution... I need a really fast algorithm.

_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
|     Juri Munkki jmunkki@hut.fi  jmunkki@fingate.bitnet        I Want   Ne   |
|     Helsinki University of Technology Computing Centre        My Own   XT   |
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^

kirby@bozo.wbst128.xerox.com (Mike Kirby (co-op)) (05/05/89)

>I'd like to write a game where the player can wander in a maze and
>see the movement in 3D perspective. The player has to be able to
>rotate around the vertical axis and it should be possible to move
>the viewpoint to any point in the maze. The maze does not change, but
>it might contain moving objects. All the maze walls are at 90 degree
>angles.

>I've thought of some algorithms, but someone must have come up with
>an absolutely amazing solution... I need a really fast algorithm.

In most of these "dungeon" type games, the maze is divided into
squares, where each square is represented by a move.  What you
could do, is create a database of "sqaures" each representing a possible
"room", and then move about, displaying these predefined rooms.  In order
to get things like perspective, you might want to look into various 
methods for doing perspective transformations.  One good article that
I would recommend would be "Nested Transformations and the Blobby Man",
by Jim Blinn. (IEEE CG & A, october 87).  He talks about basic methods for
doing 3-d perspective transformations.

The animation is a little tougher.  What kind of system are you planning on
writing this on?  Will you have some hardware, or software support from
whatever langauge you are using? (ie. core, etc?).  Many graphics
libraries contain animation primatives all built into them.  If you 
have to write all this from scratch, then I suggest you look at some
of the more basic texts for computer graphics.

Michael Kirby
mpk9172@ritvax.bitnet           (works...)
mpk9172%ritcv@cs.rit.edu        (sometimes...With a good tailwind)
rochester!rocksanne!spot!kirby  (I haven't decided if this works or not...)

philm@astroatc.UUCP (Phil Mason) (05/06/89)

In article <21795@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes:
>I'd like to write a game where the player can wander in a maze and
>see the movement in 3D perspective. 
>I've thought of some algorithms, but someone must have come up with
>an absolutely amazing solution... I need a really fast algorithm.

I have a program written by Brad Myers (with Scott Brown) called "GetOut"
that very effectively simulates a 3-D display of a run through a 2-D maze.

Sorry, it only runs on the PERQ workstation (remember the PERQ?).  I do
have source; it was written in PASCAL.  It is copyrighted so I would not be
able to distribute it.

The PERQ is a microcoded 170 ns machine with hardware Raster-OP.  Display
size is 8-1/2 x 11 (portrait) or 14 x 11 (landscape).  I do not believe the
program used custom microcode.  Actually, the program is cleverly written
and is not overly complex.  The most difficult part (it seems to me) is the
generation of a one-exit maze with corridors and not very many loops.

You can generate realistic wire frame corridors with good heuristics.  Do
the hidden line elimination by heuristic methods as well.  Don't do brute
force calculations if you wish to run the maze in real-time.

The PERQ implemetation is great - too bad you can't see it run.




-- 
Kirk  : Bones ?                |  Phil Mason, Astronautics Technology Center
Bones : He's dead Jim.         |  Madison, Wisconsin - "Eat Cheese or Die!"
...seismo-uwvax-astroatc!philm |  I would really like to believe that my
...ihnp4-nicmad/               |  employer shares all my opinions, but . . . 

paul@torch.UUCP (Paul Andrews) (05/22/89)

Check out your local X windows archive. A game was posted to comp.sources.x
some time ago called mazewar. It does what you want.

- Paul.