September 24th, 2020, 06:37
(This post was last modified: September 24th, 2020, 08:34 by Seravy.)
Posts: 10,463
Threads: 394
Joined: Aug 2015
Related bug : Due to a change a few days ago, flying units were not recognized as doomstack material.
This might have had a major influence on the AI's ability to conquer as stacks able to conquer a city full of magicians generally consists of a large amount of flying uncommon creatures or better.
Another one : AI ship request array bug caused AI transports to fail to pick up more than one stack at a time
September 24th, 2020, 19:57
Posts: 377
Threads: 10
Joined: Apr 2017
The AI is definitely treasure hunting more effectively now. It's 1505 and I'm seeing AI stacks take on some fairly difficult lairs.
AI stacks still seem to get very different results from reality, though. Check this result: a doom stack of 9 ghouls with wraith form but not focus magic goes into a lair of 6 giant spiders. They take the lair with 0 losses and raise 3 of the spiders.
... no way. Ghouls are one of the weakest common level monsters; their to hit is base 30% and about all they have going for them is their poison 1 at range. Quite often their ranged attacks against even stuff like war bears will do 0-1 damage. And the giant spiders have high resistance and high speed; in effect, they're the perfect ghoul killers. I've tried similar battles, my ghouls would all die within a turn or two. Maybe if all the luck ran my way I'd get out of the battle with a couple ghouls alive.
I dunno, the AI just does not seem to play by the same rules. I don't see how 9 commons vs 6 uncommons comes out with no losses.
Here's a save, the ghouls are at 41x46 and the lair is at 41x44: https://ufile.io/wbido74b
September 24th, 2020, 23:48
Posts: 10,463
Threads: 394
Joined: Aug 2015
Let's see. The spider stack is rated roughly twice as powerful overall, the main difference being the higher defense and their stronger poison.
Turn 1 defender
Spiders are melee and neutral so they do nothing.
Turn 1 attacker
(spending 40 MP)
Spellcasting gives +1 HP
Spellcasting gives a tiny ranged attack bonus (~1%)
Spellcasting deals 1 damage
Spellcasting deals 0.64 resistance based damage
Spellcasting adds +2 hp and about 2% melee attack (1/9th of a Wild Boar unit)
7 Ranged Poison damage is dealt
13 Ranged Magical damage is dealt
Turn 2 defender
Spiders are melee and neutral so they do nothing.
Turn 2 attacker
Spellcasting is 20 MP (half the effect as the last turn)
7 Ranged Poison damage is dealt
13 Ranged Magical damage is dealt
Turn 3 defender
Spiders are fast so they get a melee turn already.
By now, roughly 1/3 of the spider army was lost to ranged damage, making spiders only half as strong in melee as ghouls.
Spiders have double the poisons strength but ghouls have immunity and take no damage.
So basically we have 4 spiders against 9 ghouls and the ghouls take no poison damage. It's obvious the spiders lose and quickly.
Now there is one difference here compared to normal combat, which is web.
In normal combat, the spiders would web ghouls, basically forcing them to skip ranged turns.
There is no way to simulate that because it's not an ability that scales with the user.
Basically, if I make Web count as giving +2 movement speed to the unit that has the web, we can get the correct result except not really. If there are 2 ghouls vs 2 spiders and 7 halberdiers, the ghouls still use ranged because the halberdiers "slow down" the spiders. (2 outs at move 7 and 7 at move 2, the average is ~3 speed)
Likewise if there is 1 spider against 7 ghouls, the 1 spider counts as speed 7 and can move first effectively "webbing" the entire ghouls stack. Although not really because they still get to use ranged, just not before the spiders use melee.
And then there is a final plot-twist. This ghouls stack in this save file has wraith form so it's immune to web. Another detail that can't be included because the wraith form is not on the spiders - army capabilities are calculated separately for each army without knowing what the other army will be.
Overall, the result this time was correct -In my experience Spiders don't work on Ghouls if the Ghoul stack is larger and especially not if multiples have wraith form.
PS : Web Spell ability does give on benefit that wasn't relevant in this battle - the unit with Web Spell counts as being able to hit flying enemies. This too isn't 100% accurate because more fliers than spiders still allow the spider to attack them all, but better than not being able to attack them at all.
September 25th, 2020, 03:14
(This post was last modified: September 25th, 2020, 04:57 by Seravy.)
Posts: 10,463
Threads: 394
Joined: Aug 2015
Having sorted out the AI movement and diplomacy issues, the AI seems to be efficient at sending troops to their targets and keep relevant amount of wars active... but they still can't eliminate or conquer wizards very well. (transportation remains an issue though because transports can be killed on sea and take time to reach the target while the target can build new units and ships locally to reclaim any lost cities. I will run some test on the "less sea" setting and large continents to see if it makes a difference.)
Why? The more accurate automatic combat rules.
Basically, the generic land stacks the AI uses (like halberdiers and such) stand zero chance of conquering a city with generic garrison units (like magicians). The human player can overcome this issue by specifically utilizing strategies that counter that (like 9 spiders with resist elements or mana leak, a stack of gargoyles, a stack of ghouls, casting flame strike or other damage spells in combat, etc) but these are either not available for the AI or nowhere near that efficient in automatic combat.
And this is without any "wall bonus", as far as I see, that sort of modifier wasn't yet added to it.
Objectively looking at it, the only stacks that can reasonably crack "9 magicians" is either 9 durable ranged units (water elementals or better) or 9 rare creatures. (or Elemental Armor/Magic Immunity on most of the stack) - both of which aren't available in large enough quantities to conquer an entire enemy empire.
So in the current test, 1415, finally one wizard is banished the defeated the next turn. By the only person who already has Wraiths in their stacks with focus magic and shadow demons with focus magic. That does confirm my theory that the AI basically needs rare tier stuff or at least the best uncommons to crack the better garrisoned cities.
Any ideas what we can do to help the AI crack those fortified cities earlier?
Wizard elimination happening after rares is still mostly okay (the problem spells that scale poorly with player count at rare and very rare) but I would prefer at least some to happen during uncommons otherwise the AIs will likely fail to expend enough to keep up with a constantly expanding human player. ( I might be wrong on this though as I haven't had to chance to test how much the changes affect the speed human players can expand at.)
Some possible ideas :
1. Introduce spell category weighting for automatic combat depending on combat state.
Basically, right now, the casting power is equally divided between all categories - a wizard with 70 MP will use 10 on direct damage, 10 on summoning, 10 on ranged buffs, 10 on generic buffs, 10 on resistance based direct damage, 10 on...etc, assuming there are 7 categories (I don't remember, maybe there are only 5)
That's not how you play in a real combat - you beat magicians by taking advantage of their low health and focusing on your direct damage capacity. If only 1/7 of the casting power is spent on direct damage, that won't put a dent into the magicians garrison even if the AI has the highest rated direct damage spells.
2. Raise priority of resist elements as an overland spell. It's reasonably cheap to cast and offers a relevant boost to unit durability against magical ranged, but might not be enough to actually beat the magician stacks, does nothing against missile garrisons (like javelineers) and of course whether the buffs go to units that will attack such a city is up to luck.
Currently doing the test with large continents and low sea. The gap between the strong and weak wizards is larger (4x instead of 3x) and there are two wizards reduced to only a fortress city but no wizard was defeated until 1513. So the lack of sea does seem to accelerate conquest speed somewhat, it's probably worth running another 2-3 tests with these settings and see if it was just an accident or more.
September 25th, 2020, 08:11
Posts: 10,463
Threads: 394
Joined: Aug 2015
Let's compare 3 of each game type...
So this is the Large/Plane of Earth test result :
Test 1
Test 2
Test 3
Normal land results :
Coming soon
September 25th, 2020, 11:41
Posts: 10,463
Threads: 394
Joined: Aug 2015
Normal continent size and settings
Test 1
Test 2
Test 3
I don't think there is a significant difference between the two results, so it's probably safe to assume continent size and distance doesn't affect the AI's ability to win wars significantly. (though it might affect who wins those wars but that wasn't the purpose of the test)
Which means we have to somehow tweak automatic combat to give the AI a better chance to conquer cities, at least when the attacker has a relevant superiority in army quantity, casting skill, spell research and or unit quality.
September 25th, 2020, 11:53
Posts: 377
Threads: 10
Joined: Apr 2017
More typically as a player, I'll just bring more than one stack. Stack 1: sacrificial stack, grinds down the garrison. Stack 2: the conquering stack. The more powerful wizards have stacks to spare, could they just coordinate multiple of these moving to the area of the town then coordinating an assault over a single turn?
This is sort of an issue for them already; in my current game Tauron is vastly more powerful than anyone else and slinging around multiple 9-stacks of gargoyles. A single stack can't take down one of my towns, but he could do it if two stacks assaulted.
Alternate point: why does it matter that a wizard survived with 1 or 2 cities? I think the attacker could just get a peace treaty and move on to the next target. Even as a player, fortresses are usually just not worth it to assault.
September 25th, 2020, 12:28
(This post was last modified: September 25th, 2020, 12:28 by jhsidi.)
Posts: 377
Threads: 10
Joined: Apr 2017
Quote:Turn 2 defender
Spiders are melee and neutral so they do nothing.
Turn 2 attacker
Spellcasting is 20 MP (half the effect as the last turn)
7 Ranged Poison damage is dealt
13 Ranged Magical damage is dealt
Wait, the auto combat assumes that turns are played simultaneously? I.e. in real combat the spiders move first and close the distance, then in turn 2 they'd get their attacks on the ghouls. But the defender doesn't get an advantage here?
Quote:Spiders have double the poisons strength but ghouls have immunity and take no damage.
So basically we have 4 spiders against 9 ghouls and the ghouls take no poison damage. It's obvious the spiders lose and quickly.
I had a feeling this is still wrong so I set up a test file with the exact scenario, 9 wraithform ghouls and a lair with 6 giant spiders: https://ufile.io/ay88an2g
Test 1: Ghouls lose; 3 spiders remaining
Test 2: Ghouls win; 4 ghouls remaining
Test 3: Ghouls win; 2 ghouls remaining
Test 4: Ghouls lose; draw, everyone died
Test 5: Ghouls win; 3 ghouls remaining
Test 6: Ghouls lose; 3 spiders remaining
Test 7: Ghouls lose; 4 spiders remaining
Test 8: Ghouls lose; 2 spiders remaining
Test 9: Ghouls lose, 4 spiders remaining
Test 10: Ghouls win, 2 ghouls remaining
So the ghouls completely lost 6 out of 10 times. On the 4 other times, what was left behind were single or double figures, so basically around 1 unit of ghoul surviving.
Of course if combat gave ranged units a completely free turn the way that auto combat seems to, the ghouls would perform much better.
September 25th, 2020, 12:42
Posts: 10,463
Threads: 394
Joined: Aug 2015
Quote:The more powerful wizards have stacks to spare, could they just coordinate multiple of these moving to the area of the town then coordinating an assault over a single turn?
I don't think so. Even assuming the AI has multiple stacks within attack range of a target in the same turn through sheer luck, neither of the stacks would attack because they both individually see "I will lose this battle" and we can't attack into that because we might simply lose all the stacks without winning.
So the results of the consecutive battles would need to be calculated.
However there are issues with that :
1. Simulated damage isn't applied to the units. So it would be necessary to save the defending stack in a separate array, apply the damage for real, then simulate the second attack, then restore the saved data. That part isn't impossible, it's somewhat similar to what the AI does against lairs (it creates the units it would fight and erases them after the simulation).
2. End of combat damage is not predictable. It's distributed randomly. So there is no way of knowing which of the defending units actually is there for the second battle and which died. Obviously there is a big difference between "Sky Drake died, 8 spearmen alive" and "6 spearmen died, 2 alive, sky drake alive and unharmed".
3. There might be "between combat" effects that heal units. Regeneration, Stream of Life, etc. or zombies/ undead might be raised. These don't happen during the simulation.
4. The attacks have to be done in the exact same order the simulation did but the AI executes all moves within the phase randomly. This can probably be solved by storing an "order of moves" variable on the unit.
5. Other unforeseen circumstances. For example undead get raised and block the tile needed to reach the city.
I considered simply telling the AI to accept attacks that are a defeat if the enemy takes significant damage but that doesn't work either. If the damage isn't at least 80-90% then most units survive and heal back in a few turns (cities heal units faster) and if it's already that high then we can ignore the problem, sooner or later we'll have a 10% stronger stack in the area. There is also the chance someone else (mainly the human player who knows this is a feature) takes the opportunity and kill steals the target so the AI loses the army and doesn't get the target either.
Quote:Alternate point: why does it matter that a wizard survived with 1 or 2 cities? I think the attacker could just get a peace treaty and move on to the next target. Even as a player, fortresses are usually just not worth it to assault.
We had several things.
- Divine Order. The surviving wizard can keep this in play and alter the game flow globally for everyone.
- Spell Blast. Same thing as above. MP might be a limiting factor here but it's possible to hit spells when 0 MP progress was made and counter them for free so not really.
- Spell trading. The AI might act as a distribution center for higher tier spells. (the AI positive diplomacy scaling added yesterday should prevent this at least)
- Spell trading with the human player. This is a major issue because any spell the AI was able to research before losing the war is basically a free present for the human player. They can easily surpass the AI in research and give the high tier spells to the now harmless AI to get anything they missed in exchange. I would never give Colossus or Disintegrate to another player normally for something like Black Prayer or Petrify but if they are already defeated then it's a free uncommon or rare for me and the AI will be guaranteed to accept since they won't ever make it to researching very rares on their own.
- Triggering Power Link. It doesn't matter that the AI knows to prefer more expensive spells to avoid triggering it when there are several AIs stuck at knowing only uncommon or worse spells in the game who will be casting those spells because they don't have anything else.
- Triggering Fairy Ring. Same as above really, but at least this requires the AI to know rare spells so it's less of a problem.
- Escalating Alliance based war declaration. No matter how weak they are, if they are allies to 5 other people and remain in play then declaring war on any of those 5 players will get you into a war with all 5 - even if those 5 are otherwise not allied and this wizard is the only "link" to conduct the war declaration chain.
- Those cities will be missing from the empire of other wizards making them weaker. Not a big deal usually but try that in a 13 player game on Tiny landmass and suddenly those leftover capital cities are worth a lot.
- They eat up resources. Peace doesn't last forever, and as soon as they get into a new war, the units they made will be attacked and drain away valuable MP from someone else through combat spellcasting.
- If they are alive their city curses stay in play, so the "winner" of the war will probably end up losing the game on the long term.
I think these are more than enough reasons.
September 25th, 2020, 13:21
Posts: 10,463
Threads: 394
Joined: Aug 2015
Quote: Wait, the auto combat assumes that turns are played simultaneously? I.e. in real combat the spiders move first and close the distance, then in turn 2 they'd get their attacks on the ghouls. But the defender doesn't get an advantage here?
No, turns are in the order I listed - each full turn basically has 4 phases in that exact order.
Defender ranged (if turn<6 only)
Attacker ranged (if turn<6 only)
Defender melee (if melee started)
Attacker melee (if melee started)
"if melee started" depends on movement speed and as we adjusted last time, once a side started melee, after that both players get melee phases but for that one turn only the faster army gets one.
Spiders have enough movement speed to get the melee phase on turn 3 which is mostly realistic. (yes, in normal combat under perfect circumstances they reach on turn 2. But circumstances aren't always perfect, see below...)
Quote:I had a feeling this is still wrong so I set up a test file with the exact scenario, 9 wraithform ghouls and a lair with 6 giant spiders: https://ufile.io/ay88an2g
For fairness sake I will limit myself to casting common spells only. (I don't know what spell tier the wizard had access to)
So one thing I noticed was, the spiders didn't even reach the ghouls on turn 2 except for one. The forest tiles slowed them down and I stepped backwards. So getting 2 free turns of shooting is actually accurate for this specific combat terrain.
So on turn 3, it was exactly as expected, 4 spiders attacking my surviving 8 ghouls (only lost 1 to the spiders that managed to go through the forest earlier.) while 2 spiders already died to my ranged attacks.
End result was me losing 1 ghoul, 1 in red, 1 in yellow, 1 in green and 5 undamaged.
I could play it a few more times but the outcome would be mostly the same, if they can't reach me then that's that.
Obviously, the forest tile is to my advantage here so it's not an entirely fair test, but I still don't understand how you got your results. I only managed to lose if I didn't move my ghouls and didn't cast any spells - but the AI spent 60+ MP on this battle.
While the AI casting effects I listed weren't so great, it does add up : an extra 1-2 figure of ghouls and 1 fewer figures of spiders, plus the entire ghoul army had about 5% higher attack power. Also one thing I didn't pay attention to so wasn't listed was the buff the ghoul side gained from the "first turn spellcasting" bonus which is basically the replacement for combat globals.
..overall, I have the feeling spellcasting is underestimated by the system, I know it's only common spells but is 60 MP seriously only worth like 4 damage and 2 ghoul figures bonus?
|