Serious AI Bugs
Posted: Mon Jul 30, 2018 9:12 pm
After having same FFA with the AI i was pretty disappointed by how bad it performed. Since in 1v1 it acts kinda competent I decided to investigate why the FFA experience is so bad. So I put some Ais on the map and watched them. Here are some things that I found:
1)The AI blocks itself ( in advance: I cant prove this but the results pretty much point to this)
I think you all saw the AI “dance” where it moves some of its units back and some forth. At first I though it was pulling it units back to heal but upon close inspection I noticed that often this is not the case as full hp units were pulled back. I also noticed that it got worse the bigger its army grew so I watcher closer and I think I figured out what is happening. The AI moves its units back so that it can use all of it’s units in a meaningful way. Let me explain
The steps are pretty easy:
1. There is a unit the ai wants to attack
2. It(the AI) sees it has units in range
3. It fills the squares in front of the unit with its units (there is already an issue here we will come back later to this)
4. Units that are not in range of attacking and have no other target either move up or stand still
5. It attacks the unit. (so far so good)
6. Next Turn (The target unit is still alive)
7. It wants to attack the unit again
8. It sees it has units in range
9. It sees the squares that enable some units to attack the target is blocked by its own troops
10. It moves the units back to make place for the other units to attack the target
11. and so on
This means this will get worse and worse the more units the AI has and the smaller/inaccessible the target I. I have seen the AI taking more than 60 turns to defeat a city located at the coast that had no defenders except the units it produced while the other AI had a full army(including baneblades). A human player could have taken the city in 5 turns max.
Solution: Don’t retreat units that are blocking your units but instead advance them and the Ai needs to learn how to properly surround
2)The AI has a unit cap
Pretty simple even with ample resources stored and a good income the ai will stop producing units after is has a certain amount.
This is one of the reason why the AI with bigger cheats perform even worse in FFA. Both will reach the cap and this will result in a stalemate
Solution: No unit cap for AI
3)The AI doesn’t use Loyalty Buildings to improve it resources
pretty disappointed as this is a pure math related thing and that’s one thing that AI should be good at.
When your city starts pumping out 100+ resources it should realize that 6 loyalty gives 12+ resources(which is the same resource to energy ratio other building have) while also giving production.
Solution: Add Loyalty resource gain into consideration instead of only avoiding negative loyalty
4)The AI doesn’t settles if enemies are close
There seems to be a check that the AI cant settle if enemies are close.
Had a situation where 1 AI was sitting at only 2 cities despite having an abundance of resources(2000+ of all of them). They were in a fight with an AI city that was fairly close. After they destroyed the city (no other units where left) the AI settled 3 cities simultaneously.
Another problem seems to be that the AI doesn’t send its settlers into directions where there are no enemies. The settlers will always follow its armies and therefore quickly end up with enemies it its vicinity and stop expanding.
Quick example: AI A is in the lower left corne B in the lower right. After discovering each other they will send their troops in the fastest way possible to each other bases quickly filling its way with troops which will cause the to stop expanding especially if the distance is short. However all of the north half of the map would be save to expand though but the AI will ignore it.
Solution: Put in proper risk evaluation for placing cities and give the ai the ability to expand into directions that it currently has no units in but explored.
5)AI can deadlock itself
Granted I only saw this happen one time but the AI managed to get negative energy and exactly 0 ore and food income but 400 in the bank. The AI just stopped and did nothing for the next 30 turns after which it got killed.
Solution: Building something at ½ should be considered better than building nothing and being stuck
I hope this helps and maybe in the future we can have some ffa’s that are as good as the rest of the game :3.
1)The AI blocks itself ( in advance: I cant prove this but the results pretty much point to this)
I think you all saw the AI “dance” where it moves some of its units back and some forth. At first I though it was pulling it units back to heal but upon close inspection I noticed that often this is not the case as full hp units were pulled back. I also noticed that it got worse the bigger its army grew so I watcher closer and I think I figured out what is happening. The AI moves its units back so that it can use all of it’s units in a meaningful way. Let me explain
The steps are pretty easy:
1. There is a unit the ai wants to attack
2. It(the AI) sees it has units in range
3. It fills the squares in front of the unit with its units (there is already an issue here we will come back later to this)
4. Units that are not in range of attacking and have no other target either move up or stand still
5. It attacks the unit. (so far so good)
6. Next Turn (The target unit is still alive)
7. It wants to attack the unit again
8. It sees it has units in range
9. It sees the squares that enable some units to attack the target is blocked by its own troops
10. It moves the units back to make place for the other units to attack the target
11. and so on
This means this will get worse and worse the more units the AI has and the smaller/inaccessible the target I. I have seen the AI taking more than 60 turns to defeat a city located at the coast that had no defenders except the units it produced while the other AI had a full army(including baneblades). A human player could have taken the city in 5 turns max.
Solution: Don’t retreat units that are blocking your units but instead advance them and the Ai needs to learn how to properly surround
2)The AI has a unit cap
Pretty simple even with ample resources stored and a good income the ai will stop producing units after is has a certain amount.
This is one of the reason why the AI with bigger cheats perform even worse in FFA. Both will reach the cap and this will result in a stalemate
Solution: No unit cap for AI
3)The AI doesn’t use Loyalty Buildings to improve it resources
pretty disappointed as this is a pure math related thing and that’s one thing that AI should be good at.
When your city starts pumping out 100+ resources it should realize that 6 loyalty gives 12+ resources(which is the same resource to energy ratio other building have) while also giving production.
Solution: Add Loyalty resource gain into consideration instead of only avoiding negative loyalty
4)The AI doesn’t settles if enemies are close
There seems to be a check that the AI cant settle if enemies are close.
Had a situation where 1 AI was sitting at only 2 cities despite having an abundance of resources(2000+ of all of them). They were in a fight with an AI city that was fairly close. After they destroyed the city (no other units where left) the AI settled 3 cities simultaneously.
Another problem seems to be that the AI doesn’t send its settlers into directions where there are no enemies. The settlers will always follow its armies and therefore quickly end up with enemies it its vicinity and stop expanding.
Quick example: AI A is in the lower left corne B in the lower right. After discovering each other they will send their troops in the fastest way possible to each other bases quickly filling its way with troops which will cause the to stop expanding especially if the distance is short. However all of the north half of the map would be save to expand though but the AI will ignore it.
Solution: Put in proper risk evaluation for placing cities and give the ai the ability to expand into directions that it currently has no units in but explored.
5)AI can deadlock itself
Granted I only saw this happen one time but the AI managed to get negative energy and exactly 0 ore and food income but 400 in the bank. The AI just stopped and did nothing for the next 30 turns after which it got killed.
Solution: Building something at ½ should be considered better than building nothing and being stuck
I hope this helps and maybe in the future we can have some ffa’s that are as good as the rest of the game :3.