MoonBase - RTS example with Defold's experimental DataStore API

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:

  • :crossed_swords: Two armies fighting over five relay points and enemy headquarters

  • :rocket: 32,768 units by default, with support for stress-testing up to 262,144 units

  • :brain: Four unit types with different combat roles and AI behavior

  • :high_voltage: DataStore queries and scheduled, multithreaded simulation callbacks

  • :video_game: Unit selection, formation commands, attack-move, minimap and camera controls

  • :desktop_computer: 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.

14 Likes

Dont have time to get a working version of it…but reading geometry.cpp feels like reading SVG :grin:

I’ll wait till this is in some beta release, but I think my new soft-bodies engine I am working on will get some use of this :heart_eyes:
This could also be super usefull to have runtime autotiling/WFC map generation at scale

Do you have a target release version on mind?

1 Like

Dont have time to get a working version of it

For those interested, it’s in the alpha build, beta coming next week.

4 Likes