Completed the new AI research procedure.
Goals :
-Research spells in the same research cost tier first (commons, then uncommons, then rares etc)
-Some exceptional spells can be allowed to be researched one tier earlier
-Spells the AI can never use are delayed by a tier
-Avoid researching redundant spells - if a spell with the same functionality is already known, delay all other such spells until the end of the current tier, or in some cases the end of the next tier.
-In general, get an overland summon first in each tier, then some of the best combat spells then everything else.
-Deterministic research - no random chance involved, the AI always picks the "best" spell. In case of ties, the first one found, so identical ratings should be avoided as much as possible
-Take advantage of the guaranteed turn 1 uncommon research choices where applicable (Stream of Life, Astral Gate, Aura of Majesty, Gargoyles, Werewolves, Giant Spiders)
Algorithm :
First, get the priority value assigned to the spell, then apply all modifiers. Finally, pick the spell with the LOWEST total.
Assigned priority numbers for spells in increasing order (so spells are ordered in the order of research) - the number at front is the priority, the one in the back is the spell's ID.
Modifiers :
That's all, let me know if you think the AI should do something in a different order!
The system will be included in the next experimental version.
Goals :
-Research spells in the same research cost tier first (commons, then uncommons, then rares etc)
-Some exceptional spells can be allowed to be researched one tier earlier
-Spells the AI can never use are delayed by a tier
-Avoid researching redundant spells - if a spell with the same functionality is already known, delay all other such spells until the end of the current tier, or in some cases the end of the next tier.
-In general, get an overland summon first in each tier, then some of the best combat spells then everything else.
-Deterministic research - no random chance involved, the AI always picks the "best" spell. In case of ties, the first one found, so identical ratings should be avoided as much as possible
-Take advantage of the guaranteed turn 1 uncommon research choices where applicable (Stream of Life, Astral Gate, Aura of Majesty, Gargoyles, Werewolves, Giant Spiders)
Algorithm :
First, get the priority value assigned to the spell, then apply all modifiers. Finally, pick the spell with the LOWEST total.
Assigned priority numbers for spells in increasing order (so spells are ordered in the order of research) - the number at front is the priority, the one in the back is the spell's ID.
Code:
0 None
0 Magic Spirit C9
0 Spell of Return D6
10 Giant Spiders 0E
20 Lycanthropy AD
22 Gargoyles 5F
25 Sprites 9
27 Skeletons A1
30 Heavenly Light 8B - >80
31 War Bears 6
32 Ghouls A6
33 Nagas 31
34 Hell Hounds 54
35 Fire Bolt 53
36 Fire Elemental 5A
37 Black Sleep A5
38 Nature's Eye 3
39 Darkness A9
40 Confusion 2E
45 Call Centaurs 4
50 Healing 7D
60 Web 5
65 Aura of Majesty 3B
70 Shatter 58
80 Wraith Form B5 ->A8
85 Fairy Dust 7
90 Heroism 82
92 Holy Armor 7E
93 Resist Magic 29
94 Bless 79
95 Just Cause 7F
97 Holy Weapon 7C
100 Life Drain A7
105 AEther Sparks 2A
107 Earth to Mud 1
110 Endurance 7B
115 Summoning Circle CB
120 Focus Magic 2F
122 Astral Gate 8B
124 Planar Travel 8A
126 Stream of Life 94 -> 84
130 Guardian Wind 2C
135 Warp Wood 51
140 Land Link 10
150 Wall of Fire 57
160 Raise Volcano 62
170 Corruption 55
180 Chaos Channels 5D
180 Fireball 60
190 Flame Blade 5E
210 Cloak of Fear A4
215 Disrupt 52
220 Mana Leak AA
230 Phantom Warriors 2D
240 Summon Zombies A3
250 Psionic Blast 32
260 Star Fires 7A
270 Warp Creature 59
280 Dispel Magic CA
290 Resist Elements 2
300 Eldritch Weapon 56
310 Weakness A2
320 Guardian Spirit 81
460 !!!Heroic Shout CD
470 Floating Island 2B
480 Water Walking 8
500 Lightning Bolt 5B
505 Possession AC
510 Reaper Slash B1
515 New : Syphon Life AF
520 Ice Bolt 0D
530 Fire Storm 6B->61
540 Prayer 8C
550 Divine Order 87
555 Transmute 12
560 Black Prayer AE
570 Night Stalker B0
580 Fire Giant 5C
590 Shadow Demons B4
592 Chimeras 64
595 Unicorns 88
600 Cockatrices 11
602 Summon Hero D0
605 Basilisk 14
610 Aether Binding 39
615 Cracks Call 0B
617 Construct Catapult 0C
620 Famine BD
622 Flight 38
623 True Sight 83
624 Drain Power AB
625 Vertigo 35
628 Immolation 63
630 Blur 33
640 Dispelling Wave 34
650 Wall of Darkness B2
660 Phantom Beast 3C
665 Change Terrain 0F
670 Blood Lust B3
680 Spell Blast 3A
690 Raise Dead 89
700 Spell Lock 36
710 Counter Magic 30
720 Exorcise 86
722 Warp Node BA
725 Elemental Armor 15
730 Disenchant Area CC
740 Resurrection 85
970 Enchant Item CF
975 Detect Magic CE
980 Earth Lore 0A
990 Enchant Road 37
994 Move Fortress 1C ->D1
995 Nature's Cures 13
1000 Tranquility 9D
1005 Pestilence C4
1010 Flame Strike 6D
1020 Wave of Despair BB
1025 Djinn 47
1030 Doom Mastery 75 ->6C
1040 Incarnation 8E
1050 Wraiths B8
1060 Doom Bat 61 ->6B
1070 Storm Giant 41
1080 Efreet 6A
1090 Gorgons 1B
1100 Stone Giant 17
1110 Angel 93
1120 Chaos Spawn 67
1122 Armageddon 78
1125 Survival Instinct 1C
1126 Clairvoyance 22
1127 Invisiblity 3E
1129 Summon Champion D4
1130 Cloud of Shadow B9
1135 Dark Rituals A3 -> BE
1136 Flying Fortress 4D ->46
1137 Banish 40
1140 Uranus Blessing 3D
1145 Petrify 16
1147 Mind Storm 43
1150 Earth Gate 25
1160 Gaia's Blessing 1D
1170 Inspirations 98 -> 90
1180 Altar of Battle 92
1185 Lionheart 8D
1190 Prosperity 91
1200 Zombie Mastery BC
1210 Wind Walking 3F
1215 Air Elemental 42
1220 Invulnerability 8F
1230 Magic Immunity 45
1240 Doom Bolt 68
1245 Wrack B6
1250 Warp Lightning 65
1260 Iron Skin 18
1270 Earth Elemental 1E
1280 Earthquake 1A
1285 Terror A8 -> B5
1287 Holy Word 96
1290 Chaos Rift 6E
1300 Evil Presence B7
1320 Metal Fires 66
1330 Magic Vortex 69
1340 Exaltation 84 -> 94
1350 Stasis 44
1360 Blizzard 19
1370 Mass Healing 95
1380 Disjunction D2
1390 Create Artifact D3
1400 Consecration 9B
1500 Sky Drake 4E
1510 Demon Lord C8
1520 Great Drake 76
1530 Colossus 24
1540 Great Wyrm 27
1550 Death Knights C1
1560 Arch Angel 9F
1570 Behemoth 20
1580 Hydra 6F
1600 Spell Binding 4C
1610 Suppress Magic 4F
1620 Doomsday 72
1640 Life Force 9C
1660 Charm of Life A0
1670 Crusade 9E
1680 Evil Omens C6
1690 Eternal Night C5
1700 Final Wave C7
1705 Apocalypse 73
1710 Massacre C2
1711 High Prayer 97
1712 Animate Dead C3
1715 Call Lightning 23
1716 Entangle 21
1720 Annihilate C0
1730 Spell Ward 48
1740 Mass Invisibility 4A
1760 Call the Void 77
1770 Disintegrate 70
1790 Supreme Light 98
1795 Holy Arms 9A
1796 Time Stop 50
1800 Call to Arms 99
1810 Chaos Surge 74
1820 Warp Reality 6C -> 75
1830 Meteor Storm 71
1840 Herb Mastery 26
1850 Regeneration 1F
1860 Nature's Wrath 28
1870 Great Unsummoning 4B
1880 Haste 46 ->4D
1890 Summon Demon BF
1900 Creature Binding 49
5000 Spell of Mastery D5
Modifiers :
Code:
; Low tier Summoning Spell already known!
; +400 to other low tier summons
; Lycanthropy,War Bears,Sprites,Giant Spiders,Nagas,Hell Hounds,Gargoyles,Guardian Spirit,Unicorns,Skeletons,Ghouls
; If not Wraith Form, Water Walking or Floating Island, priority of those -500
; Weak combat direct damage +400 if weak or strong combat direct damage spell already known
; Fairy Dust Ice Bolt Fire Bolt Fireball Life Drain
; Weak combat unit curse +200 if another weak combat unit curse already known
; Black Sleep Vertigo Shatter Warp Creature Weakness
; Weak combat summon +400 if another weak combat summon already known
; Call Centaurs Construct Catapult Phantom Warriors Fire Elemental Summon Zombie
; Land Link, -100 if Giant Spiders known
; Lycanthropy, Giant Spiders, Gargoyles +150 if one of them known, or past turn 75
; Corruption +800 if Raise Volcano known
; Warp Wood +500 if Guardian Wind
; Darkness +900 if no Ghouls, Werewolves, Shadow Demons known
; UC or better high quality combat spells - these are generally prioritized high within their rarity tier.
; Priority +400 if no contact with the human, +100 if no hostility with the human. Combat spells cannot be used VS AI players!
; Note that this generally does not cover weak combat spells (already researching late), and does not cover very rares (the AI has to be prepared by then for war at any time)
; Group 9, 24, 59, 70, 12
; Planar Travel +800 if Astral Gate already known
; Divine Order +400 if at least two Chaos or Death books
; Group 25, +200 if Group 25, 32 known (equal or better summons)
; Group 32, +200 if Group 32 known
; Group 25 = Cockatrices Fire Giant Night Stalker Summon Hero
; Group 32 = Basilisk Stone Giant Chimeras Chaos Spawn Angel Shadow Demons
; Group 32 summons, +350 if even higher tier summons are known
; Cockatrices set to 145 if Focus Magic is known
; Blood Lust set to 21 is Werewolves known
; True Sight +500 if human player 0 Sorcery books - doesn't help against other AI!
; Group 56 +400 if Group 74,78 or 56 known
; Strong summoning spells, +400 if one of them or a better one already known
; Gorgons Storm Giant Efreet Incarnation Wraiths Doom Bat
; Very rare summoning spells
; +500 if one already known
; Artificier prefer Create Artifact
; All overland curses +300 if Peaceful or Lawful
; (spell blast, famine, evil presence, pestilence, call the void, earthquake, corruption, fire storm etc)
; Earthquake, Chaos rift, priority to 1128 (earlier) if Ruthless or Maniacal
; If combat only spell and casting skill<spell cost-10, add 2000
That's all, let me know if you think the AI should do something in a different order!
The system will be included in the next experimental version.