Redswift is an RPG engine for the TI-83 Plus. It uses 
matrix maps to draw the levels. It features:

-VERY fast movement loop.
-Buffered loading.
-Knapsack Store
-Hit Detection
-Doors
-Inn features at store (save/load etc)
-Infinite room worlds
-Customizable layout of world
  (all rooms don't have to be in
   a straight line or a square etc)
-Battles
-HP
-Attack stats
-Defense stats
-Money
-Multiple enemies - very easy to 
                    create your own.
-set density of enemies in room, if 
 the enemies in the room are richer,
 the average strength of enemies in
 room, etc.

How to create a world:
First, draw a grid. The sample rooms
that come with this program follow this grid:
    
      O
      
   1  2  3
      
      _
     | |       1
  ___| |___
 |    S    |   2   N
 |___   ___|
     |  |   
     |__|      3

     

The S indicates the room which you start in. The coordinates of
the middle room are: N=2 O=2. The coordinates of the rightmost
room are N=2 O=3. There is a level map for each of these squares
except for the ones in the corners. That is OK, as long as there
are no doors leading there. For example, in room N=1 O=2, the 
nothernmost room, there could only be a south door. If it had 
an east door, the game would look for a room with the code 
N=1 O=3 and there would be none. The game would then crash. 
However, if there was a level map with those coordinates, it 
would just load the room.

Step 2 is to make a spot for your room. For this readme, we will
add a room at N=1 O=3. First, find the line at the end of all 
the level maps. The level maps are the long lines of numbers 
and ][ symbols. After the last one, you will see the lines: 
Goto LI
End
Lbl LI
Insert about ten lines between End and Lbl LI. This is where 
we will put the new room. It doesn't matter what order the level
maps are in, as long as they have the right grid codes. The 
new room's grid code is N=1 O=3, so on the first of the lines 
that you inserted, type:

If N=3 and 0=2:Then

The and is under 2nd MATH. Now you have a spot for your new room

Step 3 is to define your level variables. On the next line, type

$->LEST(1)

Instead of a $ type the average enemy health for the room. 
Play the sample world for a while to get an idea of what health
level enemies typically have. The -> means the STO> button right
above the ON key. Also, the L is the little L found under 
2nd then STAT then OPS. On the next line, type:

$->LEST(2)

Instead of a $ type the average enemy attack skill for the room.
Play the sample world for a while to get an idea of what attack
skill enemies typically have. The -> means the STO> button right
above the ON key. Also, the L is the little L found under 
2nd then STAT then OPS. On the next line, type:

$->LEST(3)

Instead of a $ type the average enemy defense for the room.
Play the sample world for a while to get an idea of what defense level enemies typically have. The -> means the STO> button right
above the ON key. Also, the L is the little L found under 
2nd then STAT then OPS. On the next line, type:

$->LEST(4)

Instead of a $ type the average amount of } (money symbol like 
$$$) that the enemies give you after defeating them.
Play the sample world for a while to get an idea about how much
} enemies typically yield. On the next line, type:

$->P

Instead of a $ type the probablility that an enemy will attack 
you. Every time you move, you could be attacked. So, if you 
have a probability of 100%, every time you move, you will be 
attacked. If the probability is 50%, then you will be attacked
about every 2 steps. The probability values are listed below.

If you set P to... | The probability will be...

                 1 | 100%
                 2 | 50%
                 3 | 33%
                 4 | 25%
                 5 | 20%
                 6 | 17%
                 7 | 14%
                 8 | 13%
                 9 | 11%
                 10| 10%

So, 100(P/10)=[THEPERCENT] and 100/(100*[THEPERCENT])=P


Part 4 is making the map itself. This is the hardest thing to 
do. First, get a sheet of paper and write down this:

[[  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]
 [  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]
 [  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]
 [  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]
 [  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]
 [  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]
 [  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]
 [  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ]]

Wow. I know. And you CANT just type this into your calc. You 
MUST do it on paper or even copying it into notepad. Now this is
a 8 by 16 matrix. Gee, isn't that the same size as the screen? 
Yes. It is. Now you need to fill in all of those spaces between 
the commas with numbers. For example, if I typed in the number 
corresponding to a wall corner into the first square, I would 
get a wall corner in the upper-left hand corner of the screen.
Here is a table of all the possible number values:

