← Workshop

How mofu's world is built.

64.252 → 2.200 triangles, near and from afar

We built the island much the same way as mofu herself. There's no finished model, just a building plan in code. It says where the ground rises, where the house and the pond go and which tree grows where. Every part is a simple shape in exactly one color, and almost everything that keeps the world fast comes down to that.

Away from frosted glass

At the end of November we redid the whole world. Before, everything looked a bit washed out, like looking through frosted glass. We wanted something closer to a picture book: deep green, visible layers of soil around the edge of the island and warm sunlight.

We tried the new look in the browser first, with the same camera as the app, so there wouldn't be any surprises later. Then it moved into the app piece by piece: colors and light first, then ground, plants and houses, and finally mofu herself.

Two iPhones side by side: the old, pale island and the colorful picture-book draft
Left: the island in November. Right: the picture-book draft.

644 parts

Fully built, with every extension on the house, the island has 644 parts and 64,252 triangles. The triangles aren't really the problem, an iPhone handles those fine. What actually costs time is every separate drawing job sent to the graphics chip. Each part drawn on its own is one of those jobs. With 644 parts, that would be 644 jobs per frame, sixty times a second.

The island as a colored wireframe, near on the left, the coarse version for the distance on the right
The same island twice: left up close, right the way you see it from the island next door.

Every color in one picture

The fix is a shared palette. It's a tiny image, 64 × 64 pixels, and every color in the world gets exactly one pixel in it. Each vertex of a part points at its pixel. That lets us merge parts in all sorts of colors into a single mesh that needs just one material.

Grid of color swatches with color codes
The 104 colors the island, market, office and neighboring islands need between them. Each one is a pixel in the palette.

On top of that, anything that never moves gets baked together before launch, so the app has hardly anything left to work out when it opens. In the worst case the island now gets by with 80 jobs. It used to be 120.

From a distance

From mofu's island you can see the neighboring islands on the horizon, and she can walk over to them across the bridges. For that distant view, every place has a second, rough version made from the same plan. Anything smaller than a hand or lying flat on the ground is dropped, and bigger things turn into a few simple rings in their color. What's left is 65 parts with 2,200 triangles, merged into one mesh. That's a single job per neighboring island, with no textures at all. From that far away, you can't tell.

The other places work the same way. New places start out as placeholders, with a meadow, a few flower beds and a tree.

Market, office and garden as colored wireframes
Market, office and the garden, which is still just a placeholder.

Read more: How mofu is built, Costumes that belong to her fur and mofu no longer gets stuck in the furniture.