All work

Breakdown · Solo project

Tile Turfer

Jan 2026 · Unity 6 · URP 2D · C#

A top-down turf-war arena shooter in the Splatoon mould. You and the AI paint the floor your colour, and the share of the map you hold is the single number that governs everything: the difficulty, your own fire rate, and the attacks you unlock.

Tile Turfer: blue and red teams battling to claim tiles across a procedurally generated cave map, with a minimap and a fire rate power up
  • Arena60 x 60 tiles
  • Enemy cap3 to 40
  • Spawn interval4 s to 0.5 s
  • Unlocks at25 / 50 / 75%

Overview

Territory is the whole game

Tile Turfer takes the central idea of Splatoon, that winning is about ground covered rather than kills, and builds a tight single-player arena around it. Every floor tile can be painted your colour or an enemy's, and the game constantly measures what fraction of the map each side controls.

Instead of a difficulty slider or a wave timer, one turf-percentage value feeds the entire game at once: it sets how fast you fire, which attack patterns you have unlocked, how many enemies spawn, and how hard those enemies push.

The value is one division in TurfManager.GetTurfPercentage(), owned tiles over total, and everything else reads it. As you gain ground your fire rate speeds up and wider attack patterns unlock at 25%, 50% and 75%. The enemies get the same patterns at the same marks, while the spawn cap climbs from 3 to 40 and the spawn interval tightens from four seconds to half a second.

Assets/Scripts/EnemyController.cs one consumer: the same value picks the enemy's fire pattern
void SelectAndFirePattern()
{
    float difficulty = (turfManager != null) ? turfManager.GetTurfPercentage() : 0f;

    if (difficulty >= milestone3)
    {
        StartCoroutine(FirePatternWave());
    }
    else if (difficulty >= milestone2)
    {
        StartCoroutine(FirePatternTriangle());
    }
    else if (difficulty >= milestone1)
    {
        ShootBullet(0f, 0.2f);
        ShootBullet(0f, -0.2f);
    }

    // ...

The player's weapon reads the same call and interpolates between a slow and a fast cadence with it, so a single Mathf.Lerp keeps both sides of the fight moving in step: currentFireDelay = Mathf.Lerp(slowFireRate, fastFireRate, turfManager.GetTurfPercentage());

Tile Turfer mid-match: painted floor tiles across a cave arena with the player and enemies fighting for control
Ownership is stored as the tint of each floor tile, so painting the map is writing to that grid.

Generation

Procedural caves with a runtime NavMesh

Every arena is generated from scratch. A cellular-automata pass fills the grid at random, then smooths it into cave-like walls; a flood fill finds the largest connected floor region and fills in every disconnected pocket, so the playable space is guaranteed to be a single reachable area. A safe zone is cleared at the centre for the spawn.

Assets/Scripts/MapGenerator.cs a breadth-first fill over the four neighbours; ProcessMap() keeps the largest region it returns and walls up the rest
List<Vector2Int> GetRegionTiles(int startX, int startY)
{
    List<Vector2Int> tiles = new List<Vector2Int>();
    int[,] mapFlags = new int[width, height];
    int tileType = map[startX, startY];

    Queue<Vector2Int> queue = new Queue<Vector2Int>();
    queue.Enqueue(new Vector2Int(startX, startY));
    mapFlags[startX, startY] = 1;

    while (queue.Count > 0)
    {
        Vector2Int tile = queue.Dequeue();
        tiles.Add(tile);

        for (int x = tile.x - 1; x <= tile.x + 1; x++)
        {
            for (int y = tile.y - 1; y <= tile.y + 1; y++)
            {
                if (x >= 0 && x < width && y >= 0 && y < height)
                {
                    if (y == tile.y || x == tile.x)
                    {
                        if (mapFlags[x, y] == 0 && map[x, y] == tileType)
                        {
                            mapFlags[x, y] = 1;
                            queue.Enqueue(new Vector2Int(x, y));
                        }
                    }
                }
            }
        }
    }
    return tiles;
}

The demanding part is that enemies still need to path through this freshly invented geometry. Once the map is drawn, the game bakes a 2D NavMesh at runtime over the new layout, so the AI can navigate a level that did not exist a frame earlier. That runtime bake on procedural 2D terrain is the piece I am most pleased with.

Tile Turfer: a different procedurally generated cave layout showing how each arena is uniquely shaped
No two arenas share a shape. The walls, pockets and open space are generated per run.

Enemy AI

Line of sight, memory, and going after your ground

The enemy AI runs a finite state machine, moving between spawning, roaming, chasing a remembered position and chasing a visible target, with real line-of-sight checks against the walls. It also has memory: after losing sight of you it keeps hunting your last known position for a few seconds before giving up, so breaking line of sight buys time rather than instant safety.

When roaming, enemies do not wander at random. They score nearby tiles and prefer to move toward ground you own, and a tile of yours is worth ten times a neutral one. The noise added to each score is up to half of that, so they wander a little without losing the preference.

Assets/Scripts/EnemyController.cs from FindBestTileDestination(): blueTileWeight is 100, whiteTileWeight is 10 and randomScoreNoise is 50
for (int x = -tileScanRadius; x <= tileScanRadius; x++)
{
    for (int y = -tileScanRadius; y <= tileScanRadius; y++)
    {
        Vector3Int checkPos = currentCell + new Vector3Int(x, y, 0);
        if (!turfTilemap.HasTile(checkPos)) continue;

        Vector3 worldPos = turfTilemap.GetCellCenterWorld(checkPos);
        float distance = Vector3.Distance(transform.position, worldPos);

        if (distance < minMoveDistance) continue;

        Color tileColor = turfTilemap.GetColor(checkPos);
        bool isEnemyColor = turfManager.IsColorSimilar(tileColor, turfManager.enemyColor);
        if (isEnemyColor) continue;

        bool isPlayerColor = turfManager.IsColorSimilar(tileColor, turfManager.playerColor);

        float score = 0f;

        if (isPlayerColor) score = blueTileWeight;
        else score = whiteTileWeight;

        score += UnityEngine.Random.Range(0f, randomScoreNoise);

        if (score > bestScore)
        {
            bestScore = score;
            bestCell = checkPos;
            foundAny = true;
        }
    }
}
Tile Turfer late in a match: heavy territory control with dense enemy presence and upgraded attack patterns
Dominate the map and the game answers with more enemies and heavier fire.

In hindsight

What I'd change

Tying fire rate to territory fixed camping, which is what it was for. It also made a lead feed itself. The more of the map you hold, the faster you fire, and in play the winning side became too strong too quickly.

The enemies scale off the same number, so the game does push back, but not by enough. It needs a catch-up rule, the job the Blue Shell does in Mario Kart. I said as much in the coursework retrospective (PDF) at the time.