GENERAL DESIGN of ca. 1982 3D MAZE GAMES
I don't program in C, but hopefully this
description would be
much simpler than C code.
First, there is a World Map. This is basically
an "area" of memory
describing what is in the virtual reality
world. Memory is usually
labeled by the number in which it "appears",
starting at zero and
going up to a binary number equal to 1024
times how many K
you have. So it's really a line. To make
it a square (map) or cube (space),
you need to use YX as the byte number, as
explained on the first page.
As long as the world has dimensions that
are powers of 2...
(2,4,8,16,32,64,128,256,512,1024,2048,4096,8192...)
the math is simple in calculating lots of
things very quickly in the
game. (But it's not required, and if your
world was not 8x8 like
the one shown below, you'd use Y*80+X for
example to find your
place in memory in an 80x25 world.) In the
map below, the upper left
corner is 00 and the lower right is 77 (actually
63 or 3F depending on
how you are counting...octal, decimal, or
hex). In binary,111111.
The prime element of YX graphics is SET X,Y,COLOR
for a dot;
if you still don't get it, get an Etch-a-Sketch,
call one knob X and the other Y, and play
for a while.
To make a random maze in this map, place
symbols for Wall
in a square shape on the map, using whatever
symbol is convenient.
(W, 1, or in this case, whatever number represents
a color.)
Then there are several methods of making
the maze, which
usually make mazes with only one path between
two places,
unless you want more than one way to go.
One of the simplest and best ways to make
a maze is to shuffle
all of the positions that can be "rooms"
or have up to 4 ways to
go. (Every other space that is not a "room"
is a "hall" and can only
have 2 exits; the corners are "rooms"
even though they can only
have 2 exits also.) Select a room and remove
the wall symbol from it.
Then continually search the remaining rooms
full of wall, and if there
is an open room near that room, remove the
wall symbol from it,
and also from the "hall" space
between it and the open room. Forget
about the room you just created, and when
no rooms are full of wall,
you have a maze. Again, this is not the only
way to do this. And a
nicer looking maze can be made using a similar
method if you consider
the "hall" spaces as "thin
walls" and the rooms as having pebbles
in them
until they are visited and one of their walls
is broken down to a room
which has no pebble.
Here is the result of making a maze.
This is the same maze visualized another
way. (not relevant!)
Look at the red-walled maze in the upper
right corner.
The blue dot represents a player, and the
arrow represents
which way he is looking. This MAP can be
translated into
a "3D" view in perspective:
And for 3D VR goggles, perspective for both
eyes could
have been generated... something like this...
Generating perspective:
This game probably started from the foreground
and moved outward toward
the center, but it is better to start from
the background and move toward
you so that closer objects will naturally
and simply cover ones behind them.
This game also used nothing but 4 sided polygons
covering a horizon.
ALL LINES THAT GO THE WAY YOU ARE FACING
TEND TO
MEET AT THE CENTER. Again, perspective is
only important in
stereoscopic displays... volumetric ones
don't compute it at all.
(A painting requires it but a sculpture does
not.)
The 3D Maze game looked forward a step at
a time, and on each step
also looked left and right. If the space
was not empty, it would draw a
wall (or other object in some games). The
Player had these variables:
Position: X and Y
Direction (vector): XV and YV
example directions:
North: XV=0:YV=-1
South: XV=0:YV=1
West: XV=-1:YV=0
East: XV=1:YV=0
turning procedure:(used also to detect left and right walls)
Turn left: XV2=YV:YV=-XV:XV=XV2
Turn Right: XV2=-YV:YV=XV:XV=XV2
Move forward: X=X+XV:Y=Y+YV
The game would continue looking forward until
it hit a wall,
and then the view would be complete.
The first of these 3D maze game's rules were
simply to get out
of the maze, which was definitely larger
than in this example.
Others sometimes had objects, enemies, hexagonal
rooms, or
the possibility of going up and down (the
maze itself was 3D).
There are obviously more than 4 directions
possible for motion,
using either lookup tables or rotation math.
IOZONE: Virtual Anomalies
This is a weird one. The definition of IOZONE is an ambiguous
condition
where data is being pulled out of a vacuum.
Specifically, certain types of
computers can not tell the difference between
memory, uninstalled memory,
and wires that might connect to things outside
the computer. IOZONE is first of
all where the wires come out of the computer.
It stands for Input/Output Zone.
And if there is nothing connected to the
computer, and it does not know that,
then the computer will actually "access"
the nonexistent device and produce
meaningless data. The same thing happens
when you tune an old TV to a
channel that is not broadcasting. The TV
will produce a meaningless image.
And if you go into a totally dark room, you
probably won't see the color
black, you will probably see the same kind
of meaninglessness.
Apparently even today, Virtual Reality systems
can malfunction in such a way
that the "player" can escape from
the Map of the Virtual World, because I have
recently seen it happen. But it did happen
in the 3D Maze games, and other
games also, and allowed the player to see
very peculiar visualizations of the
game program itself, the other junk that
was in memory, even fall off the
edge of installed memory into Nothing, or
sometimes a chaotic field of
randomness that is hard to escape from. Uninstalled
memory is considered
IOZONE because the game can try to read it
and it might receive something
from no where without crashing. This is very
rare on PCs, though it
happens occasionally in DOOM type games.
added comment: The 3D maze game program code
is only about 2 Kilobytes.
1/14/2004