Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Thread: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    It turns out that territorial expansion penalty is amazingly easy to mod - not just to turn it off, but even to reverse.

    Spoiler Alert, click show to read: 


    No esf modding here - it's fresh campaign after taking one province.

    The root cause of mass confusion is that DBEditor simply ignores db files it doesn't understand instead of displaying some indicator of their existence. Now I don't know anything about Windows programming so I wrote my own DB editor in Ruby (more like schema autodetector + tsv mass import/export), and there it was - ultimate control over campaign AI diplomacy.

    To allow everyone else to do this, attached is manually updated DB.xsd with information about some of these new tables.

    The most important one is diplomacy_attitudes_tables. Fields are:

    • String - factor name
    • Int32 - limit
    • Int32 - change per turn
    • Int32 - initial change

    There's only one limit not two (min, max), and as far as I can tell it is upper/lower limit depending on sign of change-per-turn parameter, possibly leading to a surprise. So 0 limit and positive drift means effect can only be 0 or negative; 0 limit and negative drift means effect can be 0 or positive.

    Some examples:

    • (alliance, 80,1,30) - initial alliance gets you +30, increasing by one per turn until maxing out at +80.
    • (third_party_assassination, 0, 1, -5) - having your agent detected in assassination attempt makes your relationship with everyone worse by -5 per accident. Penalty will keep drifting by one point per turn until hitting 0 limit.
    • (assassination, 0, 2, -50) - much worse penalties against primary target - it's a separate effect
    • (war, -200, -2, -140) - war initial penalty is -140, but instead of being reduced until 0, it keeps getting worse until reaching -200. This might be one of the reasons why AI so stubornly insists on not ending long dormant wars. Something like (0, 2, -140) would resnore much needed sanity here.
    • (war_dragged_by_ally, -130, -2, -70) - allies are less annoyed than country directly attacked.
    • (peace, 0, 2, 120) - ending a war nearly restores neutral relationship, getting AI to agree is a different matter altogether.
    • (annexed_territory, 0, 1, -30) - this is the biggest failure of ETW diplomacy - go ahead and replace it with (0,0,0) to get rid of it altogether, or reduce it to something sane like (0, 2, -10). Big penalty but rapid return to normal like (0, 5, -30) would make sense as well. A very interesting experiment would be reversing it - screenshot comes from game at (100, -5, 50) - these values are testing only, but positive rapidly decreasing territorial expansion factor might change ETW from long futile wars to series of rapid opportunistic wars of opportunity and rapidly realigning network of alliances. I'm probably dreaming here, but fixing this is a necessary step.
    • (government_type, 0, 2, 0) - I'm not sure if limit does anything here, 2 is how quickly same government type relationships get changed following revolution.


    Actual values are in diplomatic_relations_government_type_tables:

    • String - government type 1
    • String - government type 2
    • Int32 - initial value after revolution
    • Int32 - final value

    I've seen this table used before (used as in "filled with zeroes"), but it's only interesting in combination with diplomacy_attitudes_tables. If you put very big value of government_type factor in it, relationships of post-revolutionary governments will behave sanely. I think it works for both positive and negative changes equally, but somebody should test it first.

    Or you could put high initial value for all government combination (again with big attenuation) - to model everybody giving a lot of benefit of doubt to the new regime even if they hated the old one. No matter what goes here, attenuation must be a lot higher than in vanilla.

    Another small one diplomatic_relations_religion_tables:

    • String - religion 1
    • String - religion 2
    • Int32 - diplomatic relationships
    • Float - religious unrest per 1% of such combination

    Unfortunately this diplomatic factor is not obviously usable - values you get at start of campaign are in esf, and there's no way to change religion mid-game to make it use new values. There might be a trick if you dig deeper.

    Religious unrest is pretty cool to mod, 0.5 means 50 points of unrest for 100%-wrong-religion territory.

    There's a lot more fresh stuff I found in pack files but let's just start with this.

  2. #2
    Teleros's Avatar Laetus
    Join Date
    Sep 2010
    Location
    United Kingdom
    Posts
    17

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Firstly, just wanted to give a big thank you for working this one out .

    Secondly... been trying out some changes in "diplomacy_attitudes", however there are still some pretty stiff penalties for breaking treaties in the game. In spite of the fact that, as part of my testing, I set it such that there were (or should be) no permanent negative diplomacy modifiers, a look through the saved game ESF file shows me that the penalties still have a limit (in my case, I attacked the Iroquois & Hurons as Britain: -200 for breaking treaties, -100 limit).


    Edit: Seems to be just the European powers that are reacting like this... odd, since I've not declared war on any of them, generally tried to be peaceful in Europe, and always backed allies up in wars (and no, they don't like me much either ).
    Last edited by Teleros; September 20, 2010 at 06:44 PM.
    Clear ether!

  3. #3
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Quote Originally Posted by Teleros View Post
    Firstly, just wanted to give a big thank you for working this one out .

    Secondly... been trying out some changes in "diplomacy_attitudes", however there are still some pretty stiff penalties for breaking treaties in the game. In spite of the fact that, as part of my testing, I set it such that there were (or should be) no permanent negative diplomacy modifiers, a look through the saved game ESF file shows me that the penalties still have a limit (in my case, I attacked the Iroquois & Hurons as Britain: -200 for breaking treaties, -100 limit).
    Initial change and drift per turn seem to work very straightforwardly.

    It requires more research to find out how limits work, and how entries in diplomacy_attitudes relate to underlying factors. diplomacy_factor_strings_tables (schema is just strings) has fewer entries than diplomacy_attitudes - for example there's only one "war" entry, and no separate "war_dragged_by_ally", and I found no junction table connecting these two.

    Limits definitely do not force values from esf back into range. I think they only limit further changes from attitudes table.

    I wrote this post just as soon as I got it to work, I don't know how far we can go with it. Please write about any new findings, I'm sure there's plenty more to discover.

  4. #4
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Quote Originally Posted by Teleros View Post
    Edit: Seems to be just the European powers that are reacting like this... odd, since I've not declared war on any of them, generally tried to be peaceful in Europe, and always backed allies up in wars (and no, they don't like me much either ).
    Territorial expansion is definitely linked with faction's continent of interest somehow. I think it works via regions_tables - taking Rumelia (cont_europe) pisses off European factions, but taking Anatolia (cont_middle_east) doesn't.

    I'm not sure what determines region of interest (there's no obvious junction table involving continents) - it might be faction capital's continent, or something is esf - perhaps someone figured it out already.


    There might possibly be other such relationships between diplomacy and factions' region, for treaty breaking etc., not just expansion.

  5. #5
    Teleros's Avatar Laetus
    Join Date
    Sep 2010
    Location
    United Kingdom
    Posts
    17

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Mmm, thing is though that I've not been expansionist in Europe at all. I just conquered Mysore 5 mins ago - the Marathas are okay with it, but all of Europe hates me XD .
    Clear ether!

  6. #6
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    After some re-testing it's no longer obvious if third value of annex_territory matters as long as it's <0 - penalty seems to be the same. Second value is entirely reliable at making penalty return to 0 faster.

  7. #7

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Hey, Im new here and I dont know how to edit these files. Could someone give me an already edited file to make things easier for me? Thanks

  8. #8

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Hey, anybody still here?

  9. #9

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Quote Originally Posted by Kratos2488 View Post
    Hey, anybody still here?
    Hi, I managed to do the mod, but how to post it here so that u can download????

  10. #10
    Foederatus
    Join Date
    Aug 2011
    Location
    London, United Kingdom
    Posts
    30

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    erm... how do I open the file?

  11. #11
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    You need to download DB Editor, and use that.

  12. #12
    Foederatus
    Join Date
    Aug 2011
    Location
    London, United Kingdom
    Posts
    30

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    i know I must sound like an idiot, but how do I get the editor to open it?? its not showing up where it should..

  13. #13
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Ask in DB Editor's thread, they should explain it much better than I can.

    Or you could simply use one of the mods which tries to fix diplomacy (including territorial expansion penalty).
    I think Darthmod reduces it, most others probably do too these days.

  14. #14
    Foederatus
    Join Date
    Aug 2011
    Location
    London, United Kingdom
    Posts
    30

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    alright, cheers

  15. #15
    Foederatus
    Join Date
    Aug 2011
    Location
    London, United Kingdom
    Posts
    30

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    are you sure you just cant try and explain it? Im sure your quite capable

  16. #16
    Foederatus
    Join Date
    Aug 2011
    Location
    London, United Kingdom
    Posts
    30

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    its ok, I worked it out for myself

  17. #17

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Hey, so the DB editor thread is huge and I dont really have time to read through its entirety. How, once you have edited and saved a new diplomacy_attituded_table, do you get the game to recognize and use the new table?

  18. #18
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    alepou: DB Editor creates .pack with updated versions of db tables you edited. You need something like Mod Manager to make the game read .pack files.

  19. #19

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    All of the keys I'm seeing are read-only. I can't edit anything, including diplomacy.

  20. #20
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Territorial expansion penalty FIXED! Oh, and the rest of AI diplomacy fixed too.

    Quote Originally Posted by stp52x View Post
    All of the keys I'm seeing are read-only. I can't edit anything, including diplomacy.
    DBEditor by default doesn't edit existing files. You can override it if you want, but it's better to create a new .pack file with a copy of tables you want to edit and change it there.

Page 1 of 2 12 LastLast

Posting Permissions

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