               Notes on editing scenario data using EDITWIR

                        Author:  Arnaud Bouis
                          Date:  2/10/2001



Introduction
============

WIR's data consists of a number of tables.  These tables are:

    Unit icons (the icons you see on the map)
    Cities
    Aircraft type
    Factories
    Tank type
    HQs
    Air Groups
    Divisions
    Corps
    Armor (sub-units, mostly battalions)
    Leaders

All this data can be edited with editwir.exe, and part of it can be edited
with the more limited scenario editor included in the game.



Data location
=============

All the data is stored in the scenario files, named obXXX.  Obwir is the
scenario file for the big 1941-45 campaign.  All the data is entirely
stored in EACH scenario file and also thereafter in each save file when you
save it, so instead of being centralized it is duplicated everywhere.  This
means that you must save the equipment's file segment and then "spread it" to
EVERY scenario file if you want to change the rating of one piece of
equipment in all scenarios. Otherwise the change will only affect the edited
scenario.  You can "spread" a change by loading a scenario, then the
appropriate file segment containing the change, and then saving the scenario
again.



Data structure and editing limitations
======================================

As you can see if you use editwir.exe, every item in a table has a number, or
index (or "slot").  For instance, the Valentine is tank number 58.
Unfortunately, the program has some hard-coded, built-in tests which use
these numbers, so changing these numbers can cause unforeseen consequences.
For example, moving the Valentine to slot #60 will cause the program to
mistake it with artillery which is hardwired for slot #60.  The program also
has hard-coded limits which restrict the number of slots. For instance, you
can only have 100 cities, 200 air groups, or 100 aircraft.  Moreover, the
program has hard-coded limits which are not even shown in editwir.exe:  air
groups 0 to 99 MUST be Axis air groups, and air groups 100 to 199 must be
Soviet.  HQ's 0-25 are Axis, and 26-49 are Soviet HQs.

It is therefore very difficult to edit the data without this knowledge.  The
following sections explain what I know of it.

All comments on free slots are based only on the analysis of OBWIR.  Other
files are practically identical, so free slot numbers are generally identical.



Data tables
===========


Map
---

This data is located in sf.map which is the only map file the game uses.
This map is editable with mapper.exe.


Unit icons
----------

Unit icons are numbered 1-249.  Unit icons 1-99 are Axis corps and unit icons
100-199 are Soviet Armies.  Unit icons 200-224 are Axis HQs and units 225-249
are Soviet HQs.  There are no free slots.


Cities
------

Cities are numbered 0-99.  It is important not to move some cities from one
slot to another or to other map coordinates, since some are hardcoded in the
game.  For example, city #79 (Odessa) at map coordinates (44,40)
automatically receives sea supply.  Another example:  slot #94 must remain
"Lnd Ls/Siber", and slot #95 must remain "Urals".  Only 2 slots (0 and 99)
are free.


Aircraft Types
--------------

Numbered 0 to 99.  Slots 0-64 are already used and therefore should not be
altered because the game makes some assumptions about these slots, such as
slots 17-22 and 63 must be Italian aircraft, and lend-lease aircraft can only
reside in slots 39-46.  Adding new German and Soviet planes, besides
LendLease and Italian planes, in those last 34 empty slots *should* be
possible, it has been done.


Factories
---------

Factories are numbered 1-399. They can belong to any side.

The factory type indicates the item it produces.  For tanks, the factory type
is the tank type + 100.  For aircraft, the factory type is the aircraft type +
200.  Heavy industry, artillery, and recon are types 0, 1, and 2,
respectively.  There are many free slots.


Tank Types
----------

Tank types are numbered 1-99.  They can belong to any side, no nationality is
associated with tank or aircraft types.  "Generic" types must be left in
their current slots.  Artillery must be left in slot #60, AT guns in slot #61,
Flak in slot #62, and Recon in slot #63.  About 35 slots are free.


HQs
---

HQs are Numbered 1-49.  Slots 1-24 must be Axis HQs, slots 25-49 must be
Soviet.  The West Front, Italian Front, OKH, OKW, Stavka and RGVK must not be
moved from their slots.  There are no free slots.


Aircraft Groups
---------------

Air groups are numbered 0-199.  Slots 0-99 must be Axis air groups, and slots
100-199 must be Soviet.  Note that the Group Nationality variable does not
change the hardcoded nationality above.  It does however allow distinguishing
between SS and regular German units for example, and also between Western
Allied groups and Soviet groups.  No slots are free.


Divisions
---------

