PDA

View Full Version : Diplomacy, I wonder...



Kobal2fr
12-19-2006, 08:10
I've noticed that at the beginning of the desc_campaing_ai_db.xml file, there is this declaration/explanation of variables :

<trusted_ally_fs_threshold float="0.8"/> // min threshold for how much we like the target faction to consider them a trusted ally
<trusted_ally_target_fs_threshold float="0.8"/> // min threshold for how much does the target faction like us to consider them a trusted ally
<trusted_ally_gs_threshold float="0.2"/> // min threshold for how trustworthy is the target faction to consider them a trusted ally


But in the actual code, these thresholds are all set to 999.0. Yet, the trusted ally status is checked a bunch of times, in triggers such as :

<decision_entry>
<!--
If trusted ally, use defaults
-->
<min_entry trusted_ally="true"/>
<faction_attitude can_force_invade="false"/>
</decision_entry>

If I am correct, I think this means the AI does not care for alliances AT ALL in its invasion decisions, or rather that the triggers checking for trusted alliances are effectively neutered. Which would account for much of the diplo grief and non-sensical aggressions.

Has anyone tried setting these variables to the suggested declaration defaults (0.8, 0.8, 0.2) ?

R'as al Ghul
12-19-2006, 15:45
It seems it isn't used. The only time it appears after the initial commentary it says:

// GLOBAL AI PARAMS (currently disabled, i.e. range = [-1.0, 1.0]) //


R'as

Kobal2fr
12-19-2006, 17:24
I think the "currently disabled" comment is intended to make explicit the fact that 999.0 values disable the variable, not that the variable itself is disabled. There are a number of checks along the lines of "if trusted ally = true then can_force_invasion = false". Maybe the trusted ally part is coded elsewhere, but if it does use the thresholds, then the checks will always come out false because they're set to 999.0 instead of working parameters.

I set them to 0.8 0.8 0.2 in my current campaign, and the game hasn't gone ker-klunk because of it, which tells me it's not an unfinished feature like the armour upgrade is.

I'll see wether my stronger alliances really last this time around. If they do... well then we'll have a very good basis for a CherryVanilla Diplomacy mod, using subtle tweaks here and there instead of Shaba Wangy's ten-ton hammer :yes:.

Kobal2fr
12-19-2006, 23:34
SUCCESS !!!

Not only are these floats implemented, they do just what they say they do : if you are above the thresholds and allied, AI will not invade, period (exceptions listed below).

Here's how I tested it :

- set the floats to -1 -1 -1. Meaning : whatever relations are, all factions consider everyone as trusted allies.
- start a campaign as the HRE, notorious for being gangbanged very fast.
- Made a lot of diplos, and allied with as many factions as possible ASAP (could probably have modded descr_strat.txt to make me start as allied to everyone right off the bat now that I think about it)
- proceeded to destroy my own faction from within. Turned every single city into castle to ruin economy and pop growth. Destroyed every single unit save for family members, whom I pooled in Nurnberg (furthest from any frontline). Gave all treasury to Pope and neighbours. Destroyed every single troop-producing building. In other words, hoisted a big "I'M WEAK ! CRUSH ME !" flag.

Results :
- I end-turned mindlessly through 72 turns before calling it quits.
- I only suffered 3 total attacks: one from Milan on Staufen, one from Venice on Bologne, one from Hungary on Vienna.
- all these settlements were free of troops, so they took them without a fight, but in 2/3 cases I had a diplomat nearby. Told them I'd give ceasefire+trade for the province back, and since I was trusted they accepted, then re-allied next turn. I don't know what caused these invasions at all but I surmise they were mission-driven, as they all happened in the 30th-32th turn, and I know from the .xml that the AI proper only kicks in at turn 30. I waited a few turns before sending a diplomat to Venice in third case, and my "give bologne + peace + trade" was demanding (not very demanding though - they still trusted me) and they wouldn't give it back. I suppose I could have bought it back, but I was very, very bankrupt at that time.
- In those 3 cases, every single other faction I was allied with instantly DoWed the offender, and the pope insta-excommed them. I was their trusted ally, some bugger attacked me, they attacked it as true allies would. The second I re-allied with them, every single other faction declared cease-fire.
- After that, for the next 40 turns, I was not attacked once, even though I was listed as number 17 in all power curves (my treasury was a whopping -57.000 at one point :laugh4:) and my settlements were all defenseless. The AI did pass armies through my lands without mil rights, but they were only on their way to battle with another faction, they never paid me any attention. Hungary actually chased rebels in my lands.
- Save for diplomatic tangles occuring during said 3 assaults and power blocks forming themselves, AI factions have never betrayed each other. They only DoWed the enemies of their allies.

--------------

So there you have it : to fix diplomacy, all you have to do it twiddle with three integers, no more, no less. All you have to do is, in fact, make it possible to have trusted allies.

A trusted alliance means "we'll help him at any cost, no matter what, and never betray our friendship". This is what we players expect from an alliance, or understand the word "allied" to mean. To the AI, a non-trusted alliance only means "if his borders are lightly guarded and we're not the weakest faction around, no need to garrison either", plus the occasional help, and the overtime boost to relations eventually leading to trusted alliance, but it will still consider its allies lands as possible targets of opportunity in the meantime.

An alliance will be trusted if all three standings are above the floats (global reliability, faction A friendliness to faction B, faction B friendliness to faction A).

I'd say 0.2 for global standing is OK : that stands for "Reliable or better", it takes some work/peacetime to get there, and any betrayal sends you down big time

0.8 for faction standing is perhaps a bit steep - it takes a lot to get relations to Excellent/Perfect, and it also takes some work to keep them there... And while the player could probably get and keep trusted allies through florin and maps, the AI factions wouldn't between themselves, if that is a real concern at all. But then again, AI factions tend to be untrustworthy (on the global standing scale I mean) on the whole, so they probably wouldn't get trusted alliances anyway...

What I do not know is how the player faction is treated regarding faction standing, that is to say : since "trusted ally" checks both "do we like them" and "do they like us", what is the setting for the player, and how does the AI determine wether the player's faction like them or not ?

My uninformed guess would be that in the specific case of the player, then their own like/dislike is mirrored. That's what I would have done in any case, had I written the code. But I don't know if there is a way to make sure of it.

Is there a console command you can input that will return fs values ?

Merlin's Apprentice
12-20-2006, 00:02
hmmm wonder what this change will do using Shaba's mod

alpaca
12-20-2006, 00:15
Good research Kobal2fr :2thumbsup:

R'as al Ghul
12-20-2006, 12:04
Very nice find! That opens up some possibilities.
Please keep at it and I hope you didn't take my initial post as discouragement (obviously you didn't ) as I didn't want to sound negative.
:2thumbsup:

R'as

dopp
12-20-2006, 15:02
Hmm, this looks interesting. I agree that the less amount of tweaking the better, unless the system is completely borked. I'll take a look at the folder myself but would you happen to know which line(s):

1. Controls the "relations decay automatically on H or VH".
2. Controls how much relations bonus you can gain from giving a gift.

