Microlandia gets its own game engine

Version 2.2

Microlandia gets its own game engine

Hello everyone! We’ve finished work on Microlandia 2.2, and this time it’s a technical update, and a pretty exciting one.

Over the past months, we’ve been quietly building Microlandia’s new game engine, Moonshine, and it’s finally ready! It’s lighter, more efficient, and less temperamental. That means smooth framerates, longer battery life, and, for those with desktop graphics, turning every setting up to maximum is no longer a bad idea.

A little history

Microlandia wasn’t originally built in a conventional game engine. It was built with browser technology, much like a web page. In fact, until now, launching Microlandia essentially meant opening a browser window in disguise, with some clever tricks to make it behave like a game. One of those was adopting WebGPU, which let us write low-level graphics code using web technology. (Duh!)

But as we added larger maps and the ability to build on smaller grids, it became impossible to ignore the cost of running an entire web browser underneath it all. The setup was very stable, but it wasn’t particularly light or efficient.

flowchart LR
    Game --> Browser
    Browser --> WebGPU
    WebGPU --> Vulkan["Vulkan (Linux)"]
    WebGPU --> Metal["Metal (macOS)"]
    WebGPU --> Direct3D["Direct3D (Windows)"]

The worst part is that because we don’t have complete control over it there were bugs that we couldn’t ever fix, like playing nicely with some OBS streaming setups, supporting the Steam overlay or the headaches our Linux users had to go through in laptops that switch between integrated and discreet graphics.

Once we recognized that limitation, we began the long process of building a new engine: one that keeps the parts of web technology we like, but is designed specifically to draw Microlandia’s blocky cities. We didn’t consider switching to a professional solution™ like Unreal or Unity, for three reasons:

  • It would mean we throw away our precious GPU math
  • In the age of AI, translating it from one platform to another is cheap. That’s the core value proposition of a game engine, by the way.
  • And most importantly: where’s the fun in that? Some of the most important games in history had their own engines and that’s what made them unique.

Moonshine

Our new engine, appropriately named after a homemade and suspiciously potent liquor, works directly with the graphics APIs we use on each platform: Vulkan on Linux, Metal on macOS, and Direct3D on Windows. That gives us total control over how the game runs and lets us handle each platform’s particular needs ourselves.

Does that mean every update will take three times as long to cook up? Of course not. It’s smart enough to have specific code paths for the OS only when absolutely necessary, and 99% of the time we’re working on the game we make progress on all the platforms at the same time.

flowchart LR
    Game
    Game --> Vulkan["Vulkan (Linux)"]
    Game --> Metal["Metal (macOS)"]
    Game --> Direct3D["Direct3D (Windows)"]

Lighter, in numbers

We measured Microlandia 2.2 against 2.1.7, the last version that ran in a browser, on three scenarios: a MacBook Air, and one ThinkPad laptop running Windows and Linux.

Graphics

Up to 10% less work for the graphics card

Windows

ThinkPad X13, Radeon graphics, graphics time per frame

−7%

2.2, on Moonshine8.87 ms
2.1, in a browser9.55 ms

Linux

ThinkPad X13, Radeon graphics, graphics time per frame

−10%

2.2, on Moonshine6.55 ms
2.1, in a browser7.27 ms

macOS

MacBook Air M5, graphics time per frame

−4%

2.2, on Moonshine6.41 ms
2.1, in a browser6.66 ms
Lower is better. The time the graphics card spends on each frame, flying the same route over the same city at 60 frames a second.

Processor

Up to 40% less processor time

Windows

ThinkPad X13, Ryzen 5 4650U, processor cores busy

−40%

2.2, on Moonshine0.35 cores
2.1, in a browser0.58 cores

Linux

ThinkPad X13, Ryzen 5 4650U, processor cores busy

−23%

2.2, on Moonshine0.49 cores
2.1, in a browser0.64 cores

macOS

MacBook Air M5, processor cores busy

−19%

2.2, on Moonshine0.43 cores
2.1, in a browser0.53 cores
Lower is better. Flying the same route over the same city at 60 frames a second.

Memory

Up to 39% less memory

Windows

ThinkPad X13, memory with a city open

−24%

2.2, on Moonshine743 MB
2.1, in a browser977 MB

Linux

ThinkPad X13, memory with a city open

−39%

2.2, on Moonshine879 MB
2.1, in a browser1,447 MB

macOS

MacBook Air M5, memory with a city open

−23%

2.2, on Moonshine1,346 MB
2.1, in a browser1,741 MB
Lower is better. Each system counts memory its own way, so compare the bars within a system, not across them.

And here’s the fun part: we haven’t done an optimization pass on Moonshine yet. So far, our focus has been on making it draw everything the browser used to, just as well, on every platform. These numbers are Moonshine’s starting point, not its finish line, so expect more improvements on that front in the updates to come.

What comes next

Finally having our in-house engine means for us a solid foundation for expanding the game without increasing our target requirements of a typical 8 GB RAM laptop. It makes us incredibly happy that we’re not gatekeeping our game only to players who own a high end system.

Another reason is that we can finally start working on sandbox and modding (both are the same feature!), confident that our engine makes it fun, rather than frustrating. I’d love to tell more but won’t spoil the surprise.

And speaking of surprises… this update also includes a hidden achievement. Can you guess what it is?