• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

durbal

Banned
58 Badges
Dec 9, 2015
3.840
10.392
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Third Rome
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Imperator: Rome
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: La Resistance
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Dharma
  • Shadowrun: Hong Kong
  • Imperator: Rome Sign Up
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV
  • Victoria 2
  • Age of Wonders: Planetfall Sign Up
  • Victoria 3 Sign Up
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Tyranny: Archon Edition
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Age of Wonders: Planetfall
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
I appreciate the AI changes in 1.33. They make the AI a lot more competent and the improvements are noticeable.

One thing seemed to be weird however, and that's the AI's ability to see into fog of war and routinely avoid or engage battle whenever it wants to. I thought maybe it was just the warfare changes that made it seem more common or something, but then when I was reading a past dev diary I noticed this:

With this improved confidence in its understanding of army strength, the AI’s safety margin for starting attacks has been reduced somewhat. It has also been made more aware of nearby armies on both sides. You will find the AI starting more winning battles, and hopefully fewer losing battles. Although the reduced safety margin combined with bad understanding of army composition can make the AI fail in this regard.
The emphasis in the quote above is mine. So my thoughts that the AI seemed to have a prescient ability to engage in battle and avoid it almost endlessly wasn't just in my head -- the AI seems to know where armies are at all times and calculate exactly when it can engage a winning battle and when it can avoid a losing battle. Overall, this makes it a lot more competent which is much appreciated. However, it also tends to impoverish gameplay a bit because a) it turns wars into siege races with battle only occurring when one side is cornered and more importantly b) it just feels cheap to try and outmaneuver the AI only for it to see what's coming and take the exact perfect path to escape, pick off a reinforcement, etc. that by all means it should not know is there.

I'm kinda torn since I enjoy the extra competency, but I'm not sure how if that's worth the AI being able to calculate exactly what it needs to do at all times even seemingly into fog of war.
 
  • 3Like
  • 2
  • 1
Reactions:
the AI has never had FoW in any PDX game, to my knowledge. they'd be crippled if that wasn't the case.
 
  • 5Like
  • 2
  • 2
  • 1
Reactions:
the AI has never had FoW in any PDX game, to my knowledge. they'd be crippled if that wasn't the case.
It would also be a serious performance drain, since each AI would have to use a different game state based on what they can see and all armies and provinces would need a constantly updating variable regarding which of the more than 1000 possible tags can see it. It simply wouldn't be practical.
 
  • 10
  • 3
  • 1Like
  • 1Love
  • 1
Reactions:
the AI has never had FoW in any PDX game, to my knowledge. they'd be crippled if that wasn't the case.
The devs said multiple times that the AI sees into to the FoW but is programmed to occasionally 'forget' where an army is. Maybe OPs highlighted quote refers to the further tuning of this ability to make the AI more competitive in battles.

This AI awareness can be abused too though. Whenever I want to snipe a sieging AI stack I plan my army movement to go through a province next to the besieged fort, but a target several provinces away. That way the AI thinks I'm not going to engage, because it believes my army is on the way to somewhere far away, and then when I'm in the province next to the fort I change the movement and go fight the battle on the fort.

The AI also completely lacks awareness of black flagged armies, like they don't exist at all. If you get black flagged, you can gather your exiled armies and then strategically un-exile yourself in one of your provinces, getting the drop on the AI.
 
  • 6
  • 4
  • 3Haha
  • 2Like
Reactions:
I think the reasoning behind the design choice is a little more subttle (although the implications about no FOW but forgetting sometime are correct). - a human can slow everthing down and play day by day. To avoid having to calculate every army every day the AI has some rules about when to reevaluate what it is doing - when it is expecting a battle to be triggered is the most obvious one and at least on a pratical level happens more in war (hence the league wars lag). What this therefore means is to create a level playing field the AI needs enough infomation that it wouldn't learn anything before the next recalc that should have changed its mind. The result is a slightly odd mix where by the AI occassionally doesn't switch to knock out a small army but knows where your armies are if nearby.

All of this led to a situation where AI was a bit to risk adverse and some humans became very good at tricking AI - both of these the patch tried to reduce.

On a side note a game where the AI played by exactly the same rules as a human would be very different. Things like relationships and all those modifiers would be meaningless. There is little mechanical reason for example to prefer same religion. The AI having logical rules for these things create the space for the player to have extra agency and more content in the game.
 
  • 2
Reactions:
the AI has never had FoW in any PDX game, to my knowledge. they'd be crippled if that wasn't the case.
This is untrue. Chaingun (or Gnivom) mentioned the pseudo-FoW the AI uses. Other posters mentioned this too.
It would also be a serious performance drain, since each AI would have to use a different game state based on what they can see and all armies and provinces would need a constantly updating variable regarding which of the more than 1000 possible tags can see it. It simply wouldn't be practical.
That's not how you would program it. Again, it had already been done anyway and the latest changes seemed to have made the AI super-aware of where everything is.
This AI awareness can be abused too though. Whenever I want to snipe a sieging AI stack I plan my army movement to go through a province next to the besieged fort, but a target several provinces away. That way the AI thinks I'm not going to engage, because it believes my army is on the way to somewhere far away, and then when I'm in the province next to the fort I change the movement and go fight the battle on the fort.
This doesn't really work anymore which I think is the major change that I'm highlighting in this thread. I don't want it to revert back to the derpy exploitable state it was in by any means, but right now it has hyperawareness and if it so much as sniffs a losing battle being remotely possible it will disengage (and vice versa for winning and engaging) -- even when it shouldn't be able to detect such things.

