Page 2 of 3

Re: So, I made an AI for FA

PostPosted: 26 May 2016, 05:07
by Aulex
Anihilnine wrote:I think you're being a little sensitive but whatever.

Machine learning is a cool idea.. Just analyze the replay vault.

But that to me sounds way too ambitious...


I'm not being too sensitive, it was just a stupid remark.

Well the concepts of machine learning aren't really ambitious, as it's just techniques built on-top of each other, so it's just a slow iterative process. The only real hindrance would be what's available for the AI to actually see as I stated previously. I don't think we could really analyze a replay file itself, rather we could just throw it up in ladder and have it learn there, providing both a "player" for others to play against and a way to train the AI. If someone wants to go this route I would love to help, I'm aware of a bunch of AI concepts, but not experienced enough to do this on my own.

Re: So, I made an AI for FA

PostPosted: 26 May 2016, 06:39
by ZLO_RD
When AI will notice players players do certain things, it also need to see what triggers those behaviours, but just from replay it can't know unit position or health (you will have to run simulation) , and AI will need those to have any success, basic ability to retreat in front of a bigger army or kite or reduce unit production if all choke points have defence...

Sounds like you need AI with some advanced UI mods to help it do micro :D

Machine learning in FA sounds very complex to me.
Afaik machine learning AI with combination of stealing moves from best players, just managed to master GO and that was kinda big advancement.

Re: So, I made an AI for FA

PostPosted: 26 May 2016, 09:11
by nine2
You can learn the entire replay vault.

1. branch fa lua code, including dump of critical information
2. run the replay with the branched code, dumping out info
3. automate downloading all replays, running them, collating info
4. run machine learning over all that and know how to be awesome
5. construct an AI to use that info and play against real people

1-3 are possible.
4 is interesting.
5 is too ambitious and would never happen.

Re: So, I made an AI for FA

PostPosted: 26 May 2016, 09:48
by zeroAPM
So a AI that can learn from the player's actions?

Spoiler: show
Mantises hunt in packs, Commander

Re: So, I made an AI for FA

PostPosted: 26 May 2016, 22:10
by Softly
Hopefully some people will try running my AI, or browse the code a bit to see how it works.

Also can I recommend we start with some more realistic suggestions?
e.g. Could you teach this AI to make an air factory? (The answer is yes)

I'm open to contributing to some kind of standard machine learning API for the AI, but if you're going to make suggestions on this front then I'd ask you put some proper thought in first. Giving a list of "1) watch/play games 2) Do magic 3) iterate" won't get us any closer :)

Re: So, I made an AI for FA

PostPosted: 27 May 2016, 02:08
by nine2
I can and will do 1,2,3 if someone can show me they can do 4 and 5

Re: So, I made an AI for FA

PostPosted: 27 May 2016, 02:12
by Softly
Anihilnine wrote:I can and will do 1,2,3 if someone can show me they can do 4 and 5


4 and 5 are the magic bits though!

Re: So, I made an AI for FA

PostPosted: 27 May 2016, 04:08
by Astrofoo
More realistic suggestion: Teach the AI how to make and effectively use ghetto gunships. This is something that I would think would be a small challenge seeing as it wouldn't be "intuitive" for an AI.

Second Realistic Suggestion(Even "easier" one imo): Teach the AI how to use engies and engineering stations to assist factory production.

Also, I have put some thought into things the FA AI is already good at. Kind of a pros/cons list.

Things AI is good at:
AI is good at expanding; managing many bases at once; taking and controlling the map

Things AI is not so good at:
Micro in any form; skillful eco management; hard teching; using engies to assist factories


Play any match against the AI on a 20x20km map and you'll find that it expands a lot faster than you in every direction. It will most likely take early map control and hold it for a little while. That's because the AI is good at being at many places at once. This would require very high apm and concentration from any good player to replicate. Not to say you won't run it over in 10 minutes when you have 3x the eco and big tech advantage, but that's the point of this thread then isn't it?

Re: So, I made an AI for FA

PostPosted: 27 May 2016, 22:16
by Sprouto
Perhaps the most important thing for the AI is intelligence gathering.

All of it's decisions are based upon it's current assessment of threat. It has a VERY short memory, so very frequent intelligence gathering is an absolute must for the AI. Simply pushing units out onto the map is the reason why the K/D ratio of the AI is so incredibly poor. Without accurate and up-to-date threat values, the AI cannot make good choices about which targets to attack, and which to avoid, with any given platoon of units.

Understanding how the AI collects intelligence information, and how it uses it (ie. - the existing Threat Map) will allow you to bring a higher level of smarts to the AI.

For those that might be unaware, the Threat Map is simply a checkerboard (16 by 16 tiles) that is applied to EVERY map. As the AI sees units in each of those tiles, the threat value for that tile is adjusted. When the AI cannot see a tile, the threat level fades out fairly quickly (between 30-60 seconds). Most of the AI routines (both stock and Sorian) use this map to determine not only targets, but select movement paths, so you can see how vitally important it is.

Re: So, I made an AI for FA

PostPosted: 28 May 2016, 01:28
by Softly
I've updated the code again to make the AI better, it can now consistently beat the Sorian AI on desert arena. This has been done while keeping the code really short and simple so people can pick up on it and understand it easily.

Next stop is to add some more sophisticated features, I'm planning on seeing how good I can get it at the desert arena map.