Songs of Conquest

Songs of Conquest

View Stats:
David May 23, 2024 @ 7:28am
The AI cheating is breaking certain maps
I never quite noticed it until I put a high level AI on my team to follow its movements quite how much they cheat. Resources are one thing, that's fine, most AIs get a head start at high difficulties to be able to compete with players. The AI has the typical cheater issues where they start very strong/near impossible, but if you just hold out they lose steam and fall behind very quickly, which is normal for most strategy games I am fine with that, it's okay.

What is special is just how much the AI cheats against neutral camps. Their battles are legit absurd, like insanity level cheating, mathematically impossible fights that should just not happen and that can cause some issues. For example the AI showing up at the players doorstep extremely early on smaller maps, or maps where there's a really short route that's blocked by extremely tough camps.
A lot of maps are designed with tough encounters blocking paths and special resources that should only become accessible late in the game, however the AI can completely ignore these design choices and go through unimpeded. This also causes issues with the difficulty settings becoming unreliable depending on the map you choose.

Here's my test:
I used 'Overwhelming' AI difficulty for this test - The 2nd highest setting, because I noticed a sharper than usual jump between Challenging and Overwhelming, I wanted to see why the difference between these two settings is so high.

I raised initial camp strength to 300% with maximum growth to see just how much the AI cheats. The nearest camp was 51-99 sappers with 11-25 archers on turn 3, guarding an amber production structure - Very high value target blocked intentionally by a decently tough fight that I cranked to be 3 times as tough as normal.

The AI cleared it on turn 3. Its wielder was level 1 with 45 rats 1 necromancer and 5 oathbound. The AI not only cleared this camp, but did so with only 4 rats and 1 oathbound lost. That is mathematically impossible.
Those are ranged troops capable of shooting at the rats and killing at least 20 in a single turn, the idea that the AI lost 4 rats in the entire battle is insanity.
I can't explain how it would be possible for a level 1 wielder to win that fight let alone win with so few losses.
So I'm assuming the AI got some ridiculously heavy buffs against neutral camps specifically or the fight simulation is just really REALLY broken.
I did another test where the same camp was a Barya camp instead or Arleon, with steam pipers, veteran pikeneers and veteran musketeers and suspiciously the AI lost exactly the same amount of units. 4 rats and 1 oathbound. It appears that whether it's archers&sappers or pikes&muskets, the result stays the same.

Now, I'm sure the simulations are simplified to save time for the player, and kudos to the game devs bc turn ends take nearly no time at all to load, but something's not quite working as it should if the AI can bulldozer tough encounters meant to stop players from progressing without an effort. It essentially breaks multiple maps completely, making the AI difficulty settings vastly unreliable depending on what map you're playing on. Some maps you might select a difficulty you're comfortable with and breeze through the map no problems, other maps you're going to get attacked on turn 10 by an army with a lvl 15 wielder and 15k army value, because the only thing standing between you and the AI was a highly difficult to defeat neutral camp that the AI can clear with no losses. This also has the side-effect of giving the AI insane amounts of experience points, since they can take MUCH tougher fights much earlier without losing any units.

I did some further tests and it looks like under normal settings the AI is just not losing any units in any of the neutral camp fights. They can clear pretty much anything with anything without losing units, which is just not a good way to balance the higher difficulty AI.

Recommendation:
1) Try to make fights between the AI and neutral camps at least reasonably withing what's mathematically possible.
2) Scaling difficulty - Rather than all bonuses being applied from turn 1, the cheats the AI gets should increase with time. This way the AI would no longer run out of steam after their one big early game attack and can maintain pace with the player. Also this way they wouldn't be doing All-in strategies anymore that attack ridiculously early and lose them the game if you defend them.
Last edited by David; May 23, 2024 @ 8:34am
< >
Showing 46-60 of 64 comments
David May 24, 2024 @ 5:55am 
Originally posted by Ail:
Just because it doesn't do better in Civ, it doesn't mean there's no better ways of doing it.

Decent build-project-selection-AI doesn't just follow a fixed build-order. It scores the items that it can build and then picks the one that gets the highest score. And those scores can be very much situational adapted.

