← All posts

Tech4 min read

Why we moved to 3D

Pre-drawn animation hit a size wall, so the Terminal Leave battlefield went 3D. Why I made the call, and how the two-plus months of the move went.

In early August I wrote that the full set of soldier appearances came to 6.7 GB and seven days of rendering. A few days after that post I decided to move the battlefield from pre-drawn images to 3D models. The move took more than two months, and as of today the 3D battlefield is on for everyone. This post covers why I did it, what stayed the same, and what isn’t finished yet.

What the problem was

With sprites, every frame of every move of every combination of armour and weapon is drawn in advance, in eight directions. Compression and loading in parts brought what one battle needs down to roughly 200 MB. That was liveable.

What was coming next was not. The size grows not with the number of items but with the number of their combinations. Civilians and police will appear in the game later, and for some missions there is the idea of disguising your squad as civilians. That means civilian clothes have to combine with every kind of armour and every weapon. On top of that, the plans include individual and bonus outfits: winter and summer uniforms, police, special forces, and civilian clothes again. One set of civilian clothes alone means about 6 GB more sprites, seven more days of rendering and another 200 MB for the player to download. Every set after it costs the same again.

In 3D combinations cost nothing. There is a model of a soldier and a model of the clothes, and the clothes are put on the soldier when the scene is drawn. One set of animations serves everyone, because everyone shares a skeleton.

What didn’t change

The most important point: only how a battle is shown has changed.

The tiles stayed. Movement, cover, fog of war, overwatch and floors are still computed on the tile grid. The server, the rules, replays and determinism weren’t touched at all: the 3D client receives the same events the 2D one did and draws them differently.

There will be no free movement without tiles. The simulation is the game itself, its foundation: the rules by which two plans meet on one shared timeline. Rewriting it would mean making a different game.

How it was checked

The game opens in a browser, including on a phone, and the main question was whether phones can handle a 3D scene.

Before rebuilding anything I made a test bench: a battle scene in three.js with soldiers and terrain, a quality switch and a frame counter. It ran in the browser on two phones — an old iPhone, deliberately weaker than the one the game targets, and a 2018 Android.

The results became budgets: how many triangles can be in a frame, how many in one soldier, how much memory can go to textures — separately for weak and strong devices. Models are made to those numbers.

How the move went

At the start there was one task: get the battle into 3D, not make it pretty. So the terrain uses the simplest possible models — just enough to place them on the field and tell what stands there. The soldiers and their animations came from the test set I had used to render the sprites. Detail didn’t matter there, so everything in it is rough. Muzzle flashes, tracers and other effects didn’t exist in the sprite version either, so they were made from scratch.

The 2D battlefield kept working the whole time, and new combat rules arrived as usual. The switch happened once the 3D field showed a battle at least as well as the old one.

Before and after

The battle before the move and after it: sprites on top, 3D below.

The battlefield in sprites
Before the move: sprites
The battlefield in 3D
After the move: 3D

What isn’t finished

Honestly — nothing. Only the foundation is done: the battle is shown in 3D. Everything else is a placeholder put together from what already existed.

One of the next stages is work on the graphics. Most likely it will go gradually: models will be replaced with better ones one at a time, and the game will look better step by step. For now, in places it looks plainer than it did with sprites. I consider that an acceptable price: the sprite road was a dead end, and the later I left it, the more would have to be thrown away.