0 | Blank Space (can move on it)
1 | North/South Wall (vertical)
2 | East/West Wall (horizontal)
3 | Wall Corner
4 | Player starting position (required)
5 | North Door
6 | East Door
7 | West Door
8 | South Door

All spaces must be filled with a number, even if it's a zero.
Here is an example... it is the middle room of the sample levels

[[3,2,2,2,2,2,2,5,5,2,2,2,2,2,2,3]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [7,0,0,0,0,0,0,0,4,0,0,0,0,0,0,6]
 [7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [3,2,2,2,2,2,2,8,8,2,2,2,2,2,2,3]]

You can see that the doors repeat twice. Doors always need to be
paired. Now the new room at N=3 and 0=2 will need at least one 
door so you can leave it. You could technically have a trap room
with no doors, but it would be very confusing to the player. 
This room will have two doors, one on the west and one on the 
south. Take a look back at the grid to see what we're doing. 
We are going to need to type this matrix in on the next line:

[[3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [7,0,0,4,0,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]
 [3,2,2,2,2,2,2,8,8,2,2,2,2,2,2,3]]->[B]

After the numbers, you can see that we need a STO> symbol, then
the matrix [B]. You do not type [B], but rather you go to 2nd, 
MATRIX. The MATRIX key is the same button as D and X to the 
negative first power. Go to the second item on the MATRIX menu 
and hit enter. Also, you will see that I put spaces before each
line to make it easier to read. You do not do that, and you dont
hit enter to go to the next line after each row in the matrix.
It is all on one line and it can look really weird:

[[3,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,
3][1,0,0,0,0,0,0
,0,0,0,0,0,0,0,0
,1][1,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0,1][7,0,0,0,0,0
,0,0,0,0,0,0,0,0
,0,1][7,0,0,4,0,
0,0,0,0,0,0,0,0,
0,0,1][1,0,0,0,0
,0,0,0,0,0,0,0,0
,0,0,1][1,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,1][3,2,2,2
,2,2,2,8,8,2,2,2
,2,2,2,3]]->[B]

It should look something like that. Never in that entire thing do
you press enter. There should be no colons in that entire thing
except at the beginning of the first line. After you're done, hit
ENTER. Type Goto LI. Then type End. You did it!

A Whole New World :)

Creating a world is somewhat more advanced. First, you need to 
delete the existing levels. Then you need to change the following
lines found at the beginning of the program:

If you want the player to start out with money, change the 0 in:
0->LMST(6)
to how much money you want them to start with.

Change the 2s in the lines: 
2->N
2->O
to the coordinates of your starting room.

Creating an enemy type:
Find the attack sequence code. You probably want to open it in
the Graph Link software and search for  !ATTACK!. Underneath the
word !ATTACK! (the only time it occurs in the whole program), you 
will see the line: 
randInt(1,10)->J
Change the 10 to the total number of enemies. If you added an enemy, 
the number would then be 11. Insert 5-10 lines after the randint line.
On the first of those lines, type: 
If(K=11):Then
But replace the 11 with the enemy number. There is a number for each 
enemy. 1-10 are taken. And since you are adding one, the next number 
would just be 11. Then store the name of your enemy to String1. For 
example, if you were making a Tolkien rpg, you might have the line:
"Ungoliant"->Str1
Underneath that, you can specify certain characteristics about the 
enemy. These are the possible variables:

H+1->H           Change 1 to how much health over the average this 
                 enemy has. You could also say H-1->H for less health.
                 Or you could have H/3->H or 5H->H.

You could also add to or subtract from room variables on the attack of 
certain enemies. Look back up to the top of the readme and look at the 
things like LEST(4) which controls the amount of money enemies give out.
You could make it so if you are attacked by a Thief, the amount of money
that the enemies give out decreases. You would do this:

LEST(4)-1->LEST(4)

Remember that the L is the little L under 2nd > STAT > OPS. Of course, if 
you were to re-enter the room the enemy cashflow would be reset to the 
average set to that room. This system helps make the game more dynamic so
that players cannot easily spot patterns in cashflow beyond certain 
rooms that tend to be richer.



(C)Summer 2003
   Brian Gordon