I'm pretty sure that's how SoC-AI already works.
For example: Having no wood but a huge need for wood would elevate the score of a lumber-camp.
Having lots of money but no unrecruited units would elevate the score of a unit-production-building. Which unit-production-building to produce can also depend on scores. For example if the wielder is a magic-user, prefer a building that produces units that produce a lot of essence.
Of course I simplified a bit and I'm no AI expert, but I know it's not as simple as just a build order, but yeah the weighted decisions method seems good. I'm sure many strategy games use some version of it, though Civ AI seems very rigid to me, but I don't know exactly what's behind the curtain there, but it's not very flexible.

Originally posted by Ail:
A big part of writing AI is to comprehend the thought-process of the player and then translate that into mathematical algorithms.
It can be a good philosophy, but you have to also know when to discard it.
Starcraft 2 has a couple cases where the brutal AI was programmed to make harder to execute moves like focus fire, but it can backfire on them. For example they often go out of their way to target down medics, which if the player knows, they can place medics deliberately in spots that bait the AI into a bad engagement.
The AI trying to be smart can sometimes make it do dumb things, interestingly enough.

Originally posted by Ail:
Funnily enough coding AI has made me better as a player too because I found out that for many things in a game I didn't really have a thought-process and was just following my intuition. But intuition isn't something I can describe in an algorithm. So I had to figure out an algorithm that comes to similar results as my intuition and with iterative improvements it often turned out that my initial intuition wasn't all that great compared to the algorithmic approach I developed for doing things.
Knowing a bit of coding and observing/testing out games has made me realise how easy it is to abuse the AI in so many games. Once you peek behind the curtain it can make it shockingly easy to find behaviours the player can exploit.
Ail May 24, 2024 @ 6:21am 
Originally posted by David:
Knowing a bit of coding and observing/testing out games has made me realise how easy it is to abuse the AI in so many games. Once you peek behind the curtain it can make it shockingly easy to find behaviours the player can exploit.
The ideal scenario from my perspective is having a bit of an arms-race with the players.
You start from the best you can do without help and then let players report these things that they can exploit about your AI.
Knowing this, you can then come up with solutions to counter those exploits or mimic them if they are generally useful.

For my "Remnants of the Precursors"-AI that's something I have done. For example: Players figured out special tactics like using repulsor-beams to protect ships that don't have repulsor-beams themselves. The AI would already realize when it can't harm the ships with the repulsors but would still try to get to those without. So they just allowed the player to kill a lot of their ships before they would eventually retreat.
So I had to find a way to identify the situation and have the AI act accordingly.

If you keep doing these reactive AI-fixes until they dwindle down and you don't get reports about stupid behaviors anymore, you'll end up with a much stronger AI than what you started with.
Ail May 24, 2024 @ 7:38am 
Originally posted by David:
It can be a good philosophy, but you have to also know when to discard it.
Starcraft 2 has a couple cases where the brutal AI was programmed to make harder to execute moves like focus fire, but it can backfire on them. For example they often go out of their way to target down medics, which if the player knows, they can place medics deliberately in spots that bait the AI into a bad engagement.
The AI trying to be smart can sometimes make it do dumb things, interestingly enough.
Yes, part of understanding the player's thought-process is also understanding when not to do something.

Btw. real-time is really a different kind of animal when it comes to making AI for. I tried making a SC1-Bot with BWAPI with some success but overall it was very frustrating. The big difference to turn-based is the debugability being so much worse. With turn-based games I simply have an auto-save every turn and replay the turn over and over in order to reproduce, fix and test an issue.

With real-time it's extremely difficult to figure out when something went wrong. For example: I had an issue where my AI would stop making additional hatcheries but I have never been able to figure out when. Or it would stop transfering drones to other bases and I also couldn't figure out why. The AI does a cycle 25 times per second. So logging everything is impractical. If one single thing breaks it can cause a cascading effect and the whole game will be lost.

It's a shame. My AI was the best of all of the competitors when it came to killing enemy scouts because I predicted their movement and sent my zerglings not to where the unit currently is but where it will be in the near future.

