Skip to content

The arena

For creatorsAdd-on 2.2.2+

In this tutorial you build a first-person arena: a central platform, catwalks you can walk under and climb, crates for cover, and glowing trims under fog. Bots come in waves and hunt you. One scene setting makes the game first person; everything else is components you already know how to set. This builds on tutorial 13, Tracks from real streets.

▶ Play the arena: click to lock the mouse, W A S D move, the mouse looks, a click (or F) fires, Space jumps, Shift runs, R plays again. On a phone, the left thumb moves (push to the rim to run), the right thumb looks, ✶ fires (hold to keep firing) and ⤒ jumps.

  1. Save a new file as arena.blend.

  2. In Properties ▸ World ▸ Simulacrum ▸ Player, set Player to First Person: it writes player.controller = fps. Add the weapon’s settings from the table below in Properties ▸ Scene ▸ Custom Properties.

  3. In World ▸ Simulacrum ▸ Input, press Add Action and choose the preset Walk set (WASD + Space + Shift). It adds moveX, moveZ, jump and run, the actions the first-person player reads.

  4. Press Add Action again and choose Fire (F / left mouse): fire = keys:KeyF ; mouse:left. Add again = keys:KeyR/Enter for the restart.

  5. Drag a Spawn Point from the Simulacrum asset library to where the player starts, and name it Spawn.

With player.controller = fps you get mouse look (click the page to lock the pointer), a character controller with gravity, jumping, steps, ramps and sliding along walls, health, a weapon, and your body: the player wears a wardrobe body whose legs walk and run with the controller’s real speed. It stands a little behind your eye, so you see your body and its shadow but never your own head.

Tag Default What it does
player.controller fps plays the scene in first person
player.body male-hoodie The wardrobe body you wear, or none
player.spawn Spawn The object you start at
player.health 100 Your most health
player.walk · player.run 5.2 · 8 Walk and run speeds, m/s
player.jump · player.gravity 5.6 · -16 Jump speed (m/s) and gravity (m/s²)
player.radius · player.eye 0.35 · 1.6 Your width and eye height, metres
player.sens · player.touchSens 0.12 · 0.3 Mouse look and phone look, degrees per pixel
weapon.damage 25 (the arena: 20) Damage per hit
weapon.rate 6 (the arena: 7) Shots per second; held fire repeats
weapon.range · weapon.spread 80 · 0.8 (the arena: 90 · 0.6) Range in metres, spread in degrees
weapon.ammo 60 (the arena: 120) Starting ammo; -1 is endless

On a phone the left half of the screen is a floating joystick that feeds moveX and moveZ; push it to the rim to run. A drag on the right half looks. Fire and jump are the scene’s own pad: add a HUD Choice Menu (Add Component ▸ HUD & Menus ▸ HUD Choice Menu) with hud.menu = fire=✶|jump=⤒, hud.layout = pad, hud.at = right (a column of round buttons at the bottom right) and hud.touch = 1 (touch screens only).

  1. Model the floor, outer walls, pillars, the central platform, two catwalks and some crates as boxes. Give each one Add Component ▸ Shooter & Strategy ▸ Level Block. A block is measured from its real bounds.

  2. Model the ramps as wedges and give each Add Component ▸ Shooter & Strategy ▸ Level Ramp. Set fps.ramp to the side it rises toward: z+, z-, x+ or x-.

  3. For a surface you walk on that never blocks, use Add Component ▸ Shooter & Strategy ▸ Walkable Surface (fps.floor = 1).

A Level Block stops you whenever it rises above a step (0.55 m) and starts below your eyes. You can walk on its top, and it blocks a bot’s line of sight. So a waist-high crate is cover, a kerb is a step, and a catwalk whose underside is 2.6 m up is a roof you walk beneath.

  1. Model the rifle pointing along Blender’s +Y axis (away from you in the front view), and give it Add Component ▸ Items ▸ Viewmodel.

  2. Set viewmodel.offset to where it sits in the camera’s frame (the arena uses 0.2,-0.21,-0.68). It rides the camera with a walk bob and recoil.

The rifle hits instantly along the centre of the screen. Each shot has a muzzle flash, a tracer and sparks, and the crosshair marks hits and kills. Being hit flashes the screen edges red. On a phone held upright, the gun is drawn closer so it stays in frame.

Add them from Add Component: Health and Bot under Characters & People, Pickup under Items.

Component Tags What it does
Health health = most health Makes any object shootable. At 0 it is destroyed (if it was spawned) or hidden, and the world hears world:killed
Bot bot = 1, bot.speed, bot.range, bot.sight, bot.rate, bot.damage, bot.accuracy, bot.eye, bot.body A hunter. Needs Health too
Pickup pickup = health or ammo, pickup.amount, pickup.respawn Walk over it and you take it if it is useful. It returns after pickup.respawn seconds

A bot wears a wardrobe body (bot.body, or one picked for it), turns to face you, and walks or runs as it moves. It closes to bot.range, checks its line of sight against the blocks, strafes and fires: bot.accuracy is its chance to hit at 10 m, lower farther away and when you move. It cannot see through a pillar. When it is blind and blocked, it steps sideways for a while.

  1. Build the bot as a spawnable, arena-bot.blend: one Empty with Health (health = 60) and Bot (bot.range = 10, bot.rate = 1, bot.damage = 7, bot.accuracy = 0.5, bot.speed = 3.4, bot.sight = 45), tagged asset.primary = 1. It is dressed in a body when it appears. Press Build Cartridge.

  2. In the arena, set spawn.preload to the bot’s address.

  3. Place health kits and ammo boxes with Pickup: the arena’s kits give 35 and return after 15 s.

  1. Waves come from data. Add data/waves.json (bots per wave: 2, 3, 4, 5, 6; the last row repeats) and data/spawns.json (the points they appear at, as x, y, z). One For Loop spawns the bots for the wave.

  2. A kill. On world:killed, add 1 to kills and 100 × wave to score. When the last bot of a wave dies, start the next wave after a 2 s breath.

  3. Death. On world:player.dead, end the game and keep the best score. Play again clears the bots, calls respawn on the player and restarts the waves.

  4. The HUD. Ten times a second, ask the player for its health and ammo and show Health {hp} · Ammo {ammo} · Wave {wave} · Kills {kills} · Score {score} · Best {best}.

The player answers to the name Player with Call Component: damage, heal, health, ammo, addAmmo, dead, respawn, position and kills. The world also hears world:player.dead, world:player.hit and world:pickup.

Give materials roughness, metal and emission in Blender: concrete, brushed metal and glowing trims. Then turn on the scene’s look settings (Look and light): ambient occlusion, bloom, ACES tone mapping, a sunset environment, a shadow-casting key light and fog. The arena uses look.bloom = 0.03 and look.fog = #1b212b,0.012.

  1. Press Build Cartridge, then publish the arena and its bot (Publish and share).

  2. Open it and click to lock the mouse: two bots come for you. Duck behind a pillar and they lose sight of you; step out and they fire.

Bots do not find paths round obstacles yet. When one cannot see you and is blocked, it only steps sideways for a while.

  • player.controller = fps gives mouse look, a character controller, a weapon and a body you can see.
  • Level Block, Level Ramp and Walkable Surface build a level from Blender shapes.
  • Viewmodel, Health, Bot and Pickup make a shooter from tags; waves come from a data table.

Next: the strategy tutorials start with RTS units and orders.