                        ----------------------------  
                        | THE WRATH OF SONA ENGINE |
                        |       TILE FORMAT        |
                        ----------------------------
------------------------------------------------------------------------------
/DISCLAIMER-Specifications in this file are subject to change without notice,\
|and not all functions listed are active yet! But I will attempt to keep this|
\                   document as up-to-date as possible.                      /
------------------------------------------------------------------------------
Tiles in the WOS engine are 20X20, stored in a big array called 'tiles'. This
array can hold 157 tiles, from 0-156. When the map reader comes across a
number, it draws the tile that goes along with it (obviously!). However,
instead of using the typical "IF tile=5 THEN drawtile 5" or whatever, a simple
calculation is made. This is called 'offsetting'.

More Detail...
OFFSETTING is a powerful way of reducing codespace. Placing all of your tiles
into a single array, and calling any of them from one command is extremely
useful and saves a lot of typing! However, there is a bit of precalculation
necessary, but once that's over with, you're set! So, here we go:
        Take the tile size (20X20=400) and divide by 2.
        Add 2.
        Set a variable to the result ex.20X20 tile...400/2=200...200+2=202
        Now, when we want to draw a tile, this is how we do it-
                PUT (x, y), tiles (offset * tilenumber)
        OFFSET is that 202, and TILENUMBER is the number of the tile to place.

Okay! That was easy, huh?

CREATING TILES-
OK, first of all-starting with beta 0.15, all tiles in the WOS engine must
color-conform to the NMedia palette standard. Why? Well, look at the graphic
enhancements! 0.14 is junk compared to 0.15. The graphics are so much better.
This is for two reasons-NMedia palette, and special effects in PixelPLUS 256,
which is what I use EXCLUSIVELY. PP256 has many palette-related effects that
helped out. With more gradients, it is more effective. So, keep those two
things in mind.

BUILDING A TILESET-
Okay, if you're serious about the WOS engine's actual tile file arrangement,
here's how it works-

Since the tiles are 20X20, we place them on the screen in order, from left to
right and up and down. At 0,0 we'll put a tile down. Then another at 20,0 and
another at 40,0 and so on...till 300,0 then the next one would be 0,20 and so
on and so forth...YES you can use tileslot 0...

The reason this is done like this is because I'm sure all of you have seen
some RPGs that use like 600 external TYL files that are either 411 bytes or
about 1200-1500 bytes. WHY!?! A typical WOS tile file will be from 4k to 15k
and will hold 157 tiles! Hrm...not everyone thinks like we do...

By the way, an old post by Petter Holmberg on one of those WWW boards
indicated another problem with many files. Since an OS can only store files
at a certain size, even a game that unzips to 300K can equal 15MB because of
all of the tiny files. So, try to keep it to a minimum! If the WOS ZIP had
every tile as an individual file...oooohhhhhh! It's scary...it would probably
unzip to over 60 megs. The source directory for WOS is over 30 megs now, then
there's a temp dir for files like GIF screens for tile 29, plus more faces,
screens, JPEGs for head-lopping, etc...that totals another 30 or so megs. All
in all, with that PLUS my development tools and source code, prolly adds up to
over 60 megs. See why optimizing is IMPORTANT!?

Okay, the files are saved as GIF files. Also, if you want the tile loads to be
invisible, you should somehow wipe out the palette, because our engine
actually places the file on the screen, then grabs the tiles off of it. So,
what we do is BSAVE the original file, then use a program that wipes the pal-
ette clean (to all zeros) and saves as a GIF87a file. Perfecto! There is a way
to save all tiles in a BSAVE file, but I don't do this for these reasons-
        -Never figured out the exact dimensions (can be done easily in PP256)
        -GIF files are smaller and the WOS engine's GIF reader is FAST
        -The time you'd save is minimal, and on a fast computer you wouldn't
                notice the difference anyways

"Um, sure, man...heheh that's all well and good, but what tiles mean what?"
Arg, I KNEW you were going to ask that question! Okay, so here's a complete
description of all 157 tiles and their uses. Note that the actual graphics of
these tiles are completely customizable-that's why we're using templates and
not loading every game tile at once (that's a waste of memory!). I've heard of
RPGs that load like 300 tiles at once yet only uses 30 of them...what a waste!
So, our way of doing things is quite dynamic and less wasteful...so you can
use that extra space saved for other things.

Tiles from 0 to 20 are "walkable" tiles. These can be walked on. Tiles from
21 to 28 are non-walkable tiles...impassable. Tile 29 is the GIF tile. It is
nonwalkable. Nonwalkable tiles continue to 50. 51 to 60 are walkable "warp"
tiles, meant for doors. 61 thru 80 are more nonwalkable tiles. 81-100 make up
the object tiles, or NPCs. They are also nonwalkable tiles. Finally, the
final 56 tiles are ANIMATION FRAMES. The first tile in a set of four is the
"key" tile, the three remaining tiles are "frames". Fourteen four-frame
animated tiles may be used in each map. When we implement the newer KM3 specs,
the tileset specs will change slightly.

FINAL NOTES AND TILE FILE DESIGN HINTS-
An important note I mentioned before is the COLOR PALETTE. This engine's tiles
        use the NMedia palette. However, if you look at the palette in PP256,
        you'll notice two runs of grays. The second run of gray near the
        bottom should NOT be used for creating tiles. Why? Because its used by
        the engine to load face files. When a face is loaded, any tiles that
        use that range will be altered until the face is removed. So, I do
        recommend wiping out that area of color and re-saving the palette to
        another palette file made specifically for this engine.
Tile 29 is among one of the coolest. When the character sprite is next to a
        tile 29 and the spacebar is pressed, a GIF image is shown. This could
        be used (and is used in WOS) for effects like looking in windows...or
        looking out across the lands from atop a mountain...or whatever your
        heart desires it to be used for. The tile itself is non-walkable.
The ETX tiles can also be used to make treasure chests. In fact, that's the
        only way to place treasure chests in the WOS engine! You just follow
        the directions in ETX-FORM.TXT for details.
Tiles 51-60 can be used in a most sneaky manner. Duplicating tiles is the best
        way of being sneaky with them, especially if you make the warps
        "invisible". Place the warp and the destination carefully...make it so
        the player has no idea that they've suddenly shifted in the map! Draw
        the two locations identically and they'll never know what hit them...
Another thing about tiles 51-60 is you have to be quite precise in determining
        their origin! If a door tile is walked on and the position of the
        tile is not set right, the engine will not record the warp. It will no
        longer bounce the character back. The bounceback feature in the older
        betas was flawed, and didn't always work. So, now it doesn't work at
        all. However, this makes for more accurate positioning of destinations
        because the coordinates given will always be accurate (unlike before!)
One of the greatest ways to make a player go mad is to make some of the
        walkable tiles non-walkable...for example, make grass, but also make a
        non-walkable grass tile. When the player tries to step on the non-
        walkable grass, it's going to drive them crazy when they can't figure
        out why they're not going anywhere!
FINALLY...
Don't feel limited! The descriptions of the tiles are merely suggestions. It's
        just kind of easy to use tile 1 as grass or whatever...but you really
        have no limitations! Just follow the rules and you'll be making the
        engine produce amazing effects in no time at all! Even the
        "weaknesses" can be used creatively if you just know how to do it...

I hope that if you use our engine, you've found this documentation useful!
