Mr. Phil Games’ Blog

Posts for Tag: Devlog

Ground Combat & Territory Borders Revamped

This week’s updates brought big strides in polish and clarity for Stellar Throne. Ground combat now displays strength bars above their respective forces, making planetary invasions easier to read. Ownership now correctly updates after successful invasions, and the final phase of an invasion plays out as intended.

On the combat side, the battlefield grid now renders fully, fleets start in centered positions, and you can left-click + drag to move the map. Support ships have distinct plus-shaped icons, colony ships use circles, and troop ships have been fully renamed for clarity. Fleets with no ships are automatically cleaned up after combat, reducing clutter.

Outside battle, draggable UI panels (shipyard, diplomacy, bombardment) were unified under a new DraggablePanel base class, making the interface smoother. Loading screens are more responsive, and territory borders now update dynamically after colonization. The border system itself has been revamped with shaders, opening the door for smoother, more striking visuals.

This update brings Stellar Throne one step closer to feeling like a finished 4X experience.

Stellar Throne Changelog Week of August 8–15, 2025

🌟 What’s New

This week brings major planetary warfare upgrades with the new Orbital Bombardment and Ground Invasion systems, a redesigned Ground Combat UI, smoother combat flow, and dozens of bug fixes and performance improvements. If you’ve been waiting to crush enemy worlds in style, now’s the time.


🆕 New Features

  • Orbital Bombardment System — Added comprehensive orbital bombardment mechanics with UI controls, allowing fleets to weaken planetary defenses before invasion.

  • Ground Invasion — Implemented ground invasion capability integrated with bombardment UI for a seamless planet conquest workflow.

  • Ground Combat UI Redesign — Enhanced battlefield visualization with army strength bars displayed above unit columns for better awareness.


⚔️ Combat Improvements

  • Damage Visualization — Incremental damage application synchronized with weapon effects for more engaging combat feedback.

  • Destroyed Ship Feedback — Clear visual indicators when ships are destroyed in combat.

  • Ship Detail Panel — Panel now closes automatically when combat begins.

  • Combat Flow — Smoother battle completion and input handling for consecutive battles.

  • Auto-Resolve — Fixed to jump directly to the final combat state.


🐞 Bug Fixes

  • Fixed multiple combat UI issues including scroll isolation, input handling, and grid cell highlighting.

  • Resolved ship targeting bug where destroyed ships could regenerate.

  • Fixed timing issues so destruction animations play at proper turn end.

  • Corrected ships having zero energy capacity in combat.

  • Fixed double damage and combat synchronization issues.

  • Resolved input handling problems when switching between combat and starmap views.

  • Fixed ground combat final screen to properly display complete phase results.


🎨 UI/UX Improvements

  • Enhanced scroll wheel isolation between UI panels and galaxy view.

  • Improved memory management in combat UI systems.

  • Better defender priority handling for grid cell movement conflicts.

  • Cleaner, modular architecture for combat UI components.


🛠 Technical Updates

  • Refactored project documentation into a modular structure for better maintainability.

  • Resolved SpatialGrid naming conflicts in CombatManager.

  • Reduced test suite orphan count and fixed various test failures.

  • Removed debug print statements and cleaned up temporary test files.


🚀 Performance & Stability

  • Improved combat animation system performance.

  • Enhanced memory management across UI systems.

  • Better error handling for bombardment operations involving Building resources.


When the Bug Breaks Before You Do

A couple days ago was… maddening.

I’d been wrestling with the same bug for days—the kind that sits in your code like a smug little goblin, daring you to come find it. Every time I thought I had it cornered—poof—it would slip away into another layer of logic.

The problem sounded simple enough: combat is simultaneous. Even if a ship gets destroyed, it should still get to fire its weapon that turn. But the UI shouldn’t mark it as destroyed until after all attacks are resolved.

Except in my game, ships weren’t showing their dramatic “destroyed” flair until the start of the next turn. By then, the moment was gone. It was like telling a joke and waiting five minutes for the punchline to land.

I threw everything at it:

  • The “outside consultant” trick—pretending Claude was a hired expert swooping in to save the day.

  • The “you’re a zookeeper” trick. (Don’t ask.)

  • Breaking the workflow into phases.

  • Having Claude explain the code back to me.

  • Running the debugger subagent.

  • Asking it to think hard… harder… ultra-think.

  • Asking Claude to improve my prompt.

  • Diagramming the problem like a detective on a conspiracy board.

  • Adding a ton of debug logs.

  • Even pulling in ChatGPT to craft a better Claude prompt.

  • Describing the issue in painstaking detail—right down to which variables changed on which frame.

Nothing. Worked.

And this wasn’t even a crash bug—the game ran fine. It was just wrong. The kind of subtle pacing flaw that players might not notice consciously, but would feel in their bones. The kind that makes everything feel just slightly “off.”

By about hour six that day, I was leaning back in my chair, staring at my code, wondering if the bug was less about the project and more about me.

Then—somewhere between frustration and surrender—I tried one more approach. Nothing special about it. No perfect galaxy-brain prompt. Just another attempt in a long line of attempts. And this time… it worked. The ships died exactly when they were supposed to, the UI updated cleanly, and the combat flow finally felt right.

I’d love to tell you it was some brilliant debugging insight or the magic words that unlocked Claude’s genius. But it wasn’t. It was just the luck of the dice—one more roll, one more try, and this time it came up in my favor.

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.


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.