I would do it but my knowledge of C++ is still too sucky to build it, so i was wondering if you guys wanted to help, as you could use this class too and it will speed up my AI so i can release it earlier so you can have fun killing/getting killed (unlikely) by it!
Here├óÔé¼Ôäós the plan:
It will first get the UnitDefs of every unit currently running with the mod at the beginning of the game.
Then different methods could extract that data and convert it into useful information by building categories. I need to organize all energy makers, metal makers and metal extractors in their respective categories, then save them into an array containing ID (eg. ARMEX), Side which builds it (easily done by doing taking the first 3 letters of its ID and converting it into a bool) and specifics such as costs in the 3 resources (metal, energy, buildtime), health and footprint (serving as weights in a score calculation). It should also create some sort of hierarchy so one can quickly find out which type of unit can build what.
Once processed and organized all that data is saved so no processing is needed after the first game.
The result is you can then make your AI completely independent of mods:
INSTEAD OF:
Get ARMCV OR CORCV to Build ARMEX OR CORMEX when Y
Get ARMACV OR CORACV toBuild ARMMOHO OR CORMOHO when Z
Build X ARMMAV AND Y ARMHAM then attack
^^^^^^
| | | | | |
Hundreds of the above to make sure the AI will build a variety of units and buildings
YOULL HAVE:
Build Metal extractor of highest score under current situation. A function will calculate score based on income, tech level, etc. The builder is automatically picked from the pool of units that can build that metal extractor, based on idleness, movespeed and buildspeed.
Build a land-based attacking force of strength X. X is determined by a function of costs, HP, firepower, current tech level of the units, etc)
That will surely save quite a lot of code and will make the AI forever compatible. Random factors in the functions and a bit of coding creativity can create a randomized attack force system while still being surprisingly effective. The only limits are the amount of coding you put into the functions that determine the units to be built, add a bit of learning and you have a kickass multi-mod AI that will always make great use of its resources!
Either way, I have a very good notion of how the sorting functions will work. I just need help writing the organizer, still haven├óÔé¼Ôäót got my head around how to code it.
EDIT: Damn it seems Sub is doing just that! Hope some of this is still useful for you guys
