Custom Maps (UFO2000)

From UFOpaedia
Revision as of 16:33, 27 April 2007 by Hobbes (talk | contribs)
Jump to navigation Jump to search

Getting Started

Terrain Requirements

Each UFO2000 terrain (such as Moon Base) requires 3 elements:

  • Tileset(s) (collection of tiles, which are the ground, walls and objects)
    • A tileset requires both images and code to determine their game characteristics
  • Maps (the individual blocks that form the battlescape)
  • Code for battlescape generation (written in .lua language)

UFO2000 and X-COM terrain file formats

There are 2 types of file formats for the tile and map files required.


Terrain Tileset images Tileset code Map files B. Generator code
UFO2000.PNG.LUA.LUA.LUA
X-COM (UFO/TFTD>.PCK/.TAB.MCD.MAP.LUA


  • The UFO2000 format, which uses .LUA and .PNG files.
  • The original X-COM format, with .MCD, .PCK, .TAB and .MAP file formats. WARNING: If using the X-COM format there are several size limitations that apply:
    • There's a maximum limit of 253 tiles usable, due to .MAP file restrictions
    • Images have to use the UFO or TFTD colors palettes and be converted to .PCK files.
  • The formats are interchangeable, i.e., a terrain can have its maps with the .MAP format while the tiles come in a .LUA and a .PNG file.
  • A tile is composed of two assigned elements: its image and physical properties on Battlescape. The images are organized into .PNG format file(s) (or .PCK/.TAB), while the code for its physical properties uses a .LUA format file (or .MCD).
  • Tiles are organized into tilesets, named after the terrain (e.g. moonbase) or the images it contains (e.g. roads, urbits, urban, frniture).
  • The battlescape code always comes in a .LUA file.


Terrain Tileset images Tileset code Map files B. Generator code
City .PCK/.TAB.MCD.MAP.LUA
Moonbase.PNG.LUA.MAP.LUA
Future terrains.PNG.LUA.LUA.LUA


The Tileset and Battle Generator code can be included on the same .lua file.

Basic Terrain Concepts

  • The layout of the battlescape is composed from several maps, and a map consists of individual 3D cells, with the size of 16x16x24 pixels.
  • Each individual map 3D cell is made of tiles, which are interactive terrain items, such as walls, doors, ladders, lifts, etc.

Tiles

===* Tiles are organized into tilesets and there are 4 types of tiles:

    • Ground (floors, roofs, lifts, etc.)
    • Left (a.k.a. West) Wall
    • Right (a.k.a. North) Wall
    • Object

Tile Properties

Maps

Dimensions

  • The minimal length and width of a map is 10x10 cells and the largest 60x60. The game cannot accept maps with dimensions that are not multiples of 10 (20, 30, 40...).
  • The maps can be either squared (e.g. 20x20) or rectangular (e.g. 20x10).
  • The maximum height is 16 levels.

Other requirements

  • Each terrain should contain at least 1 10x10 map, especially when the

map set includes non-square maps. Otherwise UFO2000 will crash when building the battle area if there are spots that can't be filled by a map.

  • In the case of maps like X-Com Base or Warehouse there must be connections

on the necessary sides of the maps, otherwise these maps can become isolated.

  • The maps belonging to a terrain must all be assigned the same tilesets.

The order by which they are listed must be always maintained.

  • All map and terrain files names should be all lower case, e.g. sewer00, not

Sewer00.

Map Design Tips

  • It is better to assign the tiles to their proper locations (ground, walls,etc.) otherwise the map might look/act weird during gameplay.
  • The West walls that look like small pillars should be placed at the intersection of West and North walls when it points downward, otherwise it will be possible to look thru the wall into buildings (see existing maps to see what is their proper placement).
  • Concerning walls, in some maps there are outer and inner walls (especially on buildings). One example is the light blue brick (outer side) and yellow (inner side) walls on City.
  • The ground of a map's 1st level must be filled.
  • If a door is placed as a wall at a corner of a intersection of walls, when it is opened it will occupy the place of the opposing wall. If the door is closed again, the wall will disappear.
  • To help visually the players to distinguish between floor levels and to spot holes made by weapons, use different tiles for the ground of each floor.
  • You can make buildings having its parts across several maps but you will have to use specific Battlescape Generation Code for them to connect correctly. Otherwise, if the battlefield is generated randomly you will have to apply differently the principle of the XBase and Alien Base terrains: instead of all sides connecting, the maps must all have one or two sides that has a connecting part, either to form a larger structure or to serve as end to a building.
  • Large maps or buildings can look very nice and be fun to build. Unfortunately, they also can turn boring and be difficult to play very easily. The same can happen with lots of small rooms, narrow corridors, lots of objects and maps with several levels.
  • It is best to keep terrains simple, with space for units to move and easy communications between maps.


Battlescape Generation Code

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 Generation scripts only required a text editor.

Tile Editors

Map Editors

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