Re: A85: RPG survey


[Prev][Next][Index][Thread]

Re: A85: RPG survey



On Tue, 16 Sep 1997 17:53:29 GMT richardlewis@cedarcity.net
(Richardlewis) writes:
...
>The numbers are room numbers, and to move to the right, you
>would add 1 to your current room number.  To move left,
>subtract 1.  For up, you could subtract 3.  Down: add 3.
>Diagonals are fun,....

You forgot about walls.  The way I have done this earlier is with a
matrix and numbered rooms.  This makes it easy to have walls, and rooms
don't need to be in grid fashion(i mean the opposite direction doesn't
necessarily return you to the room you came from). ex:

map of room:
|-|-|-|-|
|1|2|3|4|
| 5 \ 6 |
|7| 8 |9|
|-|---|-|

matrix:
;N,S,E,W   north south east and west
0,5,0,0,  ;room 1
0,5,0,0,  ;room 2
0,6,0,0,  ;room 3
0,6,0,0,  ;room 4
1,8,2,7,  ;room 5
4,8,9,3,  ;room 6
5,0,0,0,  ;room 7
5,0,6,5,  ;room 8
6,0,0,0   ;room 9

The number indicates which room is entered when exited in the given
direction, and zero denotes a wall.  Using this method, it is very easy
to set up a complicated maze.  You may think that the matrix would take
up too much room, but it would never exceed 1k (with a maximum number of
rooms at 255 and 4 bytes per room, 255*4=1020.  4 bytes less than 1k).

This matrix method makes adding rooms later very easy, you just add to
the end of the matrix(rooms aren't locked into a grid), but with
Richardlewis's method adding another column of rooms to the right side
would involve shifting everything on the second row by 1, everything on
the 3rd row by 2, etc...  Also adding a warp(secret passage?) to another
part of the level is just as easy.

Objects would be pretty easy.  You just need to use another matrix to
store what room it's in, or zero for in your inventory.  If you need to
have an object to cease to exist(like when combining objects, actually
two disappear and a third new object appears, for programming purposes),
then make sure you only have 254 rooms and assign room number 255 to
those objects that "aren't there".

There's more I could say about this, but I'll wait until it comes up.


Sincerely,
The Unibomer

Jared Ivey
Unibomer@Juno.com
Ham Call Sign: KF4BXL
The Unibomer's Shack:
     http://www.geocities.com/SiliconValley/Vista/7342/
 _______________________
|  Florida Times Union  |
|=======================|
| Unibomer Strikes Again|
|   ~~~~~~~~~~~~~~~~~~~ |
| ~~~~~~~~~~~~~~~~~~~~~ |
| ~~~~~~~~~~~~~~~~~~~~~ |
| ~~~~~~~~~~~~~~~~~~~~~ |
| ~~~~~~~~~~~~~~~~~~~~• |
|_______________________|


References: