Path Defenders - 3D Action-RPG / Tower Defense type game made in Babylon.js

, ,

Hey all, solo dev here. Been building Path Defenders on Babylon.js (currently on v9) with Vite and Capacitor for the builds (Android/Steam/web).

Wanted to share what it is and how Babylon’s being used under the hood.

What the game is

Path Defenders is a first-person action tower defense RPG. You summon a party of 25+ fantasy units to hold a lane, then drop into real-time hero combat yourself to turn fights in your favor. 100+ enemy types, boss fights, multiple worlds (ocean/beach, lava wastes, frozen highlands, a carnival big-top level, lava/fire, swamp). I got really creating and kept adding different worlds to the game

How Babylon.js is used

  • Rendering: WebGL2, all gameplay AI/movement runs on the main thread (no workers, no navmesh, just per-frame steering). Kept it simple and it’s held up fine even wit
    h big unit counts on screen.
  • Physics: Havok v2 for collision and ragdoll-ish reactions.
  • Custom rendering group setup for water: opaque world/units/hero all in group 0 so depth writes correctly, lagoon water surface in group 1, foam overlay in group 2,
    each disabling auto depth-clear so transparent layers don’t draw through units. Took some trial and error to get transparent water to respect occlusion by characters.
  • Custom shader work for wind-reactive grass (a MaterialPlugin relighting real blade geometry, not just billboards) with persistent per-instance trample so grass stay
    s flattened where units walk.
  • GPU Tessendorf FFT ocean for one of the coastal levels, tied to a shared tide clock so shoreline foam/wetsand sync up.
  • Octree culling for static geometry, with moving meshes opted into AASM/dynamic content so they don’t get frustum-culled incorrectly.
  • Shadow generator shared across the whole scene (PCF filtering) rather than per-object shadow casters, for perf.
  • Custom LOD/animation throttling for enemies: movement ticks at a lower rate than render and interpolates, which made a big difference to CPU cost with lots of enemi
    es on screen.

Performance work

Most of my optimization has been fill-rate and draw-call driven rather than exotic tricks. Merging static same-material meshes, killing per-frame material dirtying (careful with things like emissiveIntensity), keeping VFX to shared persistent particle systems instead of spinning up new ones. Been logging FPS wins over time and it’s been a slow grind of profiling with the trace/timeline tools rather than one big fix.

Where to find it

Steam and Google Play and itch.io, both under “Path Defenders” if anyone wants to see how it turned out.

Happy to answer questions about any of the Babylon-specific stuff above,
especially the rendering group/depth-clear water setup or the grass system, since those took the most iteration to get right.

6 Likes