{"slug": "i-built-a-small-c-game-engine-so-an-ai-ide-could-touch-the-whole-thing", "title": "I built a small C++ game engine so an AI IDE could touch the whole thing", "summary": "A developer built a small C++ game engine, Sapana Engine, designed to run on integrated graphics and be fully editable by an AI IDE. The engine uses Diligent Engine for GPU rendering, EnTT for ECS, and Jolt for physics, achieving mid-60s FPS on an Intel HD 620. The project is open-source on GitHub.", "body_md": "*Originally posted on Medium.*\n\nI wanted to make a game. I also wanted the AI IDE on my desk to edit the whole running process, not just the scripts.\n\nGodot still makes you do linking and scene wiring in the UI. Unreal would not run on this laptop. Writing a raw Vulkan renderer from scratch meant months before I could drop a cube on screen. So I took the middle: Diligent Engine for the GPU, and I built everything else.\n\nThe machine is an Intel HD 620. No discrete GPU. That forced the rest of the design. Keep draw calls low. Cull hard. Do not pull in heavy middleware.\n\nDemo: [https://youtu.be/nsptiy-I4Ps](https://youtu.be/nsptiy-I4Ps)\n\nRepo: [https://github.com/Ishan5hrestha/SapanaEngine](https://github.com/Ishan5hrestha/SapanaEngine)\n\nFull engines hide the part I wanted to learn, and they are too fat for this hardware. Raw Vulkan is a career by itself. Diligent sits in between. Pipeline state, resource binding, HLSL once, targets Vulkan / D3D12 / Metal / D3D11 / GL. It is a dependency. It is not the codebase.\n\nI write ECS, scenes, assets, physics, cameras, input, and a flight sim. Diligent draws.\n\n**ECS and scenes.** EnTT. Scenes are JSON. Entities get transforms, mesh refs, physics blocks, LOD groups. A loader fills the registry at startup.\n\n**Assets.** GLB/glTF through Diligent's loader, wrapped in my own cache. Builtin cube and plane for quick tests. String IDs like `builtin:cube`\n\nor `meshes/drone.glb`\n\n.\n\n**Rendering.** Two modes in config: Basic (forward, color, optional PCF shadows) and PBR (Diligent's GLTF PBR path, behind pimpl). Procedural sky, no skybox texture. Cascaded shadows. Frustum cull, distance LOD, far cull with hysteresis.\n\n**Physics.** Jolt 5.3.0, FetchContent, pinned. Opt-in. No physics block in the JSON means mesh-only. Static and dynamic bodies, box and plane shapes for now. Public headers never see Jolt. Pimpl.\n\n**Flight.** The sandbox has a quad. Two profiles on the same craft.\n\nFour virtual motor forces at the arm corners. Tunables in `config/flight.json`\n\n. Cameras: freelook, chase, FPV nose. L flips the flight profile. K cycles cameras.\n\n**Input.** Bindings live in JSON. Cursor capture for mouse look.\n\nMost of the C++ came out of the AI IDE. The real work was keeping it light enough that this laptop still runs, and fixing the parts the model got wrong.\n\nThat shot is Sapana Sandbox on Vulkan. Same frame you see in the title bar: mid-60s fps on integrated graphics. Green ground with static physics. Dynamic cubes. Visual-only glTF cube. One flyable drone. About forty static trees with box colliders.\n\nEdit a config or the scene JSON, rebuild, relaunch. No recompile hunt for every tweak. Builds on Linux (Mint 22.3 here) and Windows (`win`\n\nbranch).\n\nFar-distance cull, with LOD enabled, can strobe. Builtin cubes pop. Sky shows through. Freelook and drone share one view path, so both get it. Far hide vs camera far plane, shadow casters dropping while receivers still draw, PCF on basic meshes. Hysteresis helped. It is not fixed. Workaround: turn LOD off in `config/lod.json`\n\nand restart.\n\nIt is not Unreal. It is not a product. It is a small engine for a specific game, on limited VRAM, where the whole loop is files an IDE can touch.\n\nIf you want the boring details, the README in the repo has the layer list, controls, and build steps.", "url": "https://wpnews.pro/news/i-built-a-small-c-game-engine-so-an-ai-ide-could-touch-the-whole-thing", "canonical_source": "https://dev.to/ishan_shrestha/i-built-a-small-c-game-engine-so-an-ai-ide-could-touch-the-whole-thing-3fki", "published_at": "2026-09-03 20:08:11+00:00", "updated_at": "2026-09-03 20:25:13.856965+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Sapana Engine", "Diligent Engine", "EnTT", "Jolt", "GitHub", "Intel HD 620", "Ishan5hrestha"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-small-c-game-engine-so-an-ai-ide-could-touch-the-whole-thing", "markdown": "https://wpnews.pro/news/i-built-a-small-c-game-engine-so-an-ai-ide-could-touch-the-whole-thing.md", "text": "https://wpnews.pro/news/i-built-a-small-c-game-engine-so-an-ai-ide-could-touch-the-whole-thing.txt", "jsonld": "https://wpnews.pro/news/i-built-a-small-c-game-engine-so-an-ai-ide-could-touch-the-whole-thing.jsonld"}}