HB's modding procedure [tutorial] (work in progress)

All you need to create and discuss about new HB for NTW3

Moderator: Ziuk

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

HB's modding procedure [tutorial] (work in progress)

Postby Ziuk » Thu Sep 13, 2012 4:13 pm

0. General informations



1. Recommendations

    - make backups of your HB files - I usually create many versions of .psd .csv. .pack files when i make mistake i know that i can load older version of file where everything is correct.
    - real terrain of battlefiled shouldn't be larger than 10km x 10km. Use google earth and check size of specific battlefield.
    - try to make battle where 2 sides have chances for success - too asymmetric battles aren't good choice - sometimes you can make different scenarios on 1 map: balanced, asymmetric it's probably the best choice;
    - please don't force balance at any cost. It's quite natural that real battles were asymmetric;
    - try to avoid battles with many rivers with many brigdes because brigde bulding is probably the most annoying and complicated thing;
    - try to make battles which have got own soul: with interesting background, interesting events etc.;
    - battles must be interesting for you it's a matter of motivation (you need strong motivation);
    - create topic for your battle and collect there sources;


2. Limitations:

    - you can't make playable battle with more than 170-200 units on map;
    - you can't make map larger than 2048x2048. Map always has got square shape.
    - you can't make hb where important element is fortified town;
    - you can't make hb when you don't have access to good sources about topography of terrain
    (the best sources is historical map);
    - you can't make hb when you don't have access to good oob, informations about uniforms and organisation of armies;
    - you can't make land battle where ships supported land forces - you can add ship as static object
    - you can set only 1 level of water so you can't create for exmaple two rivers or two lakes on 2 different levels. Check Rivoli map there is 1 big river with water but there are also other rivers/streams without waters (fake rivers painted on map).
    - you can't set real dynamic weather
    - de facto you can't set your own buldings(new 3d model) on map. It's possible but very complicated and you need Ultimate Unwrap 3D + plugin.
    - max number of players in 1 scenario = 8
    - you cannot make battle with 3 or more sides;
    - without strong motivation you cannot create HB, you must be motivated, you probably will need to spend a lot of time with your map:) 2 or 3 months :)
    + HB engineers must have time to teach you:)

3. Research

You need:

    a. Order of battle - the best oob is oob with number of soldiers in each unit;
    First check: http://usacac.army.mil/cac2/cgsc/carl/nafziger.asp
    b. Historical map with position of units;
    c. Description of battle;
    d. Information about organisition of each army + info about uniforms;

Where can you find these informations?:


4. Software

You need:



5. Mapping

« HEIGHT LAYER »


Desaix's part


There are 4 height map files numbered 0/1/2/3, all are dimensioned 1025X1025 pixels
These represents the four LOD of a map regarding heights.
The most important is layer 0 which is showed when the camera is close to the terrain.
This is the only one we modify, the others 3 are created with the Lordz Tools pressing the TILEHEIGHTMAP button. It asks for input the height_map_0.dds and creates as output the other 3 layers.

Altough one can create the layer 0 painting hills and stream with GIMP/PS I strongly suggest to use Google Earth SRTM data for heights (Europe is mapped 90:1 I believe), downloading the selected area and using MICRODEM tool for exporting a BMP of the height layer.

My preferred process is selecting a suitable area in Google (better if north oriented, default setting of Google) then writing down top left corner coordinates and lower right corner coordinates. Once in MICRODEM you can select the same area using the displayed coordinates and there you go, a basic height layer is fastly created. If you rotate the camera in Google you will need to use some shortcuts when selecting area in Microdem.

Since I'm quite fast in generating height layer I can help making the layer if one shows me the selected area in Google.



Since height layer is a grey scale graphic file with range going from full black rgb(0,0,0) to full white rgb(255,255,255) you might ask what is that set the relative scale in battle.
If every height_map_0.dds has the same range why some map are flat ocean and other packed with mountains?
This is when makes its appereance the height_map_0/1/2/3_settings.xml file

Let's see one of this file:

<HEIGHTFIELD_SETTINGS world_width='2048.000000' world_height='2048.000000' normalize='true' simple_colour_blending='false' scale='12.000000' bias='-4.500000' />

Simple, just one line, the width and height are doubled each time you increase number of layer starting with 2048. What really does count here (and that you can modify) are the two values SCALE and BIAS.

SCALE set the relative gradient of hills. If you increase SCALE value with the same heigh_map_0.dds you will get map with progressively steeper hills and even mountains. If you decrease scale close to 0 your map will be a flatten landscape.

