LH-specific AI starts going in next update

I just checked in the first major LH-specific AI update.  Players should notice a pretty significant improvement.

I fixed a pretty obnoxious bug with regards to city leveling which was absolutely crippling the AI mid to late game (the effect was that city level choosing ended up largely random).

But overall, a few thousand lines of code were either written or modified with LH in mind.  It'll be interesting to see the effect others see.

What I was able to see was mostly in the late game where the accumulation of "poor choices" the AI made led it to becoming largely petrified. If you were a human player and could just hang in there, you'd ultimately win IMO.  This usually was most obvious when looking at the graphs.

Also, it now matters a lot more which players you go up against. They now play fairly differently from each other.  It'll help when they have more unit designs to choose from.  

Assuming progress is being made, I'll be happy to keep doing more on this angle.  I think there's a lot of low hanging fruit in there.

12,442 views 9 replies
Reply #2 Top

That's great to hear, can't wait to try it out. :thumbsup:

 

If I may suggest something that may help AI greatly. If AI's were able to 'mimic' what player does in order to make his faction strong it would help him a great deal.

Right now I think I can come up with some pointers that people seem to do all the time in order to win the game:

1) Pick one location with good enough resources and lots of essence for main fort city. Usually as soon as possible, one of the first 3 cities (usually first city) if possible.

2) Maximize production of the city, build all unrest reduction and faction/world unique buildings in it that actually boosts production.

3) Cast buffs on it that improve units produced in said fort.

4) Use said fort for most of unit production. Units produced there are significantly superior then the ones produced in other cities.

5) If possible, for every 5 cities make fort city on high grain location. Maximize growth in said city and build a prison as soon as it reaches level 4.

6) Separate heroes and give each an army to command.

7) At the early stages of the game, pick up all 'goodies' in range with your heroes

8) Recognize what victory conditions are enabled in order not to rush disabled one (like spell of making). Better use research on improving economy and warfare.

9) Stop random declarations of wars and declare only when ready and able to attack the enemy (no longer DoW-s from across huge map or DoW-s and then sitting there doing nothing or sending one by one unit to get killed).

 

Most of those things humans already do. If they can be implemented in AI behavior, it would increase difficulty and fun greatly.

Reply #3 Top

Thanks

Cant wait to test it out.

 

Your points  4 and 6 are very important Daynarr

A good fort doesn't actually need more than 1 essence, for growth or material bonus. Spell stat boosts are good but just being able to pump out high end troops is enough.

Reply #4 Top

Looking forward to checking it out.

Reply #5 Top

I am looking forward to test these changes on hard. So far my biggest complaints are weak AI unit stacks (maybe a recruitment problem) and lack of proper buildup before starting a war (like any player does). Also using unsupported heroes as harassment forces when the player has full stacks in the vincinity is a bad idea.

Reply #6 Top

If I may suggest something that may help AI greatly. If AI's were able to 'mimic' what player does in order to make his faction strong it would help him a great deal.
End of quote

I've said this for 100 years (yes I'm that old lol not), but anyways a database should start to build up of how the human player plays and the ai mimic it in some situations. What's that saying Quid pro quo? The human player is not going to know but it would be fantastic to see an ai mimic the player sometimes and meet him on the battlefield with his own medicine. Plus in tactical combat make the same moves. ooooooh how I'd like to see that.

1) Pick one location with good enough resources and lots of essence for main fort city. Usually as soon as possible, one of the first 3 cities (usually first city) if possible.
End of quote

On difficulties higher than challenging I'd like to see the AI get maximum city stats when it settles its first city or two. something like a 5/3/1 or 4/3/2 or maybe even a 5/3/2 * random chance it's over the cap of 9. no matter what is actually in the square. Afterall it's a higher difficulty so those that don't play past challenging can't complain.

2) Maximize production of the city, build all unrest reduction and faction/world unique buildings in it that actually boosts production.
End of quote

On higher difficulties once again past challenging I'd like to see the AI not have to worry about unrest. Crusader Kings did this very well and made the game a lot more challenging by not making the ai play by every rule the human plays by. They did it for the economy also as the ai always had enough money to field armies without worry about upkeep.

3) Cast buffs on it that improve units produced in said fort.
End of quote

Give the ai maximum defensive units from the start on higher difficulties and improve their stats as the game progresses so when the strong human player gets there it won't be a pushover battle.

6) Separate heroes and give each an army to command.
End of quote

Not so sure I agree with this I think two heroes or sov and hero is a better set as it gives more selections of more powerful skills to use, perhaps 1 melee and 1 ranged of some type (magic or arrows) would work well that's how I run my armies anyways.

9) Stop random declarations of wars and declare only when ready and able to attack the enemy (no longer DoW-s from across huge map or DoW-s and then sitting there doing nothing or sending one by one unit to get killed).
End of quote

I would like to see the ai on higher difficulties work more towards alliances with the other ais like in MOM and come after the player moreso than each other. This is the challenge the game needs on higher difficulties.

Reply #7 Top

Will this changes be up for 0.52 or it's a longer project?

 



What I was able to see was mostly in the late game where the accumulation of "poor choices" the AI made led it to becoming largely petrified. If you were a human player and could just hang in there, you'd ultimately win IMO.  This usually was most obvious when looking at the graphs.

End of quote

I confirm this after testing a very long game (800+ turn). The AI has a bunch of low level cities around. Beside the AI problems, I think it's due to the constant all vs all war state, I see they keep producing armies with every little town instead of a more organized behaviour (build armies in good fortress, expand the other non fortress cities).

https://www.dropbox.com/s/81k7wwfw8sxd21n/Master%20Quest%20T809.rar

Here is the save, if it may help testing. Saved just before last battle for main quest victory, so you can easily see the graphs too.

Reply #8 Top

I am thinking that when you play at a certain difficulty level or higher , hard for example, the ai starting city should default to a tile yield of say 4,3,2  if it is not that to begin with.  I know that is a bit of ai cheating, but not any worse than players using ctrl-n, but it may solve some problems with the ai not doing well.  I am not sure how much the ai is hindered by having a bad starting spot. 

Reply #9 Top

i just reloaded the end of a huge domination game i finished recently and all AI capitals i had conquered were at least 5/3/2 or better (on challenging difficulty) one of them was even a 5/5/2 (the former gilden capital) with a clay pit right next to it (so actually 5/6/2) and another one was 5/3/3 (the former pariden capital)