It also had a very adaptive macro-style that could seemlessly switch compositions if needed. But for that it wouldn't have to break on the way there.

Also it was so tough to deal with all the cheese-bots that only did one thing but really well. If I play a build that is save against off-gates it will be much worse against anything economical.

Another thing is you also couldn't make your algorithms too complex because they'd have to be processed within a split-second.

There were some extremely clever workarounds right in the API. For example the map was analyzed once and the data of that analysis was stored as a file. This way the AI didn't have to pathfind but could instead access a model of the map where the pathfinding was already done.
Slowpork May 24, 2024 @ 7:44am 
Originally posted by Ail:
Originally posted by David:
It can be a good philosophy, but you have to also know when to discard it.
Starcraft 2 has a couple cases where the brutal AI was programmed to make harder to execute moves like focus fire, but it can backfire on them. For example they often go out of their way to target down medics, which if the player knows, they can place medics deliberately in spots that bait the AI into a bad engagement.
The AI trying to be smart can sometimes make it do dumb things, interestingly enough.
Yes, part of understanding the player's thought-process is also understanding when not to do something.

Btw. real-time is really a different kind of animal when it comes to making AI for. I tried making a SC1-Bot with BWAPI with some success but overall it was very frustrating. The big difference to turn-based is the debugability being so much worse. With turn-based games I simply have an auto-save every turn and replay the turn over and over in order to reproduce, fix and test an issue.
Your comments made me realise why the golden era of strategy games was 10, 15, 20 years ago. Quality of code and programmers fallen dramatically over the years (not talking about SoC).
Jean-Maurice Nya May 24, 2024 @ 7:46am 
Which is also a result of the diminishing standards in society, and mainly the demand. Addicts have pretty low standards, the goods offer doesn't need to improve them. That's a whole.
sisqo102 May 24, 2024 @ 8:06am 
My question is, does the AI in HoMM 3 cheat in the same way as far as fog of war, I read it sees the whole map like here but does it see the player thru the fog? Already bought both games just having a hard time deciding which to deep delve into first. And further, is the ai in this game better than homm 3 in general?
David May 24, 2024 @ 8:32am 
Originally posted by Slowpork:
Your comments made me realise why the golden era of strategy games was 10, 15, 20 years ago. Quality of code and programmers fallen dramatically over the years (not talking about SoC).
For some companies that's undeniably true, but there's other factors too.
A shift in gaming trends and the biggest companies quitting the genre entirely kind of killed RTS for a long time. Blizzard was basically the king of RTS and they abandoned Warcraft entirely focusing on World of Warcraft instead and Starcraft 2 kinda just chugged along, getting some ressurgences with each expansion and especially with the Co-Op mode, but it was then abandoned and also while it was alive, it also took air from a bunch of would-be competitors.

The MMO craze and then the MOBA craze took the market by storm, so there just weren't that many strategy games being released, all the big companies were chasing trends, RTS was an old genre that they didn't see much promise in.

For turn based, Heroes of Might and Magic kind of just declined into oblivion over the years, each sequel getting worse and performing worse, there wasn't even a lot of competition, not many companies wanted to make a game in the genre at least until this one came along.

But there were other strategy games that did perform well. Civilization has been going decently strong for a while now and Paradox carved out a niche and is going steady, meanwhile Total War carved out their niche and proceeded to promptly run it into the ground.

All this to say, there's a reason coding fell over the years, because there simply wasn't much interest for companies to invest into the genre. Strategy doesn't quite have the same mass appeal as some of the more action oriented games do, and the console market also became rather huge, and strategy games don't do well on consoles.

That said there is an RTS boom in the making with the likes of Stormgate, Zerospace, Gates of Pyre and some yet to be announced titles in the works, all made by reputable teams with a lot of community support and I think Turn-based strategy can also make a resurgence, if SoC does well, then perhaps there's going to be other games like it.
hardy_conrad May 24, 2024 @ 10:22am 
A.I. cheating is one of those things that can be frustrating, but as I have zilch understanding of programming I give the developers the benefit of the doubt. Based on what I've read here it's to some extent that Alice in Wonderland deal, the race of the red queen, where you have to work as hard as you can just to stay in place. Yes technology gets better over time but games also get more complicated, so the net result is a need to fall back on cheating just as much today as decades ago.

