Mr. Phil Games’ Blog

Test Coverage, CLAUDE Compliance, and a Safer Codebase

Today’s focus was on strengthening Stellar Throne's internal validation pipeline and ensuring the project continues to scale cleanly under AI-assisted development.


✅ What Got Done

  • ✅ Improved Unit Test Coverage
    Identified gaps in existing test coverage, especially from earlier Claude-generated files. Added new test cases for key game systems, including colony construction, combat state transitions, and shipyard logic.

  • ✅ Test Counting & Verification System
    Built a utility that compares registered test modules against the actual file count. This prevents “orphaned” tests — where Claude writes a test but forgets to register it. It’s now part of the daily validation workflow.

  • ✅ CLAUDE.md Audit
    Completed a pass over the codebase to verify:

    • Naming conventions (camelCase)

    • File structure adherence

    • Token-safe module boundaries

    • AI prompt formatting patterns
      CLAUDE.md remains aligned with the project as of today.


💡 What I Learned

The test coverage illusion was subtle but dangerous — having tests written but not run creates a false sense of safety. Fixing this now saves major debugging headaches later. Also, AI output policies need reinforcement: it's easy for a helper like Claude to silently skip crucial steps unless expectations are made explicit and checked automatically.

The Case of the Missing Unit Tests

Today’s development revealed an important oversight: while Claude had been generating unit tests for various systems, they weren’t being added to the test runner. As a result, many validations were silently unused — giving a false sense of coverage.


🧪 What Got Done

  • ✅ Improved Unit Test Coverage:

    • Identified and integrated previously orphaned tests

    • Updated the main test runner to explicitly include all test modules

    • Improved unit test coverage


🔍 What I Learned

AI can produce great utility code, but it doesn’t always connect the dots — especially when it comes to integration. Even if a file looks complete, it may not be registered in the larger test framework. Always verify that generated tests are executed, not just written.

Smarter UI, Safer Fleets, and Combat Sanity

Today's work focused on cleaning up gameplay feedbackfixing persistent combat edge cases, and polishing core user experience elements across research, construction, and fleet management. These improvements bring Stellar Throne closer to a cohesive playable loop.


🧭 UI & UX Improvements

  • ✅ Persistent Notifications now route correctly to their respective panels (e.g., idle colonies → construction screen).

  • ✅ Top-bar navigation buttons added for: Research, Diplomacy (placeholder), Construction, and Fleet Management.

  • ✅ Research Notification on Load now reflects actual tech status.

  • ✅ Shipyard Bug Fix: Clicking the bottom ship now properly selects it.

  • ✅ Combat Visualization now only shows when the player is involved — no more interruptions for AI-on-AI skirmishes.

  • ✅ Colony Panel Fixes:

    • Newly constructed buildings now appear as expected

    • Available buildings list now displays more options


⚔️ Combat Logic Edge Cases

  • ✅ Ships In Transit Are Now Immune to Combat: This prevents weird logic loops and unresolvable battle triggers.

  • ⚠️ AI vs AI Combat Bug: Battles between non-player factions were pausing the game indefinitely. This has been identified and will be addressed.


🔍 CLAUDE.md Audit (In Progress)

A first pass of the codebase audit has begun. Naming conventions are largely consistent with camelCase, but some file structure and function naming still need cleanup. The audit continues tomorrow.


💡 What I Learned

When a system feels tangled or risky to change, use Git branches more proactively. Branching lets me explore fixes or improvements without endangering working code. It’s a simple tool I need to use more often.

Refactors, Bug Fixes, and Sprite Progress

Today was a productive day of cleanup, visual iteration, and bug hunting during a full game playthrough. A number of major systems were refactored to stay compatible with Claude and GPT tooling, and the visual fidelity of the star map continues to improve.


🧹 Major File Refactors

To avoid hitting the token limits in Claude and GPT, the following massive files were split, modularized, or cleaned up:

  1. fleet_composition_panel.zig – 1,435 lines

  2. game_state.zig – 1,342 lines

  3. ai_controller.zig – 1,192 lines

  4. save_load.zig – 1,070 lines

  5. colony_panel.zig – 1,056 lines

  6. research_panel.zig – 844 lines

  7. combat_visualization_panel.zig – 831 lines

This lays the foundation for better Claude-assisted iteration and long-term maintainability.


🎮 Playtest + Bug Fixes