I would like to mod out the decay altogether and also lessen the gift bonus. I play VH/VH and it's an annoyance having to gift my allies $$$ every turn to keep them pally with me.

Kobal2fr
12-20-2006, 19:05
@Merlin : no offense to her, but her mod is really heavy-handed and clunky.

It basically makes the AI passive until the player attacks it.

It forces it to respect any alliance for 300 turns no matter what the player did or does or the relationships between them, forces it to respect ceasefires for 30 turns no matter what it's best interests are, removes all aggression as long as the AI likes another faction even a teensy tiny bit... and she's added a slew of "more religious war" conditions that either can't work, or would heavily disturb the AI and make it sillier still if they did (which I doubt).

It's not good diplomacy, it's AI passivation.

I rewrote an .xml file from RTW scratch that should :
- make the AI actually defend its cities (for some reason, the guy that copied the AI from rome removed all defense priorities, which means the AI always uses default value (ie : defense minimal),
- make trusted alliances work while keeping untrusted alliance working until there's no common enemy at which point the AI will consider it's ally as just another opportunity target,
- do away with the silly turn 30 diplomatic hiccup,
- make the AI attack rebels smartly,
- remove blockhead 1 turn blockades and 2 unit siege gone next turn,
- make them accept/offer ceasefires when they're run down

and (hopefully, but I doubt the parameters are really implemented)
- remove aggressions between cath factions that are both >5 on the pope-o-meter (unified front against the muslims and excommed pariahs).

I'll try it on for size tonight, see how it fares. If I like what I see, I'll release it.

Kobal2fr
12-20-2006, 19:12
Hmm, this looks interesting. I agree that the less amount of tweaking the better, unless the system is completely borked. I'll take a look at the folder myself but would you happen to know which line(s):

1. Controls the "relations decay automatically on H or VH".
2. Controls how much relations bonus you can gain from giving a gift.

I would like to mod out the decay altogether and also lessen the gift bonus. I play VH/VH and it's an annoyance having to gift my allies $$$ every turn to keep them pally with me.

relations decay is in descr_faction_standing.txt

;------------------------------------------
Trigger 0092_Update_Easy_Difficulty
WhenToTest FactionTurnStart

Condition CampaignDifficulty = easy

FactionStanding exclude_factions { } normalise 1.0 50

;------------------------------------------
Trigger 0093_Update_Normal_Difficulty
WhenToTest FactionTurnStart

Condition CampaignDifficulty = medium

FactionStanding exclude_factions { } normalise 0.0 50

;------------------------------------------
Trigger 0094_Update_Hard_Difficulty
WhenToTest FactionTurnStart

Condition CampaignDifficulty = hard

FactionStanding exclude_factions { } normalise -0.5 50

;------------------------------------------
Trigger 0095_Update_Very_Hard_Difficulty
WhenToTest FactionTurnStart

Condition CampaignDifficulty = very_hard

FactionStanding exclude_factions { } normalise -1.0 40

But as far as I know that's the only effect of campaign difficulty, that and agents efficiency. There's nothing in the AI that makes it "better" when on VH, it just attacks the player more.

gift bonus I'm not sure, there is both something about it in the same file that can be modded

Trigger 0081_F_Obvious_Bribe ; fired for every 100 gold given as gift
WhenToTest Forgiveness

Condition ForgivenessName = FC_OBVIOUS_BRIBE

FactionStanding target_faction 0.14

But I'm not sure how it really works, because a 1000 gold gift certainly doesn't make your relations go from neutral to perfect...

There's also a modifier for it in descr_diplomacy.xml (give_payment), but I wouldn't touch it there because it would also affect other types of cash negociations (ie trade rights worth etc...)

Kobal2fr
12-20-2006, 19:35
Hmmm there is weirdness here :

; Make factions get a case of the 'tall poppy' syndrome. get narky about the larger factions
;------------------------------------------
Trigger 0086_Update_Tall_Poppy1
WhenToTest FactionTurnStart

Condition FactionHasRank
and FactionScorePercent overall > 90
and FactionScoreRank overall <= 1

FactionStanding exclude_factions { } normalise -1.0 90

;------------------------------------------
Trigger 0087_Update_Tall_Poppy2
WhenToTest FactionTurnStart

Condition FactionHasRank
and FactionScorePercent overall > 80
and FactionScoreRank overall <= 3

FactionStanding exclude_factions { } normalise -1.0 135

;------------------------------------------
Trigger 0088_Update_Tall_Poppy3
WhenToTest FactionTurnStart

Condition FactionHasRank
and FactionScorePercent overall > 70
and FactionScoreRank overall <= 5

FactionStanding exclude_factions { } normalise -1.0 180


; Make factions try and band up with smaller factions
;------------------------------------------
Trigger 0089_Update_Band_Together1
WhenToTest FactionTurnStart

Condition FactionHasRank
and FactionScorePercent overall < 30
and FactionScoreRank overall > 3

FactionStanding exclude_factions { } normalise 1.0 60

;------------------------------------------
Trigger 0090_Update_Band_Together2
WhenToTest FactionTurnStart

Condition FactionHasRank
and FactionScorePercent overall < 20
and FactionScoreRank overall > 4

FactionStanding exclude_factions { } normalise 1.0 45

;------------------------------------------
Trigger 0091_Update_BandTogether3
WhenToTest FactionTurnStart

Condition FactionHasRank
and FactionScorePercent overall < 10
and FactionScoreRank overall > 5

FactionStanding exclude_factions { } normalise 1.0 30

Doesn't this look strange to you ? If I understand it correctly, the TallPoppy2 means a faction will be hated if it has a total score >80%, but isn't 1st, second or third ? Am I correct in thinking all of the FactionScoreRank checks in these triggers are the opposite of what they should be ?!

Rhedd
12-20-2006, 20:15
No, that should mean that you have to be over 80% and MUST be 1st, 2nd, or 3rd.

It seems backwards, but it's looking at the raw number, not the rank. Rank 15th > 2nd, because 15 > 2.

So, Tall Poppy 1 requires 90% and 1st place, Tall Poppy 2 requires 80% and 3rd place or higher, and Tall Poppy 3 requires 70% and 5th place or higher.

Now that I'm done with that, let me say, WOW! Nice work, Kobal2fr! I'd really like to see that file you said you made. Don't forget to release it today, if it's working. ^_^

I hate over-modding, myself. We seem to want the same sorts of things fixed in the same ways. I never played Rome, though, so I'm just learning how to mod for this engine.

Question: You said, "0.8 for faction standing is perhaps a bit steep - it takes a lot to get relations to Excellent/Perfect..." How do you know what numerical value equates to which relation level? Is there a place to look to find out? How about for the global standing levels?

Kobal2fr
12-20-2006, 20:47
Aaaah, of course. Silly me.

As to your question, well, I don't, but it seems logical.

Faction standing is on a 1.0 to -1.0 scale, 1.0 being ultraperfect and -1.0 being hate_him_and_everyone_who_looks_like_him. So is global standing.

So it would make sense that each different ingame word corresponds to a fs threshold, probably something like -0.8/-0.6/-0.4/-0.2/0/0.2/0.4/0.6/0.6/0.8

I didn't find anything about that in the files, and I don't have any way to know for sure yet though... I really have to lay my hands on a list of all console commands :/

Or try out alpaca's .strings.bin reader to find out what's in the gibberish files...

alpaca
12-21-2006, 00:03
From descr_diplomacy.xml

<diplomacy_text_fields>
<text_field name="relations">
<text_entry>
<upper_threshold value="-0.8"/>
<diplomacy_text name="DT_RELATIONS_0"/>
</text_entry>
<text_entry>
<upper_threshold value="-0.6"/>
<diplomacy_text name="DT_RELATIONS_1"/>
</text_entry>
<text_entry>
<upper_threshold value="-0.4"/>
<diplomacy_text name="DT_RELATIONS_2"/>
</text_entry>
<text_entry>
<upper_threshold value="-0.2"/>
<diplomacy_text name="DT_RELATIONS_3"/>
</text_entry>
<text_entry>
<upper_threshold value="0.0"/>
<diplomacy_text name="DT_RELATIONS_4"/>
</text_entry>
<text_entry>
<upper_threshold value="0.2"/>
<diplomacy_text name="DT_RELATIONS_5"/>
</text_entry>
<text_entry>
<upper_threshold value="0.4"/>
<diplomacy_text name="DT_RELATIONS_6"/>
</text_entry>
<text_entry>
<upper_threshold value="0.6"/>
<diplomacy_text name="DT_RELATIONS_7"/>
</text_entry>
<text_entry>
<upper_threshold value="0.75"/>
<diplomacy_text name="DT_RELATIONS_8"/>
</text_entry>
<text_entry>
<upper_threshold value="0.9"/>
<diplomacy_text name="DT_RELATIONS_9"/>
</text_entry>
<text_entry>
<diplomacy_text name="DT_RELATIONS_10"/>
</text_entry>
</text_field>

Rhedd
12-21-2006, 03:43
Thank you, alpaca.

I try to keep my noob questions to a minimum, but now I have one more. ^_^

Lines like <diplomacy_text name="DT_RELATIONS_0"/> are obviously referencing entries in another file that holds the text strings. Which file would that be?

I've been looking for the text string files (like the one with ancillary descriptions, for instance) and haven't had any luck.

Rhedd
12-21-2006, 03:49
Yay. I'm not cool enough to be allowed to edit my posts. -_-

I just realized that "alpaca's .string.bin reader" might be the key to answering my question. Yes?

Now, where to find such a thing...

Kobal2fr
12-21-2006, 11:25
Aaaah thanks alpaca. I figured those lines were only about using different spoken lines etc..., had missed the thresholds.

Rhedd : the DT_RELATIONS are used in \data\text\diplomacy.txt.strings.bin, and \data\text\diplomacy_speech.txt.strings.bin which tells the game what to say/display in what conditions

mesut
12-21-2006, 16:55
Is there anything like a reader for .string files?

Regards
GrandViZ

alpaca
12-21-2006, 17:13
Is there anything like a reader for .string files?

Regards
GrandViZ
No reader but a converter: https://forums.totalwar.org/vb/showthread.php?t=75229

Rhedd
12-22-2006, 05:55
Thanks for the info, Kobal. That's exactly what I was looking for.

So... what happened to that .xml file you mentioned back in post #9? ^_^

dopp
12-24-2006, 16:55
Erm some more quick questions:

1. What's a shadow faction and why does the code make it never ask for peace or protectorate?

2. What do the AI invasion priorities do?

3. What's the difference between invade_opportunistic and invade_immediate?

4. Looking over SW's mod I noticed that she replaces all these lines:

can_force_invade="false"

With:

can_force_invade="false" invade="invade_none"

What's the difference?

Kobal2fr
12-24-2006, 17:21
- Not sure 100% what a shadow faction is, but my guess would be "those factions you have to destroy in a short campaign", or perhaps "the factions that need to destroy you to win a short campaign". They don't want peace with you because you're out to get them anyway.

- Invasion priorities do squat per se. It's just higher and higher values so that a given condition overrules other conditions further down the checks, that is to say that when there are two "valid" conditions, but one more threatening that the other, the AI acts only on the threatening one.

- Not sure, again. That's not something you can test as easily. I'd say invade_immediate is "attack with what you got, no matter what", while invade_opportunistic is "attack if you're stronger and he's weak", or "attack if you find yourself in a position to do so right now, without taking long term problems into account", but that's just conjecture at this point.

4 - nothing. Invade=none is the default so you never need to specify it. Well, it should be, only the default is just commented-on empty faction-decision. My guess would be that the AI reverts to invade_none whenever it's not specifically told to do something, but I put invade_none invade_priority=50 in the default, just in case. The default was also clear in RTW.

Rhedd : it's about done, but I'm trying to deal with the naval invasion problem post-patch, as it seems to defy logic a little bit : it invades, but still wants peace because it doesn't share borders. Only when said invasion captures its target does the AI become sensible again, and naval invasions don't seem to be triggered by the same stuff as land ones (ie borderstrength balance etc... don't apply obviously).
Plus the antitrait thing derailed my campaign testing and got me back into modding... again :)

I'll probably end up posting my file and asking you guys to test it for me.

dopp
12-25-2006, 03:46
Rhedd : it's about done, but I'm trying to deal with the naval invasion problem post-patch, as it seems to defy logic a little bit : it invades, but still wants peace because it doesn't share borders. Only when said invasion captures its target does the AI become sensible again, and naval invasions don't seem to be triggered by the same stuff as land ones (ie borderstrength balance etc... don't apply obviously).

The dangers of wish-fulfillment; we asked to see more of it, CA obliged, but since the original team has most likely been broken up to work on other projects, the integration was not seamless.

EDIT: Maybe this line says something?

can_force_invade="true" :: can naval or forced invasion settings overwrite invade parameters

Re Berengario I
12-29-2006, 11:59
- Not sure 100% what a shadow faction is, but my guess would be "those factions you have to destroy in a short campaign", or perhaps "the factions that need to destroy you to win a short campaign". They don't want peace with you because you're out to get them anyway.


I'm pretty sure a shadow faction is a faction flagged so in descr_sm_factions.txt. If you have BI you could find factions flagged this way like Eastern Empire Rebels and so on. Basically it made a faction acquire every settlement which rebels from the shadowed faction plus other side effects.

Valentine82
12-31-2006, 22:43
Do you think we can download a fixed dipomacy for cherry vanilla like with your Traits file?

:bump:

Alexander the Pretty Good
01-03-2007, 04:45
I'll second that bump.

lastofthelight
01-03-2007, 07:32
This sounds like really good stuff - I've been peering around the forums for a week or so now (just recently registered to post though) - trying to make the game run as efficiently as possible.

So, what your saying here is - it sounds like the alliance part of the code was /turned off/ during development (at least effectively turned off) and they forgot to switch it back on?

And all I have to do to fix it is go into the .xml file and change those 9999 values to the reccomended ones? I've been peering around, but I'm not much of a coder type - I just want to make the switch as quickly and easily as possible. I have the xml file opened right now, and I'm looking around but well, once more - not much of a coder type. I see the part at the beginning where...


Actually, as I type this I've figured it out - I think. I'll explain what I'm doing for any other "stupid newbies" like me reading this. I searched through the file and found:

<!--
///////////////////////////////////////////////////////////
// GLOBAL AI PARAMS (currently disabled, i.e. range = [-1.0, 1.0]) //
///////////////////////////////////////////////////////////
-->

<trusted_ally_fs_threshold float="0.8"/>
<trusted_ally_target_fs_threshold float="0.8"/>
<trusted_ally_gs_threshold float="0.2"/>


All of the above were set to 9's, like you mentiond - and like the code notes, the values of 999 effectively disabled them.

So, hopefully my alliances should hold now. I was getting rather annoyed...I had 2 marriage alliances with Byzantium, was assisting them against Venice in a war, and was giving them tribute and they still broke the alliance. I'll see how this goes.


BTW: You guys here are awesome, doing all this research. KUDOS KUDOS KUDOS!!!

Kobal2fr
01-05-2007, 20:41
I'm pretty sure a shadow faction is a faction flagged so in descr_sm_factions.txt. If you have BI you could find factions flagged this way like Eastern Empire Rebels and so on. Basically it made a faction acquire every settlement which rebels from the shadowed faction plus other side effects.

Hmmm, then it's probably just a leftover, because that's the first place I checked and there's no shadow factions defined in there.



Do you think we can download a fixed dipomacy for cherry vanilla like with your Traits file?

My comp's still somewhat on the fritz, so I can't test it yet, but it's in the works !


So, what your saying here is - it sounds like the alliance part of the code was /turned off/ during development (at least effectively turned off) and they forgot to switch it back on?

Something like that, yes. Or maybe they deliberately turned it off to make the AI more challenging/aggressive/treacherous.

And to answer the question : well, fixing the variables is a big step forward in and of itself, because with it on you can finally expect long standing alliances to mean something, but the AI will still not be all that sensical, which is where my upcoming fix will come in, hopefully.

To make it more clear : with the default values, an alliance will become trusted (that is to say, meaningfull even when not in a common war against a third faction) if your global standing is above 0.2 (which is "Inconstant" in the French version, so probably something like "Wavering" in English); and your relations with said faction are above 0.8, which is between "Very Good" and "Excellent". 0.75 is probably better than 0.8, since it's the "Very Good" threshold, meaning you'll know more precisely when the alliance is trusted or not.

alpaca
01-06-2007, 17:06
Just a short info: when you set the can_force_invade attribute to false for all invasion decisions, the AI won't do those silly attacks on the player anymore that are dependent on peace time, etc.

You probably already figured that out, but I thought it might help somebody.

lastofthelight
01-07-2007, 08:21
What exactly are you talking about?

alpaca
01-07-2007, 14:59
You know where it says that a special case exists in code to force an attack on the player if he is at peace with everybody? That's what I'm talking about.

Kobal2fr
01-10-2007, 10:49
@alpaca : if I understand the code correctly, if you set "can_force_invade = false" in all invasion decisions, then the AI won't invade, period. Ever. Doesn't it ?

As to the special case for attacking if at peace thingy, I'm convinced it's nonexistent, it's just the original coder saying "if you want to do this, this is the place in the file to do it so that it'll work". The phrase itself is commented, and there's no actual code to go with it, while for instance the "Special case exists here in code for not allowing invasion of trusted allies" which existed in the "mapping of old AI params" at the end of the file was replaced in the actual code by a line doing just that. I believe those are instructions about how to do something specific, rather than descriptions of stuff happening elsewhere or somehow hardcoded.

alpaca
01-10-2007, 15:31
@alpaca : if I understand the code correctly, if you set "can_force_invade = false" in all invasion decisions, then the AI won't invade, period. Ever. Doesn't it ?

As to the special case for attacking if at peace thingy, I'm convinced it's nonexistent, it's just the original coder saying "if you want to do this, this is the place in the file to do it so that it'll work". The phrase itself is commented, and there's no actual code to go with it, while for instance the "Special case exists here in code for not allowing invasion of trusted allies" which existed in the "mapping of old AI params" at the end of the file was replaced in the actual code by a line doing just that. I believe those are instructions about how to do something specific, rather than descriptions of stuff happening elsewhere or somehow hardcoded.
No, it invades. The invade decisions like invade_immediate still work.

And the code does exist. I have repeatedly been attacked for no reason at all by the AI and a lot of these attacks didn't even make sense - more often than not the AI even sued for peace a few turns after when I asked them.
This stopped after I changed the code to stop forced invasions. However, I think that naval invasions stopped again, too. But that's not a huge issue for me, if I want them I can script them - those the AI did were often not sensible anyways.

Sarastro
01-11-2007, 22:12
As to the special case for attacking if at peace thingy, I'm convinced it's nonexistent.

Agreed - aside from anything else, everyone is permanently at war with the rebels, so a faction entirely at peace never exists?

PS I've also played lategame campaigns where I'm by far the most powerful, everyone else is allied or neutral to me, and nobody ever attacks, so it is possible.

alpaca
01-12-2007, 14:38
Nonetheless, I was often attacked by the AI for no reason and without any sense (especially when naval invasions were involved) and this stopped after I put can_force_invade=false in every invasion decision.

sivlar
01-12-2007, 20:00
Regarding the descr_diplomacy file, it seems to be kind of screwy.

Has anyone been able to decipher what all the cost modifier values mean or determine? Seems they are all set to 1.0 and none negative.

I noticed almost all of them are set to the same cost modifier value for both offers and demands. I assume that the faction and global standing tags are the increase of that standing if the offer is accepted though?

Offers </item>
<item name="offer_trade_rights">
<cost modifier="1.0"/>
<faction_standing modifier="0.25"/>
<global_standing modifier="0.25"/>
</item>
<item name="offer_military_access">
<cost modifier="1.0"/>
<faction_standing modifier="0.25"/>
<global_standing modifier="0.25"/>
</item>
<item name="offer_map_information">
<cost modifier="1.0"/>
<faction_standing modifier="0.0"/>
<global_standing modifier="0.0"/>
</item>
<item name="offer_yearly_payment">
<cost modifier="1.0"/>
<faction_standing modifier="0.25"/>
<global_standing modifier="0.25"/>
</item>
<item name="offer_cede_region">
<cost modifier="1.0"/>
<faction_standing modifier="0.25"/>
<global_standing modifier="0.25"/>
</item>
<item name="offer_attack_faction">
<cost modifier="1.0"/>
<faction_standing modifier="0.25"/>
<global_standing modifier="0.25"/>
</item>
<item name="offer_threat_of_attack">
<cost modifier="1.0"/>
<faction_standing modifier="0.25"/>
<global_standing modifier="0.25"/

Demands </item>
<item name="demand_map_information">
<cost modifier="1.0"/>
<faction_standing modifier="0.0"/>
<global_standing modifier="0.0"/>
</item>
<item name="stopping_demand_payment">
<cost modifier="1.0"/>
<faction_standing modifier="0.0"/>
<global_standing modifier="0.0"/>
</item>
<item name="demand_yearly_payment">
<cost modifier="1.0"/>
<faction_standing modifier="0.0"/>
<global_standing modifier="0.0"/>
</item>
<item name="demand_cede_region">
<cost modifier="1.0"/>
<faction_standing modifier="0.0"/>
<global_standing modifier="0.0"/>
</item>
<item name="demand_attack_faction">
<cost modifier="1.0"/>
<faction_standing modifier="0.0"/>
<global_standing modifier="0.0"/>
</item>

Then of course the area of whether or not the AI will accept. Seems a few threshold values are there and some are missing.

<demeanours>
<!--
<demeanour_state name="ai_accepts">
<demeanour_entry>
<upper_threshold upper_thresh="0.1"/>
<diplomacy_text name="DDS_ACCEPT_LOW"/>
<character_voice name="Offer_Accepted_Close"/>
</demeanour_entry>
</demeanour_state>
-->
<demeanour_state name="new_offer">
<demeanour_entry>
<upper_threshold value="-5.0"/>
<diplomacy_text name="DDS_NEW_OFFER_WORSE"/>
<character_voice name="New_Offer_Worse"/>
</demeanour_entry>
<demeanour_entry>
<upper_threshold value="5.0"/>
<diplomacy_text name="DDS_NEW_OFFER_NEUTRAL"/>
<character_voice name="New_Offer_Neutral"/>
</demeanour_entry>
<demeanour_entry>
<diplomacy_text name="DDS_NEW_OFFER_BETTER"/>
<character_voice name="New_Offer_Better"/>
</demeanour_entry>
</demeanour_state>
<demeanour_state name="ai_accepts">
<demeanour_entry>
<upper_threshold value="0.0"/>
<diplomacy_text name="DDS_ACCEPT_EXTORTION"/>
<character_voice name="Offer_Accepted_Extortion"/>
</demeanour_entry>
<demeanour_entry>
<upper_threshold value="1.0"/>
<diplomacy_text name="DDS_ACCEPT_LOW"/>
<character_voice name="Offer_Accepted_Close"/>
</demeanour_entry>
<demeanour_entry>
<upper_threshold value="10.0"/>
<diplomacy_text name="DDS_ACCEPT_MED"/>
<character_voice name="Offer_Accepted_Standard"/>
</demeanour_entry>
<demeanour_entry>
<diplomacy_text name="DDS_ACCEPT_HIGH"/>
<character_voice name="Offer_Accepted_Generous"/>
</demeanour_entry>
</demeanour_state>
<demeanour_state name="ai_declines">
<demeanour_entry>
<upper_threshold value="-10.0"/>
<diplomacy_text name="DDS_DECLINE_HIGH"/>
<character_voice name="Offer_Declined_insulting"/>
</demeanour_entry>
<demeanour_entry>
<upper_threshold value="-1.0"/>
<diplomacy_text name="DDS_DECLINE_MED"/>
<character_voice name="Offer_Declined_Standard"/>
</demeanour_entry>
<demeanour_entry>
<diplomacy_text name="DDS_DECLINE_LOW"/>
<character_voice name="Offer_Declined_Close"/>
</demeanour_entry>
</demeanour_state>
<demeanour_state name="ai_rejects">
<demeanour_entry>
<upper_threshold value="-10.0"/>
<diplomacy_text name="DDS_REJECT_HIGH"/>
<character_voice name="Offer_Rejected_insulting"/>
</demeanour_entry>
<demeanour_entry>
<upper_threshold value="-1.0"/>
<diplomacy_text name="DDS_REJECT_MED"/>
<character_voice name="Offer_Rejected_Standard"/>
</demeanour_entry>
<demeanour_entry>
<diplomacy_text name="DDS_REJECT_LOW"/>
<character_voice name="Offer_Rejected_Close"/>
</demeanour_entry>
</demeanour_state>
<demeanour_state name="ai_counters">
<demeanour_entry>
<upper_threshold value="-10.0"/>
<diplomacy_text name="DDS_COUNTER_INSULTING"/>
<character_voice name="Offer_Countered_Insulting"/>
</demeanour_entry>
<demeanour_entry>
<upper_threshold value="-1.0"/>
<diplomacy_text name="DDS_COUNTER_STANDARD"/>
<character_voice name="Offer_Countered_Standard"/>
</demeanour_entry>
<demeanour_entry>
<diplomacy_text name="DDS_COUNTER_CLOSE"/>
<character_voice name="Offer_Countered_Close"/>
</demeanour_entry>

Might explain why the AI never accepts anything most all of the time during diplomacy. I would like to know what all the values do though if anyone has toyed around with them.

alpaca
01-13-2007, 00:42
If you ask me, the demeanours are only links to the audiovisual representation and the game figures out the decisions in hard code.
About the cost modifiers: I don't know if they actually do anything... Didn't test it, anyways.

Foz
01-14-2007, 22:02
Agreed - aside from anything else, everyone is permanently at war with the rebels, so a faction entirely at peace never exists?

PS I've also played lategame campaigns where I'm by far the most powerful, everyone else is allied or neutral to me, and nobody ever attacks, so it is possible.
Everyone is permanently at war with the rebels... but the various checks for how many enemies a potential target of attack already has take this into account. I just read one in the file that sets up conditions for immediate invasion based on:

- The target faction being at war with us
- We have at least 2x his frontline strength
- He outproduces us
- He is at war with more than one faction

The code is this:


<decision_entry>
<!--
if we're at war && we've more than twice his frontline strength && he outproduces us && he is
at war with more than one faction, then >>> invade immediate
-->
<min_entry stance="AtWar" frontline_balance="2.0" target_num_enemies="3"/>
<max_entry production_balance="1.0"/>
<faction_attitude invade="invade_immediate" invade_priority="750"/>
</decision_entry>

As you can readily see, target_num_enemies="3" is in the min_entry line, indicating that the target faction must have at least 3 enemies in order to be considered being at war with "more than one faction." Clearly this indicates that war with rebels + this faction is not enough to be considered multiple faction enemies, and the trend seems to continue through the file. So, it seems safe to say that constant war with rebels is already accounted for in the code, and conditions based on peace will likely ignore your rebel enemies.

That being said, I would point out that the "attack the guy just because he's been at peace too long" code in fact is not implemented in the file. It looks like this in the file:


<!--
<decision_entry>
SPECIAL CASE EXISTS HERE IN CODE FOR FORCING ATTACK ON HUMAN IF AT PEACE WITH EVERYONE FOR TOO LONG (hard = 4 turns, normal = 10 turns, easy = 20 turns)
</decision_entry>
-->

There is no min_entry or max_entry, and the entire decision entry is commented out. This actually happens several other places in the file, and is a very common development technique. The idea is you lay the file out in descriptive text to begin with, and then go back and fill in the actual code to accomplish that text as you get to it. You can see everything that isn't implemented in the file because it is ALL CAPS with commented out decision_entry tags, where the actually implemented items have only their text descriptions comments out, and those descriptions are converted to normal lower-case text. This fact means that some code to force invade the player just because he has been at peace in fact does NOT exist, and the attacks we witness must be due to the AI not trusting our alliance (this is a duh if you have left the default AI params disabled as they came) and triggering one of its normal attack schemes because it is threatened by us or perceives itself to have an edge against the given faction.

Also, there are for instance the following other unfinished things in the file:


<!--
NEW PARAMETERS TO CREATE AND USE:
papal_standing :: our standing with the papal states
target_papal_standing :: targets standing with the papal states
rand :: a random number
excommunicated :: is this faction excommunicated
target_difficulty :: what campaign difficulty has the target chosen
-->

<!--
<decision_entry>
SPECIAL CASE EXISTS HERE IN CODE FOR 'CAN_ATTACK_FACTION', NO INVASION IF SO
</decision_entry>
-->

<!--
<decision_entry>
SPECIAL CASE EXISTS HERE IN CODE FOR FORCING want_peace WITH A FACTION UNDER CERTAIN CONDITIONS. CONTINUES CHECKS FOR SUBSEQUENT DECISIONS
</decision_entry>
-->

This is yet another fact that points to how hurried this release was, as the dev team clearly was not even able to implement everything they had intended to in this file. Frankly I think it's amazing that they got the game working to the extent that they even have...

Durallan
01-15-2007, 14:17
<!--
NEW PARAMETERS TO CREATE AND USE:
papal_standing :: our standing with the papal states
target_papal_standing :: targets standing with the papal states
rand :: a random number
excommunicated :: is this faction excommunicated
target_difficulty :: what campaign difficulty has the target chosen
-->


this bit is just more of the documentation before the start of the file I believe.

SPECIAL CASE EXISTS HERE IN CODE FOR FORCING want_peace WITH A FACTION UNDER CERTAIN CONDITIONS. CONTINUES CHECKS FOR SUBSEQUENT DECISIONS

this one may be the missing, we have 1 territory left, maybe we should give up warring on them.

EDIT: maybe not, I think this is the the give up although thats only if you aren't a neighbour.

decision_entry
<!--
if not our neighbour, and we have any settlements, and we are at war, and they are not a trusted allies enemy, use defaults + want peace
-->
min_entry num_settlements="1" stance="AtWar"
max_entry is_neighbour="false" trusted_ally_enemy="false"
faction_attitude want_peace="true"
decision_entry

Foz
01-16-2007, 04:16
<!--
NEW PARAMETERS TO CREATE AND USE:
papal_standing :: our standing with the papal states
target_papal_standing :: targets standing with the papal states
rand :: a random number
excommunicated :: is this faction excommunicated
target_difficulty :: what campaign difficulty has the target chosen
-->


this bit is just more of the documentation before the start of the file I believe.

Not the case. Search the file for them: they're not used anywhere except right there where they are commented. Again, it's commented out ideas intended to be replaced with code and implemented, but never gotten to. I'm not saying it's horrible or anything that it is the case, as the campaign AI is actually pretty good once the variables are re-enabled, just wanted to point out to people that the programmers clearly didn't get to everything they wanted to.

As an additional note, the code that would've forced attacks on the player after a noted amount of peacetime depending on difficulty is probably not implemented due to the target_difficulty variable not being implemented, as the conditions could not be checked without target_difficulty to tell you what difficulty the player was playing on (lower difficulties would've allowed longer stretches of peace). I actually kinda like the idea, as this is still total war... so it makes sense that peacetime should be quickly interrupted by war. I wonder if we'll see it implemented in a future patch. I hope so.

alpaca
01-16-2007, 19:11
Not the case. Search the file for them: they're not used anywhere except right there where they are commented. Again, it's commented out ideas intended to be replaced with code and implemented, but never gotten to. I'm not saying it's horrible or anything that it is the case, as the campaign AI is actually pretty good once the variables are re-enabled, just wanted to point out to people that the programmers clearly didn't get to everything they wanted to.

As an additional note, the code that would've forced attacks on the player after a noted amount of peacetime depending on difficulty is probably not implemented due to the target_difficulty variable not being implemented, as the conditions could not be checked without target_difficulty to tell you what difficulty the player was playing on (lower difficulties would've allowed longer stretches of peace). I actually kinda like the idea, as this is still total war... so it makes sense that peacetime should be quickly interrupted by war. I wonder if we'll see it implemented in a future patch. I hope so.
Play a game on VH vanilla. Then implement can_force_invade="false" in every invasion decision. Play a game with the modded file.
Then come back and tell me again that there is no force invade code...
There is at the very least the naval invasion code.

