T.A.Z. 0.92b2 - DaCoTa / Insanity Software - March 5th, 1998

What is it?
-----------

T.A.Z. is a fully functioning map editor for Total Annihilation. It started out as a conversion of TATOOL to Win'95 but its much more than that now. You can visually edit the tiles, height and attributes of a map, no matter how big the map is. (I can edit 32mb and 64mb maps on my 16mb machine. I even created a 4000x4000 map on that machine. Just make sure to have enough disk-space for that kind of stuff, cause such a map is almost 100mb in size!) The 'old' T.A.Z. is the map viewer. After ten releases of T.A.Z. it has evolved into a complete map-editing program, including BMP import, block functions and compression.

Where can I find those map files?
---------------------------------

First, get the file Write_HPI from any self-respecting T.A. site.(Probably the same site as where you've found T.A.Z.) Read the docs and you are able to extract the map files from the T.A. CD-ROMs. You'll need both the TNT and the OTA file of the map you want to edit. Then start T.A.Z. and push Edit Map. (The View Map is nothing to worry about, that's the old version of T.A.Z. :-) I'm still working on the HPI extraction part in T.A.Z. When I've finished that, maps are also saved to the (compressed) UFO format, no longer to seperate TNT and OTA files.

What files are included?
------------------------

In TAZ092B2.ZIP should be the following files:

TAZ.EXE	        The main thing... Nothing without it...
TAZ.TXT	        This doc file...
UNITLIST.TXT	ASCII file where you can add new units... Need this if you want to edit OTA files...
OTAEDIT.TXT     A very small and not complete document on how to program units for creating missions... Thanx pmg!
WALL.BMP	An example bitmap for importing...
MOUNTAIN.GOB	An example piece of landscape...
STAMP.GOB	Add this into the upper right corner of a map when you release it... Please... :-)

How does the normal editing work?
---------------------------------

Roughly, there are three stages. First I'll cover the tile editing. Here you can pick up and place tiles on the map. With control and the right or left mousebutton you can fill the two work-tiles on the Control Panel. The tilebar also moves to the right position, so you can see the previous and next tiles. With Shift and the right or left mousebutton, you can put the tile back on the map. The tilebar automatically moves one place and the work-tile shows the next tile. This way you can easily move any mountain or coastline, just pick the first tile up, go to the new location and start clickin'.

The second stage is the height editing and is a little hard. When you select the height view, a height grid is showing on the map. You can adjust the height on a spot with the '+' and '-' keys.  With 'PageUp' and 'PageDown' the height is adjusted by 10. You can also set height that you can use (just like the tile editing) with the mouse, one for the right button and one for the left button. If you press enter, a window opens up where you can insert a value. The actual height under the mouse cursor is shown in the box on the Control Panel. Keep the sealevel in mind and look good at the grids of other mountains and coast- lines on how you should do it. The mesh value changes how much altitude lines are shown. The Red Line value is one line you can set on a particular value, f.e. the sea level. (There are a few cosmetical bugs in it, but they do no harm.)

The last stage is simple, the attribute editing. This works a little as the tile editing, only the attributes are numbers displayed on the map.  With control-click you can select a particular attribute and with shift-click you can put it back. If you select Clear, you can remove attributes. (Sometimes you'll see a -1 attribute; this is (probably) the same as Clear, so it's nothing to worry about.) Keep in mind you don't put attributes too close together. Some attributes are way bigger then the white box you see on the map, the white box is just the upper-left corner. (Example, a Metal Deposit is approx. 9 times the size of a white box.) Visual attributes are for one of the next versions of T.A.Z.

GOB's, what are they and what can you do with it?
-------------------------------------------------

GOB's are Geographical Objects, or in simple words, small sections of a map. With the select button, the cursor changes into a small cross (no matter what mode you are in) and you can select two corners of a rectangle. This part of the map, with all the height and attribute information is copied into an object, which you can save, load and paste back onto the map. If you load up a GOB file, the tiles will be added to the tilebar and the GOB is added to the GOB Selection List. Just click on the GOB you want to use and click on Paste. The cursor changes into a rectangle and if you click, the GOB is pasted back onto the map. Right above the GOB Selection List there are three checkboxes. These are to disable some parts of the past.  If you just want to paste the attributes, disable the Tiles and Height checkboxes and the only thing that is added are the attributes.  Simple, no? I included a sample GOB, called Mountain.GOB. It's from the 'Coast To Coast' map and is 5x8 tiles big.

Gradient GOB's
--------------

If you want to create a map with a border between two landscape types, you can create a fairly nice border. Get two plain GOB's, one per landscape type. Make shure the GOB's consist of 'common' tiles, e.g. flat land. Now, select the Gradient button and a window opens. First, select the orientation. Now select the two GOB's you want to use. Also enter the height of the land, per side. Finally, set a size for the GOB and press OK. One Custom Made Gradient GOB coming up!

A quick lesson on how to make new GOB's
---------------------------------------

This piece of the doc is how to create structures on the map. New landscape (hills, coastline, etc. etc.) is a little harder and I'll explain that if I got that working. First of all, you need the following software:

-trueSpace 3 (could be done with any other ray-tracer, as long as it can do isometric rendering);
-T.A.Z.;

Now, how to create a structure on a map in 15 steps:

1. First, create a nice structure with trueSpace 3. Put it at ground level, at the 0,0 coordinate;
2. Create a flat square for the ground and give it an obvious color which isn't used in the structure. Set it to Phong shading;
3. Glue the entire scene into one object;
4. Rotate that object -25 on the x-axis;
5. Replace all lights with one one infinite light;
6. Set it to -165 on the x-axis and 25 on the y-axis;
7. Enable shadowing on this light, set it's color to white and intensite halfway;
8. Set view to TOP;
9. Set Ray Tracing on and render the scene to disk;
10. Open up a map in T.A.Z. and click the Import Image button;
11. Set Enable checkbox and Select Tiles you want for the ground;
12. Set the normal ground color and the shadow color. Those colors will be replaced by the tiles you've selected;
13. Crop the image by adjusting the four SpinEdit boxes;
14. Set the default height;
15. Press OK;
16. Only thing that is left is adjusting the height manually.

That's it, one custom made GOB ready to paste! Just look at Wall.BMP, that's what I mean. That BMP comes directly from trueSpace3. Just load it up in the Image Import, enable the checkbox, select a few plain tiles, set the normal color to bright green and the shadow color to the darker green. Adjust the size a little, click on OK and be amazed :-)

