Real Strategy (AI)

Real Strategy (AI) 2.3.1

I have looked in AI_operation_eval logs,and found that AI hugely evaluates the original capitals of major powers and city states compared to other cities. The problem probably appears, where AI tries to get to the "desired" capital instead of taking the most adjacent city, suffers hard losses and retreats. I've also noticed that in early eras, when there are not so many cities, AI is more efficient in taking them. He is also rather smart, when waging war against city states. But in situation with multiple cities to take he starts to do strange things:(
I don't know if it's possible to make an additional parameter, depending on the distance between the "desired" city and the closest city of AI. But it would be great to test something like this.
 
@aikido_panda Your observations are in line with mine.
I already changed city valuations and basically made late wars possible at all.
Without RST, after medieval era, 90% cities have 0 valuation.
However, capitals will almost always have biggest valuations because they are the best deveoped cities plus there is an extra score for them. Which is ok because in the end AI needs to take capitals.
The problem is with attacking cities that are within the territory. There is no param for that. If you go take a look at notes for GS, firaxis claimed that they fixed it. AI is supposed to attack border cities first. Imo it happens mostly. There is improvement for sure. But i suppose cases where AI wants to go deep may still happen.
 
I have one suggestion. Probably you've already done it, but I didn't see it in Real_Strategy_Main. You introduced some era supporting strategies and probably, in this case, changing era should decrease the PSEUDOYIELD_CITY_DEFENDING_UNITS parameter. With time and technological development roads become more advanced, units travel faster, and there it scarcely matter, where they are concentrated. The number of units around city is important only in the early eras.
 
@aikido_panda
That is a good suggestion, however based on an assumption that we actually know how it works. You certainly read my notes and saw that this param I am only vaguely sure about.
Anyway, it will certainly boost cities valuation. I remember from my testing that it was very impactful.
Maybe you could give it a try? We need to check if this would not lead to AI taking unnecessary risks.
Basically, in time strategies, where there are line with PSEUDOYIELD_CITY_DEFENSES try to add similar line with defending units.
 
Yes, I'll play the next game with this change. The 'unnecessary' risks, however, will certainly depend on in-game difficulty as well, so I'll need more than one game to make a real test:(
I think that when AI picks militaristic strategy, it needs to be really militaristic - otherwise, standing army just drains money and distracts from other objectives...
 
Yes, I'll play the next game with this change. The 'unnecessary' risks, however, will certainly depend on in-game difficulty as well, so I'll need more than one game to make a real test
Yup, it takes lots of time to test such things.
Auto-play is very helpful :)
 
1000 cultures per turn is normal. I myself have achieved such success. By the way, the Firaxis developers have announced an update that affects "improved AI". I think it would be good if you knew.
Updated: 2000 cultures per 1 turn is normalView media item 5173
 
Last edited:
I payed on with my Canada game, after Canada has won the CV in turn ca. 270.
AI Canada had ca. 65 tech to my 55, and more military, I attecked him to see how does it go...
well, I won easily, tactical AI is still poor... I hope patch and further work here will improve this...
(I took all 10-12 Canadian cities by turn 310, with a handful of melee armies and ships and 5-7 biplanes)
 
@V. Soma
Actually tactical AI when defending performs much worse than when attacking.
The attack behavior trees are quite complex, there is a preparation phase, strength is measured, etc. AI can use different teams for walled cities, coastal cities, planes are supposed to be used, siege units, etc.
For defense - there is only 1 behavior tree and 1 team available. It is really poor. Basically AI grabs whatever units are in the area and tries to fight. It is really sad.
The only tactical aspect here is that AI tries to evaluate which cities are in the "most" danger. And moves units over there sort of to be ready. This is a good technique to counter other AIs because the city valuation drops automatically and AI may stop targeting this city.
 
in my game the AI with this mod "improves" (or at least performs much better) in large or huge map settings than in standard settings. In standard, they are better but not by much (I can beat them at least the king level). In large map(I played on TSL earth remastered map) suddenly there is a spike in AI difficulty and they are fielding armies when I have made few soldies and doing better by every count, forward settling everywhere, etc.
 
What i expereinced AI has produced lot of military units. It is a difference between AI+ as far as i saw. BUT! AI naval units just... stared my ships down. They raided my improvments, some of them attacked my costal cities but that is it.
 
Well, I have reduced the PSEUDOYIELD_CITY_DEFENDING_UNITS parameter, with further reducing during each era. I am still testing, but already noticed, that AI civilizations became more rigid in signing peace with each other (and with the player as well) In addition, AI is more active in moving troops towards enemy cities, BUT he often takes stupid losses, when he sends one or two units to the enemy territory, under the city ranged attack and so on. It is strange, because I did not change any tactical files of the mod. However, it's just my preliminary look and I still need do more testing.

And I have one more suggestion, if it wasn't done yet. Is it possible to make AI evaluate the diplomatic status of other discovered players? For example, when two players declare friendship or create alliance, other two become more likely to propose/accept friendship/alliance offers. You did very well with your strategy models, but it would be awesome to add some evaluations connected with diplomacy. It also would make diplomatic victory more difficult for the player.
 
