r/defold • u/mochimayhemgame • 21h ago
Help ⋅ Solved ✔ How we took a mobile tower defense crowd from 450 draw calls to 5 in Defold (single paged atlas + vertex tinting)
While optimizing our tower defense game (Mochi Mayhem, built in Defold 1.14.0, just launched on Android) for older phones and tablets, dense late-game waves with lots of animated Mochis, bubbles, and effects were pushing ~450 draw calls.
Three changes brought the full crowd down to 5 draw calls:
- One paged world atlas for world sprites so enemies, towers, and props stay inside the same texture bind.
- Tint moved to a vertex attribute on a single shared material instead of per-sprite material constants (which break batching).
- Separate ground and additive passes in the render script so shadows/ground decals and glow bursts batch cleanly without interleaving state changes.
On the gameplay side, we also kept the simulation in pure integer fixed-point Lua (no math.random, no pairs-order dependence, no floats in decision logic) so our headless tests verify identical per-tick hashes on both LuaJIT and PUC Lua 5.1.
Happy to answer questions on the batching layout or Defold mobile build pipeline! (If you want to see it running: https://mochimayhem.ca/go/reddit)