Today, we’re proud to release a framework that allows anybody to develop a WarLight AI! This framework allows any programmer to write code that plays games of WarLight, using any of WarLight’s settings and maps, for the purposes of eventually developing a new, smarter, AI to replace the current one.
Last year, TheAIGames.com ran a WarLight AI competition that allowed players to write their own WarLight bot, which would then compete with everyone else’s bot in a big tournament. This was a lot of fun, and produced a lot of WarLight AIs.
The authors of three of the top AIs from that competition have agreed to donate their source code to WarLight: GreenTea, Norman, and cowzow. I have converted Norman’s AI to work with WarLight’s engine as an example of what can be done. You can find it on github at https://github.com/FizzerWL/WarLight.AI. This project includes a framework for writing and debugging WarLight AIs, and two example AIs. The first example AI is called Wunderwaffe, which was written by Norman for the AIGames competition, and the second example AI is the current WarLight AI that’s used in production today, called Prod.
The ultimate goal of this project is to replace the current AI with a new, smarter, one, for both single-player and multi-player. This is the first part of a larger effort to overhaul the single-player section of WarLight. Updating the AI needs to happen before new single-player levels can be developed, since those levels need to be balanced based on the AI. We don’t want the AI to significantly change after these levels are made, since the levels could be made too hard or too easy to be fun.
When developing a WarLight AI for this purpose, it’s important to understand what the goals of the AI are. In the AIGames competition, the goal of the bots were to be as good as possible when fighting the other bots — win the maximum number of games at all costs. For a WarLight AI, the goals are different. For example, some bots would have logic that would tell them to run away from the opponent once they’ve detected that they can’t win the game, in the hopes of prolonging the game and forcing a draw. This wouldn’t be a fun tactic to play against when playing a single-player WarLight level.
The main goals for a good WarLight AI are, in order:
1. Be fun to play against in single-player.
2. Be fast (don’t consume a lot of CPU or memory).
3. Be good at defeating human players.
4. Be fun to play against in multi-player.
5. Be good at defeating other bots.
As you can see from this list, being fun to play against is a higher priority than being good. While being good is a goal, it’s more important that people have a fun enjoyable experience while playing WarLight.
Since the AI is used in every single-player game, and only select multi-player games, single-player is placed at a higher priority than multi-player. The single-player experience is an important part of WarLight since it’s the first thing most people experience when they first play.
Making the AI fast has to be a high priority since a slow AI will time out, essentially breaking the game. Of course, “fast” is relative. The key thing is that the AI doesn’t take an insane amount of time. Some people play WarLight from low-powered devices/computers, and if they have to wait 30+ seconds in between every turn, it would not be fun for them. Since you can play with many AIs at once, the AI should not take more than one second to compute its moves/picks, even on large maps and relatively slow devices.
I was tempted to include “don’t be predictable” as a goal. However, this really falls under the category of “Be good at defeating human players.” One key part of defeating human players is not following the same patterns every time. Defeating an AI that’s too predictable will train players to fight that AIs tendencies, when an AI should be training players to fight other players.
EDIT: Note the server needed to run this AI has been shut down due to lack of demand. So the below video no longer works.
If you can code and you want to help contribute to the AI, I put together a short video giving an introduction to the code:
Github repro: https://github.com/FizzerWL/WarLight.AI