BIAS set the water layer in map units (let's see meters or yards for facility). With a negative value of BIAS some area in your map will start to be flooded with water because the water layer is superior to that point terrain level.
With a positive value the water layer will stood below each point of the map and you won't see real water. This is why you cannot have stream with real water coming down from hills but only a general see or lake at the bottom of your terrain.

///////////////////////////////////////////////////////////////////////////////////////

Ziuk's part:


Example of height_map_0 (main file):

Spoiler: show
Image


Example of height_map_1:

Spoiler: show
Image


Example of height_map_2:

Spoiler: show
Image


Example of height_map_3:

Spoiler: show
Image


General rule:
More white - higher terrain
Less white (more black) - lower terrain


So lets check RGB color value in gimp.

For example:

When you click somewhere on white areas values are 180 - 180 - 180 :

Spoiler: show
Image



When you click somewhere on black areas values are 7 - 7 - 7 :

Spoiler: show
Image


So RGB values work like scale of terrain level: higher numbers = higher level of terrain


You need know basics of rgb: http://en.wikipedia.org/wiki/Rgb


Height layer in game:



It's terrain around haitian town: Limbé


Conclusion: You can paint white fat dot on black area and you will have very strange hill.

[youtube]http://www.youtube.com/watch?v=85jYbMELwHQ[/youtube]

"Watch video in full screen mode" (HD).

I have only polish language version of photoshop but in english version options should be in same place.

Result:

Spoiler: show
Image
Image
Image
Image




Training ground pack

I have prepared for you special pack with flat map (NTW3_Hell.pack).
Download link: http://www.mediafire.com/download.php?60aaca90y8qxjf2

It's the best training ground for Hb engineers.
Move this file into your data directory.
C:\Program Files (x86)\Steam\steamapps\common\napoleon total war\data

Open modmanger. Find NTW3_Hell.pack on list.
Select this pack, move it to the top of the list and click launch.

Spoiler: show
Image


You can find this map on battle list (single player mode). Map hasn't got name on the list - it's normal. This pack doesn't break your game compatibility in multiplayer mode so you don't need to remove it from data directory.


    - colour_map_0.jpg
    - textures.xml
    - definition.xml
    - ground_type_map_0
    - grassmap.tga
    - blendmap.jpg
    - blendmap_alpha.jpg
    - radar.jpg
    - screenshot_small.tga

« TREE LAYER »


As usual we load a jpg 2048X2048 of the colour_map_0 by pressing the LOAD MAP button.
Then we shift to the tree editor by selecting TREE TAB.
Next step is to select a type of CLIMATE from the drop down list, you will see the box populating with the correct trees for that climate (not all climates are operative). Last you select the type of season.

Then you can start planting trees on map by selecting the selected type of tree from the list by clicking on the tree name (please note that some climate have working preview jpgs to show the tree texture).
Planting a tree is done by left clicking on main map. Before doing that you can select a tree height with the two numeric text box on the right lower corner. They show a minimum height and a maximum height: the final tree height will be randomly chosen between min and max.

When you're done you first save the CSV file (working file of trees) by selecting SAVE TREE LIST button. Then you create the BMD file by slecting SAVE BMD FILE (this is the final file which must be imported in map pack). If you select RESET TREE you will delete all trees from map.

Quite simple, isn't it?

There are some additional buttons for minor tweakings:
0) OPEN TREE LIST: you can import an existing saved list with this button. Note that the correct climate must be already selected and the import procedure doesn't delete existing trees on map (always better resetting trees before loading an existing list unless you work with different files).
1) TREE UNDO: to delete the last planted tree
2) OPEN BMD FILE: to import an existing BMD file from existing map. Sometimes it works sometimes not. :wink:
3) ERASE TREE RECT: you can delete multiple trees by selecting this button, then mouse right clicking on left top corner on main map followed by mouse right clicking of bottom right corner. All the trees in that imaginary area will be erased.
4) ALL HEIGHT RANDOM: all the existing trees will be retuned in height based on the range comprised between min and max height.
5) SET HEIGHT AREA: the same as above but only for a small area again identified by mouse right clicking of top left corner followed by right clicking of bottom right.

« BULDINGS »


Same procedure as per tree layer. Load map jpg 2048X2048 with LOAD MAP button.
Select BUILDING TAB and then choose one building from the drop down list box. Many have a preview screenshot to give you an idea of building look.

Now you can mouse LEFT CLICK on main map in the position you like to build your building. You can then change orientation of building (if you have a preview of image you can see the almost correct dimension of building on map, otherwise you need to try to run NTW to see building phisical occupancy).

If you mouse RIGHT CLICK you can change position of building to a new location.

Now a brief expalnation of buttons:
1) RESET BUILDING: delete all buildings on map
2) OPEN BUILDING LIST: load a pre saved csv list of buildings. This doesn't delete existing buildings allowing for different csv lists like bridges, houses, props...to be saved separatedly.
3) SAVE CSV BUILDING LIST: save a csv list of buildings for later work
4) SAVE BMD BUILDING LIST: save a bmd list file to be imported in the final map pack
5) DELETE SELECTED BUILDING: delete a selected building from map, you can select a building hoovering with mouse over it. Building edges will turn azur instead of yellow.