Foz
01-16-2007, 22:27
I wasn't saying that can_force_invade is not implemented, or that there is no code in the game that forces invasions on the player. You can see that it's in the code. I said there is no code that forces invasions on the player based on his difficulty level, as a comment in the file specifically says there should be. The code that should do it simply is not there.

As for the can_force_invasion thing... it's kind of a DUH. You can see that it defaults to true, and only gets set to false in a very limited set of conditions, which hilariously enough mostly don't trigger with the trusted alliance variables disabled. Even with them enabled, can_force_invasion=false applies in a very limited set of circumstances, meaning that most of the time any given faction can force invade you (whatever a forced invasion means in actuality).

Magraev
01-19-2007, 10:15
I'd like some guidelines to implement the diplo-mod (or a link to download from...). It sounds very promising!

What file needs to be modded? Can it be modded with notepad?
What are the suggested entries (0.75 and 0.2?)?
How can we tell from the diplo screen if an alliance is trusted or not (english word plz)?
Is there more than one threshold ?-0.2-0.75-?
Can a trusted ally still betray you - at all?

I wonder if the game becomes too passive if you implement these changes, but I suspect not. On harder difficulties you'd have to pay a lot of florins to ensure the alliance holds.

Foz
01-20-2007, 03:34
I'd like some guidelines to implement the diplo-mod (or a link to download from...). It sounds very promising!

