Thunderbrd
C2C War Dog
I've been musing over some ideas with this and I'd like to run it past the team to see what you think about it. I'm not planning on jumping in or anything but just wanting to kind of talk this out as a concept. Correct me, btw, if I use inaccurate terminology for anything here.
I'm thinking we could have a new class, CvArmyInfo()
We'd have each type of Army be an XML definable set. Thus you'd have C2C_ArmyInfos.xml and would load in via CvInfos.cpp into the CvArmyInfo() class.
In CvPlayerAI.cpp, you'd use a combination of Leader tags and current game statistics, as well as Player definitions on current strategies, to determine a build to list of army types and modified according to various army configurations according to the tags on that army type.
Each type of grouping with a purpose that the AI would use would be generated to build that group to an Army, then the armies themselves would be managed by a leader unit AI that would have specific AI routines as the stack leader. If the stack leader dies, a new unit would be defined to lead that Army. Armies, however, are not necessarily required to have all of its units in the same stack and Armies could also have sub-Armies reporting to it.
For example, a Hunting army could be defined in the XML as generally having 1 Hunting AI unit and 1 Scouting AI unit OR 1 visibility unit etc... The leader could modify that based on the tags for the leader's personality so that he wants 2 hunters in that Hunting Army. A particular leader may also want an additional Hunting Army over the usual amount of 3 that leaders are set by default on the Army Info to want so that this particular leader tends to want 4. After the Classical era, perhaps, with the option Animals Stay Out, the amount of default Armies all leaders would want would be -1 (so normally they'd only seek to maintain 2 at this point). Perhaps if the Animals Stay Out option is NOT on, another Army entry for Interior Hunting Party, comprised of just 1 Hunter AI, would be something the AI player would be established to want by default in the XML for that Army entry.
This means we could XML program default build-to behaviors based on numerous in-game factors. Perhaps we could even program an AI routine that is adaptive to XML settings for each Army type so that even the overall behaviors could be toggled by XML, making overall an AI that could be easily adjusted with XML programming. We could tell them when and where to respond to various stimulations and how to prioritize various activities.
The more we can make a generic AI engine, the more we can empower this team as a whole to improve the whole AI behavior. Sure, some things will need to be dramatically handled in coding, but the more we make this in function modules and give the controls over to the XML, the more we can make this entire world of coding manageable through more than just some globals being used as numeric dials.
I'm not sure if I've made my point here enough to have gotten the idea across so at this point I'll open it up to questions. They may help me to sharpen the concept myself.
I'm thinking we could have a new class, CvArmyInfo()
We'd have each type of Army be an XML definable set. Thus you'd have C2C_ArmyInfos.xml and would load in via CvInfos.cpp into the CvArmyInfo() class.
In CvPlayerAI.cpp, you'd use a combination of Leader tags and current game statistics, as well as Player definitions on current strategies, to determine a build to list of army types and modified according to various army configurations according to the tags on that army type.
Each type of grouping with a purpose that the AI would use would be generated to build that group to an Army, then the armies themselves would be managed by a leader unit AI that would have specific AI routines as the stack leader. If the stack leader dies, a new unit would be defined to lead that Army. Armies, however, are not necessarily required to have all of its units in the same stack and Armies could also have sub-Armies reporting to it.
For example, a Hunting army could be defined in the XML as generally having 1 Hunting AI unit and 1 Scouting AI unit OR 1 visibility unit etc... The leader could modify that based on the tags for the leader's personality so that he wants 2 hunters in that Hunting Army. A particular leader may also want an additional Hunting Army over the usual amount of 3 that leaders are set by default on the Army Info to want so that this particular leader tends to want 4. After the Classical era, perhaps, with the option Animals Stay Out, the amount of default Armies all leaders would want would be -1 (so normally they'd only seek to maintain 2 at this point). Perhaps if the Animals Stay Out option is NOT on, another Army entry for Interior Hunting Party, comprised of just 1 Hunter AI, would be something the AI player would be established to want by default in the XML for that Army entry.
This means we could XML program default build-to behaviors based on numerous in-game factors. Perhaps we could even program an AI routine that is adaptive to XML settings for each Army type so that even the overall behaviors could be toggled by XML, making overall an AI that could be easily adjusted with XML programming. We could tell them when and where to respond to various stimulations and how to prioritize various activities.
The more we can make a generic AI engine, the more we can empower this team as a whole to improve the whole AI behavior. Sure, some things will need to be dramatically handled in coding, but the more we make this in function modules and give the controls over to the XML, the more we can make this entire world of coding manageable through more than just some globals being used as numeric dials.
I'm not sure if I've made my point here enough to have gotten the idea across so at this point I'll open it up to questions. They may help me to sharpen the concept myself.