Galaxy Guardian Dev Log: Fixing the "Invisible Wall" & Tuning Combat
Go behind the scenes of Galaxy Guardian's latest update. Learn how we fixed a critical "start game" bug and tuned enemy AI for a more intense arcade experience.
Introduction: The "Quiet" Space
Every game developer knows the feeling. You deploy a new update, excited for players to experience the new features, only to be met with... silence. Not the silence of space, but the silence of a "Play" button that simply refuses to work.
Today's development session on Galaxy Guardian started with a simple goal: make the game harder. Players reported that the early levels were too peaceful. The enemy ships were just flying by, acting more like tourists than invaders. But as we dug into the code to ramp up the aggression, we stumbled into a much deeper technical rabbit hole that threatened to break the entire game.
In this Dev Log, I'll walk you through our journey today—from the design decisions behind the new difficulty curve to the "Sherlock Holmes" style debugging session that saved the day.
Part 1: Tuning the Difficulty – "Why Won't They Shoot?"
Our first task was gameplay balancing. Feedback indicated that the Galaxy Guardian was too easy. The early waves felt like a leisurely cruise.
The Problem: Passive Scouts
We analyzed the enemy behavior code and found a logic flaw. The smallest enemy unit, the Scout, was hardcoded not to fire weapons.
if (entity.health > 4) { // Only Fighter and Boss could shoot
if (Math.random() > 0.5) spawnBullet(cx, cy, false, 0);
}
This meant that swarms of small enemies were harmless. To make matters worse, all enemies had a built-in "safety delay" of 1 full second before they even considered shooting.
The Solution: Aggressive AI
We rewrote the firing logic to be inclusive and aggressive.
- Removed the HP Gate: Now, even the smallest 3-HP scout can ruin your day.
- Instant Aggression: We initialized the fire timer to the current timestamp, removing the artificial startup delay.
- Class-Based Fire Rates: Scouts fire every 2.5s, Fighters every 1.5s.
Part 2: The "Invisible Wall" Bug
After implementing the AI changes, we pushed the code. Excited to test, we loaded the game... and nothing happened. The "INITIALIZE SYSTEM" button was dead.
The Investigation
We couldn't rely on guesswork. We instrumented the app with logs and discovered a Global Click was detected, but the React handler wasn't firing.
The Culprit: A combination of a conflicting share-modal.js script
injecting itself into the game iframe, and a stale build where the index.html
pointed to old Javascript assets.
The Fix
1. Clean Up: We removed the conflicting script.
2. Shim CSS: We created an empty index.css to silence 404 errors.
3. Rebuild: We ran a fresh build to generate new asset hashes.
Conclusion
Today was a reminder that game development is rarely just about "making game mechanics." It's an ecosystem of build tools, asset pipelines, and browser behaviors.
We started with a goal to make Galaxy Guardian harder. We succeeded, but along the way, we also made the codebase cleaner, robust, and error-free.
Play the updated Galaxy Guardian now and see if you can survive the new Sector 7 waves!