What file needs to be modded? Can it be modded with notepad?
What are the suggested entries (0.75 and 0.2?)?
How can we tell from the diplo screen if an alliance is trusted or not (english word plz)?
Is there more than one threshold ?-0.2-0.75-?
Can a trusted ally still betray you - at all?

I wonder if the game becomes too passive if you implement these changes, but I suspect not. On harder difficulties you'd have to pay a lot of florins to ensure the alliance holds.
Ha. Too passive. That's a laugh. Nooooo... the game remains plenty aggressive. I'm currently playing with the changes suggested here in an English campaign, and at war with the remnants of France, Milan, and Portugal which is mostly blockading and dropping small landing parties on mainland Britain. I started none of those wars. Of course France and Milan had good reason to try to take me down, as I was building up forces to swing through West and South France, mashing both of them between myself and my HRE allies to their East.

Getting more to your questions, the modification is quite easy to accomplish yourself. You'll need to mod descr_campaign_ai_db.xml and yes, you can accomplish it with a simple text editor like notepad. If you're not experienced at all with modding this game, it's unlikely you've unpacked the game files or configured a bat file to run the game from said unpacked files. If that is the case you can stop reading right now and go read up on the unpacker instead, as you'll need to unpack the game files and set the game up to look for modded files in order to do this mod.