« TEXTURES (colour_map_0.jpg) »


The basics of Photoshop:

Many good tutorials you can find on youtube.



Main texture of terrain is defined in 3 places :

    1. Textures.xml where you can find entry: tiled_detail_map='BattleTerrain/tiled_maps/snow1'

    Tiled maps are dds files which you can find here: battleterrain.pack > battleterrain > tiled_maps

    To change tiled_maps you need to change
    tiled_detail_map='BattleTerrain/tiled_maps/grass1
    to
    tiled_detail_map='BattleTerrain/tiled_maps/snow1'

    2. colour_map_0.jpg – it’s 2048x2048 jpeg file. You can use textures (jpg files) from battleterrain.pack > battleterrain > colour_maps as your main texture for colour_map_0.jpg or you can create own texture.

    3. colour_map_0_alpha.jpg (greyscale) – is file which define opacity level between dds file (from Textures.xml) and colour_map_0.jpg

    So you have structure of layers:

    colour_map_0.jpg
    colour_map_0_alpha.jpg
    dds file from Textures.xml

These files you can find in each HB map and in Hell.pack.



« WEATHER (default.environment) »


Default.environment is file which define type of sky/weather in HB.

Many different type of sky you can find in: rigidmodels.pack > rigidmodels > skybox > summer or winter:
.environment file is diffrent type of sky you should export one of these files and then rename to default.environment and import to your pack or replace older file.




6. OOB

How to copile an OOB for working with HIBAM editor by Desaix.

The order of battle is a list of units involved in one given battle.
What HIBAM does is to receive a .csv (comma separated value) sheet with this list and put as output an .xml scenario file readable by the NTW engine.
You can work your sheet either in CALC or EXCELproviding you always save the file with .csv format and the following settings: UNICODE UTF-8, comma separated value, NO STRING IDENTIFIER (look at first image for a CALC example).

Spoiler: show
Image



To find a working image go some posts below

Let's have a look at the csv file for the battle of Austerlitz.
You can download it below.

http://www.thelordz.org/forum/download/file.php?id=520

Let's see what each column means and how they MUST be written to avoid errors in HIBAM or, worse, crashes in NTW3 (we don't want crash in NTW since each run steals you some life minutes :) )

The first four columns can be visually set in editor:

COLUMN A) This is the X coordinates of unit starting deployment (from -1000 to +1000)
COLUMN B) This is the Y coordinates of unit starting deployment (from +1000 to -1000)

Note that coordinate reference starts at upper left corner.

COLUMN C) This is the unit orientation at startup
COLUMN D) Unit formation width at startup: usually from 10 to 20 is in column, from 30 to 50 is in line

Again you don't need to change manually these values. What instead you need to work on, and with high precision, is the two following lines:

COLUMN E: This is the unit name ID (lower case characters). This MUST ABSOLUTELY be unique with no duplication in the list. This ID name is the one NTW engine use to identify the unit in the 5 tables that we compile in each HB.
You can fill the list as you like, but I strongly suggest to use this coding rules:
- first 3 or 4 digits to identify the battle (aus_ for austerlitz in our example)
- secondly 3 or 4 digits for faction (fre_ for french, brit_ for britains, ...)
- following we have the unit class (cav_ for cavalry, inf_ for infantry,...)
- next the unit category (light_ , heavy, ... quite self explanating)
- finally the unit regiment or battalion name

If you download austerlitz example you will fast understand the correct way to fill this column

COLUMN F: Easier than previous column this is the unit INBATTLE name, the one you see in roster or when you move your mouse over the unit when playing
This is left to each "artist" likings, I do prefer ~ for separation between fields in this name. Avoid very long lines, it's usually better to start inbattle name with " " a space digit to avoid bad displaying of first charcater.

Let's jump for a moment to...

COLUMN P and Q: These two columns set the scaled strenght and absolute strenght of unit.
You only need to fill the second column (Q) because editor will automatically compute the first changing scale. For artillery unit you need to set number of cannons, not crew men (crew will be set automatically in editor).
NOTE: When setting number of cannons use a multiply of your choosen artillery scale.
If I choose 6:1 for artillery is better that each battery has multiple of 6 to avoid misbalances in game since this number will be rounded up or down in editor. My choice is thus to merge/split cannons to get the correct amount of guns in each battery. Let's say historically I have two batteries of the same type and in the same division/corps, one with 8 and one with 16 guns. I then set the first to 6 and the second to 18, moving 2 guns from the first, so that each battery is divisible exactly by 6. The result will be a fair representation of historically strenght with no risk that rounding down number in editor will change balance.

This is enough for the moment, compiling columns E,F and Q is 90% of the work on OOB. The rest are either set in editor or filled with a copy and paste when you have finished the list of units.

---