During today’s live play session, several bugs were diagnosed and resolved:

  • ✅ Fixed missing territory borders after loading a game

  • ✅ Fixed debug fleet combat where no defenders appeared

  • ✅ Fixed combat resolution stalling (ships now take damage again)

Remaining issues include:

  • UI buttons needed for various subsystems (research, shipyard, etc.)

  • Clicking persistent notifications doesn’t always route to the correct panel

  • Loading a save can show incorrect research status notifications

  • Ships in transit still being targeted in combat — may require a ruleset change


🌍 Visuals & Content

  • Continued planet sprite sheet generation (desert, barren, arctic types)

  • Generated a few new star map icons

  • Posted the latest dev newsletter


🧠 What I Noticed

There’s a growing hostility toward AI tools in gamer communities. It’s worth being mindful of how this project is presented publicly. While AI is helping with tooling and content generation, the final design decisions remain very much human-led.

Fog of War, First Playthrough, and Prompt Engineering Wins

Today was a turning point — both in terms of playtesting Stellar Throne for the first time and in figuring out how to better use Claude via prompt engineering.


🌌 What Got Done

  • ✅ Fog of War Visuals Implemented: Added a stylized galaxy image to obscure unexplored areas. Grid tiles now exist in three states:

    • Unexplored: shows the galaxy backdrop only

    • Visible: full data on stars, planets, fleets

    • Explored: shows known bodies but with stale information
      This adds a meaningful layer to exploration and information control.

  • ✅ Planet Sprite Sheet Progress: Continued work on new sprite sheets for gas giantsgarden worlds, and deserts.

  • ✅ Fuel System Re-enabled (Then Rejected): Re-tested the fuel mechanic and found it clunky, overly punishing, and not impactful enough on strategic decision-making. Removed again for now — possibly permanently.

  • ✅ First Full Playthrough:

    • Exploration phase feels good

    • Later game lacks clarity at zoomed-out scale (icons too small, weak star map feel)

    • Economy is unbalanced: too many resources, ships build too fast

    • Research is too slow (possibly because Research Labs are bugged and not completing)

  • ✅ game_screen.zig Refactor: The file had ballooned past the token limit for Claude/GPT. It’s now modularized and more maintainable.


💡 What I Learned

When Claude wasn’t understanding the 3-layer Fog of War system (kept confusing Explored vs Visible), I turned to ChatGPT for help designing a better prompt. That worked instantly. Claude called it a great prompt and immediately executed everything correctly.

Lesson: When I’m stuck with Claude, use ChatGPT as my prompt architect — especially for tricky, layered systems.


🚧 Still Unfinished / Blocked

  • 🔍 Construction System Bug: Buildings may not be finishing or may not be added to colony data. May also relate to notification failures for idle colonies.

  • 🧠 Memory Leaks: Need to audit allocations and lifetimes.


Research Deepens, Energy Burns, and the Galaxy Pushes Back

Today was all about depth and connection — linking research to real gameplay effects, improving feedback systems, and laying down infrastructure for systems that depend on each other.


🔬 What Got Done

  • ✅ Research System Enhancements: Added more technologies, unlock tiers, special projects, and gating for buildings and ship components. Research is now central to player progression.

  • ✅ Energy System: Ships now have power capacity, and weapons consume energy per use. This creates tactical limitations and strategic outfitting tradeoffs.

  • ✅ Building UI Fixes: Squashed bugs related to construction interface logic.

  • ✅ HUD Improvements: Added a clean and functional Next Turn button.

  • ✅ Smart Notifications: Implemented a new system to surface pending actions — like unassigned research, idle shipyards, and colonies needing orders.


🧠 What I Noticed

Generating believable Terran planet sprites remains tough. GPT tools frequently lean on Earth-like continents and familiar geography, even when prompted otherwise. I had to toss a lot of attempts. The mitigation strategy continues to be selective generation, manual filtering, and stitching.


⚠️ Still Unfinished

  • Systems are interdependent and tangled now. Many features can’t be finished in isolation — research depends on diplomacy, AI logic needs construction, and unlocking tech touches everything.


Explosions, Research, and High-Fidelity Sprites

Today’s dev sprint focused on destructive power and high-quality visual polish.