Having unpacked the files and found the one in question (in the data folder), you'll need to find the section of the code that looks like this:


<!--
///////////////////////////////////////////////////////////
// GLOBAL AI PARAMS (currently disabled, i.e. range = [-1.0, 1.0]) //
///////////////////////////////////////////////////////////
-->

<trusted_ally_fs_threshold float="0.75"/>
<trusted_ally_target_fs_threshold float="0.75"/>
<trusted_ally_gs_threshold float="0.2"/>
It's pretty close to the top of the file. Make sure you have the stuff about GLOBAL AI PARAMS above the variables, as the variables are mentioned first in the file in a comment that describes their use... and modding that would be worthless, lol. The three variables in the unmodded file will be set to "9.0" each IIRC.

The game code suggests the first two be set to 0.80 and the last to 0.2, but consensus is that it's nicer to set the first two to 0.75 so you can actually tell when the alliance will be trusted, as 0.75 is the threshold for "Very Good" relations, while 0.2 global standing is a minimum rating of "Reliable." If that's what you want to use too, then all you need do is make that part of the file identical to the code above by setting the first two variables to 0.75 and the last to 0.2. Save the changes, and then run your batch file with the io_first switch in it, and you're good to go. You'll know an alliance is trusted when your relations with the faction are at least Very Good, and your global standing is at least Reliable.