@aikido_panda
AI evaluates the strength of the defense and sets a team to attack. There are some parameters in the operations that define how strong a team must be.
I don’t know how exactly this algorithm works, but it seems that city-defending-units could affect that. You decreased it, so AI treats the defense as less dangerous, thus launching an attack with a smaller force.
I suspected that something like that might happen, i.e. AI might take extra risks.
Well, more tests are certainly needed, now it is all speculation.

I could evaluate diplo relations but there is no use for that. On the strategic level there is no mechanism to change the behavior of a civ against a specific other civ. All AiLists have a global effect (well, global like all actions of a civ are affected in the same way).
 
AiTypeDependence - new field in OpTeamRequirements as for now City Attack Force needs UNITTYPE_SIEGE

"AI more strongly prefers attacking with aircraft to deploying to districts."
It seems that what Firaxis did was only change order of actions in ListType="Default Tactical" (swapped places). Interesting. I would never thought that the order matters here as these lists (AiFavoredItems) are unordered by definition. Funny. There is another list, that is actually an ordered list: "AllowedMoves" and I did exactly the same over there, but apparently I was wrong.

"Improve ability for AI to use Warrior Monks militarily - Add additional war footing condition."
Finally, they added AiTypes to Warrior Monks. I have it in RST from the start... should not cause errors in DB, I used INSERT OR REPLACE
-- 2018-01-06: UNIT_WARRIOR_MONK is not in UnitAiInfos, so he is basically chilling around, doing nothing

"Boost Wonder Obsessed AI's desire for Wonders in later eras."
Wow, they added an entirely new strategy just to boost wonders and just for a specific Agenda.
<Row Type="STRATEGY_WONDER_OBSESSED" Kind="KIND_VICTORY_STRATEGY"
<Row StrategyType="STRATEGY_WONDER_OBSESSED" ConditionFunction="Has Agenda" StringValue="AGENDA_WONDER_OBSESSED"/>
and all this just to boost wonders +100%
<Row ListType="WonderObsessedIndustrialBonus" Item="PSEUDOYIELD_WONDER" Value="100"/>

The good thing is there is a new condition programmed: ConditionFunction="Has Agenda". Could be useful...
 
Diplomatic Victory
<Row Type="TRAIT_LEADER_PURSUE_DIPLOMATIC_VICTORY" Kind="KIND_TRAIT"/>
<Row Type="VICTORY_STRATEGY_DIPLOMATIC_VICTORY" Kind="KIND_VICTORY_STRATEGY"/>

<Row Type="PSEUDOYIELD_DIPLOMATIC_VICTORY_POINT" Kind="KIND_PSEUDOYIELD"/>
<Row PseudoYieldType="PSEUDOYIELD_DIPLOMATIC_VICTORY_POINT" DefaultValue="100"/>
This is something that can't be programmed in Lua, so it is very good that Firaxis added that.

<Row StrategyType="VICTORY_STRATEGY_DIPLOMATIC_VICTORY" VictoryType="VICTORY_DIPLOMATIC" NumConditionsNeeded="2"/>
<Row StrategyType="VICTORY_STRATEGY_DIPLOMATIC_VICTORY" ConditionFunction="Has Diplomatic Victory Points" ThresholdValue="1"/>
<Row StrategyType="VICTORY_STRATEGY_DIPLOMATIC_VICTORY" ConditionFunction="Leads Diplomatic Victory Points" ThresholdValue="1"/>
<Row StrategyType="VICTORY_STRATEGY_DIPLOMATIC_VICTORY" ConditionFunction="Percentage Diplomatic Victory Points" ThresholdValue="25"/>
<Row StrategyType="VICTORY_STRATEGY_DIPLOMATIC_VICTORY" ConditionFunction="Percentage Diplomatic Victory Points" ThresholdValue="60" Exclusive="true"/>

So, we need either 3 DVP or be a leader to activate this strategy. With 6 points it is an exclusive strat.

But the strategy itself is not sophistcated - just focusing AI on pursuing Favor and DVPs.
<Row StrategyType="VICTORY_STRATEGY_DIPLOMATIC_VICTORY" ListType="DiplomaticPseudoYieldPreferences"/>
<!-- Diplomatic Victory Strategy-->
<Row ListType="DiplomaticPseudoYieldPreferences" Item="PSEUDOYIELD_DIPLOMATIC_FAVOR" Value="100"/>
<Row ListType="DiplomaticPseudoYieldPreferences" Item="PSEUDOYIELD_DIPLOMATIC_VICTORY_POINT" Value="100"/>
 
Hi Infixo and all the folks here , thanks for your work for this mod, AI has definitely improved as you can see them waging wars wisely against each other and even runaways 's military power can be curbed by this wiser AI.
On a separate note since today is the released of a new fireaxis patch with improved AI should we
A) continue a existing current game(real strategy mod) that started before today's patch and also try to update today's fireaxis patch
B) start a new game with the new fireaxis patch and also with real strategy mod
Which one will incorporate "PSEUDOYIELD_CITY_DEFENSES" Value="-25 and make AI even more challenging? Thank you
 
Top Bottom