I will single out Civilization as being something that really drove me up the wall though. A human player will build libraries, universities, have scholars, specialists, resource buffs and so on and so on to research technologies. Meanwhile the computer opponent simply uses the formula "my tech level = player tech level + difficulty". Ugh. Still have a grudge from the time Germany stole democracy from me and built the associated wonder in the same turn, which is literally impossible for a human to do.
Measuperbia Dec 30, 2024 @ 6:58am 
Lavapotion.
Please fix the absurd cheating AI, its driving away my motivation to play
Echo Dec 31, 2024 @ 6:39am 
Is it still the case that the AI has a huge advantage over the neutral camps?
SquareDildo Dec 31, 2024 @ 6:50am 
AI cheating is documented in the tutorial/Codex.
Nagumo Dec 31, 2024 @ 7:50am 
Alas one of those issues they still have not solved in Strategy games.

How long do we have good Chess-AI but still take a look at all those big Franchises, like CIV or HOMM --> all of them get really fast boring vs. AI, because the Devs are not capable or want to implement sometimes the most basic rules. (Furthermore take a look at all the ongoing AI development in any other way in the www).

And i know all the argues, since i have played my very first digital Board Game, about "a good AI would be bad to play etc. etc.", again --> why was it able to coded for Chess 40 years ago already, with a lot of Difficulty Options (the very first one of my father have had 12 iirc, as a Kid i never ever going above Level 3 or 4?).
And please, do not bring the argue "games like CIV or SoC are much more complex then Chess, because "yes they are" but in the End it is only a longer road. Is it hard to code, i really believe so, but is it really not possible to do? In the End it is a time = money thing, because: How many Players will even think about it or mentioned it?

Same road as going for a good written storyline. Why is SoC first DLC have no new Campaign --> because it is a time/energy investment, they could not afford, and this is not said in any critical way, it is just the way they have decided to go.

In conclusion: I really not except a perfect AI from such a samll Indiecompany, but frankly franchises like Civilization should increase the overall experience, because this way smaller companys could maybe learn and copy some "ideas or ways" to let the time/energy investment going down for a very good AI.
Last edited by Nagumo; Dec 31, 2024 @ 7:51am
Bumc Dec 31, 2024 @ 10:12am 
Big franchises look at statistics about how many players actually engage with high difficulty and also decide that writing better logic for AI is not worth the investment.
David Dec 31, 2024 @ 10:58am 
Originally posted by Nagumo:
Alas one of those issues they still have not solved in Strategy games.

How long do we have good Chess-AI but still take a look at all those big Franchises, like CIV or HOMM --> all of them get really fast boring vs. AI, because the Devs are not capable or want to implement sometimes the most basic rules. (Furthermore take a look at all the ongoing AI development in any other way in the www).

And i know all the argues, since i have played my very first digital Board Game, about "a good AI would be bad to play etc. etc.", again --> why was it able to coded for Chess 40 years ago already, with a lot of Difficulty Options (the very first one of my father have had 12 iirc, as a Kid i never ever going above Level 3 or 4?).
And please, do not bring the argue "games like CIV or SoC are much more complex then Chess, because "yes they are" but in the End it is only a longer road. Is it hard to code, i really believe so, but is it really not possible to do? In the End it is a time = money thing, because: How many Players will even think about it or mentioned it?

Same road as going for a good written storyline. Why is SoC first DLC have no new Campaign --> because it is a time/energy investment, they could not afford, and this is not said in any critical way, it is just the way they have decided to go.