New map creation
----------------

If you want to create a new map from scratch, you first have to load a base map (you've got to have some tiles to start with). Next you have to select the tiles you want to use from that map. Just click on them and the selected tiles have a little box drawn on them. Select tiles that really look similar, only plain tiles from one kind! If you want to remove all the obsolete tiles, click the checkbox.

After this, the attribute weight values are to be set. The upper scrollbar is how much of the map is covered with attributes. (Make it 1 or 2%, or 15% to 20% for a really dense forest. With 50% the commander can't walk through it. The second scrollbar sets the individual weight per attribute. Just experiment a little with it!

Now, set the sealevel, the height used for the map (higher than the sealevel for a land-based map and lower for a water based map of course). Set the size and click OK.

After a few seconds, the map is ready and you're in the map editor. Go to the Map Settings window and Import an OTA file you want to use. Change the commander placements, correct any wrong settings and save the map to the \maps subdir of the T.A. game directory.

Map compression
---------------

This was a real pain in the rear to get it working. It was an even greater pain to get it working _FAST_. But it does. I don't know what time it needs on a 50.000 tiles map, but an 8.000 tiles map was compressed in about 10 minutes on a 16MB P133 machine, so it's quite fast I guess.

If you press the Compress button, you first have to select the map to compress and where to save it (Can be the same, but you better not. I'll explain later why not.) After that you'll get a screen with a few settings. I'll _TRY_ to explain what all those setting do so you can fine-tune the compression. If you don't, a map could be reduced to a few 100 tiles and you can't even see what was on the map.

First, the border tiles (the right most collumn and the bottom four rows) are set to the first tile. Those tiles can't be seen in the game, so why keep them? (If you want to know why the game doesn't show them, read the 'Remarks about editing' section.) But, you you want to keep those tiles, you can skip this. After that, duplicate tiles are filtered out.

Now, the major part of the compression starts. The whole principle of this is comparing every two tiles against each other. I thought of a few criteria, each criteria adding something to a value. If that value is too high, the tiles don't match. You can change the weight of those criteria in the Compression Setup. I'll try to explain:

	- Maximum Difference: If the value exceeds this, the tiles don't match.
	- Unused Color Difference: For every color the tiles _DON'T_ share, this is added to the value.
	- Minimal Tilecount: If a tile isn't used at least this much, the 'Rare Tile Differece' is added to the value. (A low value will _REALLY_ slow down the compression.)
	- Rare Tile Difference: The amount added if one of the tiles isn't used enough.
	- Cluster Size: The maximum size of matching tiles is recorded per tile. (Hmm... Not very clear... :-)
	- Minimal Group Size: Every group of matching tiles is reduced to this amount of tiles. If a group of matching tiles is smaller, nothing happens to them. So if 100 tiles are matching and this value is 10, only the first 10 are kept. (10 is a good value to keep it nice-looking.)
	- Color Difference Value: Every tile is divided in four quadrants. Of those quadrants, the average RGB value is taken, the difference between the two tiles (per Red, Green and Blue value) is quadrated and the total is squared again. This value is multiplied with the 'Color Difference Value' and added to the main value. (Even less clear... :-)))

