One more thing I realized, the above numbers are wrong, there are 4 rare arcane spells in the game, not 3 so the total number of rares is 16.
AI early rare spell choices.
In general, the AI should only ever pick spells that are at the very beginning of the tier on their research priority list.
As there are 16 rares and only 8 book slots, the amount of unresearched commons and uncommons is not relevant because the AI can benefit from this feature even if all 8 of their slots are used by rares with no leftover lower tier spells blocking them. So I will only look at the rares on the AI's research order.
Nature
Spells appear in the order of Elemental Armor, Gorgons or Stone Giant, Survival Instinct, Petrify, Gaia's Blessing, Abundance, etc
Earthquake comes before Gorgons for Maniacal and Ruthless wizards.
Petrify is added to the beginning of the list if and only if the human player is a Death wizard.
One possible way to set up AI early choices :
If Maniacal, pick Earthquake.
If Peaceful, pick Gaia's Blessing and Abundance
If Narcissist or Channeller, pick Petrify.
Pick Stone Giant or Gorgons at random (50% chance each)
Pick Survival Instinct.
Sorcery
AI research order here is Storm Giant, Flying Fortress, Invisibility, Banish, Uranus' Blessing, Mind Storm, Spell Blast, etc.
Narcissist wizards put Uranus' Blessing to the front of the list. No other modifiers seem to apply here.
Considering to implement it this way :
Pick Storm Giant
If Narcissist : pick Uranus' Blessing
if Peaceful or Maniacal : pick Flying Fortress
Otherwise 1/3 chance for Invisibility, Banish or Uranus' Blessing each.
Chaos
AI research order is Fire Storm, Flame Strike, Doom Mastery, Doom Bat, Efreet, Chaos Spawn, Chaos Rift, Doom Bolt, Warp Lightning, etc
Inner Power is added to the front if enough relevant creatures are in play buffed by it. There are no other modifiers.
This actually is less straightforward than I thought because there are pretty much four spells the AI will want (Fire Storm, Flame Strike, Doom Mastery and a summon) but only two picks.
There are three creatures here and Chaos works just fine without a rare creature, Chimeras and combat spells can do the job well. So we can get away with not guaranteeing the early creature.
Fire Storm or Chaos Rift is essential for Maniacal and Ruthless wizards who cast curses a lot, not so much for other personalities. They are mostly equivalent spells as both deal damage to garrisons so we only need one.
So I think we could use this set of rules :
If maniacal or ruthless, pick Chaos Rift or Fire Storm at random (50% chance for each).
pick Flame Strike
pick Doom Mastery
Life
Life research order goes like this : Incarnation, Angel, Divine Order, Inspirations, Lionheart, Prosperity, Invulnerability, Holy Arms,...
Divine Order is pushed to the end if at least 2 Chaos or 2 Death books are own. I think I'll change this to 3 books as it feels a bit overly cautious?
Holy Word is pushed to the beginning against Death wizards.
I see no other relevant modifiers.
I'm not so sure about pushing Incarnation early. The AI isn't that good with heroes, but the hero buffs the stack so it greatly raises the threshold of how strong targets the AI can attack and defeat in automatic combat. So it's very powerful but it's only for one stack which might or might not be at a relevant place. It's also expensive to research.
Angel being the only rare summoning spell other than Incarnation makes sense to pick early.
I see no good way to guarantee the economy strategy - we can either pick the two buffs without Divine Order, or pick Divine Order without the buffs and either case we get no Angels which is really the only relevant thing the realm has for combat at this tier beyond unit buffs.
Picking Angel and Divine Order seems the most solid choice, even though Divine Order makes Angel more expensive to cast.
Picking Angel and Inspirations might work better, but wastes a lot of overland skill to not get Divine Order early so it seems a suboptimal play. Still, Inspirations is great as it works both for military and economy as needed.
Divine Order+Inspirations seem best for an economy based approach.
So maybe this ?:
If Peaceful or Lawful or Perfectionist, pick Divine Order+Inspirations.
Otherwise pick Angel+Inspirations.
Death
AI research order is Evil Presence, Drought, Wave of Despair, Wraiths or Vampire, Cloud of Shadows, Warp Node, Dark Rituals, Drain Power, Zombie Mastery, etc.
Gate of Hades is pushed to the top of the list when the human player plays Death. No other relevant modifiers.
I think this might work well :
If maniacal, pick Evil Presence and Drought
If Ruthless, pick Drought
Pick Wave of Despair
Pick Wraiths or Vampire at random (50% chance each)
AI early rare spell choices.
In general, the AI should only ever pick spells that are at the very beginning of the tier on their research priority list.
As there are 16 rares and only 8 book slots, the amount of unresearched commons and uncommons is not relevant because the AI can benefit from this feature even if all 8 of their slots are used by rares with no leftover lower tier spells blocking them. So I will only look at the rares on the AI's research order.
Nature
Spells appear in the order of Elemental Armor, Gorgons or Stone Giant, Survival Instinct, Petrify, Gaia's Blessing, Abundance, etc
Earthquake comes before Gorgons for Maniacal and Ruthless wizards.
Petrify is added to the beginning of the list if and only if the human player is a Death wizard.
One possible way to set up AI early choices :
If Maniacal, pick Earthquake.
If Peaceful, pick Gaia's Blessing and Abundance
If Narcissist or Channeller, pick Petrify.
Pick Stone Giant or Gorgons at random (50% chance each)
Pick Survival Instinct.
Sorcery
AI research order here is Storm Giant, Flying Fortress, Invisibility, Banish, Uranus' Blessing, Mind Storm, Spell Blast, etc.
Narcissist wizards put Uranus' Blessing to the front of the list. No other modifiers seem to apply here.
Considering to implement it this way :
Pick Storm Giant
If Narcissist : pick Uranus' Blessing
if Peaceful or Maniacal : pick Flying Fortress
Otherwise 1/3 chance for Invisibility, Banish or Uranus' Blessing each.
Chaos
AI research order is Fire Storm, Flame Strike, Doom Mastery, Doom Bat, Efreet, Chaos Spawn, Chaos Rift, Doom Bolt, Warp Lightning, etc
Inner Power is added to the front if enough relevant creatures are in play buffed by it. There are no other modifiers.
This actually is less straightforward than I thought because there are pretty much four spells the AI will want (Fire Storm, Flame Strike, Doom Mastery and a summon) but only two picks.
There are three creatures here and Chaos works just fine without a rare creature, Chimeras and combat spells can do the job well. So we can get away with not guaranteeing the early creature.
Fire Storm or Chaos Rift is essential for Maniacal and Ruthless wizards who cast curses a lot, not so much for other personalities. They are mostly equivalent spells as both deal damage to garrisons so we only need one.
So I think we could use this set of rules :
If maniacal or ruthless, pick Chaos Rift or Fire Storm at random (50% chance for each).
pick Flame Strike
pick Doom Mastery
Life
Life research order goes like this : Incarnation, Angel, Divine Order, Inspirations, Lionheart, Prosperity, Invulnerability, Holy Arms,...
Divine Order is pushed to the end if at least 2 Chaos or 2 Death books are own. I think I'll change this to 3 books as it feels a bit overly cautious?
Holy Word is pushed to the beginning against Death wizards.
I see no other relevant modifiers.
I'm not so sure about pushing Incarnation early. The AI isn't that good with heroes, but the hero buffs the stack so it greatly raises the threshold of how strong targets the AI can attack and defeat in automatic combat. So it's very powerful but it's only for one stack which might or might not be at a relevant place. It's also expensive to research.
Angel being the only rare summoning spell other than Incarnation makes sense to pick early.
I see no good way to guarantee the economy strategy - we can either pick the two buffs without Divine Order, or pick Divine Order without the buffs and either case we get no Angels which is really the only relevant thing the realm has for combat at this tier beyond unit buffs.
Picking Angel and Divine Order seems the most solid choice, even though Divine Order makes Angel more expensive to cast.
Picking Angel and Inspirations might work better, but wastes a lot of overland skill to not get Divine Order early so it seems a suboptimal play. Still, Inspirations is great as it works both for military and economy as needed.
Divine Order+Inspirations seem best for an economy based approach.
So maybe this ?:
If Peaceful or Lawful or Perfectionist, pick Divine Order+Inspirations.
Otherwise pick Angel+Inspirations.
Death
AI research order is Evil Presence, Drought, Wave of Despair, Wraiths or Vampire, Cloud of Shadows, Warp Node, Dark Rituals, Drain Power, Zombie Mastery, etc.
Gate of Hades is pushed to the top of the list when the human player plays Death. No other relevant modifiers.
I think this might work well :
If maniacal, pick Evil Presence and Drought
If Ruthless, pick Drought
Pick Wave of Despair
Pick Wraiths or Vampire at random (50% chance each)