My current game has been one of the best i have played in FfH 2 in a very long time(apart from some confusion over Nox Noxis) . There is barely 1000 point between 1st and 4th place and the use of spells and stacks formations of the AI has been superb. Could anybody shed any light on the AI changes that have been made - other than the change logs.
Sure, there is only one huge function in the SDK that was completly rewritten for FfH. Lots of little mods, lots of new functions, but only one base level functiont hat was recreated from the ground up. Its called the AI strategy hash.
The strategy hash is responsible for looking through all the available strategy plans and picking those that are reasonable goals. It is the heart of the AI. The goals influence what that player builds, how he deploys his units, etc.
The default civ4 strategy hash made its decisions about what strategys were viable based on Civ4 data. For example, it had a strategy for performing a land blitz against another player. It would be considered if it had some high movement units, a weak neighbor it shared a border with and a desire to engage in warfare. But to keep from getting its land units decimated it also required access to some anti-aircraft units it could group with its attackers to protect them. Since you could never get any anti-aircraft units in FfH this strategy was never adopted. Now its been rewritten without the anti-aircraft requirement so that the AI will consider rushes fo fast moving units as a surprise rush attack (the Hippus love this strategy).
Missionary creation was another strategy. And as one of the few strategy's the ffh ai would actually qualify for with the old strategy hash it tended to go with this strategy a lot. And when it did it made tons and tons of disciples. Now there is a limit for how many disciples it will produce and the availability of so many other straegys makes this musch less of a concern.
And on and on it goes. There are strategys for going for a cultural victory (which remains unchanged), spaceship victory (removed) and rushing for nuclear weapons (removed). Getting those out of the way and making the various mitlitary strategys make more sense gives us a better starting place to work from.
I still need to add strategy hashes for pursueing altar victories, tower victories, and either attempting to raise or lower the armageddon counter. But that hasn't been done yet.
Outside of that there was also a lot of tweaking around getting the AI to produce unit enabling buildings. This was actually locked itnot he strategy hash as well as one fo the strategys the ai can pursue is unit improvement which would key it to look at building buildings that enable upgrades.
That change improves everything behind it. Because the AI was already good at casting (except for "move to" spells) but it didnt make much difference because the AI wasnt fielding appropriate units because of a bad hash, or keeping the units upgraded because of the building problems.
There is mroe to go, and it will never be perfect. But we know what to do, and we have been lining up the pieces to do this sort of work for a long time. Now that we are here I think we will see good things.