Visitor 3: Making of simple landscape: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "^=+ * " to "")
m (Some wiki formatting)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
This tutorial basics on source data of Rahmadi island. This tutorial does not provide exhaustive explanation of all the facets of terrain editing. It is a commentary to accompany sample data. For the additional information address:
{{TOC|side}}
*[[Visitor 3 Manual]]
This tutorial basics on source data of Rahmadi island; it does not provide exhaustive explanation of all the facets of terrain editing.
*[[Layered Terrain Surface Representation]]
It is a commentary to accompany sample data. For the additional information address:
* [[Visitor 3 Manual]]
* [[Layered Terrain Surface Representation]]




'''To reproduce the creation of map do so:'''
'''To reproduce the creation of terrain do so:'''
* Install BItools  
* Install BItools
* Set up working folders structure for SampleMap project
* Set up working folders structure for SampleMap project
* Unpack required PBO files to your work drive (P:\) to make data available for editing
* Unpack required PBO files to your work drive (P:\) to make data available for editing
* Start Visitor, load project and check project settings.  
* Start Visitor, load project and check project settings.
* Import surface textures.
* Import surface textures.
* Run Buldozer and edit map.  
* Run Buldozer and edit map.
 
'''Download the SampleMap project from {{Link|link= http://forums.bistudio.com/showthread.php?t=62052|text= BI Forums}}.'''


'''Download the SampleMap project from [http://forums.bistudio.com/showthread.php?t=62052 BI Forums].'''


== Working data structure ==
== Working data structure ==
Offered the sample map project is presented by '''BISampleMap.zip''' file (archive). It  contains '''BISampleMap''' folder in which alocated '''CA''' folder. Copy '''SampleMap''' folder from the '''CA''' folder into the directory on your work drive (default P:\CA\). The '''SampleMap''' folder contains following:


1. '''Data''' folder;
Offered the sample map project is presented by '''BISampleMap.zip''' file (archive).
It contains '''BISampleMap''' folder in which alocated '''CA''' folder.
Copy '''SampleMap''' folder from the '''CA''' folder into the directory on your work drive (default {{hl|P:\CA\}}). The '''SampleMap''' folder contains following:


2. '''Source''' folder;
# '''Data''' folder
 
# '''Source''' folder
3. '''config.cpp'''
# '''config.cpp'''
 
# '''SampleMap.wrp'''
4. '''SampleMap.wrp'''
# '''SampleMap.hpp'''
 
5. '''SampleMap.hpp'''


'''Data''' folder contains surface textures, satellite texture and surface mask segments generated by '''Visitor'''. It should be packed into PBO file in the end of the work.
'''Data''' folder contains surface textures, satellite texture and surface mask segments generated by '''Visitor'''. It should be packed into PBO file in the end of the work.


'''Source''' folder contains the project PEW file, helper files and source data.  
'''Source''' folder contains the project PEW file, helper files and source data.


WRP file contains the map itself. It is generated by '''Buldozer''' along with HPP file.  
WRP file contains the terrain data itself. It is generated by '''Buldozer''' along with the HPP file.


HPP file is included into '''Names''' class of the map's param '''CONFIG.CPP''' file using '''#include''' operator. It defines map names and appearance of 2D map symbols in game. '''KeyPoints''' tool panel of '''Visitor''' is used to insert those data.
HPP file is included into '''Names''' class of the terrain's param '''CONFIG.CPP''' file using '''#include''' operator. It defines terrain names and appearance of 2D map symbols in game.
'''KeyPoints''' tool panel of '''Visitor''' is used to insert those data.