hrvojej
01-31-2007, 00:40
I hope this modification has not been abandoned. All the diplomacy mods I have tried so far seem to have issues of their own, and I was looking forward to trying this one.

redpatch
02-07-2007, 13:17
what's the location for this file? I'm having trouble finding it

KnightErrant
02-07-2007, 15:48
If you have unpacked your files it should be in your /data directory.
If not then go to this thread and you can download
a subset of the /data directory files that includes the file
you're interested it.
https://forums.totalwar.org/vb/showthread.php?t=73971

Re Berengario I
02-07-2007, 17:47
Play a game on VH vanilla. Then implement can_force_invade="false" in every invasion decision. Play a game with the modded file.
Then come back and tell me again that there is no force invade code...
There is at the very least the naval invasion code.

can_force_invade is the command whic enable/disable "missions" for the Ai which are the same missions the player usually get from the council.

You know the silly conquer rebel settlement, port blockade, etc? If you pay attention to it you could recognize the same patterns in the AI behaviour.

Disabling it completely also lead to problems though when two factions share multiple borders (for example with the rebels) because the various frontline comparisons take in account the WHOLE border (to have a quick test just play a bit with the values and see how AI Russia behave towards rebels as they have huge shared borders).

So it's as always a hit and miss procedure, what is good for a faction isn't good for another and some silly AI behaviour is always to be tolerated unless you singularly write an AI for every faction and use it together with scripted invasions and defences.

