Rats Play DOOM

2025-12-1220:15428159ratsplaydoom.com

We built a complete VR setup from scratch to let rats play DOOM. The system includes a motion-tracked treadmill ball, a panoramic headset, an input trigger, and a reward circuit. All hardware and…

We built a complete VR setup from scratch to let rats play DOOM. The system includes a motion-tracked treadmill ball, a panoramic headset, an input trigger, and a reward circuit. All hardware and software components are open sourced, including 3D-printable designs, circuit diagrams, firmware, and control software.

The first version (v1) was built in New York by Viktor, who trained rats to walk through a corridor in DOOM using a simpler rig. That version was featured on Vice and PC Gamer. After moving back home, the project was paused. Public interest reignited development, leading to v2, a more advanced and modular version built in collaboration with electrical engineer Sándor Makra. Akos Blaschek later assisted significantly in documenting the project for open-sourcing, aiming to enable others to replicate and build upon this work. Key metallic components were designed and sourced in collaboration with SZURWIN KFT.

V1

  • Basic ball setup
  • Rats trained to run forward
  • Minimal sensors and mechanics
  • No panoramic screen
Rat VR Setup Version 1
Rat VR Setup Version 1

V2

  • New ball driver mechanism for smoother movement
  • Foldable AMOLED screen with 180° horizontal and 80° vertical FOV, Full HD resolution
  • Upgraded sensors for movement tracking
  • Reinforced feeder system with mixing motor
  • Modular 3D-printable components
  • Improved electronics reliability and safety
Rat VR Setup Version 2
Rat VR Setup Version 2
Full setup from side showing rat on ball, screen around, trigger, and water tube.
Full setup from side showing rat on ball, screen around, trigger, and water tube.

Limitations

We reached the point of rat habituation but didn’t start training. Our rats (Todd, Kojima, Gabe) aged out before full testing. The setup works, but behavioral validation is pending.

The hardware is a comprehensive VR rig designed for rodents. It consists of a motion-tracked sphere that captures the rat's movements, a custom-built trigger for in-game actions, a curved panoramic screen for visual immersion, and an automated reward system that dispenses sugar water to reinforce behavior. All these components are mounted on a modular aluminum frame, creating a complete, self-contained environment for the rat to interact with the game.

View the Hardware Assembly Guide

The headset wraps around the rat’s head with a foldable AMOLED screen. It maximizes immersion without obstructing whisker space. The screen supports Full HD resolution.

The headset frame also integrates several sensory components: two small air nozzles are positioned near the left and right whiskers, capable of delivering targeted air puffs on command (e.g., signaling wall collisions in-game). The frame provides a secure mounting point for the reward system's dispenser tube, placing it near the rat's mouth. Additionally, the design includes placeholders for miniature speakers near each ear, intended for future implementation of stereo audio cues.

Headset close-up from above.
Headset close-up.

3D Model: Headset

Movement is captured via a free-spinning ball under the rat. Rotary sensors track displacement and convert it into game motion. The ball can also be driven by motors.

These motors are used during training to roll the ball and simulate movement paths before a reward. This guides the rat on where to go, helping form movement-action associations. Like the trigger, this allows for programmatic training sequences with minimal initial input from the animal.

Ball mount showing driven/undriven modes and sensor placement.
Ball mount showing driven/undriven modes and sensor placement.

3D Model: Stand/Ball

The shooting input is a custom-built hand-operated lever. Rats pull it with their paws to fire. The lever is held in place by small springs, encased in a 3D-printed housing. It includes a rotary encoder to detect motion and a stepper motor to actuate it.

The motor allows programmatic control—pulling the lever to demonstrate shooting. This enables training by pairing visual cues with mechanical motion, reinforcing the association before the rat initiates the action on its own.

Close-up of trigger lever with encoder and motor.
Close-up of trigger lever with encoder and motor.

3D Model: Trigger