COLUMN S= CREW PER CANNON
COLUMN T= TYPE OF UNIT
0) Loc (Locs unit must be always below all generals of same faction)
1) General
2) Line inf, militia
3) Light inf
4) Skirmishers
5) Grenadiers
6) Chasseurs/Lancers/Light Dragoons
7) Hussars
8) Dragoons
9) Cuirassiers
10) Light art (6 or 8 lber, 7pdr howitzer)
11) Heavy art (12 or 9 lber, 20pdr unicorn,...)
12) Horse art (any type)
13) Regimental art (3 or 4 lber)

COLUMN U/V =INSPIRE and RALLY ability (only for general)

COLUMN U = If set to 2 for infantry unit means CHEVAUX DE FRISE ABILITY, if you set this ability for some unit you need to remove TRUE from disallow deployement in preferences tab for that faction

COLUMN W = SOCKET BAYONET ability

COLUMN X = SQUARE FORMATION ability

COLUMN Y = for infantry set to 1 means LIGHT INFANTRY BAHAVIOUR (open order)
for artillery set to 2 means GABIONADE ability (same as above for chavaux de frise)

COLUMN Z = UNLIMBER ability for artillery

COLUMN AA = RATE OF FIRE BOOST for artillery

COLUMN AB = TOTAL CREW per battery = (crew X #guns)

COLUMN AC = ROUND SHOT ability for artillery

COLUMN AD = CANNISTER ability for artillery

COLUMN AE = EXPLOSIVE SHELLS ability for howitzer (if set to 1 AC will be set to NUL)




7. Scenario

Scenario is XML file:
http://en.wikipedia.org/wiki/XML

Don't worry, you don't need deep special knowledge about XML. Hibam will generate xml for you.

Theory:
http://wiki.totalwar.com/w/Battle_XML_Documentation
(The most important part is : Elements of the Battle XML)

(Check and use strudcture of NTW3_hb_friedland_v24.pack as example during scenario generation).

Procedure of scenario creation:

    1. Load your colour_map_0.jpg into HIBAM - button: load map
    2. Load your proper csv file into HIBAM - button: load unit db
    3. Set your units on map - select unit and right click on map, you can also rotate units, change width of unit's formation
    4. Save your work as cvs - button: "save unit db" now in your csv you will have new parameters which descirbe position of your units
    5. Go to tab: preferences (we are in HIBAM) and in section: "general" set all options. Battle dir you can find here: battleterrain > presets > (this name) for my map name is: ntw3_hist_gorzyce1809 so whole entry is: BattleTerrain/presets/ntw3_hist_gorzyce1809/ - do not forgot about last symbol "/"
    6. Click save pref and save pref file on your Hard drive (then you can load this file so you will not need to set options in preferences tab)
    8. Tick LOC (near Create Battle XML) when you want to create scenario with LOC mechanism
    9. Create scenario as xml file: Button: create battle xml file (HIBAM will autmaticly generate xml file)
    10. Save scenario as xml file: Button: "save battle xml"
    11. Import your xml with scenario into your pack, so you need: Create new folder: mp_historical_battles. Inside this folder you need create folder for your battle: NTW3_HB_(name of your battle)_historical and there you should add your xml file:
    12. Create a new table inside: battles_tables folder where you will have list with your scenarios. You create row for your scenario and fill columns. (I think that you should use export and import TSV option in your PFM) The most strange column is a column with numbers:
    00 01 00 00 00 01 00 00 00 01 01 00 it's mean 1vs1
    00 02 00 00 00 02 00 00 00 01 01 00 = 2vs2
    00 03 00 00 00 03 00 00 00 01 01 00 = 3vs3
    13. Now you can try your scenario.


8. Uniforms

DB Tables for units are inside these folders:

uniform_to_faction_colours_tables
uniforms_tables
unit_stats_land_tables
units_tables
units_to_exclusive_faction_permissions_tables

Sometimes you need create own variantmodels but many times you can use default variant models or variant models from NTW3_hb_common_v22.pack.

Variant model is configuration of unit's parts.
Example:
http://img200.imageshack.us/img200/2851/variantu.jpg

Each unit is related to specific variant model. You can for example eaisly change element of unit (for example hat) by edition of appropriate parameter in variant model.

Each unit is also related to specific group of textures called atlas.

Typical structure of textures and atlases for 1 nation:
    russia_colour_mask.atlas
    russia_colour_mask.dds
    russia_diffuse.atlas
    russia_diffuse.dds
    russia_gloss.atlas
    russia_gloss.dds
    russia_normal.atlas
    russia_normal.dds

.atlas files are text files which contain information about position, size and name of textures which are presented on dds file.

.ddd files are graphical file.


There are 4 different dds files:

- diffuse.dds is typical picture of textures

- colour_mask.dds is a file which contains red, gren and blue (rgb) areas on black background. These areas are masks and when you want for example change color of collar you need know which color of mask is on collar place (colors of mask you can deifne in uniform_to_faction_colours)

- gloss.dds is a file which defines which part and how parts of uniforms use light (shine, reaction to light)

- normal.dds is a bump map (concavity/convexity)

Here you can find some tutorials about uniforms:
http://www.twcenter.net/forums/forumdisplay.php?f=1440

Important tutorial:
http://www.twcenter.net/forums/showthread.php?t=519393


9. Stats

unit_stats_land_tables
units_tables


Less important information about marks of unit quality(stars icon above unit) [experience level star]:
Spoiler: show
If you set a name in the units table (column before the last) you will get green or red stars displayed over morale bar.

Code is:

0 = melee
+1 = light_cavalry
+2 = missile_cavalry
+3 = lancers
-1 = light_infantry
-2 = line_infantry


10. NTW3_localization_en_v2.pack

Example of typical localization file:
Spoiler: show
Image


    units_on_screen_name_heil_rus_inf_jeg_guard_const - example of unit name.
    battles_description_NTW3_HB_Heilsberg_historical_2_vs_3 - example of description,
    battles_localised_name_NTW3_HB_Heilsberg_historical_2_vs_3 - example of scenario's name.

11. Beta tests

    - minimum is 2vs2 test because 1vs1 deforms units morale

    - loc test
    - terrain modifiers test
    - stats test
    - brigdes test
    - buldings test (players should check fight in buldings, fight inside buldings cannot generete lag)
    - delays test
    - victory points test
    - overall performance of battle test (lag test)

    How to launch beta verision of HB?

    Spoiler: show
    1. Download zip with new map http://www.mediafire.com/download.php?jpmsan3cwgprb2b

    2. Unpack zip file (password: 1807)

    3. Copy & Paste NTW3_hb_heilsberg.pack and NTW3_localization_en_v2 to your \Steam\steamapps\common\napoleon total war\data

    4. Copy & Paste NTW3_localization_en_v2 to your \Steam\steamapps\common\napoleon total war\Ntw3

    5. Download and install Mod Manger: http://www.twcenter.net/forums/showthread.php?t=344757

    6. Open Mod Manger

    7. Select 5 files and set these files in order shown on picture:
    Image

    8. Click Launch button


Bonus

A. Popular mistakes:

mistake in battle dir (preferences tab in hibam):
    wrong entry: BattleTerrain/presets/NTW3_Heilsberg1807 - result crash
    correct entry: BattleTerrain/presets/NTW3_Heilsberg1807/

mistakes in oob csv:
    - same id (same names in E column) - id is unique identifier
    - wrong unit type in column J - for example cavalry unit has got "cannon" in that coulmn

B. 3d Models - Units:

You also need:

Optional:


C. 3d Models - Buldings:

You also need:

Links:
http://www.twcenter.net/forums/showthread.php?t=431088

D. Deplyoment zones:

Tutorial is inside Hibam pack:
http://www.gamefront.com/files/21017195 ... er_3_1.rar

///////////////////////////////////////////////////////////////////////////////////////////////////

Old Desaix's tutorial:
http://www.twcenter.net/forums/showthread.php?t=399836
--
Grid method is obsolete.
Among the Quadi at the Granua.

User avatar
Lord Desaix
Lord
Lord
Posts: 2819
Joined: Thu Mar 05, 2009 3:59 pm

Re: HB's modding procedure (work in progress)

Postby Lord Desaix » Thu Sep 13, 2012 4:35 pm

Good topic Ziuk.

I must add that selecting an already developed theatre of war makes life much easier, for example if you want to make the battle of Raab you will find a lot of stuff already done regarding uniforms, map texture and selected buildings on map.

A new map provided one have good knowledge of GIMP/PS is doable in a month, a very detailed map in 2 months (of course map with lot of buildings takes more time, a flatten steppe not that much). What takes further time is the making of start position and objectives jpg.

Populating the map is not difficult, quite intuitive with my editor, what usually frustrates are sometimes occupable building. Much to be avoided are bridges at least if you're nickname is not Desaix :wink: :mrgreen:

In the following posts we will try to explain how the different files of a map work.

User avatar
Sire
Esquire
Esquire
Posts: 302
Joined: Sat Aug 04, 2012 5:44 am

Re: HB's modding procedure (work in progress)

Postby Sire » Thu Sep 13, 2012 4:36 pm

Excellent Ziuk, great topic about how to make a HB, :biggrin:
To have a good historical resources, the study and investigation before to make the scenario is very important... now I am trying to learn how can to create a monster... :wink:

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure (work in progress)

Postby Ziuk » Thu Sep 13, 2012 4:40 pm

Desaix feel free to edit my post.
Among the Quadi at the Granua.

User avatar
Lord Desaix
Lord
Lord
Posts: 2819
Joined: Thu Mar 05, 2009 3:59 pm

Re: HB's modding procedure (work in progress)

Postby Lord Desaix » Thu Sep 13, 2012 4:45 pm

height_map_0.dds + height_map_0_settings.xml

There are 4 height map files numbered 0/1/2/3, all are dimensioned 1025X1025 pixels
These represents the four LOD of a map regarding heights.
The most important is layer 0 which is showed when the camera is close to the terrain.
This is the only one we modify, the others 3 are created with the Lordz Tools pressing the TILEHEIGHTMAP button. It asks for input the height_map_0.dds and creates as output the other 3 layers.

Altough one can create the layer 0 painting hills and stream with GIMP/PS I strongly suggest to use Google Earth SRTM data for heights (Europe is mapped 90:1 I believe), downloading the selected area and using MICRODEM tool for exporting a BMP of the height layer.

My preferred process is selecting a suitable area in Google (better if north oriented, default setting of Google) then writing down top left corner coordinates and lower right corner coordinates. Once in MICRODEM you can select the same area using the displayed coordinates and there you go, a basic height layer is fastly created. If you rotate the camera in Google you will need to use some shortcuts when selecting area in Microdem.

Since I'm quite fast in generating height layer I can help making the layer if one shows me the selected area in Google.

User avatar
stilgar
Beta Tester
Beta Tester
Posts: 952
Joined: Wed Feb 23, 2011 2:29 pm
Location: 2000km from Borodino

Re: HB's modding procedure (work in progress)

Postby stilgar » Thu Sep 13, 2012 5:34 pm

Very interesting. I am all ears.
"Постой-ка, брат мусью ..."

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure (work in progress)

Postby Ziuk » Thu Sep 13, 2012 6:31 pm

Updated.

I need someone who will fix mistakes in first post. My english is strange:)
Among the Quadi at the Granua.