NOTE: you will have to unpack content of buildings.pbo, misc.pbo, plants.pbo and rocks.pbo in respective folders in '''P:\CA\''' in order to be able to work with sample data in realtime viewer.
Feature|informative|
You will have to unpack content of {{hl|buildings.pbo}}, {{hl|misc.pbo}}, {{hl|plants.pbo}} and {{hl|rocks.pbo}} in respective folders in {{hl|P:\CA\}} in order to be able to work with sample data in realtime viewer.
}}


Do not the same with '''roads.pbo''' such as '''ODOL''' model. It are not suitable for use in Visitor 3.
Do not the same with {{hl|roads.pbo}} such as '''ODOL''' model. It are not suitable for use in Visitor 3.
Instead, use the '''MLOD''' road model supplied with the '''RC3 Tools Release'''.
Instead, use the '''MLOD''' road model supplied with the '''RC3 Tools Release'''.


== Project settings ==
== Project settings ==
* Create a project: '''Project''' > '''New''' (CTRL+N) then set following in '''Project parameters''' dialog:
* Create a project: '''Project''' > '''New''' (CTRL+N) then set following in '''Project parameters''' dialog:
** '''''Terrain grid size''''' to '''512 x 512''', it is map size measured in elevation vertices.
** '''''Terrain grid size''''' to '''512 x 512''', it is terrain size measured in elevation vertices.
** '''''Terrain cell size''''' to '''10''', it is the distance between vertices in X and Y axis.
** '''''Terrain cell size''''' to '''10''', it is the distance between vertices in X and Y axis.
** Terrain size is set automatically to '''5120 x 5120''' (m^2).
** Terrain size is set automatically to '''5120 x 5120''' (m^2).
** '''''Satellite Grid''''' field > press '''''"Calculator"''''' button and '''Satellite grid calculator''' dialog appears. Input image size corresponding to size of big surface texture you are going to import later. If 1 pixel of raster corresponds to 1 sq. meter, it is possible to set '''5120''', stick to default values in the rest of editable cases ('''''Segment size''''' and '''''Segment overlap'''''). '''Calculator''' fills in necessary values. Press '''Apply proposed''' and '''Close''' buttons.
** '''''Satellite Grid''''' field > press '''''"Calculator"''''' button and '''Satellite grid calculator''' dialog appears. Input image size corresponding to size of big surface texture you are going to import later. If 1 pixel of raster corresponds to 1 sq. meter, it is possible to set '''5120''', stick to default values in the rest of editable cases ('''''Segment size''''' and '''''Segment overlap'''''). '''Calculator''' fills in necessary values. Press '''Apply proposed''' and '''Close''' buttons.
** Set 40 x 40 meters value in '''Texture Layers'''. It is the size of square into which the detailed textures are mapped.
** Set 40 x 40 meters value in '''Texture Layers'''. It is the size of square into which the detailed textures are mapped.<br>[[File:project_parameters.jpg|200px]]&nbsp;[[File:satellite_grid_calculator.jpg|200px]]<!--
-->{{Feature|important|Detailed description of '''Project parameters''' can be found here: [[Making Satellite Texture and Mask#Grid representation of landscape|Making Satellite Texture and Mask]].}}
* In '''Tools''' menu > '''Project Preferences''' command. Specify path to folder, into which surface texture segments will be generated - '''CA\SampleMap\Data''' and click '''OK''' button. Setting this is important for importing big surface textures.{{Feature|important|Textures may be generated to different folder and packed into a separate PBO file.}}
* Save the project: '''Project''' > '''Save''' ({{Controls|Ctrl|S}}) as '''my_SampleMap.pew''' or with whatever filename you want.


[[Image:project_parameters.jpg|200px]]
[[Image:satellite_grid_calculator.jpg|200px]]


{{Important|NOTE: Detailed description of '''Project parameters''' can be found here: [[Making Satellite Texture and Mask#Grid representation of landscape|Making Satellite Texture and Mask]].}}
== Terrain ==
 
* In '''Tools''' menu > '''Project Preferences''' command. Specify path to folder, into which surface texture segments will be generated - '''CA\SampleMap\Data''' and click '''OK''' button. Setting this is important for importing big surface textures.


{{Important|NOTE: Textures may be generated to different folder and packed into separate PBO file.}}
There are several possibilities how to import terrain in '''Visitor'''.
For the purpose of this tutorial, there are either XYZ file (texture generated by MicroDEM - {{Link|http://www.usna.edu/Users/oceano/pguth/website/microdem.htm|MicroDEM Homepage}}) or PNG file with PBL param file available.


* Save the project: '''Project''' > '''Save''' ('''CTRL+S''') as '''my_SampleMap.pew''' or with whatever filename you want.
{{Feature|informative|
 
Optimum format of imported PNG is grayscale with 16 bit colour depth.
== Terrain ==
There are several possibilities how to import terrain in '''Visitor'''. For the purpose of this tutorial, there are either XYZ file (texture generated by MicroDEM - [http://www.usna.edu/Users/oceano/pguth/website/microdem.htm MicroDEM Homepage]) or PNG file with PBL param file available.
 
NOTE: Optimum format of imported PNG is grayscale with 16 bit colour depth.
XYZ file depicts initial raw and unedited Rahmadi terrain.
XYZ file depicts initial raw and unedited Rahmadi terrain.
}}


* '''Project''' menu > '''Import Terrain from picture''' command.  
* '''Project''' menu > '''Import Terrain from picture''' command.
* Browse for PBL file '''CA\SampleMap\Source\Terrain\terrain.pbl'''. Make sure there is '''terrain.png''' in the same folder, for PBL file points to it.
* Browse for PBL file '''CA\SampleMap\Source\Terrain\terrain.pbl'''. Make sure there is '''terrain.png''' in the same folder, for PBL file points to it.


TIP: '''Visitor''' can also export terrain to PNG, using menu "Project" > "Export Terrain into picture...".  
{{Feature|informative|
Sometimes it is handy to make raw terrain in '''Visitor''' and later smooth or alter in some raster editor.
'''Visitor''' can also export terrain to PNG, using menu "Project" > "Export Terrain into picture...".
Sometimes it is handy to make raw terrain in '''Visitor''' and later smooth or alter in some raster editor.
}}


* Now the terrain was imported. To check it, turn on '''Show contours''' icon and change contour range using '''Actual preferences''' icon, where it is possible to set contour interval and minimum contour (both in meters).
* Now the terrain was imported. To check it, turn on '''Show contours''' icon and change contour range using '''Actual preferences''' icon, where it is possible to set contour interval and minimum contour (both in meters).
* Colours of sea, terrain elevations and contours can be set in '''View''' > '''Define configuration''' ('''Ctrl+F''') in '''Colors - height''' tab.
* Colours of sea, terrain elevations and contours can be set in '''View''' > '''Define configuration''' ({{Controls|Ctrl|F}}) in '''Colors - height''' tab.
* Visible terrain elements can be set in '''View''' > '''View settings''', ('''CTRL+Q''') or directly by the buttons in main toolbar.
* Visible terrain elements can be set in '''View''' > '''View settings''', ({{Controls|Ctrl|Q}}) or directly by the buttons in main toolbar.<br><!--
 
-->[[File:view_settings.jpg|200px]]&nbsp;[[File:view_settings_toolbar.jpg]]{{Feature|important|To get a better idea of the terrain in the course of editing, turn on "Show shadows" button.}}
[[Image:view_settings.jpg|200px]]
* Import of XYZ file is handled by '''Project''' menu > '''Import Terrain from XYZ''' command.
 
[[Image:view_settings_toolbar.jpg]]
 
{{Important|NOTE: To get better idea on terrain in the course of editing, turn on "Show shadows" button.}}


* Import of XYZ file is handled by '''Project''' menu > '''Import Terrain from XYZ''' command.


== Import of satellite texture and surface mask ==
== Import of satellite texture and surface mask ==


NOTE: During import of the data the Buldozer should be not connected to the Visitor.  
NOTE: During import of the data the Buldozer should be not connected to the Visitor.


For import from a '''Source''' folder you need the following:
For import from a '''Source''' folder you need the following:
Line 93: Line 94:
* '''mapLegend.png''' (not necessary to alter this file in other projects)
* '''mapLegend.png''' (not necessary to alter this file in other projects)


NOTE: In '''Data''' folder, detailed surfaces, textures and RVMAT files should be prepared. Every surface has several files with same basic name and various suffices:
{{Feature|informative|
*''surfaceName_CO.png'' - detailed texture which replaces satellite texture and MCO map on close range, together with normal map
In '''Data''' folder, detailed surfaces, textures and RVMAT files should be prepared. Every surface has several files with same basic name and various suffixes:
*''surfaceName_NOHQ.png'' - normal map for detailed _CO texture
* ''surfaceName_CO.png'' - detailed texture which replaces satellite texture and MCO map on close range, together with normal map
*''surfaceName_MCO.png'' - this map is mapped on texture layer square, it only multiplies over satellite texture
* ''surfaceName_NOHQ.png'' - normal map for detailed _CO texture
* ''surfaceName_MCO.png'' - this map is mapped on texture layer square, it only multiplies over satellite texture
 
These surfaces have corresponding definition of so-called clutter (small grass, plants or stones objects) generated automatically on respective surface by the game engine, unless the surface is overlaid by some model's Roadway LOD.
These surfaces have corresponding definition of so-called clutter (small grass, plants or stones objects) generated automatically on respective surface by the game engine, unless the surface is overlaid by some model's Roadway LOD.
}}


Import data: '''Tools''' menu > '''Import satellite & mask''' command.  
Import data:
* '''Tools''' menu > '''Import satellite & mask''' command.
* The '''Select layer configuration file''' dialog appear. In the '''Source''' folder select ''layers.cfg'' file and press '''''Open''''' button.
* '''Rvmat selection''' dialog appear. In the '''Save .rvmat files as:''' field '''Binary''' default value . Press '''OK''' button.
* The '''Select satellite map''' dialog appear. Select '''sat_lco.png''' file and press '''Open''' button.
* The ''''Select layer mask''' dialog appear. Select '''mask_lco.png''' file and press '''Open''' button.
* The '''Importing Satellite Data''' box appear, which displays import process.


