All case studies
Tic Tac Toe — the smallest possible game, in the browser
A WebGL build that loads and plays instantly with no download, no account and no install prompt.
- Client
- In-house title
- Platform
- WebGL / browser
- Engine
- Unity
- Genre
- Board
Unity WebGLC#gzip compressionApache
The challenge
Tic Tac Toe is a solved game. Played perfectly by both sides it always ends in a draw, which makes it a strange thing to ship — the challenge is not the rules, it is making the few seconds around them feel worth opening.The technical problem was the bigger one. Unity WebGL builds are heavy by default, and a visitor who clicks Play on a website will not wait through a long download for a game this small. If it does not start almost immediately, nobody sees it.
There is a second, less obvious problem with shipping a game this small: nobody arrives expecting much. Tic Tac Toe is the example people use for a trivial program, so the build has to justify its own existence within a few seconds of loading or the visitor closes the tab having confirmed their assumption. That puts almost all the weight on load time and the feel of the first move, because there is no content to carry a slow start.
Our approach
The build ships compressed, and the server is configured to announce that compression correctly. This is the step most WebGL deployments get wrong. Unity writes its compressed files with a generic .unityweb extension that says nothing about how they were packed, so the server has to be told explicitly — and if it is not, the browser either refuses the file or quietly falls back to decompressing it in JavaScript, which works but is several times slower.We read the actual magic bytes of the shipped files rather than trusting the build settings, found gzip, and gave this game its own server rule that declares it. The 2048 build sitting next to it is Brotli, so the two games carry separate configuration — one extension cannot mean two encodings in the same folder.
The board is square, so the player page was given a layout that holds a 1:1 ratio at any window size. That sounds minor until you see the alternative: on a wide monitor the game either stretches or gets cut off, and both look broken.
The AI blocks and forks properly, so a careless opening loses. It is beatable only when it is meant to be.
The AI was written to be beatable only where it should be. It takes the centre when available, blocks an immediate win, and recognises a fork before it is created rather than after. Against a careless opening it wins; against correct play it draws, which is the honest outcome for a solved game. Deliberately bad moves were rejected as an easy-mode shortcut because a player who wins against an opponent that ignores a completed row learns nothing and trusts nothing afterwards.
Two-player on the same screen was included for the same reason it belongs in a chess app: the most common way anyone plays Tic Tac Toe is against the person sitting next to them.
The result
The game runs directly in the browser on desktop and mobile with no download and no account. Press Play and the first move is yours.The compressed files are decompressed natively by the browser instead of in JavaScript, so the load is as fast as the build allows rather than as fast as a fallback allows.
It is playable on this site right now, which is the point — it doubles as a working demonstration that our WebGL pipeline actually delivers.
The square board holds its 1:1 ratio at any window size, so the game is never cropped on a wide monitor or squeezed on a phone — the same layout work that every WebGL title here shares.
As the smallest build in the library it also serves as the pipeline's control case: if compression, aspect handling or the player page ever regress, this is the game where it shows up first and cheapest.
More case studies
PP
Engineering
Putting playable Unity games directly on a website
Why most Unity WebGL builds load slowly or fail outright on shared hosting — and how we set ours up so they do not.
Read the case study →
Puzzle
Lights Out — the puzzle where most random boards cannot be solved
One rule, five cells per tap, and a generation problem most implementations never notice: scatter the lights at random and a large share of boards…
Read the case study →
Arcade
Stack Tower Builder — a miss that costs instead of kills
Most stacking games end your run on one bad tap. This one makes you live with it instead.
Read the case study →
