Dragoncrusader
10-16-2004, 10:59
How to create a Historical Battle (version 1.2)
Historical battles have a number of advantages over Custom battles that means it is really worth the extra time it takes to create them.
• You can write you own text to add a story to your battle.
• You can position units anywhere on the map at the start of the game to get more complex battles.
• And best of all you can program the ai! Want the ai to ambush your forces in a mountain pass or fight a retreat across a wide plain or have the Vikings land from ships while your Saxons hurry up from inland or get the ai army to sally out from a castle so that you can fight outside. It can all be done with a bit of basic knowledge.
• You can change the look of your troops
The battle information is kept in the MTW/Battle/batinit/historical battles folder and an a readme file about the ai called AISCRIPTINGINSTRUCTIONS at MTW/Battle with some of the information files in MTW/Battle/Flags or MTW/Campmap/shields or MTW/Loc/Eng.
The way to create a new historical battle (HB) is to create a new folder in MTW/Battle/batinit/historical battles and name it with your new name. Copy the adf and bdf files and the tga image file from the Bannockburn folder. This will give you a simple template to overwrite.
The Battle Description File
• Rename the bdf file with your new battle name and open it with a simple text editor like NoteTab. Replace all references to Bannockburn with your new battle name – except the map.
o StartposName – this sets the factions that are available and is usually set at ‘early’. You only need to change it to ‘viking’ if you want to use factions from that part of the game
o Predefined –
o Title - write battle name in here
o Author – here is your chance for 2 minutes of fame
o Rating –
o Description – write in here any text that you want to appear on the introduction screen
o Conditions - write in here what conditions you have to fulfil to win the battle
o IntroFMV
o OutroFMV
o MapName - Change the MapName to a map of your choice.
o Architecture - Change Architecture AT_(DARK_AGE_EUROPEAN EASTERN_EUROPEAN ISLAMIC SOUTHERN_EUROPEAN WESTERN_EUROPEAN WINTER)
o Terrain - Change Terrain (ARID LUSH ROCK_DESERT SAND_DESERT TEMPERATE WINTER) You need to check that the map you are using will allow all these terrain types. Look in MTW/Battle/Maps and check the notes for each map. Battle may fail to appear on list if an incorrect terrain type is used.
o BattleType::BATTLE_TYPE_HISTORICAL
o Deployement – true or false does not seem to affect anything
o Season - Change Season (spring summer autumn winter) to fit the map.
o WeatherSequenceId - Number sets weather for battle 0 clear 1 clear 2 rain 3 Heavy Snow 4 light snow and fog 5 light snow 6 light snow 7 light snow 8 light snow 9 mist ( I cannot find where you get a sandstorm from!!!!!)
• Change Player details
o Add a new name
o First number is the faction(for early these are 0 Rebel 1 Almouhad 2 Byzantine 3 Danish 4 Egyptian 5 English 6 French 7 German 8 Italian 9 Polish 10 Russian 11 Spain 12 Turkish 13 Aragonese 14 Burgundy 15 Mongols 16 Hungarian 17 People of Novgorod 18 Papal 19 Sicilian 20 Swiss and for Viking they are 1 Irish 2 Mercians 3 Northumbrians 4 Picts 5 Saxons 6 Scots 7 Vikings 8 Welsh )
o Second number is the alliance number. Always set this number to the same as the faction of the main army for that side and then all the allied armies need to use the same number.
o LOCAL OR ARTIFICIAL sets whether this player is ai or human. You can only have one LOCAL army.
o “Text” is the army name and must relate to an .adf file. You need one .adf file for each army
o 0 no idea
o True/false true sets army to attacker, false to defender.
o Next two numbers are the general unit’s map co-ordinates and determines for your general the starting position of the camera.
o The final number is the direction of facing 0 is north and 180 is south
o Set culture to appropriate to faction - (MUSLIM PAGAN CHRISTIAN ORTHODOX) _CULTUR0045
o If you want to add more players do so here by copying and pasting the player section and then changing the details to how you want them. You can only have ONE army from each faction, so if for example you want to create two French armies, you would create the first as normal and then use another faction, say Burgundy as the second. In order to get the second army to look French, copy the TGA image file for the French from MTW/Battle/Flags and the .bif image file from MTW/Campmap/shields using the small size of file. Paste these files into the battle folder and rename them to match the army name of the Burgundian army. I am afraid that the unit shields on the battlefield will be that of the faction that you are using and since these are determined by unit it would be a huge amount of work to change them all. So pick a faction that is close to your own in style or Rebels or Swiss which are grey.
• If you want to define an area on the battlefield, say the keep of a castle add it here in this format:
//areas
Area::1, CIRCLE 15558 35193 2000
• Triggers - Change the “” text to what you want to see on the screen like: Trigger 1 : “Protect the king or lose the battle” Trigger 2 : “Do not let your army be routed” Trigger 3 : “Break the enemy army or rout them from the field.” Change the faction numbers to match the army ones.
• If you want to add new victory conditions– change the triggers or insert new ones. Read the AISCRIPTINGINSTRUCTIONS guide to understand how triggers works and the victory conditions are listed below:
o Conditions format is: ‘Trigger::1, BT_GENERAL DIED CAPTURED FLED, factions 6, LABEL "Protect the General or lose the battle", INVERT_CHECKBOX’.
o First section of Triggers can be
BT_GENERAL DIED and/or CAPTURED and/or FLED or BT_INCAPACITATE (to trigger when an army flees)
BT_LIMIT, TIME n seconds, (to trigger after a given time)
BT_CASTLE CAPTURED, num_areas 1, MEN 100, (to trigger capturing a given area of a castle with a certain number of men)
BT_TROOPS DESTROYED, COUNT 4 (to trigger after a certain number of units have been destroyed)
BT_AREA CAPTURED, area_ids 1, MEN 10, TIME 180, (to trigger after given area on the battlefield has been captured for a given period of time by a given number of men. Add MEN 1 FOE NO_MORE 0, to this string if you want to add the condition that they enemy must be destroyed first)
BT_AREA RELINQUISHED, area_ids 1, MEN AT_LEAST 40, (to trigger if you want the player to be defeated if he fails to hold onto an area with a given number of men/time)
BT_TROOPS DIED FLED CAPTURED, PERCENT 60, (to trigger after a set percentage of troop have been killed or routed)
o Second section determined the faction number
o Third section is the label that will appear on the victory conditions screen.
o Fourth section if left blank will tick the check box on the victory conditions screen or will leave it empty if contains INVERT_CHECKBOX
• Results – change the faction numbers to match the army ones.
• Groups – this links the triggers to the results, so you have to have a group that matches each trigger and then assign whether it is a victory result or defeat result.
• Save file as a .bdf file.
Army Description File
• Rename .adf so that they match the army names that you gave them in the .bdf file. Copy and paste to add further armies.
• Open an .adf file
• The file is a list of units and each unit is laid out as follows:
o UnitStart::"Unit"
o InitialLeaderName - gives the units a name
o IsGeneral – true or false with true setting unit as army general
o Position – two number co-ordinate on the map with the first number being the x co-ordinate and the second the y co-ordinate. The average map is about 50k by 50k so a co-ordinate of 10000 40000 would be in the top left hand corner of the map. When placing units together you need to place them at intervals of 2000 for x co-ordinates and 1000 for y co-ordinates to allow them enough room to deploy. (Assuming they are facing north or south)
o Direction – facing direction of unit 0 north 180 south
o GeneralRank – number of stars for general
o LeaderHonour – sets generals honour level
o UnitMon::1
o TroopType – this sets the type of unit and you can find all the unit names listed in the MTW folder under CRUSADERS_UNIT_PROD_11
o TroopNum – sets number of men in the unit. Default level is Bodyguard 20 Cavalry 40 Infantry 60 and Spears 100.
o TroopHonour - sets soldiers honour level
o Columns – sets initial width of formation
o CurveRadius::1
o FormationType::FORMATION_CLOSE or _OPEN
o MeleeMode::ENGAGE_AT_WILL or HOLD_FORMATION or SKIRMISH
o FatigueLevel::FRESH or TIRED
o HoldPosition::true or false. If true units will be set to hold at start of game.
o GeneralIsDaimyo::false
o ArmourLevel – set level of additional armour
o WeaponLevel – set level of additional weapons
o UnitTag:: allows you to group units together so that the ai can issue them instructions
o UnitEnd::
Programming the AI
There is a guide called AISCRIPTINGINSTRUCTIONS which is found in MTW/Battle/Batinit which tells you how to program the ai to behave differently to normal. This allows you to bring on reinforcements, set up an ambush or set different victory conditions. The code for these instructions is added to the end of the .adf file for each enemy faction but if you have more than one enemy faction you must add code to all of them. This is quite difficult so either stick with one faction or do not try to adjust the ai when using more than one enemy army.
TGA and .bif files
TGA files are the image that appears on your generals flag and your units flags. The .bif files are the icon that appears next to the army name on the starting screen. Alter them as below:
(1) Load up Photoshop, or some other program that can handle TGAs.
(2) Load up a TGA from the game to use as a template.
(3) Load up the image that you wish to use, in Photoshop.
(3) Resize the image that you wish to use to the same size as the TGA from
the game (32 pixels by 32 pixels).
(4) Paste ths over the TGA from the game.
(5) Go to "Save As", select as TGA (TARGA etc).
(6) Rename the file to that which you want to call it - do not save over the
original unless you specifically wish to replace that TGA in the game.
(7) Click save, and select 24 bit when you are given the option.
(8) Place this TGA in the correct historical battle folder if it is not already
there.
(9) Resize the TGA in Photoshop to 18 pixels by 20 pixels and save it as
something different e.g. "Temp1", again in 24 bit.
(10) Use the CA BIF/BUF utility (downloadable at the org) Purpgrab to
convert this to a BIF.
(11) Give this BIF the name of one of the protagonists in the battle whose
name is encoded in the BDF file (see DragonCrusader's guide).
(12) Place this in the appropriate historical battle folder, overwriting the
original if need be, ie. if you want to replace a pre-existing BIF.
(13) Have a drink, you should be done. Load it up and see
Notes
The historical battles supplied with the game store their text files elsewhere and I have been unable to find these so far. But the game works well enough with the text in the .bdf file.
Historical Campaigns
So you have mastered Historical Battles and are looking for a new challenge?
Historical Campaigns are very similar and consist of a series of historical battle folders and files inside a historical campaign folder. The Campaign Folder is located in MTW/Battle/Batinit/historical campaigns folder in with the rest of the historical campaigns. The Campaign folder contains the various battle folders and a HCF file a HCD file and any TGA and .bif files that you want to add icons and flags for your character.
HCF file
Contains the following which can be opened and saved with NoteTab.
//
// England 100 year war. (Campaign folder name)
//
CampaignStartpos::"early" (as per .bdf, use viking for VI campaigns)
NumBattlesInCampaign::3
BattleName::"Crecy" (these are the folder names of the battles in the campaign folder)
BattleName::"Poitiers"
BattleName::"Agincourt"
Predefined::true
CampaignName::"England 100 Years War" (text which appears on the campaign intro screen)
Description::"England_100yrs_War_Description_Label" (description that appears on the campaign intro screen. Write your own text in here)
SortOrder::1 (this is the position that the campaign occupies in the list of campaigns on the introduction screen. Add a number higher than the existing number of campaigns)
The .bdf for each battle
Each .bdf for the individual battles is slightly different in that the result line that contains the victory result has an addition to the end of it. This defines the next battle in the sequence. For example:
Result::2, alliances 5, style VICTORY, battle "Poitiers"
The final battle in the sequence replaces the next battle file name with the text …… VICTORY, end COMPLETED_UNLOCKED
Contributions from Dragoncrusader, Ambrosius Aurelianus
Historical battles have a number of advantages over Custom battles that means it is really worth the extra time it takes to create them.
• You can write you own text to add a story to your battle.
• You can position units anywhere on the map at the start of the game to get more complex battles.
• And best of all you can program the ai! Want the ai to ambush your forces in a mountain pass or fight a retreat across a wide plain or have the Vikings land from ships while your Saxons hurry up from inland or get the ai army to sally out from a castle so that you can fight outside. It can all be done with a bit of basic knowledge.
• You can change the look of your troops
The battle information is kept in the MTW/Battle/batinit/historical battles folder and an a readme file about the ai called AISCRIPTINGINSTRUCTIONS at MTW/Battle with some of the information files in MTW/Battle/Flags or MTW/Campmap/shields or MTW/Loc/Eng.
The way to create a new historical battle (HB) is to create a new folder in MTW/Battle/batinit/historical battles and name it with your new name. Copy the adf and bdf files and the tga image file from the Bannockburn folder. This will give you a simple template to overwrite.
The Battle Description File
• Rename the bdf file with your new battle name and open it with a simple text editor like NoteTab. Replace all references to Bannockburn with your new battle name – except the map.
o StartposName – this sets the factions that are available and is usually set at ‘early’. You only need to change it to ‘viking’ if you want to use factions from that part of the game
o Predefined –
o Title - write battle name in here
o Author – here is your chance for 2 minutes of fame
o Rating –
o Description – write in here any text that you want to appear on the introduction screen
o Conditions - write in here what conditions you have to fulfil to win the battle
o IntroFMV
o OutroFMV
o MapName - Change the MapName to a map of your choice.
o Architecture - Change Architecture AT_(DARK_AGE_EUROPEAN EASTERN_EUROPEAN ISLAMIC SOUTHERN_EUROPEAN WESTERN_EUROPEAN WINTER)
o Terrain - Change Terrain (ARID LUSH ROCK_DESERT SAND_DESERT TEMPERATE WINTER) You need to check that the map you are using will allow all these terrain types. Look in MTW/Battle/Maps and check the notes for each map. Battle may fail to appear on list if an incorrect terrain type is used.
o BattleType::BATTLE_TYPE_HISTORICAL
o Deployement – true or false does not seem to affect anything
o Season - Change Season (spring summer autumn winter) to fit the map.
o WeatherSequenceId - Number sets weather for battle 0 clear 1 clear 2 rain 3 Heavy Snow 4 light snow and fog 5 light snow 6 light snow 7 light snow 8 light snow 9 mist ( I cannot find where you get a sandstorm from!!!!!)
• Change Player details
o Add a new name
o First number is the faction(for early these are 0 Rebel 1 Almouhad 2 Byzantine 3 Danish 4 Egyptian 5 English 6 French 7 German 8 Italian 9 Polish 10 Russian 11 Spain 12 Turkish 13 Aragonese 14 Burgundy 15 Mongols 16 Hungarian 17 People of Novgorod 18 Papal 19 Sicilian 20 Swiss and for Viking they are 1 Irish 2 Mercians 3 Northumbrians 4 Picts 5 Saxons 6 Scots 7 Vikings 8 Welsh )
o Second number is the alliance number. Always set this number to the same as the faction of the main army for that side and then all the allied armies need to use the same number.
o LOCAL OR ARTIFICIAL sets whether this player is ai or human. You can only have one LOCAL army.
o “Text” is the army name and must relate to an .adf file. You need one .adf file for each army
o 0 no idea
o True/false true sets army to attacker, false to defender.
o Next two numbers are the general unit’s map co-ordinates and determines for your general the starting position of the camera.
o The final number is the direction of facing 0 is north and 180 is south
o Set culture to appropriate to faction - (MUSLIM PAGAN CHRISTIAN ORTHODOX) _CULTUR0045
o If you want to add more players do so here by copying and pasting the player section and then changing the details to how you want them. You can only have ONE army from each faction, so if for example you want to create two French armies, you would create the first as normal and then use another faction, say Burgundy as the second. In order to get the second army to look French, copy the TGA image file for the French from MTW/Battle/Flags and the .bif image file from MTW/Campmap/shields using the small size of file. Paste these files into the battle folder and rename them to match the army name of the Burgundian army. I am afraid that the unit shields on the battlefield will be that of the faction that you are using and since these are determined by unit it would be a huge amount of work to change them all. So pick a faction that is close to your own in style or Rebels or Swiss which are grey.
• If you want to define an area on the battlefield, say the keep of a castle add it here in this format:
//areas
Area::1, CIRCLE 15558 35193 2000
• Triggers - Change the “” text to what you want to see on the screen like: Trigger 1 : “Protect the king or lose the battle” Trigger 2 : “Do not let your army be routed” Trigger 3 : “Break the enemy army or rout them from the field.” Change the faction numbers to match the army ones.
• If you want to add new victory conditions– change the triggers or insert new ones. Read the AISCRIPTINGINSTRUCTIONS guide to understand how triggers works and the victory conditions are listed below:
o Conditions format is: ‘Trigger::1, BT_GENERAL DIED CAPTURED FLED, factions 6, LABEL "Protect the General or lose the battle", INVERT_CHECKBOX’.
o First section of Triggers can be
BT_GENERAL DIED and/or CAPTURED and/or FLED or BT_INCAPACITATE (to trigger when an army flees)
BT_LIMIT, TIME n seconds, (to trigger after a given time)
BT_CASTLE CAPTURED, num_areas 1, MEN 100, (to trigger capturing a given area of a castle with a certain number of men)
BT_TROOPS DESTROYED, COUNT 4 (to trigger after a certain number of units have been destroyed)
BT_AREA CAPTURED, area_ids 1, MEN 10, TIME 180, (to trigger after given area on the battlefield has been captured for a given period of time by a given number of men. Add MEN 1 FOE NO_MORE 0, to this string if you want to add the condition that they enemy must be destroyed first)
BT_AREA RELINQUISHED, area_ids 1, MEN AT_LEAST 40, (to trigger if you want the player to be defeated if he fails to hold onto an area with a given number of men/time)
BT_TROOPS DIED FLED CAPTURED, PERCENT 60, (to trigger after a set percentage of troop have been killed or routed)
o Second section determined the faction number
o Third section is the label that will appear on the victory conditions screen.
o Fourth section if left blank will tick the check box on the victory conditions screen or will leave it empty if contains INVERT_CHECKBOX
• Results – change the faction numbers to match the army ones.
• Groups – this links the triggers to the results, so you have to have a group that matches each trigger and then assign whether it is a victory result or defeat result.
• Save file as a .bdf file.
Army Description File
• Rename .adf so that they match the army names that you gave them in the .bdf file. Copy and paste to add further armies.
• Open an .adf file
• The file is a list of units and each unit is laid out as follows:
o UnitStart::"Unit"
o InitialLeaderName - gives the units a name
o IsGeneral – true or false with true setting unit as army general
o Position – two number co-ordinate on the map with the first number being the x co-ordinate and the second the y co-ordinate. The average map is about 50k by 50k so a co-ordinate of 10000 40000 would be in the top left hand corner of the map. When placing units together you need to place them at intervals of 2000 for x co-ordinates and 1000 for y co-ordinates to allow them enough room to deploy. (Assuming they are facing north or south)
o Direction – facing direction of unit 0 north 180 south
o GeneralRank – number of stars for general
o LeaderHonour – sets generals honour level
o UnitMon::1
o TroopType – this sets the type of unit and you can find all the unit names listed in the MTW folder under CRUSADERS_UNIT_PROD_11
o TroopNum – sets number of men in the unit. Default level is Bodyguard 20 Cavalry 40 Infantry 60 and Spears 100.
o TroopHonour - sets soldiers honour level
o Columns – sets initial width of formation
o CurveRadius::1
o FormationType::FORMATION_CLOSE or _OPEN
o MeleeMode::ENGAGE_AT_WILL or HOLD_FORMATION or SKIRMISH
o FatigueLevel::FRESH or TIRED
o HoldPosition::true or false. If true units will be set to hold at start of game.
o GeneralIsDaimyo::false
o ArmourLevel – set level of additional armour
o WeaponLevel – set level of additional weapons
o UnitTag:: allows you to group units together so that the ai can issue them instructions
o UnitEnd::
Programming the AI
There is a guide called AISCRIPTINGINSTRUCTIONS which is found in MTW/Battle/Batinit which tells you how to program the ai to behave differently to normal. This allows you to bring on reinforcements, set up an ambush or set different victory conditions. The code for these instructions is added to the end of the .adf file for each enemy faction but if you have more than one enemy faction you must add code to all of them. This is quite difficult so either stick with one faction or do not try to adjust the ai when using more than one enemy army.
TGA and .bif files
TGA files are the image that appears on your generals flag and your units flags. The .bif files are the icon that appears next to the army name on the starting screen. Alter them as below:
(1) Load up Photoshop, or some other program that can handle TGAs.
(2) Load up a TGA from the game to use as a template.
(3) Load up the image that you wish to use, in Photoshop.
(3) Resize the image that you wish to use to the same size as the TGA from
the game (32 pixels by 32 pixels).
(4) Paste ths over the TGA from the game.
(5) Go to "Save As", select as TGA (TARGA etc).
(6) Rename the file to that which you want to call it - do not save over the
original unless you specifically wish to replace that TGA in the game.
(7) Click save, and select 24 bit when you are given the option.
(8) Place this TGA in the correct historical battle folder if it is not already
there.
(9) Resize the TGA in Photoshop to 18 pixels by 20 pixels and save it as
something different e.g. "Temp1", again in 24 bit.
(10) Use the CA BIF/BUF utility (downloadable at the org) Purpgrab to
convert this to a BIF.
(11) Give this BIF the name of one of the protagonists in the battle whose
name is encoded in the BDF file (see DragonCrusader's guide).
(12) Place this in the appropriate historical battle folder, overwriting the
original if need be, ie. if you want to replace a pre-existing BIF.
(13) Have a drink, you should be done. Load it up and see
Notes
The historical battles supplied with the game store their text files elsewhere and I have been unable to find these so far. But the game works well enough with the text in the .bdf file.
Historical Campaigns
So you have mastered Historical Battles and are looking for a new challenge?
Historical Campaigns are very similar and consist of a series of historical battle folders and files inside a historical campaign folder. The Campaign Folder is located in MTW/Battle/Batinit/historical campaigns folder in with the rest of the historical campaigns. The Campaign folder contains the various battle folders and a HCF file a HCD file and any TGA and .bif files that you want to add icons and flags for your character.
HCF file
Contains the following which can be opened and saved with NoteTab.
//
// England 100 year war. (Campaign folder name)
//
CampaignStartpos::"early" (as per .bdf, use viking for VI campaigns)
NumBattlesInCampaign::3
BattleName::"Crecy" (these are the folder names of the battles in the campaign folder)
BattleName::"Poitiers"
BattleName::"Agincourt"
Predefined::true
CampaignName::"England 100 Years War" (text which appears on the campaign intro screen)
Description::"England_100yrs_War_Description_Label" (description that appears on the campaign intro screen. Write your own text in here)
SortOrder::1 (this is the position that the campaign occupies in the list of campaigns on the introduction screen. Add a number higher than the existing number of campaigns)
The .bdf for each battle
Each .bdf for the individual battles is slightly different in that the result line that contains the victory result has an addition to the end of it. This defines the next battle in the sequence. For example:
Result::2, alliances 5, style VICTORY, battle "Poitiers"
The final battle in the sequence replaces the next battle file name with the text …… VICTORY, end COMPLETED_UNLOCKED
Contributions from Dragoncrusader, Ambrosius Aurelianus