Positive in-game actions trigger a liquid reward: sugar water delivered through a precise dispensing mechanism. The system consists of:

  • Mixer: Continuously stirs the sugar solution to maintain even concentration
  • Pump + Pressure Sensor: Keeps the line under constant pressure
  • Solenoid Valve: Magnetic valve that opens to release exact 10 µL doses
  • Dispenser: Positioned near the mouth for easy access

This setup ensures accurate, repeatable reward delivery with minimal delay. The reward is synchronized with game events to reinforce desired behaviors.

Reward circuit with labeled mixer, pump, valve, and dispenser.
The messy but functional reward circuit from behind.

The current system assumes basic rat mobility and grooming behavior. Fine-tuning might be needed for rats of different sizes or temperaments. Trigger placement and reward tube flow may need calibration per subject.

The setup is controlled through a modular Python system. The main entry point is arena_scenario.py, which runs the full control loop.

The system includes:

  • Motion capture: Reads movement from optical flow sensors mounted around the treadmill ball.
  • Locomotion control: Drives the ball motors to guide the rat during training.
  • Trigger input: Reads lever pulls, detects voluntary shooting actions.
  • Reward delivery: Dispenses precise 10 μL sugar water rewards via a controlled solenoid valve and maintains constant line pressure.
  • DOOM integration: Interfaces with a modified ViZDoom environment for real-time closed-loop behavior.
  • Training logic: Enforces demonstrations and delivers rewards based on game state and rat behavior.

View the Project on GitHub

The software runs on a PC and communicates with a Raspberry Pi via TCP sockets. The Pi handles real-time sensor reading, ball actuation, and reward control; the PC processes the sensor data, runs the game, and sends high-level commands to the Pi.

All major components—movement tracking, ball driving, trigger detection, and reward control—can be operated manually or in closed-loop mode. All control parameters (e.g., motor speeds, reward volumes) are set in Python code.

Limitations

There’s no in-built calibration suite. Users must validate sensor alignment and reward timing manually. Some microcontroller firmwares might require tuning based on hardware tolerances.

The rats successfully learned to navigate the virtual environment and trigger the shooting mechanism. Habituation took approximately two weeks per rat. While advanced training wasn't completed due to time constraints, initial data showed promising engagement with the system.

Rat engaging with the VR setup during a session.
Rat interacting with the VR setup.

Limitations

Full behavioral validation requires longer training periods. Cross-subject variability wasn't extensively studied. The impact of prolonged VR exposure on rat well-being needs further research.

Interested in building your own animal VR setup? Feel free to reach out for guidance. We're also compiling a comprehensive Rat VR Build Guide.

At YoloRun.Capital, we invest in ambitious, boundary-pushing projects like this, even the beautifully impractical ones. Have a wild idea? Let's talk.

A rat wearing a tiny Santa hat.

© 2025 Rats Play Doom Project - Open Source Hardware & Software


Read the original article

