Microsoft Azure CTO Mark Russinovich has developed a project called DoomPaint that uses the classic Microsoft Paint application as a display for the game Doom. By routing the VizDoom engine's output through the Windows clipboard, the project creates a functional, playable experience within a simple raster editor.
The VizDoom-to-Clipboard Rendering Loop
The DoomPaint project functions by separating the game's logic from its visual representation. while the actual computing is handled by the VizDoom engine, the visual output is redirected through a clever software wrapper. as the report states, this wrapper hides the standard VizDoom window and instead captures each individual frame to the Windows clipboard.
To facilitate this, Russinovich utilized Python's image library module to handle the frame capture process. once a frame is captured, it is pasted directly into Microsoft Paint. this creates a continuous loop where the game is effectively "playing" inside the drawing tool, using the clipboard as a makeshift video cable to transmit visual data.
Solving Paint's Silent Key Drops with UI Automation
Implementing this was not a simple matter of pasting images. Russinovich encountered a significant hurdle with Microsoft Paint's tendency to silently drop synthetic keys, which would have rendered the game unplayable by ignoring user inputs. To circumvent this, the code was designed to automatically detect these failures and fall back on UI automation if the standard Ctrl-V command failed to register.
Furthermore, the project had to address how data is handled during the transfer to prevent software crashes. According to the source, the developer had to treat the clipboard as an OLE data object. This specific technical adjustment was necessary to prevent Microsoft Paint from throwing errors when the frames were being pasted into the application.
Why Pixel Count Dictates the Frame Rate
Achieving a smooth experience required optimizing how Microsoft Paint processes incoming data. Russinovich discovered that the performance of the game was heavily dependent on the size of the active window. The report notes that the per-frame cost in Paint is primarily driven by the total pixel count rather than the overhead of the paste command itself.
By keeping the window size small, the developer was able to maintain a playable frame rate.. this optimization ensures that the heavy lifting of rendering the frames does not overwhelm the application's ability to update the canvas in real-time, allowing the game to run smoothly on its own thread.
What remains unverified about latency and modern Paint?
While the project is available on GitHub, several technical details remain unaddressed in the current reporting. It is unclear how much input latency is introduced by the cycle of capturing frames, moving them to the clipboard, and pasting them into Paint.. additionally, the source does not specify if this method remains compatible with the newer, AI-enhanced versions of Microsoft Paint found in Windows 11 , or if the added complexity of modern UI elements would break the automation.
Comments 0