The '''Select layer configuration file''' dialog appear. In the '''Source''' folder select ''layers.cfg'' file and press '''''Open''''' button.
After import, you should see '''Layers''' folder in the terrain's working directory (e.g.''' P:\CA\SampleMap\Data\'''). Satellite texture and mask segments (PNGs) and RVMAT files for every square segment are stored in this folder.
'''Rvmat selection''' dialog appear. In the '''Save .rvmat files as:''' field '''Binary''' default value . Press '''OK''' button.  


The '''Select satellite map''' dialog appear. Select '''sat_lco.png''' file  and press '''Open''' button.
{{Feature|informative|
it is not necessary to delete its content when you regenerate the textures, Visitor is capable to regenerate and replace only changed parts.
All the new PNGs should be converted to PAAs when Buldozer is started. Before you do so, it is recommended to save the project since it bears actual UV coordinates for the segments.
}}


The ''''Select layer mask''' dialog appear. Select '''mask_lco.png''' file and press '''Open''' button.
[[File:SurfaceMapLegend.png|thumb|none|600px|Content of MapLegend. Visitor uses only first row of pixels as RGB reference, rest of file does not have any function.]]


The '''Importing Satellite Data''' box appear, which displays import process.
<gallery>
After import, you should see '''Layers''' folder in the map working directory (e.g.''' P:\CA\SampleMap\Data\'''). Satellite texture and mask segments (PNGs) and RVMAT files for every square segment are stored in this folder.
File:Jnn_corazol_mask.jpg|Mask for detailed surfaces in Corazol
File:Jnn_corazol_satellite.jpg|Satellite texture for the same area
File:Jnn_corazol_ingamemask.jpg|Overview of game data
</gallery>


NOTE: it is not necessary to delete its content when you regenerate the textures, Visitor is capable to regenerate and replace only changed parts. All the new PNGs should be converted to PAAs when Buldozer is started. Before you do so, it is recommended to save the project since it bears actual UV coordinates for the segments.
=== Satellite texture ===


[[Image:SurfaceMapLegend.png|thumb|none|600px|Content of MapLegend. Visitor uses only first row of pixels as RGB reference, rest of file does not have any function.]]
This texture is mapped onto terrain. In the game, it exists as a group of slightly overlapping squares.
Their cutting and overlay is controlled by value of '''Satellite grid''' in the '''Project Parameters''' box.
To prepare satellite texture use a PNG picture of the same size which have been input for calculation of the Satellite Grid value in '''Project Parameters'''.
In {{arma}} terrains, 1 pixel corresponds to 1 m<sup>2</sup>, therefore the terrain size in metres is equal to the raster size in pixels. File should be named using '''_lco''' suffix , ensuring its proper conversion to PAA.


<gallery>
{{Feature|informative|
Image:Jnn_corazol_mask.jpg|Mask for detailed surfaces in Corazol
If you experiment with satellite texture and you need to regenerate it often, you may as well use '''_draftlco''' suffix, which causes binarization to use faster but less accurate conversion of generated segments to PAA.
Image:Jnn_corazol_satellite.jpg|Satellite texture for the same area
Do not forget to delete content of '''Layers''' folder when you change suffix of source rasters to '''_lco'''.
Image:Jnn_corazol_ingamemask.jpg|Overview of game data
}}
</gallery>


=== Satellite texture ===
=== Surface mask ===
This texture is mapped onto terrain. In the game, it exists as a group of slightly overlapping squares. Their cutting and overlay is controlled by value of '''Satellite grid''' in the '''Project Parameters''' box. To prepare satellite texture use a PNG picture of the same size which have been input for calculation of the Satellite Grid value in '''Project Parameters'''. In Arma maps, 1 pixel corresponds to 1 m^2, therefore the map size in meters is equal to raster size in pixels. File should be named using '''_lco''' suffix , ensuring its proper conversion to PAA.
 
TIP: If you experiment with satellite texture and you need to regenerate it often, you may as well use '''_draftlco''' suffix, which causes binarization to use faster but less accurate conversion of generated segments to PAA. Don't forget to delete content of '''Layers''' folder when you change suffix of source rasters to '''_lco'''.


=== Surface mask ===
* Size of surface mask should be the same as the size of satellite texture.
* Size of surface mask should be the same as the size of satellite texture.
* Surface colours in mask should be discrete to avoid any artifacts on map surface. Avoid smoothing or anti-aliasing. (Such things are possible but not too easy to make properly, you should follow the gradient depicted in ''mapLegend.png'').
* Surface colours in mask should be discrete to avoid any artifacts on map surface. Avoid smoothing or anti-aliasing. (Such things are possible but not too easy to make properly, you should follow the gradient depicted in ''mapLegend.png'').
* It is possible to use only 4 colours on each single segment of surface mask.
* It is possible to use only 4 colours on each single segment of surface mask.


NOTE: '''Visitor''' divides both input rasters in the same way.  
{{Feature|informative|Visitor divides both input rasters in the same way.}}


It is because of the colour conversion of mask segments into 4 full RGB shades (black, full R, full G, full B). In your first projects, it is safer to use just 4 surfaces for the whole map and add later as you become to know where exactly the source data is cut based on generated satellite segments.
It is because of the colour conversion of mask segments into 4 full RGB shades (black, full R, full G, full B).
In your first projects, it is safer to use just 4 surfaces for the whole terrain and add later as you become to know where exactly the source data is cut based on generated satellite segments.


=== Surface definitions in layers.cfg ===
=== Surface definitions in layers.cfg ===
* RGB values in ''layers.cfg'' must correspond to shades used in mask raster.
* RGB values in ''layers.cfg'' must correspond to shades used in mask raster.
* '''Surface''' class defines one surface and its own set of detailed textures.
* '''Surface''' class defines one surface and its own set of detailed textures.
* If you used the same surface names as in ArmA games, same clutters will be displayed in the game as on original Arma surfaces.
* If you used the same surface names as in ArmA games, same clutters will be displayed in the game as on original {{arma}} surfaces.
<pre>
<spoiler text="Show Layers config example">
class Layers ///List of detailed surfaces in map
{| class="wikitable float-right"
|+ Translation Table
|-
! Czech
! English
|-
| pisek
| sand
|-
| trava
| grass
|-
| jih
| south
|-
| mesto
| city
|-
| pole
| field
|}
<syntaxhighlight lang="cpp">
class Layers // List of detailed terrain surfaces
{
{
class pisek
{
texture = "ca\SampleMap\data\pisek_mco.png"; // Overlay texture on mid-distance, visible with sat. texture
material = "ca\SampleMap\data\pisek.rvmat"; // File defining detailed textures
};


  class pisek
class travajih
  {
{
    texture = "ca\SampleMap\data\pisek_mco.png"; ///Overlay texture on mid-distance, visible with sat. texture
texture = "ca\SampleMap\data\travajih_mco.png";
    material="ca\SampleMap\data\pisek.rvmat"; ///File defining detailed textures
material = "ca\SampleMap\data\travajih.rvmat";
  };
};
 
  class travajih
  {
    texture = "ca\SampleMap\data\travajih_mco.png";
    material="ca\SampleMap\data\travajih.rvmat";
  };
 
  class mesto2
  {
    texture = "ca\SampleMap\data\mesto2_mco.png";
    material="ca\SampleMap\data\mesto2.rvmat";
  };


  class pole1
class mesto2
  {
{
    texture = "ca\SampleMap\data\pole1_mco.png";
texture = "ca\SampleMap\data\mesto2_mco.png";
    material="ca\SampleMap\data\pole1.rvmat";
material = "ca\SampleMap\data\mesto2.rvmat";
  };
};


class pole1
{
texture = "ca\SampleMap\data\pole1_mco.png";
material = "ca\SampleMap\data\pole1.rvmat";
};
};
};


class Legend ///
class Legend
{
{
  picture="ca\SampleMap\Source\mapLegend.png"; ///Path to mapLegend file
picture = "ca\SampleMap\Source\mapLegend.png"; // Path to mapLegend file
  class Colors
class Colors
  {
{
    /// Colours must correspond to surface names
// Colours must correspond to surface names
    pisek[]={{255,255,0}};
pisek[] = { { 255, 255, 0 } };
    travajih[]={{0,255,0}};
travajih[] = { { 0, 255, 0 } };
    mesto2[]={{0,0,255}};
mesto2[] = { { 0, 0, 255 } };
    pole1[]={{99,55,0}};  
pole1[] = { { 99, 55, 0 } };
  }
}
};
};
</pre>
</syntaxhighlight>
</spoiler>


Translation:
* pisek - sand
* trava - grass
* jih - south
* mesto - city
* pole - field


== Inserting and editing of objects ==
== Inserting and editing of objects ==
{{Important| Before you start Buldozer and try to edit objects, make sure you have unpacked PBOs of all addons used in Arma maps: buildings.pbo, misc.pbo, plants.pbo, roads.pbo and rocks.pbo.}}
 
{{Feature|important|
Before you start Buldozer and try to edit objects, make sure you have unpacked PBOs of all addons used in {{arma}} terrains:
{{hl|buildings.pbo}}, {{hl|misc.pbo}}, {{hl|plants.pbo}}, {{hl|roads.pbo}} and {{hl|rocks.pbo}}.
}}


=== Insert to object list - object template definition ===
=== Insert to object list - object template definition ===
* Insert the objects you need into '''Panel of objects'''. You can do so: '''Tools''' menu > '''Nature Objects''' or '''Artificial Objects''' commands. Depending on the list in which model is inserted, it will be hidden or shown when particular filter is activated, there is no other functionality in this classification.
 
* Insert the objects you need into '''Panel of objects'''. You can do so: '''Tools''' menu > '''Nature Objects''' or '''Artificial Objects''' commands. Depending on the list in which model is inserted, it will be hidden or shown when particular filter is activated, there is no other functionality in this classification.
* Objects (*.P3D) can be inserted by clicking '''Add/Browse''' button. In '''Visitor''' objects exist as '''object templates''', defined by their template name, used model, ranges of random orientation and size on insertion.
* Objects (*.P3D) can be inserted by clicking '''Add/Browse''' button. In '''Visitor''' objects exist as '''object templates''', defined by their template name, used model, ranges of random orientation and size on insertion.


NOTE: Deleting object templates from list is possible only if none of those objects are present in the map.
{{Feature|informative|Deleting object templates from the list is only possible if none of those objects are present on the terrain.}}


In '''Defined Objects''' window, it is possible to change name, draw properties and size of randomization, pitch and facing of selected object.
In '''Defined Objects''' window, it is possible to change name, draw properties and size of randomization, pitch and facing of selected object.


[[Image:Objects_definition.jpg |thumb|none|200px|Objects definition]]
[[File:Objects_definition.jpg |thumb|none|200px|Objects definition]]
 
=== Inserting objects on the terrain ===


=== Inserting objects in the map ===
* Choose an object: '''View''' menu > '''Panel of objects''' command. Window appear, select the category of objects from drop-down list then select object and insert it with a {{Controls|LMB}} click on the terrain.
* Choose an object: '''View''' menu > '''Panel of objects''' command. Window appear, select the category of objects from drop-down list then select object and insert it with a LMB click on the map.
* Select inserted object by {{Controls|LMB}} click. It can be edited further:
* Select inserted object by LMB click. It can be edited further:
** Delete ({{Controls|delete}} key)
** Delete ('''Delete''' key)
** Move by dragging by mouse
** Move by dragging by mouse
** Change its properties ('''Object properties'''), accessed by double-click or '''Enter''' key. It is possible to change:
** Change its properties ('''Object properties'''), accessed by {{Controls|LMB2}} or {{Controls|Enter}} key. It is possible to change:
*** Object position
*** Object position
*** Rotate selected object
*** Rotate selected object
*** Elevation relative to surface (meters)
*** Elevation relative to surface (meters)
*** Object size (%)
*** Object size (%)
* By dragging over objects while holding LMB, multiple objects can be selected. If CTRL/SHIFT is held, objects are added/subtracted from selection.
* By dragging over objects while holding {{Controls|LMB}}, multiple objects can be selected. If CTRL/SHIFT is held, objects are added/subtracted from selection.


[[Image:Object_properties.jpg |thumb|none|200px|Object properties]]
[[File:Object_properties.jpg |thumb|none|200px|Object properties]]


{{Important| TIP: If you place mouse cursor over object and press '''O''' key, object will be highlighted and selected in '''Panel of objects'''.}}
{{Feature|important|If you place mouse cursor over object and press {{Controls|O}}, object will be highlighted and selected in '''Panel of objects'''.}}


=== Named selections ===
=== Named selections ===
* If the panel is not visible, it can be activated by '''View''' > '''Named Selections Panel'''.
* If the panel is not visible, it can be activated by '''View''' > '''Named Selections Panel'''.
* When objects are selected, it is possible to make named selection of them, which can be hidden, locked etc. separately.
* When objects are selected, it is possible to make named selection of them, which can be hidden, locked etc. separately.
* Context menu for named selections can be activated by '''''RMB''''' click in list of selections.
* Context menu for named selections can be activated by {{Controls|RMB}} click in list of selections.
 


== Editing terrain and objects in Buldozer ==
== Editing terrain and objects in Buldozer ==
Start Buldozer: '''Project''' menu > '''Connect to Buldozer''' command ('''CTRL+F7''') or click red exclamation button in the toolbar.
When Buldozer is started for the first time or you change any textures (regenerating satellite segments, altering objects textures), it will converting all PNGs or TGAs to PAA format, which may take a while. If application  does not respond, do not try to terminate it, let it finish its job.


[[Image:Terrain_editing.jpg|thumb|right|200px|Editing terrain in Buldozer]]
Start Buldozer: '''Project''' menu > '''Connect to Buldozer''' command ({{Controls|Ctrl|F7}}) or click the red exclamation button in the toolbar.
When Buldozer is started for the first time or you change any textures (regenerating satellite segments, altering objects textures), it will converting all PNGs or TGAs to PAA format, which may take a while.
If the application does not respond, do not try to terminate it, let it finish its job.
 
[[File:Terrain_editing.jpg|thumb|right|200px|Editing terrain in Buldozer]]


'''Buldozer controls:'''
'''Buldozer controls:'''
* You can navigate in the map using mouse.
* You can navigate the terrain using the mouse.
* Camera rotation is controlled by numpad ("'''2'''", "'''4'''", "'''6'''", "'''8'''").
* Camera rotation is controlled by numpad ({{Controls|num2}}, {{Controls|num4}}, {{Controls|num6}}, {{Controls|num8}}).
* Zoom of camera relative to cursor is handled by "'''+'''" (zoom in) and "'''-'''" (zoom out) keys.
* Zoom of camera relative to cursor is handled by {{Controls|num+}} (zoom in) and {{Controls|num-}} (zoom out) keys.
* Default distance of camera from cursor is restored by "'''5'''" key .
* Default distance of camera from cursor is restored by the {{Controls|num5}} key .
* LMB selects object (if you select objects in Visitor, they are selected in Buldozer as well).
* {{Controls|LMB}} selects object (if you select objects in Visitor, they are selected in Buldozer as well).
* Objects are rotated by holding RMB and dragging mouse sideways. Origin of rotation is defined by the position of box cursor.
* Objects are rotated by holding {{Controls|RMB}} and dragging mouse sideways. Origin of rotation is defined by the box cursor's position.
* '''LShift''' key accelerates camera rotation and cursor movement.
* '{{Controls|LShift}} accelerates camera rotation and cursor movement.
* Use '''H''' to turn on/off arrow marking closest terrain vertex.
* Use {{Controls|H}} to turn on/off arrow marking closest terrain vertex.
* Use '''N''' to turn on/off FLIR Filter.
* Use {{Controls|N}} to turn on/off the FLIR Filter.
* '''U'''''/'''''J''' rises/lowers vertex by 1 meter.
* {{Controls|U}}/{{Controls|J}} rises/lowers vertex by 1 meter.
* '''I'''/'''K''' rises/lowers vertex by 5 meters.
* {{Controls|I}}/{{Controls|K}} rises/lowers vertex by 5 meters.
 
{{Feature|important|
If you do not see editing cursor (white box) and arrow indicating selected objects, set Buldozer to use content of unpacked {{hl|UI.pbo}} by stating it in text file loaded when Buldozer starts.
Description can be found in [[Visitor 3 Manual]] page.
}}
 


{{Important| TIP: If you don't see editing cursor (white box) and arrow indicating selected objects, set Buldozer to use content of unpacked UI.pbo by stating it in text file loaded when Buldozer starts. Description can be found in [[Visitor 3 Manual]] page.}}
== Packing your terrain ==


== Packing your map ==
* To pack the terrain into PBO file, you need to have functional '''config.cpp''' (+HPP), WRP file, textures in PAA format and all relevant RVMAT files.
* To pack the map into PBO file, you need to have functional '''config.cpp''' (+HPP), WRP file, textures in PAA format and all relevant RVMAT files.
* If you are using custom objects, you should pack them and add them to ''..\Arma\Addons\'' folder to use the terrain in game.
* If you use your custom objects in the map, you should pack them and add them to ''..\Arma\Addons\'' folder to use the map in game.


NOTE: that structures described here reflects working customs of BI. Public utility used to pack PBO files packs ALL the content of a designated addon folder (in this case ''..\ca\SampleMap''), therefore it is wise to keep clean "packing" version separated and keep there only needed files.
{{Feature|informative|
These structures described here reflects working customs of {{Name|BI}}.
Public utility used to pack PBO files packs ALL the content of a designated addon folder (in this case ''..\ca\SampleMap''), therefore it is wise to keep clean "packing" version separated and keep there only needed files.
}}


{{Important| TIP: If you cannot see your map in map list, game crashes after you attempt to preview mission on your terrain or you cannot see surface textures, check ALL PATHS in config.cpp and RVMAT files in Data folder. Also make sure that any referenced files really do exist at the specified location.}}
{{Feature|important|
If
* you cannot see your terrain in game, or
* the game crashes after you attempt to preview mission on your terrain, or
* you cannot see surface textures,
check ALL PATHS in config.cpp and RVMAT files in Data folder.
Also make sure that any referenced files really do exist at the specified location.
}}




{{GameCategory|arma1| Terrain Editing}}
{{GameCategory|arma1|Terrain Editing}}

Latest revision as of 00:09, 28 September 2024

This tutorial basics on source data of Rahmadi island; it does not provide exhaustive explanation of all the facets of terrain editing. It is a commentary to accompany sample data. For the additional information address:


To reproduce the creation of terrain do so:

  • Install BItools
  • Set up working folders structure for SampleMap project
  • Unpack required PBO files to your work drive (P:\) to make data available for editing
  • Start Visitor, load project and check project settings.
  • Import surface textures.
  • Run Buldozer and edit map.

Download the SampleMap project from BI Forums.


Working data structure

Offered the sample map project is presented by BISampleMap.zip file (archive). It contains BISampleMap folder in which alocated CA folder. Copy SampleMap folder from the CA folder into the directory on your work drive (default P:\CA\). The SampleMap folder contains following:

  1. Data folder
  2. Source folder
  3. config.cpp
  4. SampleMap.wrp
  5. SampleMap.hpp

Data folder contains surface textures, satellite texture and surface mask segments generated by Visitor. It should be packed into PBO file in the end of the work.

Source folder contains the project PEW file, helper files and source data.

WRP file contains the terrain data itself. It is generated by Buldozer along with the HPP file.

HPP file is included into Names class of the terrain's param CONFIG.CPP file using #include operator. It defines terrain names and appearance of 2D map symbols in game. KeyPoints tool panel of Visitor is used to insert those data.

Feature|informative| You will have to unpack content of buildings.pbo, misc.pbo, plants.pbo and rocks.pbo in respective folders in P:\CA\ in order to be able to work with sample data in realtime viewer. }}

Do not the same with roads.pbo such as ODOL model. It are not suitable for use in Visitor 3. Instead, use the MLOD road model supplied with the RC3 Tools Release.


Project settings

  • Create a project: Project > New (CTRL+N) then set following in Project parameters dialog:
    • Terrain grid size to 512 x 512, it is terrain size measured in elevation vertices.
    • Terrain cell size to 10, it is the distance between vertices in X and Y axis.
    • Terrain size is set automatically to 5120 x 5120 (m^2).
    • Satellite Grid field > press "Calculator" button and Satellite grid calculator dialog appears. Input image size corresponding to size of big surface texture you are going to import later. If 1 pixel of raster corresponds to 1 sq. meter, it is possible to set 5120, stick to default values in the rest of editable cases (Segment size and Segment overlap). Calculator fills in necessary values. Press Apply proposed and Close buttons.
    • Set 40 x 40 meters value in Texture Layers. It is the size of square into which the detailed textures are mapped.
      project parameters.jpg satellite grid calculator.jpg
      Detailed description of Project parameters can be found here: Making Satellite Texture and Mask.
  • In Tools menu > Project Preferences command. Specify path to folder, into which surface texture segments will be generated - CA\SampleMap\Data and click OK button. Setting this is important for importing big surface textures.
    Textures may be generated to different folder and packed into a separate PBO file.
  • Save the project: Project > Save (Ctrl + S) as my_SampleMap.pew or with whatever filename you want.


Terrain

There are several possibilities how to import terrain in Visitor. For the purpose of this tutorial, there are either XYZ file (texture generated by MicroDEM - MicroDEM Homepage) or PNG file with PBL param file available.

Optimum format of imported PNG is grayscale with 16 bit colour depth. XYZ file depicts initial raw and unedited Rahmadi terrain.
  • Project menu > Import Terrain from picture command.
  • Browse for PBL file CA\SampleMap\Source\Terrain\terrain.pbl. Make sure there is terrain.png in the same folder, for PBL file points to it.
Visitor can also export terrain to PNG, using menu "Project" > "Export Terrain into picture...". Sometimes it is handy to make raw terrain in Visitor and later smooth or alter in some raster editor.
  • Now the terrain was imported. To check it, turn on Show contours icon and change contour range using Actual preferences icon, where it is possible to set contour interval and minimum contour (both in meters).
  • Colours of sea, terrain elevations and contours can be set in View > Define configuration (Ctrl + F) in Colors - height tab.
  • Visible terrain elements can be set in View > View settings, (Ctrl + Q) or directly by the buttons in main toolbar.
    view settings.jpg view settings toolbar.jpg
    To get a better idea of the terrain in the course of editing, turn on "Show shadows" button.
  • Import of XYZ file is handled by Project menu > Import Terrain from XYZ command.


Import of satellite texture and surface mask

NOTE: During import of the data the Buldozer should be not connected to the Visitor.

For import from a Source folder you need the following:

  • SatTextureName_lco.png (sample file sat_lco.png)
  • SatSurfaceMaskName_lco.png (sample file mask_lco.png)
  • layers.cfg
  • mapLegend.png (not necessary to alter this file in other projects)
In Data folder, detailed surfaces, textures and RVMAT files should be prepared. Every surface has several files with same basic name and various suffixes:
  • surfaceName_CO.png - detailed texture which replaces satellite texture and MCO map on close range, together with normal map
  • surfaceName_NOHQ.png - normal map for detailed _CO texture
  • surfaceName_MCO.png - this map is mapped on texture layer square, it only multiplies over satellite texture
These surfaces have corresponding definition of so-called clutter (small grass, plants or stones objects) generated automatically on respective surface by the game engine, unless the surface is overlaid by some model's Roadway LOD.

Import data:

  • Tools menu > Import satellite & mask command.
  • The Select layer configuration file dialog appear. In the Source folder select layers.cfg file and press Open button.
  • Rvmat selection dialog appear. In the Save .rvmat files as: field Binary default value . Press OK button.
  • The Select satellite map dialog appear. Select sat_lco.png file and press Open button.
  • The 'Select layer mask dialog appear. Select mask_lco.png file and press Open button.
  • The Importing Satellite Data box appear, which displays import process.

After import, you should see Layers folder in the terrain's working directory (e.g. P:\CA\SampleMap\Data\). Satellite texture and mask segments (PNGs) and RVMAT files for every square segment are stored in this folder.

it is not necessary to delete its content when you regenerate the textures, Visitor is capable to regenerate and replace only changed parts. All the new PNGs should be converted to PAAs when Buldozer is started. Before you do so, it is recommended to save the project since it bears actual UV coordinates for the segments.
Content of MapLegend. Visitor uses only first row of pixels as RGB reference, rest of file does not have any function.

Satellite texture

This texture is mapped onto terrain. In the game, it exists as a group of slightly overlapping squares. Their cutting and overlay is controlled by value of Satellite grid in the Project Parameters box. To prepare satellite texture use a PNG picture of the same size which have been input for calculation of the Satellite Grid value in Project Parameters. In Arma terrains, 1 pixel corresponds to 1 m2, therefore the terrain size in metres is equal to the raster size in pixels. File should be named using _lco suffix , ensuring its proper conversion to PAA.

If you experiment with satellite texture and you need to regenerate it often, you may as well use _draftlco suffix, which causes binarization to use faster but less accurate conversion of generated segments to PAA. Do not forget to delete content of Layers folder when you change suffix of source rasters to _lco.

Surface mask

  • Size of surface mask should be the same as the size of satellite texture.
  • Surface colours in mask should be discrete to avoid any artifacts on map surface. Avoid smoothing or anti-aliasing. (Such things are possible but not too easy to make properly, you should follow the gradient depicted in mapLegend.png).
  • It is possible to use only 4 colours on each single segment of surface mask.
Visitor divides both input rasters in the same way.

It is because of the colour conversion of mask segments into 4 full RGB shades (black, full R, full G, full B). In your first projects, it is safer to use just 4 surfaces for the whole terrain and add later as you become to know where exactly the source data is cut based on generated satellite segments.

Surface definitions in layers.cfg

  • RGB values in layers.cfg must correspond to shades used in mask raster.
  • Surface class defines one surface and its own set of detailed textures.
  • If you used the same surface names as in ArmA games, same clutters will be displayed in the game as on original Arma surfaces.

Translation Table
Czech English
pisek sand
trava grass
jih south
mesto city
pole field
class Layers // List of detailed terrain surfaces
{
	class pisek
	{
		texture = "ca\SampleMap\data\pisek_mco.png"; // Overlay texture on mid-distance, visible with sat. texture
		material = "ca\SampleMap\data\pisek.rvmat"; // File defining detailed textures
	};

	class travajih
	{
		texture = "ca\SampleMap\data\travajih_mco.png";
		material = "ca\SampleMap\data\travajih.rvmat";
	};

	class mesto2
	{
		texture = "ca\SampleMap\data\mesto2_mco.png";
		material = "ca\SampleMap\data\mesto2.rvmat";
	};

	class pole1
	{
		texture = "ca\SampleMap\data\pole1_mco.png";
		material = "ca\SampleMap\data\pole1.rvmat";
	};
};

class Legend
{
	picture = "ca\SampleMap\Source\mapLegend.png"; // Path to mapLegend file
	class Colors
	{
		// Colours must correspond to surface names
		pisek[] = { { 255, 255, 0 } };
		travajih[] = { { 0, 255, 0 } };
		mesto2[] = { { 0, 0, 255 } };
		pole1[] = { { 99, 55, 0 } };
	}
};
↑ Back to spoiler's top


Inserting and editing of objects

Before you start Buldozer and try to edit objects, make sure you have unpacked PBOs of all addons used in Arma terrains: buildings.pbo, misc.pbo, plants.pbo, roads.pbo and rocks.pbo.

Insert to object list - object template definition

  • Insert the objects you need into Panel of objects. You can do so: Tools menu > Nature Objects or Artificial Objects commands. Depending on the list in which model is inserted, it will be hidden or shown when particular filter is activated, there is no other functionality in this classification.
  • Objects (*.P3D) can be inserted by clicking Add/Browse button. In Visitor objects exist as object templates, defined by their template name, used model, ranges of random orientation and size on insertion.
Deleting object templates from the list is only possible if none of those objects are present on the terrain.

In Defined Objects window, it is possible to change name, draw properties and size of randomization, pitch and facing of selected object.

Objects definition

Inserting objects on the terrain

  • Choose an object: View menu > Panel of objects command. Window appear, select the category of objects from drop-down list then select object and insert it with a Left Mouse Button click on the terrain.
  • Select inserted object by Left Mouse Button click. It can be edited further:
    • Delete (Del key)
    • Move by dragging by mouse
    • Change its properties (Object properties), accessed by Double Left Mouse Button or Enter ↵ key. It is possible to change:
      • Object position
      • Rotate selected object
      • Elevation relative to surface (meters)
      • Object size (%)
  • By dragging over objects while holding Left Mouse Button, multiple objects can be selected. If CTRL/SHIFT is held, objects are added/subtracted from selection.
Object properties
If you place mouse cursor over object and press O, object will be highlighted and selected in Panel of objects.

Named selections

  • If the panel is not visible, it can be activated by View > Named Selections Panel.
  • When objects are selected, it is possible to make named selection of them, which can be hidden, locked etc. separately.
  • Context menu for named selections can be activated by Right Mouse Button click in list of selections.


Editing terrain and objects in Buldozer

Start Buldozer: Project menu > Connect to Buldozer command (Ctrl + F7) or click the red exclamation button in the toolbar. When Buldozer is started for the first time or you change any textures (regenerating satellite segments, altering objects textures), it will converting all PNGs or TGAs to PAA format, which may take a while. If the application does not respond, do not try to terminate it, let it finish its job.

Editing terrain in Buldozer

Buldozer controls:

  • You can navigate the terrain using the mouse.
  • Camera rotation is controlled by numpad (NUM 2, NUM 4, NUM 6, NUM 8).
  • Zoom of camera relative to cursor is handled by NUM + (zoom in) and NUM - (zoom out) keys.
  • Default distance of camera from cursor is restored by the NUM 5 key .
  • Left Mouse Button selects object (if you select objects in Visitor, they are selected in Buldozer as well).
  • Objects are rotated by holding Right Mouse Button and dragging mouse sideways. Origin of rotation is defined by the box cursor's position.
  • '⇧ Shift accelerates camera rotation and cursor movement.
  • Use H to turn on/off arrow marking closest terrain vertex.
  • Use N to turn on/off the FLIR Filter.
  • U/J rises/lowers vertex by 1 meter.
  • I/K rises/lowers vertex by 5 meters.
If you do not see editing cursor (white box) and arrow indicating selected objects, set Buldozer to use content of unpacked UI.pbo by stating it in text file loaded when Buldozer starts. Description can be found in Visitor 3 Manual page.


Packing your terrain

  • To pack the terrain into PBO file, you need to have functional config.cpp (+HPP), WRP file, textures in PAA format and all relevant RVMAT files.
  • If you are using custom objects, you should pack them and add them to ..\Arma\Addons\ folder to use the terrain in game.
These structures described here reflects working customs of Bohemia Interactive. Public utility used to pack PBO files packs ALL the content of a designated addon folder (in this case ..\ca\SampleMap), therefore it is wise to keep clean "packing" version separated and keep there only needed files.
If
  • you cannot see your terrain in game, or
  • the game crashes after you attempt to preview mission on your terrain, or
  • you cannot see surface textures,

check ALL PATHS in config.cpp and RVMAT files in Data folder.

Also make sure that any referenced files really do exist at the specified location.