Custom Maps (UFO2000)

From UFOpaedia
Revision as of 10:24, 25 April 2007 by Bamb (talk | contribs)
Jump to navigation Jump to search

The new lua map format is pretty clear once you have cleared the initial confusions, understanding the map format really the biggest hurdle for a newcomer.

Tiles

Tiles are the small squares, one soldier occupies one floor tile. A tile represents approximately a 1x1x2 meter space in the game world.

A tileset is an assortment of tiles. The graphics (also called sprites) of a tileset are in a png master image list file (dawnmasterimagelist.png) and the attributes of the tiles in a lua file (like dawncitybeta102.lua). Dawn City beta 102 has 236 tiles in the lua file and 242 sprites in the master image list file. A tile can be a floor tile, a left wall or a right wall tile or an item tile.

Maps

Maps are stuff like buildings. Maps are constructed out of tiles. They are often of size 10x10 tiles horizontally, 4 or 8 vertically. A 1x1 map is 10x10 tiles. Maps are saved into binary .map files. (Like dawn00.map, dawn01.map etc...). 2x2 or bigger maps are not rare.

Battlescape

The Battlescape consists of many maps, that are mixed pretty randomly according to a script. The script is in a lua file (dawncitybeta102.lua). Battlescape sizes are 4x4, 5x5 and 6x6 map units. (1 map unit is 10 tiles). So a 4x4 battlescape containing only small 1x1 building maps would have 16 maps.

Terrain

Terrain is the upper concept for all of the above. You can download extra terrains for ufo 2000. A terrain constructs battlescapes out of the terrain's own maps with the terrain's own script. And the maps use the terrain's own tileset. Examples of terrain include Apartment, Native and Dawn City.


Editing

For editing, for making tiles, the javascript tile editor that runs in a web browser does the attributes for the tiles and you need a paint program for making the sprites in the master image list.

For making maps, you need the javascript map maker that runs in the browser.

Battlescape construction scripts are currently done by hand?

Tile Editor

The tile editor has a pretty good help file that explains the most. First you have to set the right working directory, for example d:/ufo2000/extensions/terrain-dawncity-beta102

To be able to edit or add tiles to the tileset, you have to copy-paste in the tileset's lua script. You also have to give the name of the master image file so that the editor can load the graphics.

Map Editor

The map editor has a pretty good help file that explains how it works.

First of course set the working directory.

Then you have to load a tileset, done by copy-pasting the tileset lua file. (Tileset and battlescape are in the same lua, for example dawncitybeta102.lua.)

If you want to edit existing maps, or save into a format that ufo2000 reads, you need a hex editor to save or load the binary .map files. Use the editor recommended in the help of the map editor as the copying and pasting will work with that.


Relevant Links

Map maker and tile maker, with download link: http://www.xcomufo.com/forums/index.php?showtopic=242025548

.map fileformat: http://www.xcomufo.com/forums/index.php?showtopic=242025366&hl=mapeditor

Addtileset script: http://www.xcomufo.com/forums/index.php?showtopic=242024650

Old map format description: http://www.xcomufo.com/forums/index.php?act=attach&type=post&id=9254 --Bamb 03:24, 25 April 2007 (PDT)