This tutorial will explain the basic steps to creating a simple Machines map, using only some basic tools and a text editor. Each step in this tutorial comes with screenshots to help you follow along.
New maps will be created from existing ones. Each map in Machines is made from tiles, they are often noticeable in-game as boundaries of textures. Without using any 3D modelling program you can create maps from the existing tiles, rearranging and rotating them. In this tutorial we will use tiles from the Central Dominance (from the Fortress terrain) map.
Things You need Edit
- metaex.exe (http://download.wiredforwar.org/Tools/metaex.zip);
- psbex.exe (http://download.wiredforwar.org/Tools/mb%20Extraction%20Tools.zip);
- Microsoft DXViewer. This is part of Microsoft DirectX SDK. You can find standalone .exe somewhere in Internet http://www.google.com/search?hl=pl&q=dxviewer.exe
- A resource editor, preferably XN Resource Editor (http://www.wilsonc.demon.co.uk/d10resourceeditor.htm);
- Machines with Windows 2000/XP Patch.
Prepare your workplace Edit
Please first make a backup copy of your Machines installation. Now download all needed files. Extract the .zip files and place metaex and psbex in your Machines installation directory, usually \Program Files\Acclaim Entertainment\Machines\
Modify machstrg.dll Edit
Run XN Resource Editor. Select File - Open and browse to \Program Files\Acclaim Entertainment\Machines\machstrg.dll. Expand the 'String Table' list and browse to 519. At entry 8288, insert the title of the preferred scenario eg. Mini Fortress. Save the file and close XN Editor.
Machstrg.dll stores localized strings under numbered list called IDS. A created entry will be displayed as the title of the new scenario. You can use other entries, just remember its number
Extract metafile Edit
Run command prompt with administrator privileges. Press Start and Select from Accessories - Command Prompt (under Windows Vista/7 Right-click Command Prompt and then click Run as administrator). In the command prompt, change the directory to the Machines installation folder. Type:
cd "\Program Files\Acclaim Entertainment\Machines\"
press enter to confirm. The directory displayed in the command prompt should now change. To extract the metafile, type:
metaex -mi mach1.met -e *
Now you can make a backup of your metafile, simple by copying mach1.met to another directory.
Create scenario entry in sceninfo.dat Edit
Open data\sceninfo.dat file in a text editor. You can type in command prompt:
or browse to the file and open it from windows explorer.
In the text editor, search for the phrase SKIRMISHES. Below the line TERRAIN fortress..., paste:
SCENARIO minifort PLANET mini IDS 8288 TEXT minifort.txt MUSIC 9
Save the file and close the editor. Now delete pdata/sceninfo.bin and savegame/playinfo.bin (this step will remove your saved games, please make a backup copy of these files to be sure)
del pdata/sceninfo.bin del savegame/playinfo.bin
Sceninfo.dat stores a list of scenarios and campaign data. The scenario tree is simple and self-explanatory: a list of singleplayer scenarios is listed under SKIRMISHES. The MULTI_PLAYER section stores scenarios for multiplayer games. Skirmishes are divided into: battle, normal skirmish and special. They are named, respectively, MEDIUM, SMALL and LARGE. The TERRAIN keeps information about the terrain,IDS points to localized string in machstrg.dll, TEXT points to the file with description (stored in data/ folder). The SCENARIO entry is very similar to TERRAIN, the additional field PLANET point to the planet used for game and MUSIC set music track played from CD. All orginal description files are stored in .bin format (.bin files can be extracted to .txt by txtex).
The pdata/sceninfo.bin and savegame/playinfo.bin should always be removed after modifing data/sceninfo.dat, otherwise the new scenario list will not be generated.
Create scenario description Edit
Create a new text file called data\minifort.txt. In command prompt:
Copy and paste following the text to your text editor:
CAMPAIGN <w>Mini Fortress map size - small players - 2-4 default starting resources - 1000 END OBJECTIVE 1 END OBJECTIVE 2 END HINT END WIN You are victorious. END LOSE Loser. END
Save the file. Now run Machines, select Single player - Skirmish, browse to Terrain - Fortress. You should see a new scenario entry entitled Mini Fortress.
The format of the .txt file is a little tricky. The same file can be used for description of single scenario, campaign scenario, terrain type, planet or system (in campaing). In skirmish mode, the CAMPAIGN section is description displayed in bottom-right panel. The special sequence <w> sets the selected line of text to white. After first running machines after creating the .txt file, a .bin equivalent should be generated in pdata/ directory. Browse to pdata/ and search for minifort.bin. After each modification of the source .txt you should delete its .bin version. Machines always loads .bin file before .txt.
Create scenario file .scn Edit
Use a text editor to create a scenario file data/minifort.scn. In command prompt:
file should have contents such as the following:
RACES_DEFAULT RED PC BLUE AI GREEN AI YELLOW AI ENDRACES_DEFAULT CONDITIONS TIMER timeout 3600 ENDCONDITIONS ACTIONS WON_OR_LOST ON timeout ENDACTIONS RACE RED none CAMERA_POS 212 273 100.0 -90.0 41.0 0.0 ZENITH CONSTRUCTIONS MACHINES NBMU 0 VIRTUAL_BEACON LEVEL_3_BEACON NORE 0 ENDRACE RACE BLUE data/skirmish.spl CAMERA_POS 212 273 100.0 -90.0 41.0 0.0 ZENITH CONSTRUCTIONS MACHINES NBMU 0 VIRTUAL_BEACON LEVEL_3_BEACON NORE 0 ENDRACE RACE GREEN data/skirmish.spl CAMERA_POS 212 273 100.0 -90.0 41.0 0.0 ZENITH CONSTRUCTIONS MACHINES NBMU 0 VIRTUAL_BEACON LEVEL_3_BEACON NORE 0 ENDRACE RACE YELLOW data/skirmish.spl CAMERA_POS 212 273 100.0 -90.0 41.0 0.0 ZENITH CONSTRUCTIONS MACHINES NBMU 0 VIRTUAL_BEACON LEVEL_3_BEACON NORE 0 ENDRACE RESEARCH_ITEMS data/default.rsi ENDRESEARCH_ITEMS
You can find detailed description of .scn files in Judas Modding Tutorial (from forums.wiredforwar.org).
Extract source .psb Edit
Use psbex to extract tiles from .psb. In command prompt:
while extracting psbex should display various information about the extracted files. Files are extracted to models\planet\fortmult\lod and models\planet\fortmult\lod0. At this point you should have all files needed to create your own map (.scn, .txt in data and .psf, .csp, .env, .lod, .x in planet directory).
Create planet directory Edit
Each planet map in Machines has its own folder. Now we create a folder for the mini planet. Browse to models/planet. Make a copy of fortmult folder and rename it to mini. Rename all files in models/planet/mini/ from fortmult to mini. You should get a mini.psf, mini.csp and mini.env files in the mini folder.
Modify metafile list Edit
The .psf, .csp, .env and .scn files are stored in metafile mach1.met. Before compiling the new mach1.met you have to inform metaex that new files exists. First create the file list, in command prompt:
metaex -mi mach1.met -l mach1.txt
Now open the mach1.txt:
and append following lines to the end of file:
data/minifort.scn models/planet/mini.csp models/planet/mini.env models/planet/mini.psf
Edit .psf (planet surface file) and .csp Edit
Browse to models\planet\mini and copy the contents of models\planet\mini\texture2 to the lod0 folder. Now you can use DirectX Viewer to view the tiles. Drag and drop one of .x files from models\planet\mini\lod0 to DirectX Viewer window. After loading, the model is invisible. Use right click and drag to rotate it in your window. Now you can stop for a moment and browse these files.
Load .psf file in your text editor:
Replace its contents to:
PLANET_SIZE 4 4 TILE_SIZE 60 //TILE_CELLS 4 4 TILE_CELLS 2 2 TILE_BOUNDS -30 -30 30 30 BACKGROUND_FILE fortmult.bg // Tile(0,0) ROTATION 0 HEIGHT -10.065 TILE lod/tile37.lod // Tile(1,0) ROTATION 3 HEIGHT -10.065 TILE lod/tile36.lod // Tile(1,0) ROTATION 3 HEIGHT -10.065 TILE lod/tile36.lod // Tile(0,1) ROTATION 3 HEIGHT -10.065 TILE lod/tile37.lod // Tile(1,1) ROTATION 0 HEIGHT -10.065 TILE lod/tile36z.lod // Tile(1,1) ROTATION 1 HEIGHT -10.065 TILE lod/tile32.lod // Tile(1,1) ROTATION 1 HEIGHT -10.065 TILE lod/tile32.lod // Tile(2,1) ROTATION 2 HEIGHT -10.065 TILE lod/tile36.lod // Tile(1,1) ROTATION 0 HEIGHT -10.065 TILE lod/tile36z.lod // Tile(1,1) ROTATION 1 HEIGHT -10.065 TILE lod/tile32.lod // Tile(1,1) ROTATION 1 HEIGHT -10.065 TILE lod/tile32.lod // Tile(2,1) ROTATION 2 HEIGHT -10.065 TILE lod/tile36.lod // Tile(0,0) ROTATION 1 HEIGHT -10.065 TILE lod/tile37.lod // Tile(1,2) ROTATION 1 HEIGHT -10.065 TILE lod/tile36z.lod // Tile(1,2) ROTATION 1 HEIGHT -10.065 TILE lod/tile36.lod // Tile(2,2) ROTATION 2 HEIGHT -10.065 TILE lod/tile37.lod
.psf file describes the planet surface. The first line PLANET_SIZE specifies the number of tiles in two dimensions. Our map will be 4x4. TILE_SIZE is the size of single one tile. You can use in this map all tiles from the extracted .psb files which has exactly this size. // charactes mark comment in your file. Each tile entry has three lines: ROTATION, HEIGHT and TILE. Rotation specify rotation of tile in right angle, it can be 0, 1, 2 or 3. TILE points to the file used to display the tile.
.lod files are closely related to .x. Each .x file in the lod0 folder is used in one of the .lod. If you want to create a map with specific .x files you should browse lod folder and look in .lod files for reference to those .x.
The next step is to create the boundaries of your map. Open the .csp file in a text editor:
Replace its contents to:
DOMAIN 0 0 0 240 240 OBSTACLE 4 100 0 0 20 20 20 220 0 240 OBSTACLE 4 100 0 0 240 0 220 20 20 20 OBSTACLE 4 100 220 20 240 0 240 240 220 220 OBSTACLE 4 100 20 220 220 220 240 240 0 240The
.csp file stores information about domains, obstacles and portals. Our domain has size of planet (4x4 planet with tile of size 60 gives planet of size 240x240). OBSTACLE 4 100 this is an obstacle with 4 points (quadrangle) and height (?) 100. Lines below OBSTACLE are coordinates of points. Every map should have at least 4 obstacles for map edges. It's a good idea to use paper and pencil to sketch and calculate edges.
Compress metafile Edit
The final step is to compress the metafile. In command prompt, type:
metaex -mo mach1.met -l mach1.txt
Now you can start Machines, select your created Mini Fortress map and admire the almost first new map in Machines since 1998 (for proper operation set the settings as follow: START POSITION: FIXED, VICTORY CONDITION: DEFAULT and PLAYER COLOR: red). You can modify map.bmp from mini/ folder to change minimap (on the screenshot it is simply painted to black). Remember: after each change in .psf remove generated map file to create new one (here pdata/mini.psb file).
Look at other .psf files from Machines, you can learn from them how to make other maps. If you need some help, ask on http://wiredforwar.org/forums.