DayZ:Configuring 2D Map

From Bohemia Interactive Community
Jump to navigation Jump to search


Overview

DayZ supports generating a 2D map from the terrain data, which means this map is always up-to-date and does not require any other maintenance. It supports any terrain (including community made) with the limitation of showing only the map of currently loaded terrain (world).

Base configuration

By default, the GUI map layout with MapWidgetClass is displayed after executing an action on the map item (ActionUnfoldMap) and the necessary configuration is included per specific map item (located at DZ\gear\navigation\config.cpp). The map UI can be also created independently of the map item, but then you will need to override in your mod a RscMapControl class (located in bin\config.cpp - it is recommended to base off the values that are at DZ\gear\navigation\config.cpp). If you are interested in creating a custom map item (with custom model) and specific 2D map configuration, I recommend you to take a look at the sample included at the end of this page.

Location labels

Location labels is a feature of a 2D map, which is not tied to any specific map object and is defined within a CfgWorlds entry of a terrain (class Names). Following game config example shows how one can be configured:

class CfgWorlds
{
    class CAWorld;
    class YourTerrain: CAWorld
    {
        /* .. */
        /* locations definition */
        class Names
        {
            class location_name
            {
                name="LocationName";
                position[]={11339.77,14391.05};
                type="locationtype";
            };
        };
        /* end of locations definition */
        /* .. */
    };
};

name parameter can be also a string from the stringtable database (can be localized). position is a 2D position, specified in meters. Please keep in mind that positioning multiple labels close to each other can lead in some not being visible at all. Available values for the type parameter are in the following table:

Name Icon Notes
Capital none Used for biggest settlements.
City none Used for mid-sized settlements.
Village none Used for small settlements.
Local none Used for miscellaneous locations.
Marine none Used for coastal locations (bays) or in-land water bodies.
Ruin DZ\gear\navigation\data\map_ruin_ca Used for castles.
Camp DZ\gear\navigation\data\map_camp_ca Used for summer camps.
Hill DZ\gear\navigation\data\map_hill_ca Used for mountains.
ViewPoint DZ\gear\navigation\data\map_viewpoint_ca Used for places with nice views (without text usually).
RockArea DZ\gear\navigation\data\map_rock_ca Used for larger parts with lot of rocks around.
RailroadStation DZ\gear\navigation\data\map_station_ca Used for rail stations.
IndustrialSite DZ\gear\navigation\data\map_factory_ca Used for large industrial areas.
LocalOffice DZ\gear\navigation\data\map_govoffice_ca Used for local offices (with Public Address System panels).
BorderCrossing DZ\gear\navigation\data\map_border_cross_ca Used for border crossings.
VegetationBroadleaf DZ\gear\navigation\data\map_broadleaf_ca Used for larger forest areas.
VegetationFir DZ\gear\navigation\data\map_fir_ca Used for larger forest areas.
VegetationPalm DZ\gear\navigation\data\map_palm_ca Used for larger forest areas.
VegetationVineyard DZ\gear\navigation\data\map_vineyard_ca Used for vineyards.

Changes in this config do not require map to be re-binarized.

Values for map property

Each map object (p3d) can contain a named property called map in geometry LOD. This defines how such object should look like on the 2D map. There can be 4 cases basically:

  • hidden from the map
  • icon only
  • icon and bounding box
  • special case (roads, railway)

If you do not specify this property, it is automatically assumed that object will not be visible = default value for this property is map=hide.

Name Icon Hides BBox Notes
track none no Width of the road included, color defined by the game config (class MapDefaults).
road none no Width of the road included, color defined by the game config (class MapDefaults).
main road none no Width of the road included, color defined by the game config (class MapDefaults).
power lines none yes Color defined by the game config (class MapDefaults).
railway none yes Color defined by the game config (class MapDefaults).
house none no Color derived from the geometry LOD.
fence none no Color derived from the geometry LOD.
wall none no Color derived from the geometry LOD.
hide none yes Use to hide object (default value).
bush dz\gear\navigation\data\map_bush_ca yes
small tree dz\gear\navigation\data\map_smalltree_ca yes Used for small trees (orchards). They do not form forests triangles.
tree dz\gear\navigation\data\map_tree_ca yes Used for solitary trees. Forest triangles are created (based on CfgWorlds parameter minTreesInForestSquare).
rock dz\gear\navigation\data\map_rock_ca yes Used on large rock cliffs. Rock triangles are created (based on CfgWorlds parameter minRocksInRockSquare).
fuelstation dz\gear\navigation\data\map_fuelstation_ca yes
lighthouse dz\gear\navigation\data\map_lighthouse_ca yes
stack dz\gear\navigation\data\map_stack_ca yes
transmitter dz\gear\navigation\data\map_transmitter_ca yes
watertower dz\gear\navigation\data\map_watertower_ca yes
shipwreck dz\gear\navigation\data\map_shipwreck_ca yes
monument dz\gear\navigation\data\map_monument_ca yes
busstop dz\gear\navigation\data\map_busstop_ca yes
fountain dz\gear\navigation\data\map_fountain_ca yes
waterpump dz\gear\navigation\data\map_waterpump_ca yes
hospital dz\gear\navigation\data\map_hospital_ca no
store dz\gear\navigation\data\map_store_ca no
police dz\gear\navigation\data\map_police_ca no Police department.
firedep dz\gear\navigation\data\map_firedep_ca no Fire department.
tsign dz\gear\navigation\data\map_tsign_ca yes Tourist directional sign.
tshelter dz\gear\navigation\data\map_tshelter_ca yes Tourist shelter.
tourism dz\gear\navigation\data\map_tourism_ca yes Usually used on pub-like objects.
cross dz\gear\navigation\data\map_cross_ca yes Solitary crosses.
chapel dz\gear\navigation\data\map_chapel_ca no Small churches - chapels.
church dz\gear\navigation\data\map_church_ca no Big churches.
view-tower dz\gear\navigation\data\map_viewtower_ca yes Used on small view-towers.
quay dz\gear\navigation\data\map_quay_ca yes Not used at the moment. Can be used for selected pier objects.
bunker dz\gear\navigation\data\map_bunker_ca yes Not used at the moment.
fortress dz\gear\navigation\data\map_fortress_ca yes Not used at the moment.
rocks dz\gear\navigation\data\map_rock_ca yes Not used at the moment.
ruin dz\gear\navigation\data\map_ruin_ca no Not used at the moment, it is recommended to use location type Ruin instead.

Changes of the map property in the models require map to be re-binarized.

Sample

You can take a look at DayZ Samples package to see an example of probably the simplest possible implementation of brand new map item (with ability to have a custom texture and model) for a new terrain (look out for Test_MapItem folder).