quill/val Public Public: anyone can read this; nobody can change it.

forked from benjivers/val

workbenchthis machine
Files 16611dd34ec2ea73a39a2dece0010023cace015e
79 lines · 3.6 KB · ~933 tok Raw History
1
# val
2
3
Five attackers with the spike, five defenders, abilities on cooldown. First to 13.
4
5
A top-down 5v5 played in a browser. One match is always running on the
6
server: open the page and you are given a seat in the round that is
7
happening, taken from a bot where it stands. When a match ends it shows the
8
result for a few seconds and starts a new one, so nobody ever arrives at a
9
frozen board.
10
11
## What is real
12
13
Everything that decides a round is computed on the server and only the
14
server:
15
16
- **Movement, shooting and hit detection.** The client sends intent — a
17
  direction, an angle, a held key — never a position. Damage is by hit
18
  location (how close the ray passes the target) with falloff and armour:
19
  a Vandal head shot kills through full armour at any range, a Phantom's
20
  does not past fifteen metres.
21
- **Line of sight.** A snapshot only carries the enemies that viewer can
22
  see. A smoke blocks that sight line, a flash blinds by the angle you were
23
  facing, and a blinded player is sent no enemies at all. A patched client
24
  learns nothing a plain one does not.
25
- **The spike.** 100s round, 4s plant, 45s fuse, 7s defuse with a
26
  checkpoint at 3.5s — a defender killed past half way leaves the defuse
27
  half done for the next one.
28
- **Credits.** 800 to start, 9,000 cap, +200 a kill, +300 to the team on a
29
  plant, loss bonus 1,900 / 2,400 / 2,900. A buy you cannot afford is
30
  refused server-side.
31
- **Bots** fill every empty seat and use their kit: smokes on the way in,
32
  flashes before the entry, a recon dart, a molly on the planted spike.
33
34
Agents: Ember, Veil, Sable, Mender, Rook — two basics bought with credits
35
(charges last the round), a free signature on a cooldown, and an ultimate
36
paid for with ult points from kills, plants and the two orbs on the map.
37
38
Guns: Classic, Ghost, Sheriff, Spectre, Phantom, Vandal, Operator.
39
40
## What is not
41
42
- One map, one match at a time, ten seats. There is no matchmaking, no
43
  ranking and no account: your seat belongs to a session cookie.
44
- No overtime — first to 13 ends it at 12–12 too.
45
- Sight is a full circle rather than a view cone; top-down has no vertical,
46
  so the hit location comes from how precisely the shot passes the target.
47
- Assists are counted as a field but never awarded.
48
- The live match lives in memory and is gone if the process restarts; only
49
  finished match results are written to SQLite under `FORGE_APP_DATA`.
50
51
## Playing
52
53
WASD move, the mouse aims, click fires, **R** reloads, **F** plants and
54
defuses (hold it), **C / Q / E / X** cast, **B** opens the buy. On a phone
55
the left thumb walks and the right thumb aims and fires.
56
57
```sh
58
PORT=8080 FORGE_APP_DATA=./data bun run src/server.ts   # run it here
59
bun test                                                # the check every pull runs
60
VAL_URL=http://127.0.0.1:8080 bun run src/tty.ts        # the terminal interface
61
```
62
63
The terminal plays the same match over the same socket: it draws the grid,
64
the scoreboard and the round, and takes a seat. The exact command that
65
reaches it is in `FORGE_APP_SSH` when the app runs, and the page prints it.
66
67
The forge sets `PORT`, `FORGE_APP_DATA`, `FORGE_APP_ENV`, `FORGE_APP_URL`,
68
`FORGE_APP_SSH` and `FORGE_APP_COMMIT` when it starts the app; `forge.json`
69
says how.
70
71
## Shape
72
73
`src/map.ts` the grid and its geometry · `src/weapons.ts` the damage table ·
74
`src/economy.ts` credits · `src/abilities.ts` the agent kits ·
75
`src/match.ts` the round loop (`tick(state, dt)` is the whole game and takes
76
no clock) · `src/bots.ts` the seats nobody is in · `src/arena.ts` the one
77
live match and its sockets · `src/server.ts` the door · `static/val.js` the
78
browser. The rules are pure functions and the tests play whole matches
79
headlessly.
↑↓ navigate ↵ open esc close
↑↓ navigate ↵ open esc close

Keyboard shortcuts