Doomformer is a project that compiles integer neural networks into ZDoom maps, allowing the game engine to execute the computations of a neural network. In this system, the game's internal mechanics are repurposed as a computational substrate: 'voodoo dolls' (extra player entities spawned by the game) perform the arithmetic, while sector light levels and plane heights are used to store the resulting values. The project ensures accuracy by comparing every value read back from the running game against a NumPy integer reference with a tolerance of zero.
This image represents the core concept of the Doomformer project, where neural network computations are mapped onto DOOM's internal mechanics.
The mechanism relies on the game's ability to handle complex logic through scripts and entity interactions. The dolls execute every multiply-add, activation, and comparison operation. While the dolls handle the core arithmetic, ACS (Automated Control Script) level scripts manage the flow of data, moving input gates, rewinding the dolls, and copying results out of the network. This approach turns the game world into a physical representation of a neural network's architecture, where the 'weights' and 'biases' are encoded into the map's geometry and entity properties.
While technically impressive, the method is significantly slower than standard computational libraries. For a small multi-layer perceptron (MLP), the engine time is approximately 23,000 times slower than NumPy, and a full timer around the call can be 65,000 times slower. For example, processing a handwritten digit can take 163 seconds of real-time DOOM at the default schedule, though this can be reduced to 8 seconds using specific optimization flags. The project also includes a 'museum' map that allows users to interact with the network, such as rewiring connections to see how they affect the output in real-time.