Aaaaaand, here it is, the moment everyone was waiting for, the next major version number for Caster of Magic, 3.0!

It’s a huge, yet tiny update…tiny from the outside, huge on the inside. Three high impact AI procedures have been completely replaced, buying buildings – small but important, next, the power distribution – pretty much the core of the AI’s long term magic strategy, and finally, the huge, vast, gigantic, over 7000 bytes large combat spell selection. It might not sound much in the era of terabytes, but that’s over 3 thousand lines of code in assembler…and it’s all gone and made completely new.
What does this mean? Mostly that whenever we notice the AI is casting a dumb spell in combat, it’s now easy to add any new rules on what to do for it. Even relatively complex rules. The new procedure is a single ASM file, so any changes can be easily recompiled into a new procedure to replace the previous version instead of having to manually insert each part separately, trying to find appropriate sized gaps like in a puzzle. And maybe most importantly, it’s less wasteful on space – there are over a thousand unused bytes still remaining, even though I added a million things already – important stuff like picking the spell that actually does the most damage instead of just the one that has higher “priority” even if it’s mitigated by enemy defenses.
Of course, this isn’t a magic button, we still have to come up with working logic the AI can follow to improve anything, but space won’t be a problem for…some time.
About the power distribution procedure, I think the only big change worth mention here : the AI is now aware of various Spell of Mastery research tactics – they can decide to push research up very high, or turn it off and ignore it, or do neither and spend normally. These decisions are not made at random, they are based on the game state, so be careful about that.
Since these are major changes on the inside and I had a quite limited amount of time for testing, there is an elevated risk of bugs, if you find any, please let me know ASAP! I made sure the AI is smarter in every combat situation I could throw at them, but I might have overlooked some corner cases. If you observe the AI to cast worse spells than usual in combat, or have troubles with overland resources (gold, mana, research, casting skill) when they aren’t supposed to, please report it (you burning down 90% of their cities does not count :P )

December 25, 2016 at 4:42 pm by Seravy
Category: Uncategorized