Mapping/Testing
From UFO:AI
Contents |
General advice
- Test using latest trunk checkout of both code and maps.
- Enable confirmation in options - this way you will be able to see exactly where soldier intends to walk and we will see that in screenshots.
- You can create in-game screenshots using F12 key. Screenshots are created in ~/.ufoai directory.
- When creating screenshots, consider hiding HUD with F11 key. You can get the HUD back by pressing Esc.
- When creating screenshots, consider that somebody has to both understand what the problem is and where is it located on the map. Do not zoom in too much and do not zoom out too much.
- You can set in-game variable cl_campitchmin to 0 - this way you will be able to take screensots from more angles if required.
- Compile without lightmap if you only want to check the brushwork or the pathfinding, see the map compile article for more information.
- If the map is random assembly (map name starts with a +), game prints map definition to console - for example,
"-village/vil_ +s02 +s03" "0 0 8 8"
(this is not a valid definition). When reporting problems in such maps, copy and paste this string to your report.
Pathfinding grid
Wilminator has implemented an overlay of the pathfinding grid. It draws rectangles over tiles, depicting pathfinding related information using colours and shape of those rectangles.
To enable this overlay, enter setdeveloper DEBUG_CLIENT in the game console. Here's a screenshot of the result:
Colour explanation:
- green - this tile can be reached and entered by the actor based on remaining TUs;
- yellow - this tile can be entered by an actor, but the current actor does not have enough TUs to reach it this turn;
- red - this location cannot be reached;
- black - this location would have the actor fall more than one level and is not reachable;
Stepon tints the tile with blue, so you get the following:
- cyan - this tile can be reached by the actor based on remaining TUs and has stepon;
- light white - this tile can be entered by an actor and has stepon, but the current actor does not have enough TUs to reach it this turn;
- pink - this location cannot be reached and has stepon;
- blue - this location with stepon would have the actor fall more than one level and is not reachable.
Also, the height of the box is the marker for the highest the adjacent cell floor can be in order to enter the adjacent cell.
Testing a map
When testing maps, it is usually not desired to have aliens and civilians - turn ending takes a long time and sometimes they even shoot at you. Setting ingame variable sv_ai to 0 will prevent AI actors from appearing.
If for some reason you want to walk around a lot and maybe test func_breakable by shooting, you can load the map with AI actors (set sv_ai to 1 again) and enable variable g_notu.
GTKradiant is not rendering everything (it does not render ambient light, flowing aspects...) so it may be useful to check the map in-game.
To test your map with aliens, players, civilians:
First, you have to start a new single player game, build a base and have a team of soldiers "available". Or you can load a single player game. But you need to have some soldiers hired (and assigned to the first dropship).
Open the game console with the ^ key above your tabulator-key (or Shift ESC to get the console and ESC to return to the normal GUI). You may do it in game or from the main menu.
Typemaplistto get a list of valid maps. Start your map by typing
map <day|night> [mapname]for "whole map" or
map <day|night> +[ump-filename] [theme]for random maps.
The map will be loaded with the soldiers from your current game (those selected on the main dropship) with their current equipment. Aliens will be chosen from ???
Some examples:
map night africa map day +oriental small map day +oriental medium
Generic problems
There are some problems that pose like map problems, but most likely are bugs somewhere in code. Fixing such things per map is not possible.
- Actors entering actorclips
http://sourceforge.net/tracker/index.php?func=detail&aid=1710034&group_id=157793&atid=805242 Usually caused by func_breakable somewhere near.
- Passable flag not working
http://sourceforge.net/tracker/index.php?func=detail&aid=1899597&group_id=157793&atid=805242
probably also http://sourceforge.net/tracker/index.php?func=detail&aid=1692764&group_id=157793&atid=805242
(fixed in revision 15557).
- Out of sync server/client.
Sometimes confirmation path shows one line, actor moves in other, tile can be selected as the target, but soldiers do not move there, soldiers manage to walk into seemingly solid walls...
All of these problems have in common being unable to easily reproduce.
Some of the issues that most probably are caused by this :
http://sourceforge.net/tracker/index.php?func=detail&aid=1864713&group_id=157793&atid=805242
- Unpassable tiles without a reasonable explanation, at least so far - testcase at http://sourceforge.net/tracker/index.php?func=detail&aid=1801104&group_id=157793&atid=805242
Map infrastructure improvements
There are also some larger proposed changes to mapping (they probably should be listed elsewhere...) :
- Reworked pathfinding
Not strictly mapping, but closely related, as this will fix a lot of problems and also create a new ones.
Currently pathfinding does not take into account all brushes, so additional actorclips are required, and there are other limitations. More information at http://lists.cifrid.net/pipermail/ufoai/2008-March/000391.html.
- Edit-time or compile-time map part inclusion
Some objects have to appear on a lot of maps, and single change to such object currently involves changing all of those maps individually. Such objects include dropship and ufos. More information at http://lists.cifrid.net/pipermail/ufoai/2008-March/000392.html.
- Setting nodraw flag for invisible faces
Brush faces that are not visible can be set nodraw - that improves map performance. Doing that for all surfaces manually is a very tedious work, especially for older maps that are cleaned up. The mapcompiler recognizes cases where surfaces faces downwards and are not seen from birdsview - they have set the faces to be nodraw automatically. This is being implemented - get design information.