Comments

  • By godelski 2025-12-1223:392 reply

    I absolutely love this!

    # Suggestion:

    You really should release parts as parametric or at least the source files. I see everything is an STL and STLs are just a pain to work with. Suppose we want to try with mice? Or what about my cat? I do not expect just scaling in my slicer is going to end up with a good result, I'll need to redo everything from scratch. But parametric parts? That gives us a lot faster iteration. That gives you a lot faster iteration too! I highly recommend taking that approach when designing and I find it is worth it more often than not.

    Could you add cost estimates to the BOM? These never need to be accurate but I always find it helpful when estimating a project. You're just saving people from the time it takes to click every single link and throw them into a calculator. And informs people very quickly what to innovate on to drive costs down. (Sorry, BOMs without cost estimates are a big pet peeve of mine)

    # Questions:

    - Do the rats enjoy playing Doom?

    - Are there specific games the rats like to play?

    I've never thought about what types of videogames other animals would enjoy, but damn if you didn't just open Pandora's Box here. I actually think we could learn a lot about them (and even their specific personalities) from this question. It gives a whole other level of refinement than just knowing what my cat's favorite toys and games are...

    And also, thanks for open sourcing this! I'm excited to see what comes of it!

    • By chickenhun 2025-12-130:212 reply

      Gonna be honest here, I've worked on this for so long, so many iterations, lots of versions for each 3D part, software and all, at this point I just wanted to publish everything I had and do it fast. And you are totally right, publishing without parametric source files was a mistake, I'll upload everything I have shortly, prices included. Note: mice require smaller setups and that just leads to the redesign of most parts - smaller ball, ball driver, lever with weaker springs... training cats prompts for a larger ball, same issue. VR setups for cats though would be super cool!

      On this setup my rats were only habituated, they did not end up playing Doom. Even habituation seamed super slow, they were a year old when I started it. On the previous setup though, when they learnt to run on the ball and how that influences their reward, they got hooked. I believe they enjoy not just the reward, they get a sense of how their actions influence the game and they like that. They would run on the ball so much at some point they wouldn't even bother drinking all the juice and it was just dripping on the setup.

      No idea what they would best like to play. It needs to be a first person game though, that's what they are able to understand how to handle, it's more natural to them.

      Thank you for taking the time to give feedback! I also hope pet VRs become a thing and people can connect with their pets virtually too!

      • By xeonmc 2025-12-133:56

        Is the graphics rendering modified to output actual barrel projection to match the display, or did you just take the original perspective projection and stick it on a distorted screen?

        Consider making the screen panoramic around a larger radius rather than just around the head, perhaps on the order of ball diameter. This reduces the visual stereodisparity mismatch and lowers the cognitive load for habituation.

        Consider also making the trigger chin- or bite-activated to allow simultaneous shooting and moving.

      • By godelski 2025-12-130:472 reply

        Oh, I hope you don't take this as me being upset. I'm super happy and totally get the motivation. I a fan of the adage "better to do something half assed than no assed" (not that this is half-assed). Just wanted to make the comment to help drive motivation and let you know there's a demand. Releasing the sources could really help too just so people don't have to work with the mesh.

        But on the rat part, that is super interesting! I was suspecting they might not like Doom because shooting a gun might be such a foreign concept to them that it breaks immersion. But it seems like you say they like running around in the simulated environment? (Time for Cheeze-Doom? lol)

        Again, super cool and thank for releasing things! This is that crazy stuff I just love to see people exploring.

        • By chickenhun 2025-12-131:33

          Thank you! <3 On shooting: exactly that, it is so foreign to them, I doubt they could grasp the concept, but they can understand the loop of: pull lever -> audiovisual feedback of shooting with monster disappearing -> reward. Biting or scratching a surface as a form of attack may work better, but the audiovisual + reward response should help them to understand at what visual signals to pull the lever to make it go boom.

        • By sdenton4 2025-12-136:141 reply

          This mod includes collecting cheese (though it's a side activity, and maybe too subtle for the rats): https://youtu.be/qPRvw6kRN-8?si=j9iuTuiHerm0AhQ2

          And here's a thing I knew had to exist: a doom mod/level set on a moon made of cheese... https://youtu.be/XxdeUbE9kvw?si=_cpJQKuDy87BN7EP&t=10m20s

          • By godelski 2025-12-1320:301 reply

            They missed a real opportunity for "Omelette Doom Fromage" there

            But yeah, I'd wager too subtle. I'm also questioning now how much rats use smell for navigating their environments. I notice that my cat is a lot more smell oriented than I initially thought and I think it makes a big difference. Hard to tell though.

            • By sdenton4 2025-12-151:19

              Humans are /extremely/ visual compared to other animals: this tends to make us underestimate the intelligence of other animals (when we use visual intelligence as a proxy for general intelligence) and miss out on smart uses of other senses entirely. Rats are well-known for thwarting maze studies using things like fine sensitivity to slope, directional orientation using smell gradients across a room, or detecting the direction of researchers outside the maze based on micro-vibrations.

              (Good book on the general topic of measuring animal intelligence: "Are We Smart Enough to Know How Smart Animals Are?" by Frans de Waal)

    • By DANmode 2025-12-135:211 reply

      Anecdotally: Cats like fruit ninja.

      • By yareally 2025-12-1316:23

        Funny enough, so does my green cheek conure (small parrot about the side of a fist). Their beaks are made from keratin, like our nails, so it's conductive when touching the screen.

        The hiss of the bombs gets him a bit angry though. Parrots hiss and it kind of sounds like that.

  • By apt-apt-apt-apt 2025-12-1223:512 reply

    As an evolutionary cousin of a rat, the half-second delay after firing my weapon and the response would make me want to eat my whiskers.

    This would completely kill any potential reward (and replace it with the opposite, frustration) you're trying to train me with, please fix immediately.

    • By chickenhun 2025-12-130:25

      Lol you are correct! At least training them becomes smoother the faster you administer reward. Learning happens at different timescales in the brain, and immediate feedback (about <300 ms) yields the most reliable neural updates.

    • By Buttons840 2025-12-130:181 reply

      One of the most important traits of intelligence is understanding and appreciating delayed reward.

      I saw a gambler win the jackpot. He was really excited and started gathering up all the chips he'd won. Why he was so excited to win a bunch of plastic chips, I'll never know. What's so great about plastic chips? Why was his brain so excited when all he was doing was gathering plastic chips? ...

      A half-second delay doesn't mean your brain can't learn to make the precursor feel good.

      • By komali2 2025-12-132:011 reply

        The colorful plastic chips work well enough to trick our dumb monkey brains, just like red notification bubbles.

        • By theultdev 2025-12-135:282 reply

          You missed the point. The chips are exchanged for money shortly after. The brain knows this.

          Similar to the rat knowing the sugar comes very shortly after the task.

          • By eloisius 2025-12-136:151 reply

            I think that’s the same idea behind clicker training for dogs. There’s a delay in giving them the actual treat, but the instantaneous click sound lets them now they did the thing that results in a treat

            • By theultdev 2025-12-138:261 reply

              pavlov conditioning

              • By richardatlarge 2025-12-138:41

                not pavlov conditioning -- in Skinner's three term contingency, the stimulus context acquires meaning/significance related to the consequences of a response. a neutral or even negative stimulus (context) can become it's own reward through this process. this conditioned stimulus explains most animal and human experience. Humans are especially prone to constructing meaning based on the primal.

                Think of the senses: sound becomes talking, music, etc. food become cuisine, obesity, and anorexia. eyes becomes art, movies, etc. desire becomes porn, s@m, etc.

                meaning is constructed, socially constructed, or what skinner call "learning." His masterwork, long forgotten, is the "generic nature of stimulus and response." Generic as it open to near total manipulation

                skinner was the man

          • By Buttons840 2025-12-1318:311 reply

            Yep. And money is just another kind of chip. What's so great about money?

            • By cylemons 2025-12-146:43

              It gets exchanged for hamburgers

  • By quasarj 2025-12-1221:294 reply

    How can he not include a video of it working? D:

    • By purplecats 2025-12-1221:452 reply

      i think its just people being out of touch with reality. perhaps engineering minds not thinking enough product. its too commonplace for me to even complain about. someone builds something primarily visual - a robot, a GUI application, etc. and links to their github/etc but they ensure that there are no visuals included.

      • By chickenhun 2025-12-130:442 reply

        This is far from primarily visual, but I do understand your point. I could not take videos unfortunately. I mentioned it in other places, but this project took so long, I just wanted to put it out there and get some feedback. I'm glad that people are this receptive to it, and I hope someone would take the project over!

        • By theultdev 2025-12-135:30

          You built all this and saw a mouse rolling on a ball playing Doom, but didn't record it?

        • By notfed 2025-12-132:38

          > I could not take videos unfortunately

          Why?

      • By d-lisp 2025-12-130:05

        At least there are 3d models of the dispositive and some pictures !

    • By why_at 2025-12-1222:05

      In the results section it looks like there's supposed to be an image of it but the link "placeholder_rat_playing.png" returns a 404 :(

    • By slim 2025-12-148:30

      because there's nothing to show

        We reached the point of rat habituation but didn’t start training. Our rats (Todd, Kojima, Gabe) aged out before full testing. The setup works, but behavioral validation is pending.

HackerNews