Some maps are very hard to compress, until you find the right values of the parameters. The 'Color Difference Value' is important if a lot of detail is lots and the compression just removed way too much tiles. (For example: 'Lava Alley' is reduced to 300 tiles from 8000 with these default settings, but 'Coast To Coast' is perfectly compressed from 1200 to 800 tiles with only a few very small cosmetical glitches.)

If you think it takes too long to compress a map and you hear a constant rattling of the harddrive, go to a friend with more memory. The compression is way faster if all the tiles are loaded into the memory at once and the disk swapping is minimal.

Remarks about editing
---------------------

The visual part of the in-game map is within the black-white lines. As you'll see you have 4 rows extra above and below it and 1 column extra to the left and right. Do not worry about this and don't put your energy in them. The only time you'll have to worry about them is when you are editing the height data. If you have a mountain on the lower rows, the height lines are shifting up. The lower 4 rows are to get the whole visual map have height data. (Look at the map Ashap Plateau on disk 1 to understand it a little better if you are confused.) The upper 4 (white) rows are only so you can edit everything; it neither is used visually in the game. This is the same with the extra left and right columns. Don't bother about them; just use it to edit whatever is in the black-white rectangle.

The minimap is automatically updated while editing the map. The map in the TNT file isn't used, the minimap is calculated entirely from the tiles. I'm going to improve it a little, the minimap calculation isn't very acurate for small maps. (Smaller as 125 tiles.)

After the editing, save it (preferably under a different name) and put it in the \maps directory of T.A. (Make one if it isn't there.)

Unitlist.txt is a simple textfile listing all the unit code names. If you want to add a new unit, just put it in there.

If you've created a map, please add Stamp.GOB in the upper right corner of the map. You can't see it in the game, it's just a little advertisement for T.A.Z. It's only 4k and it won't hurt you :-)

System requirements
-------------------

The P.C. on which T.A. is running should do fine. :-) I can edit 64mb maps on my 16mb machine (A P133) and it works pretty smoothly. It takes about 5 to 10 seconds to load a map. (Somewhere around 1000 tiles per second.)

Known bugs
----------

Map Settings could be kinda buggy. Isn't very good yet. There are a few cosmetical bugs, but they are nothing to worry about. Just move one tile and the map is redrawn completely. If you get a pointer error or some other kind of fatal or non-fatal error, please write me about it. Give as much details as possible so I can track that bug down and add a cross on my bug-kill list. :-)

History
-------