redpatch
02-07-2007, 22:20
If you have unpacked your files it should be in your /data directory.
If not then go to this thread and you can download
a subset of the /data directory files that includes the file
you're interested it.
https://forums.totalwar.org/vb/showthread.php?t=73971

Man I must've been blind. ty

Foz
02-08-2007, 01:00
can_force_invade is the command whic enable/disable "missions" for the Ai which are the same missions the player usually get from the council.
Really? How'd you draw that conclusion? I'm not trying to say it isn't so, but I didn't see anything that indicated it was related to missions, and am curious how you found this out.

Re Berengario I
02-08-2007, 13:23
Really? How'd you draw that conclusion? I'm not trying to say it isn't so, but I didn't see anything that indicated it was related to missions, and am curious how you found this out.

Try to enable hotseat mode and take control of some factions controlled by AI. You'll find out that they have missions the same as player has, the rebels also.

Further on you can observe how the AI faction usually goes for the same objectives (and port blockades, etc) that you'll get as missions if you play that faction (within the same situation and timeframe of course).

If you insert the "can_force_invade = false" then you'll see that the AI won't follow aymore the previous objectives, it doesn't attack neighbour rebels, unless the conditions you specified elsewhere are reached, it doesn't block ports, etc

Foz
02-08-2007, 16:57
Goes off to examine the file and think about it a while...

Combing the file for it, I found only these basic cases where can_force_invade is set to false (it defaults true the rest of the time):


<decision_entry>
<!--
If trusted ally, use defaults
-->
<min_entry trusted_ally="true"/>
<faction_attitude can_force_invade="false"/>
</decision_entry>

<decision_entry>
<!--
If we are allied and have only been allied for a short duration, no invasion set up, cannot force invade
-->
<max_entry num_turns_allied="3" stance="Allied"/>
<faction_attitude can_force_invade="false"/>
</decision_entry>

<decision_entry>
<!--
If we have agreed to a ceasefire only a short time ago, no invasion set up, cannot force invade
-->
<min_entry num_turns_ceasfire="0" stance="Neutral"/>
<max_entry num_turns_ceasfire="3" stance="Neutral"/>
<faction_attitude can_force_invade="false"/>
</decision_entry>
The 2nd and 3rd are to give a grace period where forced invasions can't happen if we recently declared an alliance or a ceasefire. The first applies generally when there's a trusted alliance, which also makes sense.

It also makes sense conceptually that missions would be the things that cause "forced invasions." The file doesn't mention anything about them, but does go on to setup the various conditions that trigger all sorts of AI attacks. This implies that a forced invasion is something that doesn't rely on any of the usual decision parameters, and probably comes from a different source entirely - so while it certainly isn't conclusive, I'm inclined to believe it triggers from AI missions as that makes the most sense as a secondary source of attack directives.

iceman0486
02-10-2007, 00:38
This looks awesome guys, but I was wondering if this is approaching anything like a mod that the retarded computer user (i.e. me) could use without mucking around in files that can screw up your game. Improved diplomacy would be a wonder though, and no more random attacks would be nice.

nikolai1962
03-14-2007, 02:20
Modding the strategic AI :2thumbsup:

Only got the game recently and a bit rusty so some questions if anyone knows:

1) I want faction-specific AI. What I was thinking was editing the attack decisions to be weighted more to faction standing than military strength and having something like,



Trigger France_Caen
WhenToTest FactionTurnStart

Condition not TargetFactionType france
and << this faction owns Caen >>

FactionStanding france -0.01

With one of these for each region france wants so that over time france would have a weighted tendency to dislike more those factions that owned regions it wanted. But i'm not sure of settlement ownership conditions.


2) Is the base global standing moddable? I'd like it to start at reliable for same religion.

3) Anyone know what this does?


relations_improved_thresholds
{
-0.1
0.5
0.9
}

relations_worsened_thresholds
{
-0.9
-0.5
0.1
}

