'Map' in code and scripts

From UFO:AI
Jump to: navigation, search

First, there are the *.map files. They are generated by uforadiant and contain a technical description of the contents of a maptile. The *.map files need to be compiled by ufo2 into a binary form, the *.bsp files.

At map load time these bsp files are read into a class named MapTile. A map that consists of just one tile is called 'static map', while those that are composed of several tiles are called 'RMA', which spells 'random map assembly'. For both the tiles are stored in a struct named 'mapTiles_t'.

Second, there is the maps.ufo script. It contains mapdef entries for each map that are later read into the struct mapDef_t. A mapdef describes in which situations or missions the map would be suitable in terms of climate, involved aircrafts, population and so on.

For RMAs, we also need blueprints how we have to put the tiles together. They are called 'assembly' and are found in the .ump files, along with technical descriptions of the tiles.

For actually putting an RMA together, the RMA process uses a class MapInfo to keep track of the status of that process. This class is almost exclusively used inside sv_rma.cpp.

Third, we have mapData_t. Its most important contents is the routing table. Class Routing describes all the places where an actor could walk on the given map, while pathing holds the TUs needed to go there from the current starting point eg. the actor's position.

pathing_t resides in clientBattleScape_t, mapData_t and mapTiles_t are in serverInstanceGame_t, mapDef_t in csi_t.

Confused ? That was just the overview.

Personal tools