0.92b2- The reason why I released this one and not 0.93b is
        that a bug was reported about the minimap. It would
        look fine in the editor bug in the game it would turn
        up all garbled, grey or dark. After two night of
        searching I found the bug and fixed it. Thanx Blackthorn,
        Cong & Garry!
      - I was working on better drawing of lines on the map.
        I wasn't finished with the palette for those lines so
        it won't look too good when editing the height mesh.
        The problem is that it's not finished and some things
        don't work anymore. Only the height mesh works with those
        new routines, the unit placement doesn't. So you have to
        use 0.92b for that and 0.92b2 to finish a map and save
        it with a good minimap. I wish I didn't have to release
        it like this but I don't have a choise. I'll release 0.93b
        asap and get over with this trouble.
      - I'm also working on GOB libraries and ATA (Annihilator
        Tile Archive) import routines but they aren't finished
        either, sorry for this.
      - Changed internal GOB routines, they are a LOT more
        efficient. Tiles are only added onto the map if a GOB
        is actually placed, not when loaded.
      - I fixed a another few bugs in the OTA editing. Thanx
        pmg!
      - Changed the process display of the map compression,
        now you have a percentage and an estimated time left
        display which should give you the idea something is
        happening. :-) BTW: if the process hasn't reached 1%
        yet, the ETL is very inaccurate. Thanx Kevin!
      - I've added a small and still uncomplete documentation
        on how to program units for creating missions... Thanx
        to pmg for creating it for me! It's called OTAEDIT.TXT.
