u/Next-Share6716

Added ragdoll ants, persistent goo and power-ups to my Phaser 3 roguelite – frame spikes went from 13.5 ms to 7.4 ms after fixing the first version
▲ 2 r/phaser

Added ragdoll ants, persistent goo and power-ups to my Phaser 3 roguelite – frame spikes went from 13.5 ms to 7.4 ms after fixing the first version

Thanks again for all the feedback on my last post about ANT HUNTER (gecko knight raids an ant colony). The game felt too calm, so this week was all about action:

- Killed ants get flung with a bit of fake 3D physics (height, gravity, bounce, wall reflection) instead of just fading out

- Goo stays on the floor: one RenderTexture at half resolution, blobs get queued and drawn in a single beginDraw / batchDraw / endDraw per frame

- Power-ups for 6 seconds: flame cone, chain lightning, exploding kills

- Kill streaks with callouts, and a "perfect dodge" that slows the world to 25 % while the gecko keeps full speed

The first version stuttered badly when 30+ ants died at once. What fixed it:

  1. Batch all goo stamps per frame instead of drawing each one separately

  2. Pool the flying goo bits (pre-warmed, max 120)

  3. Update the kill-streak DOM element once per frame, not on every kill

  4. Limit sounds to 40 voices per 60 ms (hordes were clipping the audio)

Happy to go into detail on any of it. Is anyone doing something smarter for persistent decals in Phaser?

youtube.com
u/Next-Share6716 — 13 days ago
▲ 13 r/phaser

Cut my Phaser game's GPU memory from ~1.1 GB to 127 MB by trimming sprite sheets

My game (a browser extraction roguelite, gecko knight vs. ant colony) renders its characters in Blender as 8-direction sprite sheets. Every frame was a fixed 288×288 cell – and most of that was empty space. On phones this added up to over 1 GB of decoded textures, and switching weapons crashed the tab.

What fixed it:

- A small Python build step trims each frame to its visible pixels, packs them tightly and writes a Phaser atlas (JSON hash with trimmed / spriteSourceSize). Phaser keeps the original frame size and origin, so nothing in the game code had to change – frame indices stay the same.

- Skins used to be recoloured canvas copies of every sheet. Now a tiny custom SinglePipeline shader applies a 3×3 colour matrix at draw time. (Phaser's preFX colour matrix rendered a pink square on my phone, the plain pipeline works fine.)

- Canvas textures removed with textures.remove() stay in Phaser's CanvasPool at full size – CanvasPool.remove(canvas) actually frees them.

Result: 1147 MB → 127 MB in game, loading is noticeably faster, no more crashes. Happy to share the trim script if anyone's interested.

reddit.com
u/Next-Share6716 — 16 days ago
▲ 4 r/phaser

Made an extraction roguelite with Phaser 3 – gecko knight vs. ant colony, playable on PC and phone

The characters are 3D models rendered into 8-direction sprite sheets in Blender, the game itself is TypeScript + Phaser 3. This week I added touch controls: a floating stick that follows your thumb, a big axe button you can hold to keep swinging, and cooldown pies on the buttons.

Play it free here: https://maik-wimmer.itch.io/ant-hunter

Happy to answer questions about the sprite pipeline!

u/Next-Share6716 — 18 days ago