💥 What Got Done

  • ✅ SpriteSheetMaker Upgrade: Implemented the Mitchell filter for high-quality downscaling. This significantly improves crispness and sprite consistency when generating sheets from single images.

  • ✅ Bombardment System: You can now rain destruction from orbit. Basic damage logic is in place, with hooks for visuals and colony impact.

  • ✅ Ground Combat: First pass at a turn-based ground invasion system is working — includes attacker/defender phases and post-battle resolution.

  • ✅ Visual Effects Foundation: Started work on a unified FX system to support combat visuals like explosions, hits, and transitions.

  • ✅ Save/Load System: Added auto-savequick save, and a new save/load UI panel for player access and session persistence.

  • ✅ Research System: Implemented the framework for unlocking technologies — categories, cost progression, and placeholder techs.


🔍 What I Learned

The Mitchell filter made a noticeable visual upgrade for my sprite workflows — definitely worth the integration. It’s now clear that sprite quality from AI tools can be saved with the right post-processing. Also, committing to a unified effects system early means smoother integration later, especially for combat-heavy sequences.


🚧 Still in Progress

  • The Research System is scaffolded but incomplete — needs UI improvements, better tech tree layout, and actual gameplay unlocks.


A Big Systems Push – Colonization, Borders, and Battles

Today was a heavy systems-focused day in Stellar Throne. I made major progress on gameplay infrastructure and galaxy simulation features — pushing forward across colonization, ship systems, economy, and even the early combat layer.


🌌 What Got Done

  • ✅ Colonization System: Colonies can now be established and affect nearby territory.

  • ✅ Improved Territory Borders: Adjacent colonies now merge and fill territory more realistically.

  • ✅ Sensor System Overhaul: Colonies now reveal stars only; planets require ship presence to reveal.

  • ✅ Planet Type Adjustments: Terran and Ocean worlds are less common, Gas Giants more common.

  • ✅ Fleet Management: Added fleet splittingmerging, and renaming features.

  • ✅ Ship Components & Retrofitting: Began component system and retrofitting support.

  • ✅ Terraforming System: Initial hooks implemented.

  • ✅ Building System: Basic framework begun (awaits research unlocks).

  • ✅ Trade System: First pass implemented (currently lacks destinations).

  • ✅ Victory System: Added tracking logic and display UI.

  • ✅ Game Setup Screen: Customize game options before galaxy generation.

  • ✅ Battle System: Implemented with an auto-resolver and simple battle visualization.


🧠 What I Noticed

  • The design philosophy of “build the framework early, even if features are placeholder” really paid off — systems like terraforming, building, and trade are all partially implemented and ready to expand once research and diplomacy come online.

  • Sensors now reveal different information depending on context (colony vs ship), which helps with fog-of-war and strategic decision-making.

  • Sprite generation is still a bottleneck, and I need better upscaling or native-resolution output.


🔧 Still in Progress

  • 🚧 Ship Component Retrofitting – Lacks advanced components beyond starter parts.

  • 🚧 Terraforming System – Blocked until the research system is available.

  • 🚧 Building System – Also waiting on research and unlock logic.

  • 🚧 Trade System – Has no destinations or diplomacy integration; currently functions magically.


Restart, Rebuild, Recalibrate

After discovering that snake_case had been deeply baked into the project from near the start, I made the tough call to restart Stellar Throne from scratch. Enforcing camelCase from the new CLAUDE.md spec led to unintended breakages — especially thanks to batch Python scripts Claude had run, which mangled filenames and import paths.

Instead of trying to untangle it all, I opted for a clean slate. Painful, yes, but with the speed of agentic tools like Claude, I’m confident I’ll catch back up quickly.

On the bright side: the visuals are already looking better.


✅ What Got Done

  • Rebuilt the star map with newly rendered star and planet sprites

  • Implemented fleet movementHUD overlays, and user notifications

  • Built a new app: SpriteSheetMaker to stitch GPT-generated sprites into clean, aligned sprite sheets

  • Recreated sprite sheets for F-type and G-type stars

  • Began implementing ship construction UI and logic


💡 What I Learned

  • Agentic development makes it easy to justify starting over — dangerously easy. Productivity makes code feel disposable, but discipline matters.

  • GPT still struggles with sprite sheet consistency. The centering is unreliable, so I’m generating one-off sprites and stitching them myself.

  • The starting sector often places the player too far from meaningful targets. I may need to guarantee at least 7 stars and 1 colonizable world within reachable range.


🧱 Still in Progress

  • More star and planet sprite rendering

  • Continued work on ship construction systems