Monday, April 16, 2012

Advanced AI (Custom AI Framework)

All the latest code for Advanced AI is now up at http://www.warriorhut.org/forged_alliance/advanced_ai/



I'm not 100% sure of the state it is in but I did have it working once so it should only require some bugfixes to get back to where it was. The last major change I did was to merge two mods AI Support (mine, not Sorians) and Advanced AI into one. It has one dependency (Advanced Utils) and requires some shadowing (drop the shadow data in gamedata or use my mod system patch).



Most of the hook and shadow files simply attach the AI to the lobby and armybrain, they shouldn't need to change much. The really custom stuff goes into folders under \shadow\lua\AI\types and this is where you'll find my custom "rush" AI.



At the moment the custom rush AI is just a skeleton, however it is quite a complex one. Its behaviour is to take high-level goals like "get mass" and break them down into prioritised tasks like "cap mass point". It then assigns those tasks to the most appropriate units according to a set of "rules". The rules system probably needs the most work. Its job is to increase or decrease the AIs "enthusiasm" for certain tasks. I set it up so it can be programmed by merging rules using operators like "add". The intention was that these operators could also be used ingame in UI sliders or an AI console to allow players to fine-tune allied AI (or to train opponent ones).



It's still basically a framework, not a competitive AI. It was designed to let modders make their own AIs more easily by creating goals, tasks and rules. It's at the stage where it can process these files but I never got around to really defining any (there is a hydrocarbon goal for reference though).



I will be porting the framework over to Spring but if anybody of reasonable skill would like to adopt this mod and continue development I'm happy to offer support and updates. I have already begun development of an intel library (analyzes threats and opportunities) for Spring that could be ported back to Supcom (the games Lua interfaces are reasonably compatible).



PM me or drop a question here if you'd find any of this interesting or useful.|||I had a look through the code and it does look very interesting, but I would really like to see a complete basic AI before trying it out myself. That way I can see its proven.

No comments:

Post a Comment