Teaching A Machine To Be Worse At A Video Game Than You Are

Is it really cheating if the aimbot you’ve built plays the game worse than you do?

We vote no, and while we take a dim view on cheating in general, there are still some interesting hacks in this AI-powered bot for Valorant. This is a first-person shooter, team-based game that has a lot of action and a Counter-Strike vibe. As [River] points out, most cheat-bots have direct access to the memory of the computer which is playing the game, which gives it an unfair advantage over human players, who have to visually process the game field and make their moves in meatspace. To make the Valorant-bot more of a challenge, he decided to feed video of the game from one computer to another over an HDMI-to-USB capture device.

The second machine has a YOLOv5 model which was trained against two hours of gameplay, enough to identify friend from foe — most of the time. Navigation around the map was done by analyzing the game’s on-screen minimap with OpenCV and doing some rudimentary path-finding. Actually controlling the player on the game machine was particularly hacky; rather than rely on an API to send keyboard sequences, [River] used a wireless mouse dongle on the game machine and a USB transmitter on the second machine.

The results are — iffy, to say the least. The system tends to get the player stuck in corners, and doesn’t recognize enemies that pop up at close range. The former is a function of the low-res minimap, while the latter has to do with the training data set — most human players engage enemies at distance, so there’s a dearth of “bad breath range” encounters to train to. Still, we’re impressed that it’s possible to train a machine to play a complex FPS game at all, let alone this well.

6 thoughts on “Teaching A Machine To Be Worse At A Video Game Than You Are

  1. If you want to train against “bad breath range”, try Star Trek Online. Unless they’ve improved it since I last played, every enemy in that game likes to get so close that one stands a better chance of stabbing them in the back then shooting them in the chest (not sure the stabbing mechanic exists in STO, but this gets my point across).

    Also, “bad breath range” is something I will have to remember. 😁

  2. What’s scary is the game’s anti-cheat will probably not even detect that this isn’t a human playing as the input is coming from USB devices. This project can easily be repurposed to serve as a basic aim-assist that the anti-cheat will never detect, which can give advantage to the game.

    1. Depends on the cycle rates etc, if the program is reliably every nth of a second as the program loops changing input than the same sort of anti-cheat input filter that spots those rapid trigger signals so rampant as a cheat what 20? years ago can spot it – its an input beyond human abilities.

      For me though I’d just like the whole anti-cheat thing to be largely thrown out, it generally just gets in the way without really stopping cheating from being possible. There is always a way to get around it if really wanted (and you can argue that with anti-cheat software running there is less effort put into looking for the cheaters and treating them appropriately – assuming the software will do it for you).

      Plus the common anti-cheat software just flat out can’t work via steams Proton/wine so forces you to have a nasty windoze install of some sort, which for me is a real pain. Even more so when many of the games with it really don’t need it anyway, the serious competitive player vs player games it makes some sense, when there is prize money and large scale competitions (though in those you would expect enough observers to make effective cheating very tricky), but in a player vs environment game or the more casual game is it really worth the hassle?

      1. Ahh yes, the venerable rate detector in “most” anti-cheats. But then again, this is programmable, and you can simply program the thing to increase/decrease a certain random rate that is within margin of error to get around this.

        If you connect an optocouple/relay to a mice’s button, and have the thing auto-click for you. Would it detect it as a bot then? I don’t think so. Similarly, if this bot emulates as a “legitimate” HID in such a way that it can move your cursor (again with the randomization added so that rate/pattern detection is mostly scrubbed), then that’s where the lines are blurred.

        I totally agree that anti-cheats aren’t perfect, nothing is. It generally just reduces the amount of people without the know-how, or without knowing the source from using cheats that aren’t detectable.

        But I guess you’re right, this mostly has a novelty use if you just want to troll the kid next door. Although, unofficial online tournaments with cash prize pools does exist and is very common, at least where I live.

    2. Not necessarily, the anti-cheat will just have to morph into an AI as well. Comparing heuristics between the machines and humans would be difficult for humans at scale, but those small nuances are noticable between the AI vs human. Plus, the anti-cheat gets the luxury of being integrated into the game while the external AI is stuck on the outside looking in. The question now is if the developer/publisher thinks it’s worth deploying an AI to fight AI cheaters and how long they’re willing to play this game of cat and mouse?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.