Most of the particle systems have been converted into the new WraparoundGPUParticles2D system. Prior to this and just like the Sprite2D objects I mentioned in the last update, I was using nine copies of any particle system that got attached to an asteroid. Like the three particle systems for the explosion effect, so each asteroid actually ran 27 particle systems when it blew up. They wouldn't match going across a screen boundary, but to be honest I have a hard time telling if two particle systems side by side are in sync, unless they're only emitting a particle or two at a time.
Ah, but now I have convinced Godot to run one particle system and draw it in nine different places.
This took some doing.
The particle systems are not particularly well-documented even when one is just making them with nodes. And unlike the sprites, there's not a handy function built in to the CanvasItem class to just draw a particle system elsewhere.
GPU particle systems, as the name implies, run entirely on the GPU. Short of scraping the screen or diving very deep into the video memory, there's no way to even determine where the particles are. So rather than using intermediary functions, we have to dive all the way in and start dealing with the RenderServer directly.
This is also not particularly well-documented.
But it's done, and I now have code that can drop a single particle effect in as many places on the screen as I want.
With the old system, I had a singleton in place that each asteroid had to ask for permission to start a new particle system, and if there were too many currently running the answer was just no. So that asteroid goes boom, but there's no sparkles, no smoke, no ... pop. I've left the same 180 particle system limit in place, but if you actually manage to hit it you've made it to stage 23, very carefully blown up just the large and medium asteroids, then somehow blown up all the small ones simultaneously. The only believable part of that is making it to stage 23. I believe in you!
In other news, should you make it to stage 23 or beyond and manage to unseat one of the top scorers, your avatar will now show next to your name on the leaderboard.
You might also notice that you start seeing score rewards at the end of a stage somewhere around stage 32. All of the other upgrades can stack up to four times, with the exception of the tungsten shotgun rounds, and I've deprioritized score upgrades to act as filler when there's no other eligible upgrade available.
Couple of bug fixes here and there, but they were little things that bothered me and not game-breaking bugs.
Still on the roadmap, just off the top of my head:
SteamInput integration
Further performance enhancements (see previous patch notes)
Maybe a new gun or two, which will mean the starting loadout might not populate all three weapon slots. In fact, I might make a pre-game upgrade that allows the player to choose their first weapon. It'd force the player to actually move the ship around, which is an essential part of the game.
A mechanism for the player to steer RNJesus (yes, that's actually what the random number class is called) towards providing one type of upgrade over another. Probably not quite a full factions setup, but something leaning that way.
Thinking about achievements. That's all I'll say about that.
boom boom.
