Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    I tried to make a Valorant AI using computer vision

    blog thumbnail

    I Tried to Make a Valorant AI Using Computer Vision

    Valorant is one of the most popular game modes, closely following Counter-Strike: Global Offensive (CS: GO) and its Dust 2 map. While I may not be very skilled at Valorant myself, I wondered if I could teach a computer to play the game. After all, computers excel at taking on tedious tasks, so why not let them handle the laborious work of playing Valorant?

    To ensure fairness, I designed the AI to have the same inputs and outputs as a human player, without any special knowledge of the game. I connected two computers; one with Valorant installed and the other able to capture the screen of the first computer and send mouse and keyboard commands via a Logitech dongle. These were the only connections between the two systems, with no memory poking, debuggers, or any other funny business.

    Training the AI involved using computer vision, specifically creating a machine learning model that could recognize enemies, shoot, and navigate within the game. I relied on transfer learning, leveraging pre-trained models online and fine-tuning them to recognize objects in Valorant. Initially, I used a model called Faster R-CNN, but its performance was hindered by latency issues, as it could only process images at a slow rate.

    To address the latency problem, I switched to the YOLOv5 model, which provided faster processing speeds while achieving satisfactory object recognition. However, the AI still had limitations when it came to determining its location in the game world, its direction, and the specific map it was playing on. To tackle these challenges, I utilized the mini-map, filtered circles of specific sizes and colors to identify the player's location, and employed basic dead reckoning techniques to estimate movement. Additionally, I incorporated a black and white map to assist with basic pathfinding.

    Controlling the game required a unique approach. Instead of using traditional APIs or software, I utilized a Logitech wireless dongle, which operates on the same frequency as wireless mice. By broadcasting mouse messages, I could replicate human movements without the need for additional software. This allowed me to navigate the game and perform actions like planting the bomb and buying weapons.

    Despite all the progress made, the AI's performance in Valorant was far from impressive. It struggled with aiming, often shooting body shots instead of headshots. Additionally, there were synchronization issues, incorrect view angle calculations, and challenges with recognizing enemies in close proximity. The AI also lacked game sense and prediction capabilities, making it far inferior to skilled human players.

    While there is room for improvement, such as enhancing recoil control, lowering latency, and leveraging audio hints, the project highlights the challenges of creating an AI for real-time games like Valorant. Nevertheless, successes seen in other games like Starcraft demonstrate the solvability of such challenges. Robotics and self-driving car technology offer valuable insights that could be applied to further refine AI performance in gaming.

    Keywords

    Valorant AI, computer vision, machine learning, transfer learning, YOLOv5, mini-map, pathfinding, wireless dongle, game control.

    FAQ

    • Can the Valorant AI recognize enemies accurately?
    • How did you overcome the latency issues with the initial model?
    • What challenges did you face in controlling the game remotely?
    • Is it possible to improve the AI's aiming and game sense?
    • Can the AI handle complex scenarios, such as bomb planning and weapon switching?

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like