Hardcoding vs machine learning.

I’m going to be using this “Ideas for the future” section to discuss the development of BWAPI bots, going over a few ideas about ways the coding and gameplay can change to make the bots more versatile and effective.

Yesterday, a game between Krasi0 and LetaBot (Martin Rooijackers), two of the strongest bots in the SSCAIT, ended with a very surprising result.

Replay link:
http://www.openbw.com/replay-viewer/?rep=http%3A%2F%2Fwww.openbw.com%2Fwp-content%2Fuploads%2F2017%2F01%2F0739-kras_Mart-TvT.rep

Martin had hard-coded a specific counter to Krasi0: an SCV rush. Usually these two would be expected to play late game mech, but this game ended with LetaBot’s victory in just over 3 minutes.

I, and several other people in the Twitch chat were pretty disappointed that we’d missed out on a proper battle – few other bots are capable of using all the units available to them effectively, and matches between two bots which are both able to do this have been rare.

It was certainly impressive to see that a strong bot can be taken down easily if you know how to counter its weaknesses, but it sparked a discussion about whether bots should be allowed to have pre-programmed counters for specific opponents.

I think that it’s better to allow this sort of play, but there are good arguments on both sides.

Bots that are just following a build order aren’t really being intelligent – the bot isn’t the one recognising strategies and adapting to them, it’s the programmer, so hard-coding counter builds is far less useful than building a bot that learns and adapts from the AI-research perspective.

In the long term it should be far more effective to program good decision-making and machine learning, so hardcoding entire builds is in some ways just a waste of time, as it should soon be superseded by heuristic-based bots, then by bots which actually have an understanding of how their opponents play, and can develop their own counter builds.

Some people equated the use of a predetermined counter strategy to cheating. I think this attitude is a little extreme, but it does still seem a little “cheap” to find a small weakness in a good bot and exploit it like this, only revealing that you knew about this weakness when it comes to the bots actually playing each other.

There is a possibility that use of unexpected hard counters will put less emphasis on bots that are capable of solid gameplay. In a worst case scenario, people keeping their builds secret and working on exploiting specific weaknesses in other bots rather than just outplaying them will mean that Brood War AI battles will just devolve into a competition of who can cheese the other bots the hardest. We’ve already seen very powerful bots that specialise in cheese do well over the past few years – ZZZKbot and Stone come to mind. Though these bots are usually fun to watch, I don’t think anyone wants the entirety of SSCAIT to be 4 pools, photon cannons and SCV rushes.

There are benefits to allowing this sort of programming though, at least at this point in Starcraft AI development:

The metagame of AI battles is still developing. When you’ve got up to 10,000 APM, certain strategies which are usually ineffective, even in the hands of Korean demi-gods with up to 600 AMP, are suddenly much stronger: Mass vultures with perfect splits and kiting, 4 or more simultaneous attacks to different bases, tactical retreat of protoss units to avoid taking damage beyond shields, last-frame pickups to prevent projectile weapons from hitting. All of these micro abilities are only limited by programming and the minimum frame rate cap.

The use of custom strategies thought up by programmers is currently much faster and more efficient than waiting for the bots to come up with the strategies themselves, so investing effort into specific builds and counters to them allows the meta to develop. It may turn out that the main strategies used by pros aren’t effective compared to the best builds possible when you know how to use 10,000 APM properly.

When the meta has reached a more stable position, it becomes more practical to work on bots that can learn for themselves. Only at this point will you know whether a learning algorithm will be useful in the long term – a bot might be great at producing counters to the bad positioning and adaptability of most of the bots that currently dominate the meta, but in a few years it might be completely useless, or at the very least, require a lot of reworking. A well made machine learning algorithm should be able to handle various situations, but would likely require more time and processing power than bot programmers currently have access to.

Cheesy builds tailored against specific weaknesses also encourage programmers to make their bots as robust as possible, and remove all these minor weaknesses. Hopefully, the overall long term effects of this will be that bots become more robust and versatile so that they can stand up to many different strategies, rather than that the bots that get cheesed decide to cheese their opponents back.

That said, I would be open to the idea of a Brood War AI competition where the bots aren’t allowed to have preprogrammed build orders, and must learn to play effectively. I wouldn’t even be against the SSCAI changing their rules to prevent bots from choosing specific builds against specific opponents, but there should at least be somewhere that bots with predetermined counters can play each other. Without these cheesy counter builds we’d lose a lot of research potential, and (to my mind more significantly) a lot of the most interesting end entertaining bots.

If you have any opinions or information about the different ways build orders can be developed, or about which you think are most useful for research and/or entertainment value, feel free to share your ideas in a comment.

Advertisements