Cheating AI. The amount of times I've read this about our game in public forums is beyond frustrating. I am so over having this accusation levelled at us when it holds literally zero truth. Time and time again players blame their losses on our code being unfair, when the reality is we just worked bloody hard to ensure the AI bots provided a solid challenge to players at all levels and always kept you on your toes. And it wasn't easy. It was far from easy. In fact it was some the best work I've ever produced. Yet still, publicly our game keeps being labelled as having lazy, cheating AI. Why I oughta!
The bitterness? Well, when you understand just how much effort went into the production of the AI you'll understand just how disappointing it is that many players not only don't appreciate that work, but actively denigrate it just because they can't believe our bots drive so well without unfair assistance. So here's the spoiler alert; they receive no unfair assistance - they're just better than you. And yes, it is deeply disappointing to have the reputation of some of my best work destroyed in this way. Perhaps if I'd have done a worse job of it then I might have received more kudos on the basis it was more plausibly genuine. Well, we'll never know, because the public has already decided it's all a sham.
The purpose of this article then? To vent my frustrations - you'll have to forgive me that, but also to put the record straight in busting some myths and provide a rare look at just what really goes on under the hood in GRIP.
I think I should say from the start that this is not a discussion about how hard the game is and where we should pitch it in terms of difficulty. This is subjective. We feel we have it more or less right. Other people disagree. But it's not meant to be easy, it's meant to be a challenge. It's a game for hardcore players and it won't please everybody. We had to pitch it somewhere, and it is where it is. No, this article is about whether the bots cheat, and explains how they in fact, don't.
Rubber banding
There is no forced rubber banding, or catchup assistance, in GRIP. Yet the converse is the most common untrue thing written about the game. You can elect to turn it on or off outside of the campaign with it defaulting to off out of the box, but inside the campaign it is always off regardless.
Many players observe that the bots never drop far behind or get too far ahead of you and assume, without foundation, that catchup assistance is turned on. It isn't. In fact what is happening here is that the vehicles are just driving well when trailing, and we deliberately limit how far bots can get ahead of you when leading to give you a fighting chance. Without that limitation, they would be even more of a challenge than they already are.
Even with catchup assistance deliberately turned on by the player, this mechanism favours you more than the bots in all but the lethal difficulty level. So with it switched on, you're actually giving yourself an unfair advantage.
Vehicle handling
The vehicles the bots drive have exactly the same dynamics and handling qualities as the vehicles you choose for yourself as a human player. Exactly the same. No additional grip, no additional power or acceleration.
Vehicle control
Bots drive their vehicles by issuing controller inputs in exactly the same way that human players do. The vehicle control code has no real idea of whether it is a human or a bot that is controlling it, it just knows that it is receiving controller inputs and responds to them blindly.
If you feel that bots somehow have snappier control responses then just delve into your Input settings and make some adjustments in there. There's nothing preventing you from tightening up your responses in order to gain an edge over the bots.
Pickup assignment and handling
Pickups are assigned to players based on where they are in a race; leading, mid-field or trailing. It has no care for whether you are a bot or a human player - it purely assigns pickups based on race position. This except for one, single caveat - in hard or lethal difficulty bots receive Firestorms more often than usual but only if they are trailing badly and catchup assistance is turned off. In reality this rarely happens, but it was implemented quite a while ago when their driving qualities weren't as good as they are today.
As far as pickup use goes, each pickup is unaware of whether an AI bot used it, or a human player did. Therefore each pickup functions in the same way regardless of whether a bot or a human sent it on its way. A missile is a missile, a gun is a gun, and that's it.
speed differential
I have the fastest car yet bots still come speeding past me so they must be cheating, right?
No, not at all. They may be using a Firestorm, or even a charged Firestorm. They may be boosting when you are not. They may be benefiting from catchup assistance if you have elected to turn that on, but likewise you will benefit from that too if you yourself are trailing. In no circumstance however, do bots benefit from unfair speed.
But, but, but ...
So with all that said, all those points addressed, all those avenues closed down, why do the bots win so often? Well I'm so glad you asked. It isn't cheating, it isn't magic or witchcraft either - f#cking hard work is why that is. Let us elaborate ...
Let's start by saying it wasn't always that way. I remember a good year or so before the game was released the bots weren't driving so well at all. In fact, it was a real concern to me personally just how we were going to get them to a place where they provided a challenge to all but the most novice of players. When viewing races through the cinematic camera they kept making mistake after mistake after mistake for a whole host of different reasons. Even with the mountain of AI code that I had already written up to that point, there was just so many edge-cases that remained to be addressed that it felt like an insurmountable problem.
Daunted, but not overwhelmed, I rolled-up my sleeves and got to work to see just what we could do to improve the situation. Here's just a few of the things we implemented at that time to improve their vehicle control:
-
Fishtail recovery when the back-end is trying to get away from them
-
Drifting around corners to minimise the turning circle
-
Using J turns to recover from facing the wrong direction
-
Using the launch capability to recover from facing the wrong direction
-
Using the reset capability more swiftly to recover from getting into a jam
-
Avoiding fighting each other when they are trailing in a race to just concentrate on driving
-
Avoiding the use of weapons when on tricky areas of track where vehicle control is the priority
-
Improvements to object avoidance and track-branch decision making
-
Using air control to help ensure a good landing after getting airborne
It was through addressing many different situations like these where we gave bots discrete intelligence that we managed to transform the game from something that was barely competitive at all to something that provided you with a real, genuine challenge. It was no one thing that made all the difference, it was many, many small things that, working together, provided a solid solution. This wasn't something I expected when embarking on the task here, I thought it would give us a continual headache and that we'd never reach the goal. But the reality was that at some point we reached a critical mass of intelligent behaviour that somehow thrust us over the line. It was a rare moment of coding satisfaction, taming something so wild.
To get to that point took several months. I spent literally weeks just watching bots driving around alone, looking for mistakes in their behaviour and then formulating solutions to each and every issue that came up. Once all the general problems were out of the way we had to examine every single race track to see how the bots performed with the racing data that each contained. Often you would spend two or three days on just a single track finding problems and correcting the data so that the bots drove more effectively. This for every class of vehicle, within both Classic and Airblades. Every time the track changed, or the vehicle dynamics changed, you would have to do it all over again. We did all of this painstaking work, specifically to ensure the bots would never have to resort to cheating.
Conclusion
We've only opened the smallest window here but I hope it gives you a flavour of the lengths we have gone to in order to have bots drive in an intelligent manner, of a level which is uncommon to most racing games. The idea was to be unable to discern whether a vehicle is bot or human controlled when looking at its behaviour. I didn't want to see them making any stupid mistakes, mistakes that a human would never make. While I wouldn't say we reached that goal 100%, we certainly did get very close, closer than in any other game I've ever worked on.
I feel like we've only just scratched the surface here, but to talk about this any more would mean delving into some detail about how this all works together and already this article has reached a fair length. But it is certainly something worth writing about, so I'll shortly be publishing a more in-depth look at just how the AI system for the bots was constructed and attempt to provide a master-class in AI systems design that explores many different areas. So many in fact, that I'm sure I'll need to chop it up into several digestible pieces. First up then, how do the bots know where to drive within such complex environments?
[Posted 02/28/2020] |