User avatar
Sire
Esquire
Esquire
Posts: 302
Joined: Sat Aug 04, 2012 5:44 am

Re: HB's modding procedure (work in progress)

Postby Sire » Thu Sep 13, 2012 7:59 pm

really amazing, I do not want to interrupt the masterful lesson that your are giving... :cool: :wink:

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure (work in progress)

Postby Ziuk » Thu Sep 13, 2012 10:02 pm

Updated 1 and 4.
Among the Quadi at the Granua.

User avatar
Lord Desaix
Lord
Lord
Posts: 2819
Joined: Thu Mar 05, 2009 3:59 pm

Re: HB's modding procedure (work in progress)

Postby Lord Desaix » Fri Sep 14, 2012 9:14 am

About HEIGHT LAYER:

Since height layer is a grey scale graphic file with range going from full black rgb(0,0,0) to full white rgb(255,255,255) you might ask what is that set the relative scale in battle.
If every height_map_0.dds has the same range why some map are flat ocean and other packed with mountains?
This is when makes its appereance the height_map_0/1/2/3_settings.xml file

Let's see one of this file:

<HEIGHTFIELD_SETTINGS world_width='2048.000000' world_height='2048.000000' normalize='true' simple_colour_blending='false' scale='12.000000' bias='-4.500000' />

