Hi everyone,
it's been a while since my last showcase, so here is something a bit bigger: QtCraft, a voxel sandbox game (yes, the Minecraft kind) written in C++23 with Qt 6.12.
[image: 45-1a-sunset-realistic.jpg]
I've always wanted to make a more elaborate game with Qt. Privately there never was the time, and at work 3D never really came up as the solution to anything.
Then I found myself with some free leftover tokens from work, and the first thing I did with them was to finally start on that old idea: a Qt-based Minecraft clone. After the weekend those tokens were used up, and like a proper junkie I upgraded my private subscription to the 200 € tier and let it keep going. Roughly 7,000 $ later (had the tokens been paid via the API), this is the result.
Part of the motivation was that I actually wanted to learn this stuff: game dev, 3D rendering and so on.
Well. I now have a 3D Qt/QML game, but I learned sadly little about how it's actually done. To change that, I'd have to sit down and work through the code myself, which puts me right back where I started x)
So, the premise, what is QtCraft exactly?
At its core, QtCraft is an experiment in how far an AI agent (Claude Code) can build a non-trivial C++/Qt project more or less autonomously. I set the direction, decided the open questions, play-tested and reviewed, but the vast majority of the code was written by the AI.
What I did put in place is a lot of guard rails, because "the AI writes code" without checks degrades quickly:
Static analysis on every change: clang-tidy, clazy, qmllint, plus project-specific checks (function/file length, no output parameters, duplicate code, QML rules)
Modern C++ guidelines (C++ Core Guidelines, e.g. only named casts), warnings as errors, no exceptions (std::expected/std::optional instead)
Sanitizers: AddressSanitizer + UBSan and ThreadSanitizer runs on the full test suite (~470 tests)
Screenshot hooks and offscreen rendering, so UI and world can be tested and compared without a visible window
Headless and GUI benchmarks with A/B comparisons between builds (e.g. Qt 6.8 vs 6.12)
Remote bot controls, so the AI can run/test actual gameplay scenarios
clangd as an LSP tool for the agent, plus a generated code map, so it navigates the code instead of reading half the repo into its context
A decision log (every larger design decision gets a numbered entry), independent review agents before every merge, and CI for macOS, Windows and Linux
QtCraft contains:
Client/server architecture, also in single player (local server in the same process), multiplayer over TLS
Generated worlds with biomes, villages and structures, survival, creative, spectator and adventure mode
Redstone-like "Signal Dust", minecarts, farming, enchanting, trading …
Data-only mods (JSON), an in-game handbook (also on the web) and QDoc API docs
Rendering via QRhi, UI in Qt Quick, gamepad support
[image: 45-1a-valley-day-realistic.jpg]
There are two render modes. Village, classic
[image: 45-1b-village-day-classic.jpg]
The menus are plain Qt Quick:
[image: 76-1-02-menu-start.jpg]
Versions currently on GitHub:
0.1.0 is more or less the unedited state of what the AI produced.
1.0.0 (currently as release candidate) contains a number of reworks on top of that.
Not everything turned out the way I would have built it myself, and some parts were reworked several times. The entities are the best example: the AI did not build in enough robustness for future requirements, so every new feature that touched them meant another round of restructuring. That's probably the most interesting lesson of the whole project for me.
So please, if you're interested, try it!
Both versions are on GitHub, with packages for macOS (universal), Windows x64 and Linux (AppImage):
Repository: https://github.com/DeiVadder/QtCraft
Releases: https://github.com/DeiVadder/QtCraft/releases
Handbook & API docs: https://deivadder.github.io/QtCraft/
Feel free to look around, play it, or dig through the code (and the decision log). I'm grateful for any feedback — on the game, the code, or the approach itself.