Charting the void

Cosmic Cliffs, Carina Nebula · NASA, ESA, CSA, STScI

Back to Projects
Tug of War key art
Unity Game · Solo Project

Tug of War

Kamba Adeema, the Avurudu tug of war, rebuilt in 3D: two chibi village teams, one rope and a bet on every heave.

Engine
Unity 6 (URP)
Platforms
  • Android
  • WebGL
  • Windows
Genre
  • Tug of war
  • bet per heave
Orientation
Landscape
Role
Solo developer
Year
2026

01The Game

Kamba adeema (කඹ ඇදීම, "pulling the rope") is the tug of war played at every Avurudu fair in Sri Lanka. It started as a three.js game in my Next.js arcade, and this is its Unity 6 rebuild. Two teams of chibi villagers, Yati Pila in red and Uda Pila in blue, heave on a village pitch at dusk in front of tiered stands full of villagers waving flags, filmed side-on like a sports broadcast.

You bet on each heave. Eight grips are drawn per heave, the side with more grips drags the rope, and the first team to pull the red ribbon seven marks over its line wins the match. YATI or UDA pays 1.92×, DRAW pays 3.55× and POWER pays 27.5× when your side wins the heave by three or more, all at a 97% return. In the arcade, every paid heave is drawn and settled by the game provider.

A festival, not a casino

Drummers, lanterns, a pahana oil lamp and a cheering village crowd make it feel like Avurudu first and a betting game second.

Eight fair coins

Every heave is eight independent, fair grips, so both sides are priced exactly the same and the maths has a closed form.

Sealed before the first heave

Each demo match is sealed with a hashed seed before it starts, and History lets you re-draw every heave once it’s over.

02Screenshots

These screenshots were captured straight from the game. Tap any of them to see it bigger.

03Core Loop

  1. 1

    Pick a card

    Tap YATI or UDA, DRAW, or POWER under your side’s card. Your pick stays on the card, so the next heave is one tap.

  2. 2

    Set the stake

    Use MIN, ½, 2× or MAX, or type a stake. AUTO repeats your bet 5, 10 or 25 times, and TURBO speeds up the pull.

  3. 3

    HEAVE!

    Press HEAVE! or swipe down. The grips light up one by one, the rope moves and you’re paid straight away. Tapping the ground cheers your side on.

  4. 4

    Seven marks

    The first team to drag the ribbon seven marks wins. The match seed is revealed and the next match seals itself after a short countdown.

04Key Features

Village arena at dusk

A packed-earth strip with a chalk line, marker flags, a red-and-blue barrier, tiered stands, lanterns, drummers and palms under a violet-to-gold sky.

A crowd that reacts

222 low-poly villagers in sarees, sarongs and banians wave team flags and Sri Lankan flags and cheer every heave.

Rope physics

The rope runs on a damped spring, and every puller leans on a spring of their own, kicked by the strain, each grip, each slip and the heave.

Match-end reactions

The rope drops, the winners face the camera and jump with their fists up, and the losers slump to the ground and cry.

Candy 3D interface

Glossy slab buttons with a lip that sinks when pressed, jelly pick cards and cream panels under ribbons, all in Baloo 2, with big touch targets.

Pahana loading screen

A brass oil lamp whose seven wicks, one for each mark, light up as the game loads.

05What I Built

I made this game on my own, so I handled the design, the code, the art pipeline, the audio and the release.

  • I designed the betting cards, the paytable, the stamina rule and the match flow.
  • I programmed the gameplay and every screen in C#, building the UI in code with UI Toolkit.
  • I wrote the rules and the HMAC draw as a standalone C# package that the game provider also compiles and runs.
  • I built the Blender Python pipeline that makes the arena, the 222-strong crowd, the villagers and their tug-of-war moves, the rope and the 3D logo.
  • I also built the UI skin and icons in Python, found and mixed the Avurudu sounds, and wrote the fairness, layout and device screenshot tests.

06Under the Hood

Rules in one place

The grips, marks, stamina, paytable and HMAC draw live in a pure C# package with no Unity references. The client runs it for the offline demo, and the game provider compiles the same files as the authority for paid heaves.

Closed-form maths

The swing (Yati grips minus Uda grips) is exactly a shifted Binomial(8, ½), so every bet’s price comes from a formula rather than a simulation. A .NET simulator then checks each bet’s return over real matches.

The demo seal

Before the first heave, a match is sealed with the SHA-256 of a secret seed and the hash of a fresh blockchain block. Each heave’s grips are HMAC-SHA256 of the seed, the client seed, the block hash and the heave number, and the seed is revealed when the match ends.

One draw per heave

The backend owns the match and a strictly increasing nonce, so leaving in the middle of a heave can never replay the same grips. A fairness test checks it, along with the two sides being symmetric.

07Art & Audio Pipeline

A village from scripts

build_arena.py makes the pulling strip, marker flags, barrier, tiered stands, pandals, lantern poles, drummers’ stands, the pahana, palms, bunting and stalls, and build_crowd.py fills the stands with 222 villagers.

Villagers & their moves

build_villagers.py dresses KayKit characters in sarongs, banians, headbands and sarees, and animates Ready, Strain, Heave, Haul, Dragged, Slip and Fall with IK on the KayKit rig.

The sounds of Avurudu

A script found CC0 recordings on Freesound: shehnai and drums, dholak, tabla, a conch, the koel and rathinga firecrackers, cut and levelled in Python. The grunts, rope burn and claps are synthesised.

08Challenges & Solutions

ProblemTired teams should feel weaker, but changing the odds mid-match would make the prices dishonest.
SolutionStamina only changes how far the rope moves. A spent team that loses a heave by two or more is dragged double, but the odds of every heave stay exactly the same.
ProblemA crowd of 222 animated villagers is a lot for a low-end phone.
SolutionA performance governor drops the crowd and the effects when the frame rate falls, so the heave itself stays smooth.
ProblemIt’s a landscape game, but people open it on phones held upright and in portrait browser windows.
SolutionPhones auto-rotate between the two landscape sides, a portrait window shows a turn-your-phone card, and a layout sweep test checks every screen from 1:1 to 21:9 for clipping and overlap.

09Tools & Takeaways

Unity 6 · URPC#UI ToolkitBlender 5.2 (Python)HMAC-SHA256 fairness.NET RTP simulatorWebGL · Android
  • A cultural game lives or dies on the details: the conch, the koel, the pahana and the clothes do as much as the gameplay.
  • Keeping stamina away from the odds let the game have drama without making the maths dishonest.
  • Springs are a cheap way to make ropes and bodies look physical without a full physics simulation.

Credits. The villagers are built on KayKit characters and animations (CC0), the Sri Lankan flag is public domain, the font is Baloo 2 (OFL), the recordings come from Freesound creators (CC0) and the crowd from Gregor Quendel (CC BY 4.0), with Kenney sound effects (CC0). The arena, crowd, rope, logo and the pullers’ moves were made for the game in Blender, with no AI-generated art or audio. Everything is credited on the in-game About screen.