Simple, just one line, the width and height are doubled each time you increase number of layer starting with 2048. What really does count here (and that you can modify) are the two values SCALE and BIAS.

SCALE set the relative gradient of hills. If you increase SCALE value with the same heigh_map_0.dds you will get map with progressively steeper hills and even mountains. If you decrease scale close to 0 your map will be a flatten landscape.

BIAS set the water layer in map units (let's see meters or yards for facility). With a negative value of BIAS some area in your map will start to be flooded with water because the water layer is superior to that point terrain level.
With a positive value the water layer will stood below each point of the map and you won't see real water. This is why you cannot have stream with real water coming down from hills but only a general see or lake at the bottom of your terrain.

ANy question?

Good,we can go on then :mrgreen:

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure (work in progress)

Postby Ziuk » Fri Sep 14, 2012 4:48 pm

Can you describe role of these buttons in Hibam:
- save unit pos / load unit pos
- set rout pos
?

I didnt use them but my scenario works.
Among the Quadi at the Granua.

User avatar
Sire
Esquire
Esquire
Posts: 302
Joined: Sat Aug 04, 2012 5:44 am

Re: HB's modding procedure (work in progress)

Postby Sire » Fri Sep 14, 2012 8:33 pm

very interesting, I listen carefully... this reminds me, when I went to study at the university, and my early years... very beautiful years... please continue... :surprise: :smile: :wink:

User avatar
Lord Desaix
Lord
Lord
Posts: 2819
Joined: Thu Mar 05, 2009 3:59 pm

Re: HB's modding procedure (work in progress)

Postby Lord Desaix » Sat Sep 15, 2012 9:32 am

Ziuk wrote:Can you describe role of these buttons in Hibam:
- save unit pos / load unit pos
- set rout pos
?

I didnt use them but my scenario works.


SAVE/LOAD UNIT POS: not active

SET ROUT POSITION : in the battle script file there's a line setting x,y coordinates of rout position. I'm not sure how that works in battle, I suppose a routed unit tends to move towards that point.
You can set that point in HIBAM clicking on SET ROUT button and then right clicking on the battle minimap, then SAVE PREFERENCES to store your values

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure (work in progress)

Postby Ziuk » Sat Sep 15, 2012 1:18 pm

Updated 0, 1,

+Bonus

I also added Desaix's post about scale/bias
Among the Quadi at the Granua.

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure (work in progress)

Postby Ziuk » Sat Sep 15, 2012 8:38 pm

Updated: 0, 2, 4!!!.
Among the Quadi at the Granua.

User avatar
Zeb
Yeoman
Yeoman
Posts: 117
Joined: Tue Feb 21, 2012 12:53 am

Re: HB's modding procedure [tutorial] (work in progress)

Postby Zeb » Tue Sep 18, 2012 3:36 pm

Thank you ziuk!!!!!!! :looney:

User avatar
Lord Desaix
Lord
Lord
Posts: 2819
Joined: Thu Mar 05, 2009 3:59 pm

Re: HB's modding procedure [tutorial] (work in progress)

Postby Lord Desaix » Tue Sep 18, 2012 3:43 pm

How to copile an OOB for working with HIBAM editor by Desaix.

The order of battle is a list of units involved in one given battle.
What HIBAM does is to receive a .csv (comma separated value) sheet with this list and put as output an .xml scenario file readable by the NTW engine.
You can work your sheet either in CALC or EXCELproviding you always save the file with .csv format and the following settings: UNICODE UTF-8, comma separated value, NO STRING IDENTIFIER (look at first image for a CALC example).

example_csv.jpg
example_csv.jpg (124.53 KiB) Viewed 15384 times


Let's have a look at the csv file for the battle of Austerlitz.
You can download it below.

austerlitz_reg_morning_3_vs_3_db.rar
(6.96 KiB) Downloaded 270 times


Let's see what each column means and how they MUST be written to avoid errors in HIBAM or, worse, crashes in NTW3 (we don't want crash in NTW since each run steals you some life minutes :) )

