OpenRA/OpenRA — pull request #2518 by tthiery (2012-12-16 13:08:00+00:00)
Title: Added Level1 AI with HackyAI capabilities

Hi Maintainers ;)

I rewrote the HackyAI for further extensions. The HackyAI was/is indeed Hacky, not only in the way it works but also how code was structured. The main intention of this changeset is that the individual tasks of the AI (attack, base building, damage repair, rally points, unit building) are separated from a code perspective (and clear visible). The naming "Level1" is from my humble understanding that the AI will anyway evolve in iterations (e.g. Level2 => an AI which actually has a plan, Level3 => an AI which actually is reduced by war fog) and HackyAI is now just Level1. "Little" extensions like super power use or simple ship/air strategies can be integrated in the Level1 as a "Strategy"

PULL hints:
- System.yaml and the .csproj needs to be merged manually as openRA bleed and my bleed differ quite a bit. (sorry for that, I am new to Git and GitHub)
- HackyAI and Level1AI co-exist, Level1 AI is completely in a separate folder.
- As I also did a code cleanup and a file based restructuring, diff will not really help ;)
- I can also understand, that you integrate the code but do activate it yet for the next release (by system.yaml) due to release stability concerns.

Hope to hear from you guys.

=====================================================================
Added Level1 AI (assuming several attempts to create a good AI)
- Moved all HackyAI code into 5 individual strategies (attack, base
building, damage repair, rally points, unit building)
- Generated Level1 AI environment

Code Cleanup
- Removed var (readability)
- Added new lines (readability)
- Removed multiple exit points (reduce complexity)
- Added argument guards (maintainability)
- Changed variable names (readability)
- Added source code comments (maintainability)