0.92b - This is a Speed Devil! Now T.A.Z. really lives up to his
        name as Tasmanian Devil. I've cut down the loading time
        by about 90-95% and (a rough guess) 75% of the drawing
        time. Thanx to John Biddiscombe and Agustin Villena, the
        authors of the TDIBPaintBox component for Delphi.
      - Another big advantage of this speed enhancement: I changed
        the four arrows into scrollbars. Now it's a lot easier to
        move around over the map, just drag and click your way
        around the map.
      - Revamped the complete interface of the main window. It's
        much, much better now. (Lots of speedbuttons, cool! :-)
        Not every speedbutton is working yet, but the most
        important are.
      - I improved the window-resize code. Added a minimum size
        though, because I had to do too much checking if I didn't :-)
      - Changed the height-grid code into an altitude-mesh code.
        Some of you will know what I mean, it looks the same as
        the height mesh in the game.
      - Added Map Compression. Tripple Pass compression with
        Four selection criteria. Don't use without reading what
        the options are, the default values aren't fit for every
        map! At least it's fast, it did 'Coast To Coast' in 9
        seconds (yes, nine!) and removed 400 tiles from the 1200.
      - Added Bitmap Import. You don't have to think about the
        palette or the size of the BMP file you want to import,
        just import it. If you have trouble getting the piece
        of landscape fit nicely into the rest of the landscape,
        T.A.Z. can replace one color to a selection of already
        existing tiles and another color to a shadowed version
        of those tiles.
      - Added checking of tiles when loading GOB's. This will
        reduce tile build-up enourmously when loading a lot of
        GOB's. Could take a little longer if there are a lot of
        tiles already loaded. (I read about people working on
        50.000+ tile maps... If anyone does, please write me
        about the performance of T.A.Z. BTW. The tile limit of
        the TNT format is 65535, so be a little carefull with
        creating huge maps!)
      - Added names for GOB's. It'll show the filename of the
        loaded GOB's. If you save a GOB, the name is changed
        accordingly.
      - I dropped the GOB Mirroring idea, it just won't work.
        The lighting comes in from the left, so if you would
        mirror a GOB, it just doesn't fit in anymore. If you
        have a GOB you want to mirror, just grab it with PSP,
        mirror it there and import it again.
      - Improved the MiniMap render resolution, the resuolution
        is four times as high as before. This way, small maps
        should look much better now.
      - Disabled the Undo function for now, it costed way too
        much time when working on big maps and small PC's.
        Have to re-think my approach on this one.
      - Removed a bug in OTA file loading, when a map already
        had been loaded once.
      - Added a forgotten OTA option (Glamour), fixed a few OTA
        options (now correctly writes a ';' after them) and
        added an option to easily add new units. See
        Unitlist.txt. Thanx PMG!
      - I have an american mirror site! Thanx to MadMoses from
        Purest Annihilation <http://pa.neurogamer.com/>.
        The mirror is at <http://pa.neurogamer.com/taz>.
      - I've been working on a 10" (yes, ten inch... That's
        a whole 15cm!) black & white monitor cause my old
        one blew up :-(( I got a new 15" and saw that some
        forms were messed up when run with another font
        size. Now I hardcoded the font size so it should
        be correct with every font size. (Could be small
        if you have a very high resolution.)
      - Did you know the T.A.Z. source code is over 8500 lines
        of Delphi 2 code and it has been written in somewhere
        around 130 days?

0.91b - I really messed 0.9b up... In the hurry to get it
        out on monday, I left some things terribly unchecked,
        resulting in all kinds of errors... I checked this one
        enough so it will load up a map, not crash out of it
        before even trying to read it. :-(((
      - You can see a panel on top. Doesn't do anything yet,
        only sits there taking up place.
      - You can edit all the options in the Map Settings window,
        it will save to an OTA file, but it's not very handy to
        use. I'll do it in the future...

0.9b  - First of all, I updated the credits. I hope didn't
        forget anybody and I've mentioned everyone correctly.
      - I fixed a real big bug with GOB's. Maps on which GOB's
        were used with new attributes on them, messed up the
        map when trying to load them in T.A. (exit to windows
        on the terrain loading). I don't know exactly how to
        fix those maps, probably load up the map, maybe reload
        the used GOB's and save it again. (This is why I 
        released this version while OTA editing wasn't finished
        yet.)
      - Gradient GOB creation added. Now you can get a fairly
        nice looking border between two different styled maps.
        Just load two plain GOB's, one for every style (say,
        a piece of plain Desert and a piece of plain Green
        planet) and press the Gradient button. Select the
        orientation, both map heights and the size of the
        GOB. Last but not least, press OK and you've got
        yourself a nice GOB. :-)
      - Working on the map compression. Quite tricky though.
      - Almost forgot, lots of people wanted to see a resizable
        edit window. Here you've got it :-) Was easier than I
        thought.
      - Imporved minimap quality. Looks really good now, as I
        say myself. :-) With this quality, I don't think I'm
        going to implement High Quality Minimap creation
        anymore. (The idea was to use a four times as high
        resolution for the minimap. It could make some difference
        on small maps. If you still want this, please tell me.)
      - Now correctly calculates the minimap/real map ratio.
      - You can add new items to the attribute list. I've
        added every attribute from every map, but there are
        a few more. Complete list in some next version. If
        you know an attribute, use the 'others' button.
        (Be carefull, if it's wrong, T.A. can't load up the
        map!)
      - Fixed tons and tons of bugs.
      - I haven't finished the OTA file editing yet. (It's a
        pain in the ... Some things work though. The Randomized
        Commander placement works. Add/Delete/Duplicate unit
        isn't tested 100% yet, don't know if they're working.
        Also, can someone help me writing some documentation 
        about this, cause it's quite complicated and I don't 
        want to put lots of time in that when I can continue 
        programming in stead.

0.8b  - Did a LOT, but I mean a LOT of work on this version.
      - Removed all the loose windows, only the minimap, now
        with a smaller caption. (Isn't it neat :-)
      - Added GOB support. Copy, paste, save and load pieces
        of a map. Can load from other maps, it'll add the tiles
        used in the objects.
      - BIG speed improvements in the editor. Loading time is
        a little longer, but that's the price to pay for it.
      - Automatic MiniMap update. Not very good on small maps,
        but it's fast!
      - Did a LOT of work and research on OTA editing. In the
        next version, everything should be editable about the
        OTA files. This means easy mission creation!
      - Did so much work, I think I forgot a few things. :-))

