We’re experimenting with new ways to handle large numbers of game entities efficiently in Defold, and @Mathias_Westerdahl released recently an example game: MoonBase: Relay Wars to showcase its possibilities and stress-test WebGPU in Defold:
MoonBase is a fully playable RTS skirmish example game built with the new experimental DataStore C API, demonstrating data-oriented simulation and native rendering at (huuuge) scale.
The example features:
-
Two armies fighting over five relay points and enemy headquarters -
32,768 units by default, with support for stress-testing up to 262,144 units -
Four unit types with different combat roles and AI behavior -
DataStore queries and scheduled, multithreaded simulation callbacks -
Unit selection, formation commands, attack-move, minimap and camera controls -
GPU instanced rendering, with an experimental WebGPU build
Instead of creating a separate Defold game object for every unit, MoonBase manages unit data and simulation through native C++ code using DataStore, and Defold handles the rest of the game.
Note
Please note this is an experimental project that currently requires a custom Defold engine SDK with the new DataStore APIs. It doesn’t work out of the box with the regular Defold release yet. The C library API is experimental, but for some of our experienced users it might be useful in its current state, for testing. DataStore is planned as a core Defold feature. We’ll build our custom data type implementation on top of it. It is part of our plan to move our physics engines into separate extensions.