The first four columns can be visually set in editor:

COLUMN A) This is the X coordinates of unit starting deployment (from -1000 to +1000)
COLUMN B) This is the Y coordinates of unit starting deployment (from +1000 to -1000)

Note that coordinate reference starts at upper left corner.

COLUMN C) This is the unit orientation at startup
COLUMN D) Unit formation width at startup: usually from 10 to 20 is in column, from 30 to 50 is in line

Again you don't need to change manually these values. What instead you need to work on, and with high precision, is the two following lines:

COLUMN E: This is the unit name ID (lower case characters). This MUST ABSOLUTELY be unique with no duplication in the list. This ID name is the one NTW engine use to identify the unit in the 5 tables that we compile in each HB.
You can fill the list as you like, but I strongly suggest to use this coding rules:
- first 3 or 4 digits to identify the battle (aus_ for austerlitz in our example)
- secondly 3 or 4 digits for faction (fre_ for french, brit_ for britains, ...)
- following we have the unit class (cav_ for cavalry, inf_ for infantry,...)
- next the unit category (light_ , heavy, ... quite self explanating)
- finally the unit regiment or battalion name

If you download austerlitz example you will fast understand the correct way to fill this column

COLUMN F: Easier than previous column this is the unit INBATTLE name, the one you see in roster or when you move your mouse over the unit when playing
This is left to each "artist" likings, I do prefer ~ for separation between fields in this name. Avoid very long lines, it's usually better to start inbattle name with " " a space digit to avoid bad displaying of first charcater.

Let's jump for a moment to...

COLUMN P and Q: These two columns set the scaled strenght and absolute strenght of unit.
You only need to fill the second column (Q) because editor will automatically compute the first changing scale. For artillery unit you need to set number of cannons, not crew men (crew will be set automatically in editor).
NOTE: When setting number of cannons use a multiply of your choosen artillery scale.
If I choose 6:1 for artillery is better that each battery has multiple of 6 to avoid misbalances in game since this number will be rounded up or down in editor. My choice is thus to merge/split cannons to get the correct amount of guns in each battery. Let's say historically I have two batteries of the same type and in the same division/corps, one with 8 and one with 16 guns. I then set the first to 6 and the second to 18, moving 2 guns from the first, so that each battery is divisible exactly by 6. The result will be a fair representation of historically strenght with no risk that rounding down number in editor will change balance.

This is enough for the moment, compiling columns E,F and Q is 90% of the work on OOB. The rest are either set in editor or filled with a copy and paste when you have finished the list of units.