Divisions are numbered 1-799. Slots 1-369 must be Axis, and slots 370-799
must be Soviet. If the division's readiness is greater than 99, then the unit
is not yet on the map and will arrive after a delay of (readiness - 99) turns.
A division can either be under a corps or directly under an HQ.  A division
belongs to a corps if its HQ number is below 200.  The division's HQ number
is the slot number of the corps.  A division belongs to an HQ if its HQ
number is above 200.  The division's HQ number is the slot number of the HQ
plus 200.  There are no free slots.


Corps
-----

Corps are numbered 1-199.  Corps 0-99 are Axis corps.  Slots 100-199 are
Soviet armies.  There are no free slots.


Armor
-----

Armor units are numbered 1-1199.  The armor table includes both divisional
sub-units which are usually tank battalions/regiments, and independent
battalions/regiments which includes artillery, anti-tank, and flak battalions.
An armor unit can either belong to a corps/army, an HQ, or a division.  An
armor unit belongs to a division if its formation HQ number is below 1000. In
this case, the formation HQ number is the parent division's slot number.  An
armor unit belongs to a corps/army if its formation HQ number is above 999
and below 2000.  Here, the formation HQ number is the slot number of the
corps/army the armor unit is attached to, plus 1000.  Finally, an armor unit
belongs to an HQ if its formation HQ number is above 1999. The armor unit's
formation HQ number is the slot number of the HQ the armor unit is attached
to, plus 2000.  There are many free slots.


Leaders
-------

Leaders are numbered 0-99.  Leaders 0-49 are Axis and slots 50-99 are Soviet.
Hitler must remain in slot 0 and Stalin, in slot 50.  There are no free slots.



Automatic reorganizations/upgrades
==================================

The game engine performs a number of changes in the OB data and equipmment of
units at certain dates. Here they are:


20 July 1941:

    Corps in slots 100-186 which are of types 25 (corps) and 18 (mech corps)
    turn to type 23 (army) and are renumbered.

    Divisions in slots 430-459 of type 5 (motorized div) turn to type 32
    (rifle div).


Every week starting in January '42:

    Tank regiments in the range of 320-699 armor units (type 16) are reformed
    with newer tanks:  KV-1E, KV-1S, KV-85, IS-I, and IS-IIM.


First week of April '42:

    Divisions 1-4 (SS) and 12 (G.D) turn to type 4 (PzG div).

    Divisions 370-409 (tank div) turn to type 13 (tank corps).  The armor
    units of the above divisions turn to type 15 (tank brigade).

    Divisions 410-429 (tank div) turn to type 15 (mech corps).  The armor
    units of the above divisions turn to type 15 (tank brigade),


Every week starting in April '42:

    Armor units 320-699 (soviet tank brigades) are reequipped with newer
    tanks: T-70, T-34/85, Valentine, T-34 M43, and T-34 M40, if pools permit.


Every week starting in January 43:

    SPG regiments (type 15) have their tanks replaced with Su-76 if pools
    permit.

    SPG regiments (type 20) equipped with Su-76 see them replaced by heavy
    SU/JSU assault guns if pools permit.

    The JPZ armor units 201-229 (type 8) see their tank destroyers replaced
    with Marder III, Nashorn, Jagdpanther or Jagdtiger.

    1/4 of the KV-II pool turn into Su-152.

    1/4 of the old T-37, T-60, T-70, T-26, BT-5, and BT-7 pools turn
    into Su-76.

    1/4 of the T-35, KV-1, KV-1E pools turn into KV-1S.

    1/4 of the T-28 and T-34 M40 pools turn into T-34 M43 (before
    August '43) or Su-85 (after August '43).

    1/4 of the Stug-IIIB pool turns into Stug-IIIG.

    1/4 of the Pz-II, R35, Pz38, Pz-38(e) pools turn into Marder III.

    1/4 of the Pz-III(f-j) pools turn into Pz-IIIm.

    1/4 of the Pz-IV(d-g) pools turn into Pz-IVh.

    1/4 of the Elefant pool turns into Jagdtiger.

    1/4 of the Marder III pool turns into Hetzer.

    1/4 of the M13/40 and M15/42 pools turn into Marder III.


Every week starting in March '43:

    The JPZ armor units (type 8) of divisions 17-42 have their jagdpanzers
    upgraded to newer types if pools permit:  Marder II, Marder III, Nashorn,
    JgdPzIV, and StugIIIg.


Every week starting in April '43:

    1/4 of the KV-1S pool turns into ISU-122.


First week of September '43:

    Divisions 1-6 (SS) and 12 (G.D.) turn into type 3 (Pz div).

    Divisions 52-64 (motorized) turn to type 4 (PzG div).


Every week starting in January '44:

    Panzer battalions in the range of 1-200 armor units have a good chance of
    seeing their tanks reformed with Pz-IV(g,h,j) or Panther.

