# MoonBase - RTS example with Defold's experimental DataStore API

**URL:** <https://forum.defold.com/t/moonbase-rts-example-with-defolds-experimental-datastore-api/83523>\
**Category:** The Defoldmine\
**Created:** [November 16, 2026, 9:51am UTC](https://forum.defold.com/t/moonbase-rts-example-with-defolds-experimental-datastore-api/83523 "2026-11-16T09:51:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [November 16, 2026, 9:51am UTC](https://forum.defold.com/t/moonbase-rts-example-with-defolds-experimental-datastore-api/83523/1 "2026-11-16T09:51:35Z")

</div>

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:

> **[GitHub - defold/example-moonbase: An example of the DataStore C library usage](https://github.com/defold/example-moonbase)**
>
> An example of the DataStore C library usage

**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.

---

<div class="post-metadata">

**Author:** ![Mathias](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias/32/44015_2.png) [@Mathias](https://forum.defold.com/u/Mathias)\
**Post date:** [November 16, 2026, 2:52pm UTC](https://forum.defold.com/t/moonbase-rts-example-with-defolds-experimental-datastore-api/83523/2 "2026-11-16T14:52:06Z")

</div>

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

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 😍  
This could also be super usefull to have runtime autotiling/WFC map generation at scale

Do you have a target release version on mind?

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [November 16, 2026, 3:00pm UTC](https://forum.defold.com/t/moonbase-rts-example-with-defolds-experimental-datastore-api/83523/3 "2026-11-16T15:00:02Z")

</div>

> Dont have time to get a working version of it

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