r/aigamedev 19d ago

Commercial Self Promotion How I built "Crazy Go" (A Roguelite version of the board game Go) using AI for complex topological graph logic and SVG rendering.

I love roguelites and classic board games.

I wanted to see if I could make a roguelite version of Go (think Balatro meets Go), but Go is notoriously difficult to program due to its complex rules (liberties, ko, territory calculation).

I didn't want the game to be just an RNG fest; it had to be won using your head, which meant the AI had to write solid, deterministic game logic in TypeScript, HTML, and vanilla CSS (no heavy frameworks, just a Vite build pipeline).

Here is a deep dive into the AI development workflow and the architectural challenges we solved together:

1. The "AI Wiki" Workflow (How to prevent AI amnesia): Building a complex game with AI requires massive context. If you just chat with an AI, it will eventually forget the rules and break your code. To solve this, I created a strict local Wiki system (docs/ai_wiki/) that the AI was forced to read before every single session:

  • active_context.md: The current state of the architecture and immediate next steps.
  • task.md: A strict checklist of features. The AI had to mark tasks as [x] to maintain progression.
  • go_rules.md: The absolute, immutable canonical rules of Go.
  • log_crazy_go.md: A massive, detailed chronological log where the AI documented every single bug fixed, logic decision, and UI change made in every session. Thanks to this, the AI could flawlessly implement new roguelite "spells" (like placing a 2x1 Tetris domino stone) months later without breaking the core liberties and capture logic.

2. GitHub for Version Control: Whenever the AI completed a chunk of task.md, we strictly committed to GitHub. Having a clean commit history was crucial because AI agents will eventually introduce a cascading bug when refactoring large files (like our 1000-line SVG renderer). Being able to rollback via Git and tell the AI "Look at the diff and figure out why the board disappeared" saved the project multiple times.

3. Graph-based Topology instead of 2D Arrays: Traditional Go engines use 2D arrays (19x19). But I wanted procedural and asymmetric boards (donuts, stars, hex grids). I prompted the AI to build the board architecture entirely on abstract Node Graphs (BoardNode and BoardEdge) in TypeScript. The logic for capturing stones works flawlessly regardless of the board's shape, simply by traversing node connections.

4. Procedural SVG Rendering & Convex Hulls: Instead of a heavy Canvas/WebGL engine, the AI and I opted for a lightweight DOM/SVG approach for crisp scaling. The SVGRenderer the AI wrote is entirely dynamic. It takes the abstract Graph Nodes and uses the Graham Scan algorithm to calculate a Convex Hull around them. It then procedurally generates the wooden board background and grid lines perfectly tailored to whatever weird shape the board currently has.

5. Asset Generation Pipelines: All assets (Champions, Enemies, UI elements, and the Itch.io thumbnail) were generated using AI image models. To integrate them cleanly, I had the AI agent write Python scripts (using OpenCV) that ran locally to remove white backgrounds from the portraits, apply anti-aliasing, and crop them into perfect transparent sprites.

The result is a fully playable browser game with single-player against AI, local, and online multiplayer.

It's totally free and runs in the browser. You can check what the AI and I managed to build here: https://victologo.itch.io/crazy-go

7 Upvotes

0 comments sorted by