Results 1 to 15 of 15

Thread: Making Historical Battles

  1. #1

    Default Making Historical Battles

    I have hardly found info in the forums about the art of making playable Historical Battles. I'll try to place here some useful things I have learnt, and I hope people help to increase the info.


    0. Battle Editor

    Right-click your Rome shortcut, go to properties.
    At the end of the target line, type in: -enable_editor
    When you start up your game, You can launch the Editor from the Options menu.

    Official RTW Editor Documentation: http://www.twcenter.net/forums/downl...o=file&id=1162
    Tutorial: https://forums.totalwar.org/vb/showthread.php?t=114262
    Tutorial for MTW2 editor (similar to RTW editor): http://www.twcenter.net/forums/showthread.php?t=277519

    Tips:
    - Ctrl+Z does work in the Battle Editor (to Undo latest change).
    - You can change the text files and load the Historical Battle again without exiting the game. (Unlike campaign text files where you need to restart to test the changes).


    1. Related Folders

    Historical Battles (HB) are placed in the folder:
    \data\world\maps\battle\custom\

    And they load the map info from the files placed at the folder:
    \Data\world\maps\base\

    In AlexanderTW, for Custom and Historical battles to work propely, the file:
    \data\text\Battlefields_regions_and_settlement_names.txt
    must fit the descr_regions.txt of the previously mentioned \base folder.
    And you need a DS file placed in this folder:
    \data\world\maps\campaign\Battlefields\descr_strat.txt

    The map image shown in the Battle Editor when you choose the battle location is:
    \data\menu\map_composite.tga


    2. File map.wfc

    It is generated by the Battle Editor and it saves information about the landscape in the tile where the battle is fought: heights, terrain type (vegetation, rocks...), and custom feature models.
    The climate (weather and vegetation type) is read from the \base\ map, as well as the terrain that sourrounds the playable tile.
    If there is no map.wfc present, the terrain of the playable tile is also read from the \base\ map.
    So this file is not really needed unless you have changed the terrain with the Battle Editor, or you are using a different base map.

    Settlements:
    If you place a settlement with the Battle Editor, the terrain is not smoothed arround the city and you can see rough gaps in the borders. And the smoothing tool does not work arround the city borders, so it is hard to adjust the terrain properly.
    I have discovered that, just removing the file map.wfc, the terrain arround the city appears in battle automatically smoothed (like it appears in custom or campaign battles). Better rename it because the Battle Editor needs the map.wfc file to open the HB properly.

    Settlement Plans:
    It seems custom Settlement Plans Sets cause some troubles in HB. These custom cities appear ok in the Battle Editor, but when you play the battle, they load the default settlement plan (not the custom one), even when the custom underlay/overlays are loaded properly.
    At least, I have been unable to use custom settlement plans unless they are the default set.


    3. File descr_battle.txt

    Playable
    The Editor uses to add "fe_non_playable" to all new Armies. Remove it if you want this Army to be playable.
    Also, the Faction must be placed in the "playable" section at the top of the file.

    Weather
    You can force the climate and weather of the battle by using this command:
    Code:
    constant_weather_and_time ( day_time 22.00, year_day 0, temperate_summer, rain_summer_shower, duration	24.00 )
    In stead of the default:
    Code:
    variable_weather_and_time ( day_time 22.00, year_day 0, duration	24.00, weather_seed	0 )
    The allowed climates and weatherevents are those from the file descr_daytypes.txt. The main limitations I have seen using constant_weather_and_time are:
    - The sky clouds can not be selected so you will play always under the same sky.
    - The weather condition does not change along the battle.

    While using variable_weather_and_time, by changing the the weather_seed you can:
    - Set different initial clouds
    - Set the initial weather and random changes along the battle
    - But it is not possible to change the climate, and too much time consuming to find the apropriatte seed.

    Reinforcements
    Reinforcing armies must be defined at the bottom of all other armies. And you can set the time delay until they appear:
    (6 minutes = 0.100 at "reinforcement_time")
    Code:
    reinforcement	carthage, 2
    reinforcement_time	0.100
    
    deployment_area_point	-150.419, -845.459
    deployment_area_point	-150.502, -750.647
    deployment_area_point	-285.924, -748.704
    deployment_area_point	-289.506, -843.962
    
    unit			0, -163.266, -801.528, 85, formation_type square, formation_width 20.882
    The reinforcement army is automatically set to non playable, and it does not seem possible to force them to be controllable by the human player.
    They appear placed in the defined deployment area as all other armies.

    The reinforcements sometimes stand still when they arrive (and they do not engage in battle) if the character is set to be a "general" in stead of a "named general".
    The reinforcements appear at the begining (no delay) when his alliance is set to be the "atacking" faction in a siege, while it works fine if they are set to "defending".

    Sieging
    If there is a non-ambiental settlement in the map, the Editor automatically adds "sieging" at the end of each attacking army.
    I don't know why, but sometimes the battle can not be loaded (KTM) unless you delete this line manually. I think it is related to the type of settlement used.
    Anyway, the AI do not need this command to act properly in battle. You just need to:
    - give to the sieging alliance the "attacking" flag. Else, they will fight as a non siege battle.
    - give them the objetive "condition capture_major_settlement". Else, I'm not sure if the AI really tries to capture the settlement or it just attacks the factions inside.
    - give at least one siege equipment to each army in the attacking alliance. Else, this minimal equipment could appear in the middle of the map.

    AI behavior
    All alliances can be set to "defending". But only one of them can be set to "attacking".
    It seems this flag affects the behavior of the AI in battle, at least in a siege battle. But I have been unable to get the AI to stand still like he does in campaign when he is the defender.

    As soon as the AI takes control of the army, he is going to change the position of all his units to fit one of the formations defined in the file descr_formations_ai.txt.
    It seems the formation chosen by the AI is based on the number and type of units (as always), but I'm almost sure he also takes into account the initial position of the units. At least, just changing the position of some units, I have been able to force the AI to use a different formation with the same army.

    If his alliance is flagged as "can_deploy", The AI sometimes places his units automatically in the deployment area, ignoring the location you defined initialy. I'm still not sure exactly in which cases, but I think it is when the AI can't find a formation that fits the initial placement.
    - If the AI is the defender in a siege, it seems he always try to deploy personally his units.
    - If the AI is the attacker in a siege (with siege engines), be carefull while using "can_deploy", since it can cause a CTD, and it is not sure the AI will deploy the units.
    - In other cases, I have been able to force one full army to be automatically deployed by the AI by choosing a dissordered (and overlapping) initial position for the units. But it rarely works.


    Siege historical battles are a bit buggy in RTW, specially if the AI is the attacker. And the main reason is that You have deployed the units, not the AI.
    You will see there are no vanilla HBs where the AI controls the assaulting faction... But I'll try to add here some tips that allowed me to set up the AI for a siege assault:
    - When there are several units capable to attack the gates (rams and elephants), the first unit listed in the first army of the alliance will perform the attack. After that, I think the best elephant unit is chosen to attack the gates. (the distance to the gate is not taken into account)
    - When there are several units capable to assault the walls (towers and scales), the best units are chosen to attack the main walls. I thought each tower/scale would attack the closer wall... but it is not true.
    - If you have given the siege engines to the wrong units (units the AI do not consider the best ones based on the siege formation), then extra siege engines will appear in the centre of the map, and the chosen units will run to catch them at the start of the battle (spoiling completely the behavior of the AI).
    The type of these extra engines depends on the engines you asigned to the first attacking army.
    - If you don't want to give siege engines to some of the attacking armies, I suggest to convert them into reinforcements.
    In fact, I suggest not to give siege engines to reinforcement armies since I think it could cause CTDs.
    - Finally, if you find troubles to get rid of those annoying extra engines appearing in the center of the map for no apparent reason... try reducing to the minimum the type of siege engines used by the first army of the alliance, then try to asign those engines to the best units of the army (even if bodyguards).
    Multiplayer
    For the battle to be playable online you need to add "multiplayer" after the name of the battle. Optionally you can add "not_singleplayer" so it does not appear in the single player browser.
    Code:
    battle		Chaeronea_MP_2v2 multiplayer not_singleplayer
    playable
    	macedon
    	greek_cities
    end
    nonplayable
    end
    If you find some trouble to get the HB working online, I would suggest:
    - to check there are more than one faction playable: checking the factions are placed in the "playable" section, and removing "fe_non_playable".
    - to convert the reinforcements into standard armies.
    - to remove the "can_deploy" option if a siege battle.
    - to dissable the scripts. (I don't think scripts work online, though I never tested them)


    4. Linked Historical Battles for Alexander TW
    In Alexander TW it is possible to make series of historical battles where you need to win one battle to unlock the next battle. You just need:
    - to copy inside the folder of the custom battle the void file named "locked", if you want this battle locked by default
    - file unlock.txt with the name of the previous battle needed to unlock this battle
    - file order.txt with the order of this battle in the series


    5. Scripts
    You can add a script to the battle, by adding these lines at the bottom of descr_battle.txt (and placing the script file in the same folder):
    Code:
    script
    descr_script.txt   ;write here the name of the script file
    Unit Label
    They are defined in the prepare_for_battle section of the script, and they are used by the rest of script commands to identify each unit.
    Code:
    label_unit 1 0 18	UNITLABEL
    - First number is the Alliance
    - Second is the Army inside this Alliance
    - Third is the unit number inside this Army

    Docudemon Commands
    You can use into the script the commands from the docudemon file: Unofficial scripting documentation
    The problem is that once you give a order to a unit, the ai stops managing it. And when the unit finalizes the action, it becomes idle, waiting for another order from the scripts.
    If you want to release a unit back to AI or player control, you can use the command:
    (Note it also unlabels the specified unit)
    Code:
    release_unit UNITLABEL
    It is hard to control the units (or groups) one by one along the battle, so I have hardly used those "order" commands. I have found much more simple, and usefull, these other commands:

    - unit_group_enable_automation GRP_NAME true
    When this command is called, the group move quickly his units to fit one formation from formation_ai.txt. Then they keep this possition waiting for more orders. Unlike other "order" commands, with this one the AI is still active, so they still fire proyectiles and use his special habilities like warcry, skirmish...
    (it is the same than when the player gives the control of a group to the ai)

    - unit_group_enable_automation GRP_NAME false
    This command restores the standard AI mode

    Between these commands, it is possible to use a couple of commands not included in the CA docudemon, that I have seen in Alexander TW scripts. (So they might work only under Alex engine):

    - unit_group_automate_attack GRP_NAME PLAYER_UNIT
    Note the difference with the standard command "unit_group_order_attack_group/unit"

    - unit_group_automate_defend_position GRP_NAME 194 83 100
    This one places the units of the group sourranding this location, with their back pointed to the position: X, Y, Distance.

    Example

    I place here an script that I have used succesfully to force the AI to play defensive.
    I also include a Script that makes a general invulnerable unless he is engaged in melee battle. Useful to protect him from arrows.
    Code:
    script
    
    prepare_for_battle
    
    	ai_active_set off   ;dissable ai
    
    	label_unit 0 0 0	ELF_0
    	label_unit 0 0 1	ELF_1
    
    	label_unit 0 1 0	NUM_0
    	label_unit 0 1 1	NUM_1
    	label_unit 0 1 2	NUM_2
    
    	label_unit 1 0 0	SAURON
    	label_unit 1 0 1	ORC_1
    	label_unit 1 0 2	ORC_2
    	label_unit 1 0 3	ORC_3
    	label_unit 1 0 4	ORC_4
    
    	define_unit_group GRP_ELF ELF_0 ELF_1
    	define_unit_group GRP_NUM NUM_0 NUM_1 NUM_2
    	define_unit_group GRP_SAURON SAURON
    	define_unit_group GRP_ORC ORC_1 ORC_2 ORC_3 ORC_4
    
    while ! I_BattleStarted		; Wait for deployment
    end_while
    
    	ai_active_set on   ;re-enable ai
    	pause_battle	; The battle starts in pause mode
    
    ; DEFENSIVE GROUP
    
    	if not I_LocalFaction seleucid
    		unit_group_enable_automation GRP_ELF true	;Sets defensive mode
    	end_if
    
    		monitor_conditions I_IsUnitGroupEngaged GRP_ELF
    			if not I_LocalFaction seleucid
    				unit_group_enable_automation GRP_ELF false	;Release standard AI mode if some unit in the group attacked
    			end_if
    
    			terminate_monitor
    		end_monitor
    
    		monitor_conditions I_IsUnitGroupEngaged GRP_NUM
    			if not I_LocalFaction seleucid
    				unit_group_enable_automation GRP_ELF false	;Release standard AI mode if the other group in his alliance engaged
    			end_if
    
    			terminate_monitor
    		end_monitor
    
    ; INVULNERABLE GENERAL
    
    	if not I_LocalFaction romans_julii
    		console_command invulnerable_general "Sauron"	;Character Name
    	end_if
    
    		monitor_event BattleEnemyUnitAttacksPlayerUnit not I_LocalFaction romans_julii
     			if I_IsUnitEngaged SAURON
    				console_command vulnerable_general "Sauron"
    				point_at_unit_pos SAURON
    			end_if
     			if not I_IsUnitEngaged SAURON
    				console_command invulnerable_general "Sauron"
    				remove_battle_map_arrow
    			end_if
    		end_monitor
    
    		monitor_event BattlePlayerUnitAttacksEnemyUnit not I_LocalFaction romans_julii
     			if I_IsUnitEngaged SAURON
    				console_command vulnerable_general "Sauron"
    				point_at_unit_pos SAURON
    			end_if
     			if not I_IsUnitEngaged SAURON
    				console_command invulnerable_general "Sauron"
    				remove_battle_map_arrow
    			end_if
    		end_monitor
    
    while I_InBattle
    end_while
    ; this final bucle is needed so the "monitors" keep working all along the battle
    
    end_script
    6. Things I would like to know

    - Which is the effect of supporting_armies? (Num of Supporting Armies in the Editor).
    - If there is a way to give to the player the control of another army. For example, like the reinforcements that comes in campaign and they are added to the player units.
    - If there is a proper way to force the AI to deploy automatically his units.
    Last edited by Bardo; 11-27-2009 at 01:19.

  2. #2

    Default Re: Making Historical Battles

    Thanks Bardo,

    This is alot of help, I'm trying to figure out how to make a historical battle for a modification now, started a thread about it and Makanyane was kind enough to lend some assistance.

    When I get through the first stages I'll be sure to look your thread up again

  3. #3

    Default Re: Making Historical Battles

    You can ask me if you have some doubt, Wundai.

    I have updated the first post with my latest discoveries, mainly for siege battles and scripting.

  4. #4

    Default Re: Making Historical Battles

    When I play a siege battle made in editor, routed defending units run out of the town and towards the map end - instead of to the town square.

    How to fix this? Is it possible?

    Another problem is that it seems that there is a limit of minimal number of soldiers for each type of unit.

    For cavalry it is 8 soldiers per unit (when I created a unit with 4 horsemen, it had 8 horsemen in the actual battle anyway).

    For most of infantry - 13, and for large infantry units (such as warband, phalanx pikemen, etc.) - 20.

    Is it possible to change this limit so that I can make cavalry units with 1 - 7 soldiers each, etc.?
    Last edited by Domen; 02-04-2013 at 16:39.

  5. #5

    Default Re: Making Historical Battles

    The number of soldiers that you select in the battle editor is someway averaged (I don't remember exactly how) by the number of soldiers set in export_descr_units.txt.
    If you want single soldier units in an historical battle, give 6 soldiers to the unit in export_descr_units.txt (the minimum), and then select 1 soldier in battle editor (or descr_battle.txt).
    For the rest of units, I use to select in battle editor a multiple (2x) of the number of soldiers from export_descr_units.

    About routing units, I see them running towards the plaza in my historical battles, but I do not know how to change it. I'd suggest to check the owner of the settlement, the home faction, the defending alliance, and the victory conditions, just in case. For example, in my case:


    Code:
    --> faction	carthage
    ...
    settlement
    {
    	level huge_city
    	tile 149 80
    
    	year_founded 1
    	fortification 4 carthaginian, walls 0 towers 0 gates 2 gate_defences 0
    	population 24000
    	battle_pos -480.000 835.951 160.000	rotation_0	0
    	plan_set default_set
    	faction_creator carthage
    }
    
    ...
    
    battle	149, 80
    
    --> home_faction	carthage
    --> alliance	can_view	carthage, defending
    alliance	can_view	romans_julii, attacking
    
    ...
    
    
    objectives
    
    alliance 0
    condition destroy_or_rout_enemy
    
    alliance 1
    condition capture_major_settlement 
    condition destroy_or_rout_enemy
    Last edited by Bardo; 02-05-2013 at 05:38.

  6. #6

    Default Re: Making Historical Battles

    Ok, thanks for this info! I will try to fix these routing units bug and report the results here.

    But meanwhile, I have one more question.

    Do you know how to change the level of towers and gates without changing the wall level? I made a large town with Wooden Walls but I wanted reinforced gates and arrow towers - but it seems that nothing changed, and gates are still normal wooden (rather than reinforced wooden) and towers are just watch towers (rather than arrow towers). No matter if I change this in editor or in descr_battle.txt - nothing happens.

    And when I increase the fortification level - I automatically get stone wall, rather than wooden wall with better towers / gates.

    What numbers should i put in here to get Wooden Wall with Arrow Towers and Reinforced Gates?:

    fortification 4 carthaginian, walls 0 towers 0 gates 2 gate_defences 0
    But - anyway - it seems that only changing the number of "fortification level" actually does something in game.

    When I change the other 4 numbers (walls, towers, gates, gate_defences) - it doesn't have effect in the actual game.
    Last edited by Domen; 02-09-2013 at 20:39.

  7. #7

    Default Re: Making Historical Battles

    It is that line for sure what you have to change, but I do not remember exactly which numbers.
    The values are linked to those of the EDB file, the standard for Wooden Wall are:
    Code:
    fortification = wall_level 1
    walls = I don't know the effect ??
    towers = tower_level 1
    gates = gate_strength 1
    gate_defences =  gate_defences 0
    I guess you are looking for:
    Code:
    fortification 1 carthaginian, walls 0 towers 1 gates 1 gate_defences 0
    Last edited by Bardo; 02-11-2013 at 14:14.

  8. #8

    Default Re: Making Historical Battles

    Thank you Bardo!
    Last edited by Domen; 02-14-2013 at 02:00.

  9. #9

    Default Re: Making Historical Battles

    Hi Bardo

    I was just wondering how do I add front end movies to historical battles like what they do in RTW:Alex?

  10. #10

    Default Re: Making Historical Battles

    @Domen: I remembered how to force units to rout towards the plaza instead of to the borders of the map. You have to select the defending alliance in the battle editor and to enable the flag "no_withdraw".
    It is also possible to change it manually in descr_battle, for example:

    battle 102, 118
    variable_weather_and_time ( day_time 6.00, year_day 0, duration 24.00, weather_seed 0 )

    home_faction romans_brutii
    alliance can_view romans_brutii, defending
    alliance can_view germans, attacking

    army romans_brutii, 0, no_withdraw, supporting_armies 0
    @Antelope: I never tried it, but I guess you just need to place a file named "frontend_movie.mpg" in the folder of your historical battle,
    same than you may place an image named "snapshot.tga". Alex-TW.exe should automatically load them.

  11. #11

    Default Re: Making Historical Battles

    Thanks!

  12. #12

    Default Re: Making Historical Battles

    Do you know how to add a fort in the custom battle?

    When I add a fort using just tools from the editor, the fort disappears when I try to play this battle.

    So it seems that something has to be edited in / done with the txt. files of the battle?

  13. #13

    Default Re: Making Historical Battles

    Quote Originally Posted by Bardo View Post
    @Domen: I remembered how to force units to rout towards the plaza instead of to the borders of the map. You have to select the defending alliance in the battle editor and to enable the flag "no_withdraw".
    It is also possible to change it manually in descr_battle, for example:



    @Antelope: I never tried it, but I guess you just need to place a file named "frontend_movie.mpg" in the folder of your historical battle,
    same than you may place an image named "snapshot.tga". Alex-TW.exe should automatically load them.
    Just one more thing.

    Apart from what you wrote ("no withdraw"), you must also remove the "ambient settlement" line of text.

    Otherwise, units are still not withdrawing to the town center (even with "no withdraw" added).

    "Ambient settlement" has to be removed (it is in the same line as "battle [coordinates - for example 102, 118]").

  14. #14

    Default Re: Making Historical Battles

    Thanks guys for the help, I have found out that for it to work you must have a a win, lose loading screen plus a front end map.tga

  15. #15

    Default Re: Making Historical Battles

    Hey whats up? I'm fairly new to the Battle Editor and I just recently started to make some Historical maps (For example Thermopylae). The problem is, when I save the map and go to play it every faction is listed "Non Playable." So i go into the directory in my RTW folder Data/world/maps/battle/custom to edit my map to make all the factions playable but I didnt see my map there or anywhere in the data file. I was wondering how one could fix this issue and be able toplay a custom Historical map?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO