Overview

Hostile Takeover Author Kit Overview

The Hostile Takeover Author Kit contains the tools needed to create content like new levels and graphics for Hostile Takeover.

Game Databases

Hostile Takeover makes use of "Game Database" (.pdb) files to store its content. There is a custom game database for each major graphics format Hostile Takeover supports. For example htdata816.pdb contains graphics tuned for 8-bit, lores (16-pixel tile) devices whereas htdata424.pdb contains graphics tuned for 4-bit hires (24-pixel tile) devices. There is a separate database (htsfx.pdb) which stores sound effects. The tool packpdb2.exe is able to create Game Databases and extract or view their contents.

Levels

Single and multiplayer levels are created with the Map Editor (M.exe) then added to a Game Database with the utility mkpdb.bat. Level files, also known as Level Description files, have the extension .ld. See how to create a Level for details.

Templates, Template Collections

Maps are created in the Map Editor by assembling puzzle piece-like Templates which have been designed to fit together to form roads, cliff ranges, rivers, etc. The TemplateExtractor utility is used to extract Template art, terrain information and name from artist-friendly source files and convert them into Map Editor and game-friendly Template Collection (.tc) files.

A single Template Collection contains all the Templates for maps of a region, e.g., grassy or sandy. Template art is authored as 24-bit color images that break down into 24x24 tiles. Automated tools perform the job of reducing the Template art to Hostile Takeover-compatible 8-bit color art including scaling down the art to accommodate lores devices. A Template Terrain info image is scanned to determine which areas of the templates block the movement and placement of units/structures in the game. For details on all of this see how to create a Template Collection.

Testing new Levels and Templates

Once a Template Collection has been assembled and a Level(s) created add them to a Game Database (see adding Template Collections to a Game Database and adding Levels to a Game Database) and launch Hostile Takeover to give them a play test.

Helper utilities

Several shortcut utilities have been included in this kit to reduce the number of steps needed for common authoring operations. They are:

makeall.bat | Extracts grassy Templates to create grassy.tc, then adds it and the grassy_test.ld Level to the htdata816.pdb and htdata824.pdb Game Databases
updGrassy16.bat | Adds grassy.tc and grassy_test.ld to htdata816.pdb
updGrassy24.bat | Adds grassy.tc and grassy_test.ld to htdata824.pdb

Use these batch files as a starting point to create your own helpers. It may be as simple as searching for each "grassy" and replacing with the name of your environment, e.g., "sandy".


New Page 1

 This collection of topics give step by step instructions on how to perform common Hostile Takeover authoring operations.


How to create a Level

launch Map Editor

open Template Collection. Create if necessary.

create a new Level (menu File, New)

adjust level Settings (min/max players, bounds, title)

drag Templates onto the map

arrange Templates as desired

add initial structures/units for each side

adjust side Settings (e.g., initial view, initial credits)

save as .ld

<NOTE: must save over a pre-existing Level at the moment. Fix: provide preprocessor and document use of [Levels] section of Game.ini.pp>

incorporate into a Game Database

test with HT.exe


How to create a Template Collection (.tc)

How to create a Template Collection

A Template Collection (.tc) is a file that contains, surprise, a collection of Templates. Templates are the puzzle pieces of terrain that are placed on a map in the Map Editor (M) when creating a Level.

To create a Template Collection:

  1. Create a .png file containing all the templates constrained and arranged as defined by the Template Art Guidelines. Follow the naming convention: <style>Templates.png, e.g., grassyTemplates.png
  2. Create a .png file containing template terrain information (i.e., which parts of the template block unit movement in the game). See the Template Terrain Guidelines for details. Follow the naming convention: <style>Terrain.png, e.g., grassyTerrain.png
  3. Create a .txt file containing a name for each template. See the Template Naming Guidelines for details. Follow the naming convention: <style>Names.txt, e.g., grassyNames.txt
  4. Use the TemplateExtractor tool to extract the templates, terrain info, and names from the .png and .txt files and compile them into a Map Editor friendly Template Collection (.tc) file.

Once the source files are ready invoke the TemplateExtractor from the command-line to create the .tc file:

TemplateExtractor -tc <style>.tc -n <style>Names.txt -art <style>Templates.png -ter <style>Terrain.png

The result will be a Template Collection you can load into the Map Editor or add to a Game Database for previewing in-game.


How to add a Template Collection to a Game Database

