Dev Log: Refining Loot Drops and Enemy Visual Feedback


Experience Vial Drop Logic Fix

I encountered a perplexing bug today where experience vials 🧪 weren't dropping from enemies, even with high drop percentages set in the GUI. After some investigation, I discovered that the drop logic was backward: the system prevented drops when it should have been allowing them, and vice versa!

The issue boiled down to a subtle logic error. When checking if an item should drop, the system was instructed to stop processing on a successful roll, effectively saying, "if you win the roll, don’t give loot." A quick fix involved flipping the logic to continue instead of stopping on successful rolls.

With this corrected, loot now drops correctly based on percentage chances, and the experience gain upgrade system works as intended. This was a great reminder to double-check conditional logic, especially in core gameplay systems like loot drops. In the future, I’ll prioritize testing edge cases (0% and 100% drop rates) to catch similar issues early.

Hit Flash & Elite Outline Integration

While enhancing enemy feedback systems, I stumbled upon a visual bug: elite enemies' golden outline ✨, meant to make them stand out, disappeared every time they were hit. Instead of looking intimidating, they just looked buggy!

Initially, I suspected a timing issue with the hit flash effect. I tweaked durations and even attempted to force-refresh the outline after each hit, but nothing worked. Digging deeper, I found the real problem: Godot’s handling of shader materials. The hit flash and elite outline were clashing, competing for the same material slot and overwriting each other.

The solution was to treat the effects as a material chain rather than isolated components. By making the hit flash aware of the elite outline's material and ensuring proper chaining, I got both effects to coexist. Now the outline persists, and the flash delivers satisfying hit feedback.

Key Takeaways

  • Always validate conditional logic for gameplay-critical systems to avoid backward results (like reversed loot drops).
  • When dealing with shaders, coordinate effects that modify the same properties or resources.
  • Modular, cooperative components make code cleaner and more maintainable.

These fixes are small but impactful. The updated loot system ensures a consistent gameplay loop, and the polished visual feedback elevates the game's overall feel. Every detail matters when crafting an engaging player experience! 🎮

Files

game_updated.zip Play in browser
84 days ago

Get Knightmare

Leave a comment

Log in with itch.io to leave a comment.