User avatar
Zeb
Yeoman
Yeoman
Posts: 117
Joined: Tue Feb 21, 2012 12:53 am

Re: HB's modding procedure [tutorial] (work in progress)

Postby Zeb » Tue Sep 18, 2012 3:48 pm

your awsome desiax

User avatar
Sire
Esquire
Esquire
Posts: 302
Joined: Sat Aug 04, 2012 5:44 am

Re: HB's modding procedure [tutorial] (work in progress)

Postby Sire » Tue Sep 18, 2012 11:07 pm

very interesting and useful your explanation Desaix. Great post Ziuk. :wink:

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure [tutorial] (work in progress)

Postby Ziuk » Fri Sep 28, 2012 2:14 pm

Update: Video-tutorial :)
Among the Quadi at the Granua.

User avatar
Sire
Esquire
Esquire
Posts: 302
Joined: Sat Aug 04, 2012 5:44 am

Re: HB's modding procedure [tutorial] (work in progress)

Postby Sire » Mon Oct 01, 2012 1:50 pm

Ziuk wrote:Update: Video-tutorial :)

Ziuk, thank you very much, excellent video tutorial, very good, very well explained the concept to make height maps ... this topic is really great, is the best I've seen... Thanks :cool: :wink:

User avatar
Sire
Esquire
Esquire
Posts: 302
Joined: Sat Aug 04, 2012 5:44 am

Re: HB's modding procedure [tutorial] (work in progress)

Postby Sire » Sun Oct 14, 2012 4:07 pm

Desaix and Ziuk, great tutorial, very good, excellent. Please, you can explain how to place buildings, houses and churches? and also explain how can put trees and shrubs? :cool: :wink:

User avatar
Lord Desaix
Lord
Lord
Posts: 2819
Joined: Thu Mar 05, 2009 3:59 pm

Re: HB's modding procedure [tutorial] (work in progress)

Postby Lord Desaix » Mon Oct 15, 2012 10:19 am

Ok, here's the tutorial about TREE LAYER and BUILDING LAYER

1) TREE LAYER

As usual we load a jpg 2048X2048 of the colour_map_0 by pressing the LOAD MAP button.
Then we shift to the tree editor by selecting TREE TAB.
Next step is to select a type of CLIMATE from the drop down list, you will see the box populating with the correct trees for that climate (not all climates are operative). Last you select the type of season.

Then you can start planting trees on map by selecting the selected type of tree from the list by clicking on the tree name (please note that some climate have working preview jpgs to show the tree texture).
Planting a tree is done by left clicking on main map. Before doing that you can select a tree height with the two numeric text box on the right lower corner. They show a minimum height and a maximum height: the final tree height will be randomly chosen between min and max.

When you're done you first save the CSV file (working file of trees) by selecting SAVE TREE LIST button. Then you create the BMD file by slecting SAVE BMD FILE (this is the final file which must be imported in map pack). If you select RESET TREE you will delete all trees from map.

Quite simple, isn't it?

There are some additional buttons for minor tweakings:
0) OPEN TREE LIST: you can import an existing saved list with this button. Note that the correct climate must be already selected and the import procedure doesn't delete existing trees on map (always better resetting trees before loading an existing list unless you work with different files).
1) TREE UNDO: to delete the last planted tree
2) OPEN BMD FILE: to import an existing BMD file from existing map. Sometimes it works sometimes not. :wink:
3) ERASE TREE RECT: you can delete multiple trees by selecting this button, then mouse right clicking on left top corner on main map followed by mouse right clicking of bottom right corner. All the trees in that imaginary area will be erased.
4) ALL HEIGHT RANDOM: all the existing trees will be retuned in height based on the range comprised between min and max height.
5) SET HEIGHT AREA: the same as above but only for a small area again identified by mouse right clicking of top left corner followed by right clicking of bottom right.

Feel free to ask. Building construction will follow.

User avatar
Ziuk
Beta Tester
Beta Tester
Posts: 1058
Joined: Fri May 27, 2011 1:58 pm
Location: Poland

Re: HB's modding procedure [tutorial] (work in progress)

Postby Ziuk » Mon Oct 15, 2012 1:05 pm

Desaix, can you add your 2 last lessons to my first post in this topic?. I cannot add attachments to posts. Can you also add "sticky" atribute to this topic ?

---
Can you add these trees to Hibam?:

Image
Among the Quadi at the Granua.

User avatar
Lord Desaix
Lord
Lord
Posts: 2819
Joined: Thu Mar 05, 2009 3:59 pm

Re: HB's modding procedure [tutorial] (work in progress)

Postby Lord Desaix » Mon Oct 15, 2012 2:19 pm

i'M GOING TO UPDATE MY HIBAM TUTORIAL, no need to put again in first post.


Return to “HB development room”

Who is online

Users browsing this forum: No registered users and 2 guests