Submissions by Gilberto Moreno tagged pooling

Some bug fixing, refactoring, and some rest and healing for today!

Last night I had a migraine and it kinda messed with my sleep schedule and cascaded into lower productivity today.

Got some proper rest and when I finally got to work I did actually manage to get some proper progress done for the day!

Preamble to today's task ✅!

The previous version of the game had walls and enclosed rooms and as such it was impossible for a projectile to never return to the pool or so i thought.

As it turns out

When I reload the scene any projectile from player or enemies still in the world would become untethered to the global pooling system of projectiles which is a big nono. I was creating memory leaks!

What got fixed today:

  • Projectile memory leak squashed - projectiles now properly return to pools when scenes reload instead of becoming ghost references
  • Added Lifetime.cs component - automatic cleanup system for projectiles with configurable duration (10s default)
  • Fixed pool initialization order - moved ProjectilePoolsManager to Start() so dependencies actually work
  • Enhanced weapon system while I was in there - better frame timing, charged shot handling, visual feedback improvements
  • Cleaned up audio system lifecycle and added new ricochet hit sounds

The reality of the work:

Started as what I thought was a simple 3-effort bug fix but ended up touching like 6 different interconnected systems. Classic case of "oh while I'm here let me also fix this other thing" 🤔

About 4-5 hours total (curse you tension headache), but totally worth it for proper memory management. No more projectile ghosts floating around when I reload scenes!

Nearly ready for more playtesting without worrying about mysterious null refs 👻!