Jump to content

Custom Maps (UFO2000): Difference between revisions

From UFOpaedia
Bamb (talk | contribs)
No edit summary
No edit summary
Line 1: Line 1:
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.
== A Quick Explanation ==
 
Each UFO2000 terrain (such as Moon Base) requires 3 elements:
*Tiles (ground, walls and objects)
*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. The UFO2000 format, which uses .LUA and .PNG
 
files. And the original X-COM files, with .MCD, .PCK, .TAB and .MAP file formats.
* 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.
* The battlescape code always comes in a .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 ==
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 is composed of two assigned elements: its image and physical properties on battlescape. The images are organized into .PNG format file(s) (.PCK/.TAB), while the code for its physical properties uses a .LUA format file (.MCD for XCOM).
A tile can be a floor tile, a left wall or a right wall tile or an item tile.
 
* 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 ==
== 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 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 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.
* The maps can be either squared (e.g. 20x20) or rectangular (e.g. 20x10).
* The maximum height is 16 levels.
 
== 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.  


== Terrain ==
* The ground of a map's 1st level must be filled.  
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.


----
* 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.


== Editing ==
* 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.
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.
 
* 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.


For making maps, you need the javascript map maker that runs in the browser.
* 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.  


Battlescape construction scripts are currently done by hand?
* It is best to keep terrains simple, with space for units to move and easy communications between maps.


== 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.
== Battlescape Generation Code==


== Map Editor ==
== Editing ==
The map editor has a pretty good help file that explains how it works.
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.


First of course set the working directory.
For making maps, you need the javascript map maker that runs in the browser.


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


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.
== Tile Editors ==


----
== Map Editors ==


== Relevant Links ==
== Relevant Links ==
Line 54: Line 88:
Old map format description:
Old map format description:
http://www.xcomufo.com/forums/index.php?act=attach&type=post&id=9254
http://www.xcomufo.com/forums/index.php?act=attach&type=post&id=9254
--[[User:Bamb|Bamb]] 03:24, 25 April 2007 (PDT)

Revision as of 21:09, 26 April 2007

A Quick Explanation

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

  • Tiles (ground, walls and objects)
  • 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. The UFO2000 format, which uses .LUA and .PNG

files. And the original X-COM files, with .MCD, .PCK, .TAB and .MAP file formats.

  • 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.

  • The battlescape code always comes in a .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

  • A tile is composed of two assigned elements: its image and physical properties on battlescape. The images are organized into .PNG format file(s) (.PCK/.TAB), while the code for its physical properties uses a .LUA format file (.MCD for XCOM).
  • 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

  • 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.

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