Right now if you have a superior army and can arrive at a province adjacent to the AI that will allow you to engage in battle should you arrive there (because of faster army and/or closer province than the escape routes) the AI will sniff this out even through fog of war and calculate when it needs to retreat to be able to arrive to a province of safety (such as behind a friendly fort, to reinforcements, etc.). The AI being able to do this isn't in itself a problem to me except in the cases where the AI should have no idea what's coming due to fog of war, such as when it's sieging a border fort and you move your armies through friendly, unoccupied territory (i.e. in fog of war) to arrive at a province where you will be able to engage it from. The AI can see this maneuver coming and will retreat or, more problematically, it will create a chain of reinforcements to arrive so as to win the battle -- reinforcements which you often can't see as a player because they are in fog of war.

I think the reasoning behind the design choice is a little more subttle (although the implications about no FOW but forgetting sometime are correct). - a human can slow everthing down and play day by day. To avoid having to calculate every army every day the AI has some rules about when to reevaluate what it is doing - when it is expecting a battle to be triggered is the most obvious one and at least on a pratical level happens more in war (hence the league wars lag).
The AI recalculates decisions constantly, not only on game ticks. This is obvious when it decides to move to a province so you change orders to intercept it and it immediately cancels its own move order (and rinse and repeat) -- the dance we've probably all seen before.
 
With the caveat that no single person knows exactly how the AI works, and certainly not why:
The main problem with having proper FoW for AI is that it would need some kind of memory of approximately where enemy troops are. So instead it kind of works like this:
All your enemies will collectively keep track of where your troops are. If neither of them has "seen" the army for a while, it can be probabilistically "forgotten". The AI also tries to not consider exactly where your armies are, but "blur" the position a bit. This blurring definitely applies in how the AI tries to retreat from your armies. So it doesn't really compute a perfect path or such. But I understand it might feel like that.

I'll try to look at this to see if some fairly safe improvements can be made. I'm also aware of a few places where the AI actually looks at the "forgotten" armies as well. Will see if I can remove some such cases.
 
  • 10Like
  • 8
  • 3Love
  • 1
Reactions:
With the caveat that no single person knows exactly how the AI works, and certainly not why:
The main problem with having proper FoW for AI is that it would need some kind of memory of approximately where enemy troops are. So instead it kind of works like this:
All your enemies will collectively keep track of where your troops are. If neither of them has "seen" the army for a while, it can be probabilistically "forgotten". The AI also tries to not consider exactly where your armies are, but "blur" the position a bit. This blurring definitely applies in how the AI tries to retreat from your armies. So it doesn't really compute a perfect path or such. But I understand it might feel like that.

I'll try to look at this to see if some fairly safe improvements can be made. I'm also aware of a few places where the AI actually looks at the "forgotten" armies as well. Will see if I can remove some such cases.
Could you tell us more details about how the AI code works here? This sounds like a very interesting implementation.
 
  • 1
Reactions:
The main reason why this is more noticeable in 1.33 is the change in the dependency of threat on distance.
As the threat contribution of enemy units is higher in 1.33, even if they are still several provinces away, the AI is threatened earlier and therefore sees the enemy earlier in the eyes of the player (as the player just notices the AI moving away due to unacceptable threat/dangerous siege). As minimal distance as well as the distance factor per province are affected, this change is quite severe and relates to several other differences, like some cases of the AI leaving sieges early.

I think one could reevaluate the new threat formula first before changing AI fow behaviour and arrive at an acceptable state.

The AI forgetting enemy armies could help the AI in trying to be more offensive with multiple small stacks, but the problem remains, if all enemy army positions are known. Therefore, it seems to be more important to address the problem of multiple small AI stacks being all afraid at once, even though a combined stack would not be afraid. Especially since the flanking consideration and the added preferences for safe terrain have not made things better in that regard. I know that this is probably quite difficult to do, but in my opinion there are still multiple promising ideas on how to do it.

With the caveat that no single person knows exactly how the AI works, and certainly not why

With access to the code I could certainly try the first part :) (I know that this is not your decision to make). The "why" will probably always remain a mystery though.
 
  • 2Like
Reactions:
My biggest issue are, and kind of not, when you send your numberically similar or larger army to a province and the enemy "flees" because it "knows". This fog of war must be very transparent. Also on the flip side, they abandon areas/sieges when I do this... I mean, I'm going to catch you, its just a matter of time.. Also it tells me AI have no magic FoW-Army nearby, but they probably have if the AI wont move when doing this.. Or have just superior combat modifiers and confident my AI allies are not nearby or wont reinforce or ... [insert math thinking animation here].
 
  • 1
  • 1Like
Reactions:
the AI has never had FoW in any PDX game, to my knowledge. they'd be crippled if that wasn't the case.
Yes, they have, or they ignored everything. This is how I played the game forever. Camp an army in mountains, not so small it would be smashed but small enough to draw the enemy in, with one enemy back one square in the fog of war (well, what it would be for the player). I have won day 1 wars (back when you could do that) against France as Castille, Austria as Castille and Portugal and England as Castile, that very way. And let me tell you, getting Enrique killed in the mountains of Austria to free Styria, and thus become the leader in the role of the Inheritance was the most fun I've ever had in this game.
 
  • 1Haha
Reactions:
It would also be a serious performance drain, since each AI would have to use a different game state based on what they can see and all armies and provinces would need a constantly updating variable regarding which of the more than 1000 possible tags can see it. It simply wouldn't be practical.

On the contrary, there are studies showing that an AI which doesn't know the game state and has to explore the map in order to gain knowledge of the game state is less resource instensive than an AI which has perfect knowledge on the game state.