0.7b  - Added PageUp and PageDown and mouse editing of the height.
      - Added cursor box when tile-editing. (Little bug in it :-(
      - Started on new map creation, extraction from HPI and OTA
        editing.
      - Had to rush to get it out, not as polished as normal, sorry
        about that.

0.6b  - Did a LOT of work on the map editing, is working quite fine
        already! Did a 75% rewrite of this file, the old version is
        stuffed in a corner of this version :-)

0.55b - First look at what is going to be the map editor. You cannot
        edit yet, but the map display in the map editor (completely
        different from the original map viewer) for testing purposes
        only. It leaves some temporary files for now, but this will be
        fixed when the map editing is done. No docs about the editing
        yet, just use all the arrow buttons on the screen or click on
        the minimap.
      - Updated the docs, I forgot to mention Write_HPI was needed to
        get TNT files.

0.5b  - Removed the header display. Quite useless to look at and only
        took space.
      - Display the size of the Complete Map image using current
        distance level. If it exceed about 1000 x 1000, think a sec
        about starting it if you only have 16MB of memory. (Like me :-)
      - Added split button. This splits the correct TNT file up into a
        few smaller resource files, all with one part of the map. This
        way other utilities have less work to do. (Handling a few
        smaller files is easier then one big file.) Joining is not yet
        implemented.

0.4b  - Added Save to BitMaP options. For now 16M colordepth save,
        should be 256 colors.
      - Not really released. I had only time to add one option, so I
        waited another day. I didn't want to drive everybody crazy with
        four new versions in four days. :-)

0.3b  - Added Tiles option
      - Removed external BIN palette files
      - Code speedups

0.2b  - Fixed flicker bug
      - Fixed image resize bug
      - Fixed disabled button bug
      - Added complete map magnification

0.1b  - First working and released version

Future enhancements
-------------------

- Full OTA Map Settings editing.
- Visual attributes;
- Extracting and compressing HPI files;
- Automatic 'object' recognition (Mountains and other pieces of landscape);

Those options should keep me busy for a few days. :-)

Credits (in alfabetical order)
------------------------------

The Commander:

	Chris Taylor  &  Cavedog

My Fellow Authors:

	Adam Swensen		Author Annihilator
	Agustin Villena	Author TDIBPaintBox Delphi Component
	David Dunscombe	Author TABuilder
	Eddy Jansson		Author TATOOL
	Eric D.			Author WriteHPI and hacker of various T.A. formats
	Joe D.			Author HPIUtil DLL file
	John Biddiscombe	Author TDIBPaintBox Delphi Component

The Media:

	MadMses		SiteOp Purest Annihilation - Thanx for the mirror site space!
	Larry			SiteOp Annihilation Center
	Magar			SiteOp Annihilated.com
	Ky Woo			SiteOp Annihilation Online
	Ryan N. Freebern	SiteOp AnnihiLab - Thanx for the review and splash screen!
	Scott Yaskin		SiteOp TA Map Evaluation Center

The Mailers:

	Adam Swensen		For being curious about the screenshot...
	Alabkar			For giving lots of helpfull comments...
	Alex Richardson	For offering me help...
	Axehandler		For offering me help with Win32 graphics...
	Bob			For being unpatient...
	Calvin Lee		For asking me help...
	Conan Gonad		For supporting me...
	Dale Larson		For being curious about the HPI format...
	Daniel Personson	For offering me help with the HPI format...
	Don Kelly		For being curious about my code...
	Jack v. Rooy		For offering me help with the HPI format...
	Jake			For being unpatient...
	Jesse Williams		For offering me help with Help files...
	Michael Wakkinen	For offering me help with the HPI format...
	Miguel			For asking me help...
	Mike			For the bug report...
	Mike Ryan		For being a bug-reporter...
	Nick Hall		For being on the UvA too :-)
	PMG			For the bug report... When are you going to release the campaign?
	Ramon Morang		For offering me help with code speedups...
	RawDeal			For giving helpfull comments...
	Scott Shelton		For being curious about my code...
	Scott Manzi		For giving helpfull comments...
	Scott Milton		For helping me with the docs...
	Sean M. Vismaw		For giving helpfull comments...
	Shane Miller		For offering me help with programming...
	Simon Pedersen		For honouring me :-) And the bug report...
	Sren Kappel		For asking me help...
	Timothy Mead		For the bug report...
	Tiberman		For giving helpfull comments...
	Vurty			For supporting me...

Contact me
----------

Any problems, limitations, bugs, language improvements, performance glitches or any other thing, want to receive the newest version right away, please contact me at:

"Claudio Tagliola" <tagliola@wins.uva.nl>
http://gene.wins.uva.nl/~tagliola/TAZ
http://pa.neurogamer.com/taz