November 26th, 2017, 18:44
Posts: 10,495
Threads: 395
Joined: Aug 2015
btw I'm still looking for suggestions to replace "rule 4" on the AI.
November 26th, 2017, 19:19
(This post was last modified: November 26th, 2017, 19:23 by Nelphine.)
Posts: 5,010
Threads: 17
Joined: Aug 2016
For me, rule 4 plays into overall production rules.
While you've given them to us, I haven't had time to look over them in detail yet.
I do think nomads should do stables instead of fighters guild, even with the strategic strength difference.
I think its amusing that they're forced to build the smithy, when I almost invariably sell smithies from conquered cities.
That being said, even ignoring the differences for specific races, I don't think we can avoid having AI go straight to fighters guild. The AI simply doesn't know when its units are relevant. It can't build several cavalry, several bowmen, several swordsmen, and then use the appropriate one based on the human units. It only knows strategic strength. Unlike the human who can take advantage and attack with the right unit mix.
Basically they are lovely units, balanced against each other, that the AI doesn't understand and so it has to skip to halberdiers which have no specials (and so therefore the AI actually understands them).
Which again leads to, we can't make any of the four low tier units strong enough to encroach on halberdiers, and the AI is going to skip them anyway. The best we can do is increase them to make halberdiers not as cost efficient. (But note, this already leads to humans using halberdiers instead of anything better due to cost efficiency, so in extreme cases this could quite literally lead to hunams never building fighters guilds, just like I never build armorer's guilds.)
November 26th, 2017, 20:39
Posts: 10,495
Threads: 395
Joined: Aug 2015
Tried to look up the discussion about implementing this AI "rule 4" and realized it's nothing like we thought. It wasn't added because the AI needs the fighter's guild units to stop summoned creatures or anything like that, no. They have their own summoned creatures for that and those even stop attacks from enemy units better than halberdiers ever will.
What it was added for is,
1. to prevent the AI from overextending, that is, pumping out settlers endlessly without raising any of the cities in military tier, ending up with an empire that has 10 cities already but still produces swordsmen everywhere on turn 70 which makes it easy to take for the human
and
2. To give the player some place for their own settlers instead of hogging everything like there is no tomorrow, resulting in the human not being able to plant their second settler at all.
Forced production of a Fighter's Guild, an expensive building, creates a ~10 turn gap between settler 2 and 3, which is not much and won't threat the AI's performance, but does mean the human player gets a much better chance to build at least 2-3 outposts before there is no more land to build on nearby.
Note that I haven't found any discussion about this around the time it was added - I merely remembered this all started with the "make the AI produce less settlers, this is unplayable" complaints. Which was bad for the AI as it was serving easy to conquer cities for the human instead of being a threat, and also bad for the human because not being able to use settlers all the time is annoying.
I'm not sure if this was before or after the fixing of the AI bug where they only sent settlers to lands near the human, but I suspect it was before. So that probably shouldn't be a concern anymore - but overextending without the ability to build better units is a very valid problem. Cities will generally have units they can produce as the garrison, so if the AI does do other stuff like economy buildings first, they are just doing a favor for the human by giving them a better city. So we probably don't want it to do other buildings without other units - but mixing the two might not be that bad.
Swordsmen do horrible at defending cities sadly as they are wiped out by poison and bows as well. Cavalry is slightly better, it works well vs ranged attackers, but fails against melee units like nagas or hell hounds anyway. Bowmen are semi-ok actually, as long as we are fine with Guardian Wind and Skeletons becoming stronger for human players. So giving the AI a small timeframe for bowmen and cavalry while they can also get their marketplaces and such before the FG might not be a bad thing...but I don't think it's good either, more like, about the same - assuming they do get the FG going in the capital at the very least. We can also hope the AI hits the city with the summoning circle and dumps a few summons into the garrison to improve it somewhat, so it does well without halberdiers. Honestly, I don't think halberdiers are that good for the AI - they are as weak to ranged attacks as swordsmen. They only work against certain threats like bears or nagas but fail vs ghouls. So FG first is only really a good tactic if the AI has a race with a strong FG unit like lizardmen and barbarians or the game did progress into the state when the AI has a decent production capacity to support massive stacks of halberdiers.
Overall, I do think we have some room to tweak rule 4, but not too much - The FG tactic should still come into play early enough on the larger cities, but the small ones might not need it on certain races. (But definitely for others. I do think Dwarf, Gnoll and Barbarian must always go for their military buildings - steam cannons, berserkers and wolf riders are that good.)
I might underrate the importance of AI halberdiers though. We haven't had a chance to see an AI without the broken, overdone "rule 4" since the release of...I think, 4.0 or around that when the new AI overland production procedure was made so I can only speculate how good or bad the rule is currently.
We probably need to go through races separately.
Barbarians : definitely do FG. Nothing compares to berserkers here.
Gnolls : Stables here which is cheap and generated production so can't go wrong with doing that early and Wolf Riders are probably better for the AI than halberdiers anyway.
Beastmen : Might do better if FG is not rushed - their FG units aren't that much better actually, so doing FG somewhat later might work better here. FG should be the building to go for though - as it is needed for Centaurs and as an intermediate step towards Minotaurs and Manticores.
Dark Elf : depends on how we update the race, their halberdiers actually aren't that great as is compared to swordsmen, and the AI knows how to use the ranged cavalry. Maybe force the stables early instead?
Draconian : Not sure if their halberdiers are really that much better to be worth the FG rule and they only need the FG for doom drakes as next tier racial unit. Forcing the Maritime Guild for Air Ships might be interesting. However being a Myrran race, strategic strength is important here and only halberdiers have a good one for the race. Forcing FG only if the human is not Myrran might be best? idk.
Dwarf : Forced University for Steam Cannon, perfect. They don't have bowmen and cavalry to build to begin with so they have to upgrade.
Halfling : They no longer have bowmen and never had cavalry while their swordsmen are subpar without buffs so they must do the fighter's guild unfortunately, even if the slingers aren't that amazing for AI use. The only other alternative would be the wizard's guild for magicians but that's way too expensive. Or Shamans but they are far too weak.
High Elf : Longbowmen are great but we can't force those easily because Forester's Guild needs a Forest tile which we might not have access to. The race benefits from early granary and such a lot though, so delaying the Fighter' Guild, but forcing it later seems the best solution, similarly to beastmen.
High Men : If we add a new unit, we'll probably need to teach the AI to go for that, if the new unit is early enough. Otherwise, not sure, the Pikemen aren't that good for the AI, but the rest are bad too.
Klackon : No choice here, must do early FG, that's the correct play with the race, even for the human.
Lizardmen : Same, no bowmen or cavalry, but Javelineers instead...
Nomad : I guess stables first and FG at a later time would work better than only FG but early.
Orc : Orc units are not strong to begin with, the race is more into the growth/economy. Halberdiers and even Hordes are still easy to kill. So upgrading to them might not be the best tactic, but I have no better idea.
Troll : Their swordsmen are actually not that bad but being a military race, they probably should try to pump out as strong units as possible as early as possible. So unsure on this one as well.
November 27th, 2017, 02:50
(This post was last modified: November 27th, 2017, 02:51 by Arnuz.)
Posts: 542
Threads: 4
Joined: Jul 2017
Seravy, I've just broken through the towers in a game to find a nomad AI with all the cities full of mages. It's got bears and nagas, I guess the mages are considered a stronger unit.
So, thanks to the fact that there are only ranged magic units I can conquer them all with a single hero with high enough resistance/invisibility, or nightblades, golems, or anything else that works with this kind of opposition.
For me what's more important is to try and teach the AI to use mixed troops for defence. Sure, the strategic strength will be lower, and AI vs AI fight could be worst but for humans having a single type of defence make attack too easy imho. The use of the weaker units means however that the roaming stacks could be stronger and be ready for aggression earlier!
So what I'm suggesting is to tweak rule 4 and the garrison rule at the same time. Ideally I'd like them to have 1/2 shamans, some mix of melee and ranged units, and eventually to upgrade the melee from swordsmen to halberds and from bowmen to mages in general...
November 27th, 2017, 07:24
(This post was last modified: November 27th, 2017, 07:26 by Seravy.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
Ehh, I'm having serious doubts about mixed garrisons. So they have 4 mages and 4 halberdiers?
Use the invisible unit or equivalent to kill the 4 mages, retreat, now kill the halberdiers with any army.
But you don't need to resort to such trickery. Bring 9 mages of your own. You lose 2-3 on the first turn but then the remaining ones destroy the enemy mages and then also the halberdiers because 9 mages are better than 4 mages and 5 halberdiers.
The AI uses magicians only because they are strictly better than mixed garrisons in most cases. There are potential exceptions, for example griffin mixed with mages works well.
But there is one more concern. Units that don't stay in the city will be pushed into offensive stacks. Mages are bad at doing that. So while the magician and the griffon are equal in the garrison, it's clear the griffon is better in the offensive army and shouldn't be wasted as garrison.
...Also, magicians are easy to unlock. Other units good enough to mix with them generally require an armorer's guild or equivalent which will not be available for a very long time. So even if the AI happens to mix the units, they'll still have only magicians for a long period of time.
November 27th, 2017, 07:29
(This post was last modified: November 27th, 2017, 07:33 by Seravy.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
This is the current garrison priority table. Units with identical or similar values can get mixed - each level is worth +2 points. So a level 2 unit with 9 score can be mixed with a level 0 that has 13 score, or another level 2 with 9 score. Lower score leaves the city, higher stays.
Code: Necromancer HERO 120
Beastmaster HERO 110 Soul Link, good for endgame capital even! (garrison will be fantastic)
Colossus 100
Sky Drake 100
Demon Lord 95
Great Drake 95
Arch Angel 95
Illusionist HERO 90 Overpowered defender, keep in capital if has levels, or no VR creatures!
Great Wyrm 87
Behemoth 87
Djinn 87
Efreet 85
Stone Giant 80
Storm Giant 80
Chaos Warrior HERO 80 Better than a Storm Giant
Hydra 75
Death Knights 75
Gorgons 75
Swordsmen HERO 74 Raise Dead!
Priestess HERO 72 Prayer, Prayermaster
Shadow Demons 70
Sage HERO 70 Has mass dispel, good capital defender
War Monk HERO 70 Super agility, extremely hard to kill
Magician HERO 70 Flame Strike!
Witch HERO 70 Black Prayer, nice for capital defense
Warlock HERO 70 Doom Bolt
Dwarf HERO 67 Has armsmaster so should stay and level other heroes in capital for a while
Warlocks 65
Nightmares 61
Golem 60
Magicians 58 Draconian
Chaos Spawn 55
Wraiths 55
Angel 55
Great Lizard 55
Magicians 55 Troll
Chimeras 55
Unicorns 50
Demon 50
Earth Elemental 50
Magicians 50 High Men, Halfling
Paladins 50
Magicians 46 High Elf
Magicians 42 Other
Doom Bat 30
Water Elemental 29
Fire Giant 28
Gargoyles 27
Dragon Turtle 25
Rangers 25
Sprites 20
Steam Cannon 20
Bard HERO 20
Paladin HERO 20 Send these out to fight enemies, they are better in attack teams
Black Knight HERO 20 Send these out to fight enemies, they are better in attack teams
Priests 18 High Men, Dark Elf
Air Ship 18
Slingers 18
Pegasai 18
Saints 17
Ghouls 17
Shaman 17 Troll
Hammerhands 17
War Trolls 17
Minotaurs 16
Jackal Riders 16
Giant Spiders 15
Shaman 15 Halfling
Priests 15 Other
Horde 15
Doom Drakes 15
Stag Beetle 15
Javelineers 15
Wyvern Riders 15
Dervish HERO 15
Healer HERO 15
Huntress HERO 15
Elven Lords 14
Pikemen 14 Nomad
Griffins 14
War Mammoths 14
Bowmen 13 Draconian
Manticores 13
Catapult 13
Werewolves 12
Cockatrices 12
Halberdier 12 Nomad, Dark Elf, Draconian, Troll
Shaman 12 Other
Berserkers 12
Longbowmen 12
War Bears 10
Halberdier 10 Gnoll, Klackon, Lizardmen, Beastmen, Dwarf
Pikemen 10 High Men
Barbarian HERO 10
Orc Warrior HERO 10
Thief HERO 10
Druid HERO 10
Warrior Mage HERO 10
Assassin HERO 10
Wind Mage HERO 10
Ranger HERO 10
Draconian HERO 10
Golden One HERO 10
Ninja HERO 10
Rogue HERO 10
Amazon HERO 10
Unknown HERO 10
Elven Archer HERO 10
Knight HERO 10
Chosen HERO 10 Send this one out as soon as possible to gain experience!
Phantom Beast 9
Swordsmen 9 Nomad, Dark Elf, Draconian
Bowmen 9 Other
Zombies 8
Halberdier 8 Other
Nightblades 8
Night Stalker 7
Swordsmen 7 Barbarian, Gnoll, Klackon, Lizardmen, Beastmen, Dwarf, Troll
Cavalry 7 Dark Elf
Centaurs 7
Wolf Riders 7
Horsebowmen 7
Hell Hounds 6
Nagas 6
Fire Elemental 5
Skeletons 5
Spearmen 5 Nomad, Dark Elf, Draconian
Swordsmen 5 Other
Spearmen 3 Barbarian, Gnoll, Klackon, Lizardmen, Beastmen, Troll
Cavalry 3 Other
Phantom Warrior 2
Spearmen 1 Other
Guardian Spirit 0
Air Elemental 0
Settler 0 Any
Engineers 0 Any
Feel free to suggest improvements to this table.
November 27th, 2017, 08:20
Posts: 542
Threads: 4
Joined: Jul 2017
I see, I don't value much all mages defences, they are just so easy to kill with their abysmal health. You need to find a way to get over the first turn barrage, but that's not so difficult... I would drag them down in priority quite a bit. Example: doom bats are much scarier imho, and water elementals or fire giants are much sturdier... Even dragon turtles make me worry more than magicians. But maybe this is to avoid keeping good units in defence? If that's the reasoning then I see the point. But then why is gorgons higher? I guess I don't have enough info on the motivation for the priorities.
OTOH, your argument about the double army doesn't really work I think. Sure, you can first attack with an invisible unit (or similar) and deal with the mages and then with the halberdiers afterwards. But that's still more effort than dealing with the mages only with your invisible unit and that's it, no? And with mixed troops you can still upgrade them by type... Wait, this is the difficulty isn't it? It would be too difficult to have categories of garrison units and to make logic that considers the categories? If this is the issue then forget all I've said (or rather add it to the issue list - mixed defenders needs categories logic which is too hard to do)
On a different note, heroes are also quite easy to deal with as long as they don't have uber items. They are a kind of category with its own embedded logic (which is, max 6 units of the category in total). A beastmaster (second top in the table) without levels/uberarmor will give her bonus only for the first of 25 battle rounds. Wouldn't it be better to send them out adventuring? Is it possible to get the AIs to assess items too, like they already do levels? That sounds quite difficult, tbf. And buffs?
November 27th, 2017, 09:09
(This post was last modified: November 27th, 2017, 09:12 by Seravy.)
Posts: 10,495
Threads: 395
Joined: Aug 2015
Quote:Wait, this is the difficulty isn't it? It would be too difficult to have categories of garrison units and to make logic that considers the categories? If this is the issue then forget all I've said
Categories are impossible. We can have reduced priority for additional copies of the exact same unit though.
The Beastmaster and Necromancer heroes have the highest equipment priority, so they will be well equipped and very hard to kill. Especially with a stack of buffed very rare creatures ripping through whatever attacking forces you use while you try. Fortunately, this is one of the things that works better than expected.
Doom Bats are low priority because they do well on offense and create amazing doomstacks. On defense they are not that great, being a melee unit with high speed they are likely to get used up and die in battles fairly quickly. As cities likely only have one or two, while doomstacks will be a group of 9, they are not a good defender.
Gorgons on the other hand are quite generic - they don't excel at either role so there is no reason to force them to go offensive. Albeit, being a melee unit, they might be a poor defender after all, they are still better than something like a halberdier or even priest.
Do note these tables are used only when the AI summons or produces a 10th unit. Otherwise, when building stacks, they will pull the unit with the highest strategic strength, except for leaving the best two in the city for garrison duty. So even if magicians have low priority, they are likely to stay because of their low strategic strength while at most 2 of the better unit stays. (Note the "2" can be 1 or 3 depending on AI personality.)
November 27th, 2017, 19:25
Posts: 10,495
Threads: 395
Joined: Aug 2015
Completed the new, more detailed, all races included, rule 4 :
Code: ; Force military building as needed
cmp byte ptr [bp-092h], 2 ; Must have 2 settlers on their way towards a destination.
;Settler being produced does not count!
jl NoMandatory
cmp word ptr [bp-10h], 4 ; Must have at least 4 units in city!
jge fighter
mov word ptr [bp-0Ch], 0 ; Already have 2 settlers globally and fewer than 4 units, don't make settler!
jmp NoMandatory
;-----------------------------------------------
; Ship Wright's Guild
;-----------------------------------------------
fighter:
cmp byte ptr [-60C9h],0
jnz myrranship
call getwiz
cmp byte ptr [bx-60C9h],0
jz notmyrranship
myrranship: ; If human or AI is Myrran priorize ship access anyway - early land grab is critical with fewer wizards on own plane!
cmp word ptr [0BD90h],50
jg notmyrranship
; build ship wright's guild
call getcurrenttown
cmp byte ptr es:[bx+2Bh], 0FFh
jnz notmyrranship
xor di,di
productionloop2:
cmp di, [bp-6]
jge finally2
mov bx, di
shl bx, 1
lea ax, [bp-88h]
add bx, ax
cmp byte ptr [bx],12; Production candidate list element
jz doshipwright
inc di
jmp productionloop2
doshipwright:
mov ax,12
jmp buildthis
finally2:
notmyrranship:
;-----------------------------------------------
; Marketplace
;-----------------------------------------------
call getwiz
cmp word ptr [bx-5DE0h],100
jge notlowgold1
cmp [bp-8Ah], 9
jz notlowgold1 ; Klackons cannot build this
call getcurrenttown
cmp byte ptr es:[bx+39h], 0FFh
jnz notlowgold1
mov ax,26 ; Marketplace
jmp buildthis
notlowgold1:
;-----------------------------------------------
;-----------------------------------------------
; Madatory military building trigger checks
;-----------------------------------------------
call getcurrenttown
mov al, es:[bx+14h] ; Population*10+Difficulty*5+turns
sal al,1
add al,[0BD96h]
mov cl,5
imul cl
mov cx,ax
add cx,[0BD90h]
cmp [bp-8Ah], 0 ; Barbarian
jz Barbarian1
cmp [bp-8Ah], 1 ; Beastmen
jz Beastmen1
cmp [bp-8Ah], 2 ; Dark Elf
jz DarkElf1
cmp [bp-8Ah], 3 ; Draconian
jz Draconian1
cmp [bp-8Ah], 4 ; Dwarf
jz Dwarf1
cmp [bp-8Ah], 5 ; Gnoll
jz Gnoll1
cmp [bp-8Ah], 6 ; Halfling
jz Halfling1
cmp [bp-8Ah], 7 ; High Elf
jz HighElf1
cmp [bp-8Ah], 8 ; High Men
jz HighMen1
cmp [bp-8Ah], 9 ; Klackon
jz Klackon1
cmp [bp-8Ah], 10; Lizardmen
jz Lizardmen1
cmp [bp-8Ah], 11; Nomad
jz Nomad1
cmp [bp-8Ah], 12; Orc
jz Orc1
jmp Troll1
;-----------------------------------------------
; Gnoll, Dark Elf - Stables immediately
;-----------------------------------------------
Gnoll1:
DarkElf1:
cmp byte ptr es:[bx+28h], 0FFh
jnz NoMandatory
mov ax,9 ; Stables (for Wolf Riders and production)
jmp buildthis
;-----------------------------------------------
; Barbarian, Halfling
;-----------------------------------------------
Barbarian1:
Halfling1:
Klackon1:
Lizardmen1:
cmp cx,55 ; If popdiffturn >= 55 -> pop 4, turn 0 or pop 1 turn 30, Expert
jl Nomandatory
BuildFGOnly:
cmp byte ptr es:[bx+24h], 0FFh
jnz NoMandatory
mov ax,5 ; Fighter's Guild
jmp buildthis
;-----------------------------------------------
; Beastmen
;-----------------------------------------------
Beastmen1:
HighElf1:
Orc1:
cmp cx,125 ; Turn 100 on expert if pop 1, or 50 on pop 5 etc
jle NoMandatory
jmp BuildFGOnly
;-----------------------------------------------
; Draconian
;-----------------------------------------------
Draconian1:
cmp byte ptr [-60C9h],0 ; If human not on Myrror, force early FGs for lair clearing with strategic strength.
jz barbarian1
; Vs human, saints, bowmen, shaman are not much worse than halberdiers, we can upgrade to them later (but still do it to get closer to doom drakes)
jmp Beastmen1
;-----------------------------------------------
; Dwarf
;-----------------------------------------------
Dwarf1:
cmp byte ptr es:[bx+3Fh], 0FFh
jnz NotBH
mov ax,20h ; Builder's Hall
jmp buildthis
notBH:
cmp byte ptr es:[bx+33h], 0FFh
jnz NoMandatory
mov ax,14h ; Build University (for Steam Cannons)
jmp buildthis
;-----------------------------------------------
; High Men
;-----------------------------------------------
HighMen1:
cmp cx,145 ; Turn 120 on expert if pop 1, or 70 on pop 5 or 50 on pop 7 etc
jle NoMandatory
cmp byte ptr es:[bx+2Fh], 0FFh
jnz NotLIB
mov ax,10h ; Library
jmp buildthis
notLIB:
cmp byte ptr es:[bx+34h], 0FFh
jnz NoMandatory
mov ax,15h ; Wizard's Guild
jmp buildthis
;-----------------------------------------------
; Nomad
;-----------------------------------------------
Nomad1:
cmp byte ptr es:[bx+28h], 0FFh
jnz nomad2 ; Upgrade to fighter's later
mov ax,9 ; Stables (Horsebowmen!)
jmp buildthis
nomad2:
cmp cx,105 ; Turn 80 on expert if pop 1, or 40 on pop 4 etc
jle NoMandatory
jmp BuildFGOnly
;-----------------------------------------------
; Troll
;-----------------------------------------------
Troll1:
cmp cx,75 ; Turn 60 on expert if pop 1, or 30 on pop 4 etc
jle NoMandatory
jmp BuildFGOnly
NoMandatory:
A quick summary of the code :
Barbarian - very early FG
Gnoll - Stables first
Dark Elf - Stables first
Halfling - very early FG
Beastmen - lateish FG (~turn 50-60)
Draconian - lateish FG is Myrran human, otherwise very early FG
Dwarf - Builder's Hall and University first
High Men - late Wizard's Guild (subject to change once we decide on the new unit or test the race more)
Nomad - Stables first, and medium FG (faster than beastmen, slower than trolls)
Troll - early FG
Orc - lateish FG
Klackon - very early FG
Lizardmen - very early FG
|