In conclusion: I really not except a perfect AI from such a samll Indiecompany, but frankly franchises like Civilization should increase the overall experience, because this way smaller companys could maybe learn and copy some "ideas or ways" to let the time/energy investment going down for a very good AI.
Stellaris more or less fixed this issue with scaling difficulty.
The AI gets the cheating bonuses same as they do here, but the bonus is not a static one, but rather they get more the longer the game goes on, that way even if the player snowballs harder than the AI, the AI will be able to match the player, and the AI is no longer impossible to beat at the start of the game.
Scaling difficulty should be industry standard for all strategy game and it boggles my mind that it is not.
Originally posted by David:
I never quite noticed it until I put a high level AI on my team to follow its movements quite how much they cheat. Resources are one thing, that's fine, most AIs get a head start at high difficulties to be able to compete with players. The AI has the typical cheater issues where they start very strong/near impossible, but if you just hold out they lose steam and fall behind very quickly, which is normal for most strategy games I am fine with that, it's okay.

What is special is just how much the AI cheats against neutral camps. Their battles are legit absurd, like insanity level cheating, mathematically impossible fights that should just not happen and that can cause some issues. For example the AI showing up at the players doorstep extremely early on smaller maps, or maps where there's a really short route that's blocked by extremely tough camps.
A lot of maps are designed with tough encounters blocking paths and special resources that should only become accessible late in the game, however the AI can completely ignore these design choices and go through unimpeded. This also causes issues with the difficulty settings becoming unreliable depending on the map you choose.

Here's my test:
I used 'Overwhelming' AI difficulty for this test - The 2nd highest setting, because I noticed a sharper than usual jump between Challenging and Overwhelming, I wanted to see why the difference between these two settings is so high.

I raised initial camp strength to 300% with maximum growth to see just how much the AI cheats. The nearest camp was 51-99 sappers with 11-25 archers on turn 3, guarding an amber production structure - Very high value target blocked intentionally by a decently tough fight that I cranked to be 3 times as tough as normal.

The AI cleared it on turn 3. Its wielder was level 1 with 45 rats 1 necromancer and 5 oathbound. The AI not only cleared this camp, but did so with only 4 rats and 1 oathbound lost. That is mathematically impossible.
Those are ranged troops capable of shooting at the rats and killing at least 20 in a single turn, the idea that the AI lost 4 rats in the entire battle is insanity.
I can't explain how it would be possible for a level 1 wielder to win that fight let alone win with so few losses.
So I'm assuming the AI got some ridiculously heavy buffs against neutral camps specifically or the fight simulation is just really REALLY broken.
I did another test where the same camp was a Barya camp instead or Arleon, with steam pipers, veteran pikeneers and veteran musketeers and suspiciously the AI lost exactly the same amount of units. 4 rats and 1 oathbound. It appears that whether it's archers&sappers or pikes&muskets, the result stays the same.

Now, I'm sure the simulations are simplified to save time for the player, and kudos to the game devs bc turn ends take nearly no time at all to load, but something's not quite working as it should if the AI can bulldozer tough encounters meant to stop players from progressing without an effort. It essentially breaks multiple maps completely, making the AI difficulty settings vastly unreliable depending on what map you're playing on. Some maps you might select a difficulty you're comfortable with and breeze through the map no problems, other maps you're going to get attacked on turn 10 by an army with a lvl 15 wielder and 15k army value, because the only thing standing between you and the AI was a highly difficult to defeat neutral camp that the AI can clear with no losses. This also has the side-effect of giving the AI insane amounts of experience points, since they can take MUCH tougher fights much earlier without losing any units.

I did some further tests and it looks like under normal settings the AI is just not losing any units in any of the neutral camp fights. They can clear pretty much anything with anything without losing units, which is just not a good way to balance the higher difficulty AI.

Recommendation:
1) Try to make fights between the AI and neutral camps at least reasonably withing what's mathematically possible.
2) Scaling difficulty - Rather than all bonuses being applied from turn 1, the cheats the AI gets should increase with time. This way the AI would no longer run out of steam after their one big early game attack and can maintain pace with the player. Also this way they wouldn't be doing All-in strategies anymore that attack ridiculously early and lose them the game if you defend them.
I've noticed it in this and that similar Sirens game. And on the easy modes. Pretty much every map so far on both has me blocked of with unwinable encounters and not enough resources in the areas i'm blocked into. Yet the ancient Heroes of might and magic gives a lot more freedom. But maybe i'm just unlucky. Like really unlucky. Or just need to get good.
< >
Showing 46-60 of 64 comments
Per page: 1530 50