~~~

Ty in advance.

alpaca
03-14-2007, 15:31
1) I_SettlementOwner <faction>
2) Well you can always make some triggers for it that trigger only on turn one or so.
3) I think this determines when you will get a popup message that your relations have improved or worsened (e.g. if it gets below 0.1 you'll get a popup that it worsened)

nikolai1962
03-15-2007, 08:02
Ah, ty.



Trigger france_caen_england
WhenToTest FactionTurnEnd

Condition FactionType england
and I_SettlementOwner Caen = england

FactionStanding factions { france } -0.02


looks like i'm going to need one trigger per region a faction wants for each of the other factions...ouch

Re Berengario I
03-15-2007, 11:01
Very interesting idea Nikolai but you have then to setup the diplomacy xml file to make the bad relationships to have a substantial effect. And you'd have als to tune down (or to eliminate like I did) the end turn normalization wich with high difficulty campaign setting makes the relationships worsen at every turn regardless.

If I can give you an advice is to start from a blank descr_campaign_ai_db.xml, tune the base aggressivity of AI to your tastes (I prefer an AI which builds up its forces enjoying peace until it's ready to strike, others prefers the vanilla bloodshed) and then starts playing with triggers to link the the basic AI behaviour to the campaign happenings.

nikolai1962
03-17-2007, 05:48
but you have then to setup the diplomacy xml file to make the bad relationships to have a substantial effect

Yup. Was looking at the things you can test for and faction and global standing was there just the vanilla AI is far more interested in military strength. I'm going to change it all round so the AI reasoning revolves around how much they like you and how much they like you being largely determined by whether you have some region(s) they want. Should be able to make it act more realistically I think. Will take a lot of typing though.



And you'd have als to tune down (or to eliminate like I did) the end turn normalization wich with high difficulty campaign setting makes the relationships worsen at every turn regardless.

Yeah i deleted that too. No wonder the AI factions in RTW seemed so crazy.


If I can give you an advice is to start from a blank descr_campaign_ai_db.xml

Good advice. I did this and created a mini AI profile that limits the AI factions to attacking rebels. Currently running the game with all the factions set to that profile so I can see where there are map path-finding problems.


Interestingly with isneighbour=true set in the profile you still get some naval landings, just less than when it is removed.


Just realized my trigger was the wrong way round.

Trigger france_caen_england
WhenToTest FactionTurnEnd

Condition FactionType france
and I_SettlementOwner Caen = england

FactionStanding factions { england } -0.02

oz_wwjd
03-24-2007, 07:48
I've just gone ahead and changed the value in the descr_campaign_ai_db fire,now what's this about running a batch fire with the io_first switch to implement it? Can't I just run the game normally and load my saved game?Forgive me I don't usually mod games but the AI diplomancy or lack of is driving me insane..

alpaca
03-24-2007, 13:50
I've just gone ahead and changed the value in the descr_campaign_ai_db fire,now what's this about running a batch fire with the io_first switch to implement it? Can't I just run the game normally and load my saved game?Forgive me I don't usually mod games but the AI diplomancy or lack of is driving me insane..
using the file_first switch tells your game to use the changed files instead of those in the packs.
And be aware that it might not be savegame-compatible (dunno really).

Carl
03-25-2007, 17:23
Has anybody worked out how Descr_Diplomacy works yet?

In the latest version of my Rebuild-ProblemFixer BETA I seem to have an issue where-by all alliances are considered demanding no matter what turn it is or what the relations.reputation is. So I could do with some help.

Thanks.

Carl.

Shahed
04-19-2007, 10:30
I've changed my file to 0.75,0.75 and 0.20.

But it still would eb nice to have Kobal's file to compare. EXCELLENT work all !

Should I be changing the force_invasion parameter to false ?
Does that improve the campaign ?


Trigger 0093_Update_Normal_Difficulty
WhenToTest FactionTurnStart

Condition CampaignDifficulty = medium

FactionStanding exclude_factions { } normalise 0.0 50

So here 0.0 means that relations will improve at a factor of 0 i.e normal, what does the 50 mean ?
In these triggers I can only see the use of 1, 0, -0.5, -1. What about 0.5 ? Should'nt medium difficulty be at 0.5 ? seems logical to me.

Thanks very much for the help. Appreciate it greatly.

Salute !

Shahed
04-19-2007, 13:02
Just a short info: when you set the can_force_invade attribute to false for all invasion decisions, the AI won't do those silly attacks on the player anymore that are dependent on peace time, etc.

You probably already figured that out, but I thought it might help somebody.

Hi Alpaca, I just checked my file, it's 1.1 and all can_force_invade are already false. Am I looking in the right file ? It's descr_campaign_ai_db.xml

alpaca
04-19-2007, 15:25
What I meant back then was that you have to put can_force_invade=false into every invasion decision.
As of 1.2 that's not necessary anymore because we can override the default by using the continue faction_standing, but since you're using 1.1...

Shahed
04-19-2007, 18:15
Hey sorry if I sound stupid, but I am using 1.1, with PureFixer 1.13. Anyway that means I don't have to change anything, if I understand correctly.

SigniferOne
04-19-2007, 21:34
What I meant back then was that you have to put can_force_invade=false into every invasion decision.
As of 1.2 that's not necessary anymore because we can override the default by using the continue faction_standing, but since you're using 1.1...
Alpaca, can you explain this a little bit? Why is that clause not needed anymore? I don't have 1.2 yet, what is the general consensus about frequency of silly invasions or port blockades? Hopefully CA rebalanced a lot of things, since what was bugged was not the M2TW engine, but merely the settings in the AI text files.

alpaca
04-19-2007, 22:18
Well you don't have to put it into all decisions because you can have a decision at the top that doesn't stop the game from choosing a decision below but that overrides the default can_force_invade setting.

Edit: I just noticed there's another new setting called "use_cheat_overrides" in 1.2, if we set that to false it might do the same (and even more).

Foz
04-28-2007, 03:02
Trigger 0093_Update_Normal_Difficulty
WhenToTest FactionTurnStart

Condition CampaignDifficulty = medium

FactionStanding exclude_factions { } normalise 0.0 50

So here 0.0 means that relations will improve at a factor of 0 i.e normal, what does the 50 mean ?
In these triggers I can only see the use of 1, 0, -0.5, -1. What about 0.5 ? Should'nt medium difficulty be at 0.5 ? seems logical to me.

Thanks very much for the help. Appreciate it greatly.

Salute !
The 0.0 means the normalise moves your standing with each faction toward 0.0, which is the dead center of the standing meter: not good nor bad. The 50 is a divisor. The game finds the difference between each faction's standing and 0, divides it by 50 (in this case) and modifies the standing by the result. This means the further you are from 0 standing, the more normalise moves you toward 0, and conversely that when you are already near 0, normalise does very little to your standing with that faction. It basically makes it easier to escape bad standing and harder to maintain good. Every time it will take you 1/50th of the way to the target value. So smaller values in the divisor position actually mean the effect on your standing w/ other factions will be far greater.