Following the recent Supreme Computer Cup I was inspired to have a go at developing a basic AI for FAF. As I had zero experience of coding in Lua, I thought at the same time I would write down things as I learnt them to have both a guide for other people interested in getting started in developing an AI, and a dev log for the creation of my AI.
See below for a link to the current AI development guide and devlog:
https://docs.google.com/document/d/1uQlEoN-kti7G2MnhwD60uaaHwVevPNYH/edit?usp=sharing&ouid=100973959280546778272&rtpof=true&sd=true
You can also access the mod on Github:
https://github.com/maudlin27/M27AI
I've copied the current overview from the guide below:
This document is intended to do 3 things at once (meaning it does none of them very well!):
- Act as a guide to people new to FAF AI development, including collating any other useful resources out there on AI development
- Be a sort of dev log of my thought process and development steps for creating my first FAF AI, with extracts of code thrown in
- Form my main ‘todo’ list for further developments of my AI
If you see any errors, or have any comments or suggestions (in particular any AI developers who read this since you’ll probably know better/easier ways of doing things than the methods I’ve chosen) let me know and I can update the guide where relevant.
If you’re here for useful resources and/or details of how to write AI and don’t care about the dev log aspect then just skip to section 2) Setup and background and section 5) Index of useful functions, and/or browse the index for points that may be of interest.
Latest changes (v48 summary)
A smaller update that should have minimal impact on how well M27 plays, yet still be one of the more noticeable updates:
- Added 21 different messages/taunts to give the AI more of a personality
- 9 bugfixes, including fixing an occasional crash that could happen when checking the pathing of units during the game
- 4 misc changes, including adding support for upcoming FAF develop changes to ensure M27's bomber dodge logic continues to work
Areas of focus by version (history):
v1-3: Release
v4 - Intel and threat detection
v5 - Use of ACU and hotfix
v7 - Engineers and building upgrades
v9 - Air
v10 - Anti-Turtle
v11-v12 - Pathfinding and misc changes
v13 - Anti-navy
v14 - ACU and mobile shields
v15-v18 - CPU optimisation and hotfixes
v19 - Rally points and air domination strategy
v20 - Late game
v21-23 - Eco management
v24 - Bombers
v25 - Misc
v26 - Nukes
v27 - T3 Arti
v28 - Game options/compatibility
v29 - Optimisation and TMD
v30 - Czar, Soulripper and Defences
v31 - Bombers (again) and TML
v32-33 - Plateaus
v34-35 - Turtling
v36 - Skirmishers
v37-38 - Game enders
v39 - Quantum optics
v40 - Deceiver
v41 - Hives and shield disruptor
v42 - Misc and multi-TML defence
v43 - Misc and UEF experimentals
v44-46 - Teamwork
v47 - Optimisation
v48 - Personality