Dev blog 27 Jan 2017

Progress update and some challenges in making a keeper bot

What we've been doing recently:
Keeper bot
Bot integration into matchmaking and practice alone
Map performance optimisation

What's coming up:
Final testing and release of keeper bot
Moving on to outfield bots (probably defender first)
Triage of the 50+ things in our in-tray.

Making bots
Making the keeper bot has been very interesting. There have been four major challenges so far.

Making judgements on actions
Imagine you are keeper and the ball goes into the corner near you. Do you go to collect it? As a human a quick glance at the radar and your knowledge of the match so far will tell you if it's safe. You know if the other team has players who are likely to chase the ball, how quick they are at boosting, how they might try to block/attack you if you do pick up the ball.

A bot has none of this knowledge. We have spent much more time getting the bot to understand when to do something like fetch a ball as we have spent writing the code to perform that action. The next time you are keeper and consider going to collect a ball, why not try and think what decisions you made to reach your conclusion, and how you might describe those actions mathematically and logically.

Tuning skill levels
Making a very good keeper was actually relatively easy. The video that David posted a couple of weeks ago showed a prototype which could save most charged shots. Bots can know with mathematical certainty exactly where a shot is going as soon as it is fired, and then starting moving there more quickly than any human. This is effective, but not much fun to play against.

We have gone for a mix of approaches to give some different skill levels. Some bots will use techniques like kick/pull, others will not. Some bots will react quickly to shots, others might take a few tenths of a second to move. Our bots do not cheat. They will never move faster than a human player and are subject to the same world rules.

Edge cases
I was feeling proud when we played the first internal test match with the keepers and they were performing well. The gold-level bot was an aggressive shot stopping monster, and the wood-level bot stopped the easy shots and conceded anything aimed well. The match was fun and balanced for the human players. Then we noticed that the wood bot would just stand and stare at you if you picked the ball up and ran into corner of the goal. The wood bot does indeed attempt to knock out players that come near it, but I'd left a small gap in the coverage area that was just big enough for a player to slip through untouched.

I'm looking forward to seeing everyone trying to break the bots in many creative ways, so that we can make them better.

Assumptions made in existing code
The UDK version of the game was never intended to support bots, so there have been many assumptions made in the code that any actions by a controller will be coming from a human player. There was probably a couple of days trying to, among other things, work out how to get the bots to aim up without the whole model rotating on the y axis and seeing them floating on their backs in mid-air.

We have also derived our bot from the basic bot code supplied with UDK, which means occasionally they used to switch into Unreal Tournament behaviour and start moving to a tactical vantage point. I think we've squashed all of these, but if you see a bot making a bid for freedom, please let us know so we can hunt him down and catch him.

Final thoughts
At the moment, our bots behave like... bots. Tricks that work on a human player (e.g. changing your aim while shooting) will not work on the bot, and things that would never work on a human might fool a bot easily. However, our primary goal is to get working bots for all positions, so that more matches can happen, and then we can try to make them more human.