Use the helper batch file mkpdb.bat to insert a new Template Collection (.tc) into Game Database (.pdb). mkpdb invokes a number of tools to produce an 8-bit palette from the Template Collection and reduce the Templates to 8-bit before adding them to the Game Database.

To add a Template Collection into a Game Database:

mkpdb -pdb <database> -tc <template collection> -size <16 | 24>

Example:

mkpdb -pdb htdata816.pdb -tc grassy.tc -size 16


How to add a Level to a Game Database

First create or edit the Level (.ld) file using the Map Editor (M.exe). Then use the helper batch file mkpdb.bat to insert the Level into a Game Database (.pdb).

To add a Level to a Game Database:

mkpdb -pdb <database> -ld <level> -size <16 | 24>

Example:

mkpdb -pdb htdata816.pdb -ld grassy_test.ld -size 16


Guidelines

not implemented yet


Template Art Guidelines

24-bit color

24x24 tile

aligned on a tile grid

each template must be surrounded by at least one tile's worth of empty space including at the edges of the document

surrounding area must be filled with the RGB value 255,0,255

Templates are extracted from left to right, top to bottom. The names in the Template Names file must match this order.

naming convention: <style>Templates.png

over-brightening and saturating to compensate for device deficiencies

must have matching Template Terrain file

must have matching Template Names file

see grassyTemplates.png as an example


Template Terrain Guidelines

Template terrain info is extracted from left to right, top to bottom. Order must match Template art and names.

Black tiles are unobstructed

Red tiles are obstructed

surrounding tiles are irrelevant but should be filled RGB 255, 0, 255


Template Naming Guidelines

order must match left to right, top to bottom order in Template art .png

if Template art is reordered so must the names

give related Templates the same prefix (e.g., road00, road01, cliff00, cliff01)


Reference

 This section contains topics for each tool that is part of the Author Kit.


Hostile Takeover Reference

HT.exe is a GUI application but it can be passed arguments either through a Windows shortcut or via the command line.

HT usage:

HT [-m mode]

The mode value specifies which display mode to start HT in. The default is 0 which his 8-bit color, low resolution if htdata816.pdb is present. Mode 1 is 8-bit color, high resolution if htdata824.pdb is present.


mkpdb Reference

mkpdb.bat Reference

mkpdb.bat is a helper utility which will insert a Template Collection (.tc) and/or Level (.ld) into an existing Game Database (.pdb) after applying any necessary 'crunching' operations. mkpdb.bat must be invoked from a command line.

mkpdb.bat usage:

mkpdb -pdb <.pdb> [-tc <.tc>] [-ld <.ld>] [-size <16|24>]

Example:

mkpdb -pdb htdata16.pdb -tc grassy.tc -ld grassy_test.ld -size 16


packpdb2 Reference

packpdb2.exe can be used to create (aka 'pack') data files into a Game Database, to extract (aka 'unpack') the contents of a Game Database, and to view the contents of a Game Database without extracting them.

packpdb2 usage (creating/packing):

packpdb2 -p <CRID> <pdb file> [filespec]

Pack [filespec] into <pdb file> with creator id <CRID>. Optional [filespec] defaults to .\*.*

packpdb2 usage (extracting/unpacking):

packpdb2 -p <CRID> <pdb file> [filespec]

Unpacks files from <pdb file>. Optional [filespec] defaults to .\*.*

packpdb2 usage (viewing):

packpdb2 -v <pdb file>

View contents of <pdb file>


TemplateExtractor Reference

TemplateExtractor.exe is a utility for extracting all the information needed in Template Collection from three source files: a .png file with Template images, a .png file with Template terrain info, and a .txt file with Template names.

For details on the formats of these source files see the Template Art Guidelines, Template Terrain Guidelines, and Template Naming Guidelines.

TemplateExtractor usage:

TemplateExtractor [-tc <output.tc>] [-n <names.txt>] -art <art.png> -ter <terrain.png>

If the output Template Collection is not specified each Template will be written as a separate .png file using the name given in the names.txt file. If no names file is specified the Templates are named "templateNN" where NN starts at 00 and increments for each Template.

Example:

TemplateExtractor -tc grassy.tc -n grassyNames.txt -art grassyTemplates.png -ter grassyTerrain.png

This will produce the Template Collection grassy.tc which may then be loaded into the Map Editor for use or added to a Game Database.


Map Editor Reference

to be written