At a glance
- Dates
- Context
- Technologies
- Source code
- Project repository on GitHub
Overview
A miniature battle in augmented reality on an Android phone, built with Unity.
Problem
Make a miniature battlefield appear in the room, and be able to walk around it to watch it from every angle.
Role
Solo project: a prototype at ENSIM, then a version 1.0 as a personal project.
The idea
ARmageddon makes a miniature battlefield appear in the room you are in. The phone detects the floor: you set a terrain on it and sculpt it, it gets covered with trees, rocks and grass, then two armies fight on it, in a cartoon style.
The player walks around the scene and watches it from every angle. The starting idea: re-enact battles while seeing the whole battlefield, and show what augmented reality makes possible.
Trees, rocks, soldiers, buildings, bombs and water: asset packs imported into Unity. Explosions, smoke and sounds: generated by code.
New in version 1.0
The 2025 prototype set a terrain, soldiers and buildings, but soldier movement was only tested in a separate scene. Version 1.0 makes it a complete game:
- The terrain is set where you aim, at the size you want, 1 to 3 m wide; before, it appeared on its own on the lowest detected surface.
- The relief is sculpted point by point, with an adjustable brush, and dug areas turn into lakes; before, two fingers raised or lowered the whole relief at once.
- Two armies face each other, on either side of a front line.
- Soldiers walk on the sculpted relief, hear the enemy, take cover and shoot.
- Buildings belong to a team, give cover and collapse under fire.
- Each team has bombs, which dig craters in the terrain.
- The interface is new: welcome screen, rules of the game, step-by-step buttons, Undo, Replay, pause when AR tracking is lost.
- Sounds and short vibrations go with the actions.
The improvements announced for the prototype (several teams of soldiers, water, a bombing system) are done.
A game, step by step
Button names are given as they appear in the game, whose interface is in French.
- Place the terrain. An aiming frame follows the detected floor at the centre of the screen. Set the size, then tap Poser le terrain: the terrain is set where you aim, facing you.
- Sculpt. Tap the terrain to set a point, then hold Monter or Creuser, or drag with two fingers; the Zone slider sets the brush size. Dug areas fill with water.
- Deploy. Valider le terrain freezes the relief and draws the front line, the blue half facing you. Each team places up to 30 soldiers and 3 buildings on its side; Annuler removes the last one.
- Start the battle. Each soldier seeks the nearest enemy, closes in and shoots. Each team has 2 bombs: tap Bombe bleue or Bombe rouge, then the terrain, and the bomb falls.
- The result. A team wins when the other has no soldier and no building left standing. You can then replay the same battle, change the armies or start again on a new terrain.
Each step starts the video at the top of the page at the matching moment.
- The rules 0:00
- Place the terrain 0:04
- Sculpt the relief 0:08
- Deploy the armies 1:10
- The battle 1:56
- The result 2:31
An interface made for the thumb
The interface is built by code, with a few rules kept on every screen:
- Everything fits within the screen’s safe area, clear of the notch and the navigation bar.
- At the top, what you read: the instruction for the step and the messages. At the bottom, under the thumb, what you touch.
- One main action per step, in orange, at the very bottom; the step’s tools just above it.
- Buttons only appear at the step where they are needed: the relief, then the armies, then the battle.
- At launch, a Comment jouer (how to play) screen sums up the goal of the game and its four steps.
- When AR tracking is lost, the game pauses and says why: too dark, moving too fast, floor too plain.
Under the hood
- Terrain on a real surface. AR Foundation detects the planes of the room. For a miniature scene, the origin of the AR scene is scaled up, as AR Foundation recommends, rather than the content scaled down: the terrain keeps its game units (navigation, physics) and appears at the size you want.
- Sculpting. The terrain mesh, almost flat at first, is deformed around the chosen point with a bell-shaped profile, softened by local smoothing. You can dig below floor level: these hollows turn into lakes.
- Scenery. Trees, rocks, bushes and grass are placed with Perlin noise: a dense forest along the edges, so it does not hide the battle, groves inside, and 260 pieces at most for phone performance. Purely visual, the scenery has no collision.
- Navigation. The NavMesh is baked on the sculpted relief when the terrain is validated, then rebuilt without a hitch after each crater. Water cannot be walked on, and soldiers walk around buildings.
- Soldiers. A soldier hears an enemy beyond its firing range and walks towards it, with a slight random offset so the soldiers do not advance in single file. Within range, it fires once a second, with a 70% chance to hit. If the relief stops it, it fires from where it stands. With no enemy within earshot, it goes to destroy the enemy’s buildings.
- Buildings. A soldier sheltering by a building is hit far less often: the bullets that would have hit it crash into the walls. Five stopped bullets bring the building down.
- Bombs. Two per team. The blast wounds soldiers, less the further they are from its centre, damages buildings and digs a crater; two well-placed bombs bring a building down.
- Victory. A team wins when the other has no soldier and no building left standing; if nobody can shoot any more, the team with the most buildings wins.
- Effects and sound. Explosions, smoke, dust and sounds are generated by code, with no imported file, along with short vibrations.
The 2025 prototype
The first version, built alone in about fifteen hours at ENSIM, with Unity and C#, AR Foundation and ARCore: a terrain rising from the detected floor, a relief set with two fingers, a Lock button, and soldiers and buildings placed with a tap.
Soldier movement was tested in a separate scene, with Unity’s NavMesh: each soldier found the nearest one and went round obstacles to reach it.
Result
- soldiers at most per team
- 30
- buildings per team
- 3
- bombs per team
- 2
- the terrain’s side, in the room
- 1 to 3 m
A complete Android application, from placing the terrain to the victory screen. The version 1.0 APK is available on GitHub, for an Android phone that supports ARCore.