Results 1 to 7 of 7

Thread: How to add additional terrain effects for units! Useful for Combat modifications!

  1. #1

    Default How to add additional terrain effects for units! Useful for Combat modifications!

    What this tutorial will show you?
    - How to add different effects to various ground types affecting various stats of your units during a battle.

    Why?
    - In the moment, terrain is effecting only the speed of a unit, even if the terrain tooltip during battles is telling you something different.
    Wouldnīt it be nice if Archers standing in a forest would suffer an accuracy penalty? And charging in a dense forest shouldnīt be as effective as on flat ground like grass etc.

    Tables we are working with:
    DB->ground_type_to_stat_effects_tables->ground_type_to_stat_effects
    and
    DB->ui_unit_stats_tables->ui_unit_stats

    Tools you need:
    PFM 3.03 (I donīt explain how to use it, daniu description does that by far better)

    Letīs get started:
    1. open the data_rome2.pack with PFM
    2. navigate to DB ==> expand DB ==> look for ground_type_to_stat_effects_tables ==> expand it ==> ground_type_to_stat_effects


    Explanation:
    affected_stat ==> well itīs the unit_stat that will be changed
    ground_type ==> it the terrain that triggers the stat change
    multiplier ==> defines if a stat recieves a bonus or a malus

    As you can see, the only thing terrain or ground types are currently effecting are the unit speed and thats the reason there is only a unit_ground_type_movement_modifiers_tables in the DB
    The difference between these two tables:
    ground_type_to_stat_effects defines the stat changed without making any difference between the different unit types available, so the effect you set here is set for ALL UNITS!

    unit_ground_type_movement_modifiers_tables defines the effect of terrain for different unit types, so you can finetune the universal stat effect from ground_type_to_stat_effects but itīs limited to movement speed.
    For all other effects we would need unit_ground_type_(enter a stat)_modifiers_tables. Donīt know if itīs possible to add new ones.

    3. Extract the table with PFM
    4. Create a new mod PFM (name it, choose a folder/directory etc.)
    5. Add the extracted table with PFM to your new mod

    To add new stat_effect you must know the names of the different stat_effects for units that are available
    You can find these here:
    data_rome2.pack-> DB-> ui_unit_stats_tables-> ui_unit_stats


    All available unit_stats
    Spoiler Alert, click show to read: 

    scalar_bracing
    scalar_entity_acceleration_modifier
    scalar_entity_charge_speed_modifier
    scalar_entity_deceleration_modifier
    scalar_spotting_range
    stat_accuracy
    stat_ammo
    stat_armour
    stat_bonus_vs_cavalry
    stat_bonus_vs_elephants
    stat_bonus_vs_infantry
    stat_charge_bonus
    stat_first_strike
    stat_health
    stat_melee_attack
    stat_melee_damage_ap
    stat_melee_damage_base
    stat_melee_defence
    stat_missile_damage
    stat_morale
    stat_reloading
    stat_shield_armour
    stat_shield_defence
    stat_ship_health
    stat_ship_move_speed
    stat_speed
    stat_weapon_damage
    stat_weapon_range


    In our example we will add a new stat for the terrain type forest and the effect should be, that all units that have a bonus_vs_cavalry (spear units mostly) should be more effective fighting Cavalry in wood.

    6. Add a new row and do the following entries:

    affected_stat ==> stat_bonus_vs_cavalry
    ground_type ==> forest
    multiplier ==> 1,3

    Now all units with a bonus_vs_cavalry will receive an additional bonus if they fight cavalry in a forest, thats it. By the way, bonus_vs_cavalry is a bonus applied to a weapon and not a unit, and the base bonus_vs_cavalry can be set under db==> melee_weapons_tables ==> melee_weapons

    7. Add whatever you like, save and copy the new mod in your data folder activate it with the modmanager if you saved it as mod.pack type.


    8 Enjoy your changes!
    The nice thing, you will see all terrain type effects during a battle, point your mouse over a forest and wait a sec till the tooltip expands and you see that your changes are active.

    As always, feel free to use the example mod in your own, play around with it and crediting me would be nice.


    Download example mod:
    http://www.2shared.com/file/KZbkgs_G..._terrain_.html
    Last edited by Andonai; September 23, 2013 at 07:43 PM.

  2. #2
    sinople's Avatar These Romans are crazy!
    Join Date
    Apr 2007
    Location
    France
    Posts
    2,447

    Default Re: How to add additional terrain effects for units! Useful for Combat modifications!

    Thank you

  3. #3

    Default Re: How to add additional terrain effects for units! Useful for Combat modifications!

    Great work. Very useful for improving the combat mechanics.

    Pity we can't differentiate between troop types to give effects.

    I wonder if you can have negative multipliers? (thus turning a positive effect into a negative one on a different terrain)
    Last edited by Southern Hunter; September 28, 2013 at 08:02 PM.

  4. #4

    Default Re: How to add additional terrain effects for units! Useful for Combat modifications!

    Quote Originally Posted by Southern Hunter View Post
    Great work. Very useful for improving the combat mechanics.

    Pity we can't differentiate between troop types to give effects.

    I wonder if you can have negative multipliers? (thus turning a positive effect into a negative one on a different terrain)
    As long as CA doensnīt add other ground_type_to_stat_effects tables or we are able to implement our own, we canīt differentiate between the troop types. Itīs sad, because this would really enhance combat mechanics.
    Negative multipliers are not needed for negative effects, just use a multiplier < 1, and the unit will recieve a negative effect.

  5. #5

    Default Re: How to add additional terrain effects for units! Useful for Combat modifications!

    Tangentially related, but what is stat_first_strike?

    Also, is there any indication that new ground types can be created? I'm thinking that stat_weapon_range should be modified for units that are on hills or elevated. I imagine this could require an editing of the battlemaps, depending on how the game recognises the ground types. I just can't believe anyone would go through the trouble of differentiating scrubs and road, and not also do the same for height elevations.
    Currently following these promising mods - Imperia Antiquitatis by Splenyi
    Traits, Talents, and Toadies
    by Hellbent
    Real Roman Reforms
    by Aodh Mor
    Unit Icons project
    by Bullgod
    Also recommended:
    City Sack, Liberation and Diplomatic Options
    by Dresden

  6. #6
    Magnar's Avatar Artifex
    Join Date
    Jul 2013
    Location
    The last place you look
    Posts
    4,370

    Default Re: How to add additional terrain effects for units! Useful for Combat modifications!

    Sorry to burst your bubble here, but a large number of the stat changes here are not possible. You can add them to the table and launch the game but there are actually no effects to many of the stats in game

  7. #7
    Hetairos's Avatar Roma Surrectum II
    Join Date
    Jan 2014
    Location
    Serdika
    Posts
    1,511

    Default Re: How to add additional terrain effects for units! Useful for Combat modifications!

    Quote Originally Posted by Magnar View Post
    Sorry to burst your bubble here, but a large number of the stat changes here are not possible. You can add them to the table and launch the game but there are actually no effects to many of the stats in game
    Firstly, my appreciation to the post it is a great effort.

    Now, I know even more stats, links, dependencies and tables that do not really work (e.g. most stuff that is linked to campaign movement). Is this deliberately ignored by CA, a bug that might get fixed once the Assembly Kit is out of Beta or just some things that can't be changed because of hardcoded stuff?

    I am sorry for being a newbie in this topic. I am just curious if those things can be fixed by CA so we can use them.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •