GPT Model Writes Complete Physics Engine from Scratch

cloneofsimo · x · 2026-07-14

A developer discovered that a GPT model can build a complete physics engine similar to MuJoCo entirely from scratch.

The AI-generated engine features a gym-style API, is implemented in C++, supports native headless rendering and Web rendering, and allows environments to be defined using Python's native DSL, eliminating tedious XML configurations. The developer noted that while it isn't guaranteed to be better than MuJoCo or fully original, it proves AI can now write genuinely legitimate and usable micro-physics engines. Furthermore, agents following PD control can be trained using the PPO algorithm.

Related event: AI Writes Complete Physics Engine from Scratch in Under 10 Prompts(4 posts)→

Original post →

More from coding & agent

coding & agent channel →