@korial29/tiny-fps 0.49.4 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,7 +28,7 @@ It started as a co-op shooter inspired by carlini's [Yet Another Doom Clone](htt
28
28
  | `@korial29/tiny-fps/local` | Same-browser multiplayer, no server: the host runs in a tab | ~12.7 KB |
29
29
  | `@korial29/tiny-fps/server` | Node WebSocket server (needs `ws`) | Node only |
30
30
 
31
- CI checks the budgets (64 KB and 16 KB) on every pull request.
31
+ CI checks the budgets (68 KB and 16 KB) on every pull request.
32
32
 
33
33
  ## Live demo
34
34
 
@@ -176,6 +176,7 @@ The subset of `WebSocket` the client uses: `binaryType`, `onopen`, `onclose`, `o
176
176
  | Crouch | C. At sprint speed it is a slide, low enough to go under a 1.2 m slot |
177
177
  | Fire | Left button: click to fire the gun, hold to charge it; click to cut with the katana |
178
178
  | Weapon | 1 the gun, 2 the katana, 3 the rail gun, or the wheel to the next one |
179
+ | Reload | R: a new battery in the gun, a new capsule on the rail gun (also when it runs dry) |
179
180
  | Mute | M (remembered) |
180
181
 
181
182
  Facing a ledge between 1.2 and 2.4 m above your feet in the air, you take hold of it: forward or Space climbs, back or C lets go, and Space looking away jumps off it. Jumping while running next to a wall, up to half a metre away and not more than about 50 degrees off it, starts a wall-run along its side (about a second, hold forward, Space kicks off). Ctrl is not used, since Ctrl+W closes the tab.
@@ -194,10 +195,10 @@ The game is the movement and a capture the flag on top of it, with a tackle, a g
194
195
  - **Capture the flag**: touch the enemy flag, at its base or where it was dropped, to take it, and carry it to your own base while your own flag is there: that is a capture, and the flag goes home. Touch your own dropped flag to send it home at once; left alone it goes home after 10 seconds. A carrier who falls off the roofs or leaves drops it where he last stood. A tackled carrier drops it too, and it lies there for 2 seconds: nobody can send it home, and the carrier's teammates can grab it. There is a ring of light on each base, a marker toward each flag (and toward your base while you carry), a banner for each event and a sound for a take, a drop, a return and a capture.
195
196
  - **A match** ends at 3 captures or after 8 minutes, then everyone sees the result and each player's captures and returns for 10 seconds, and a new match starts with everyone back at their spawn.
196
197
  - **The map**: Highline, 94 by 240 m under an open sky, the same for both teams (the blue half is the mirror of the red one). Each team holds a 26 m tower with its flag and eight spawns. Three routes lead to the other tower, and they meet at the plaza in the middle. The **Spine** (west, 26 m) is the fast one, about 25 s by sprint: an 11 m gap that takes a dash or a double jump, a 17 m viaduct along a wall that takes a wall-run and a dash, a beam over the plaza. **Midtown** (centre, 19 to 21 m) is roofs, short gaps and ledges to grab, about 36 s. The **Lowline** (east, 14.5 m) is stairs, short gaps and a sign to slide under, about 39 s, and needs no special move. A miss costs time: roofs under the gaps and ladders of ledges lead back up, and only a fall into the street puts you back at your tower.
197
- - **Weapons**: each team's armoury is a plinth 1.5 m high past its flag, in sight of the spawns, with a gun rack, a katana rack and a rail gun rack: run and jump up to take them. You spawn with none and carry each once taken.
198
- - The **plasma gun** holds 60 shots. A click fires a plasma ball at 40 m/s that bursts on the first wall or enemy it touches, and the view kicks up with each one. Held, the button charges the next ball, shown by a gauge under the ammo counter, and letting go fires it: up to 5 shots' worth in one second, which takes 5 health and puts any enemy down.
198
+ - **Weapons**: each team's armoury is a plinth 1.5 m high past its flag, in sight of the spawns, with a gun rack, a katana rack and a rail gun rack: run and jump up to take them. You spawn with none and carry each once taken. A weapon comes to hand dark and lights up over half a second.
199
+ - The **plasma gun** holds 60 shots, 15 at a time in a battery in its grip: an empty one, or R, swaps it in 0.9 s, the gun dark until the new one is in. A click fires a plasma ball at 40 m/s that bursts on the first wall or enemy it touches, and the view kicks up with each one. Held, the button charges the next ball, shown by a gauge under the ammo counter, and letting go fires it: up to 5 shots' worth in one second, which takes 5 health and puts any enemy down.
199
200
  - The **electric katana** needs no ammo. A cut takes 2 to 4 health by the cut, reaches 2.2 to 3.2 m, and shocks a foe it does not put down: a short stumble the way the blade goes. A cut that puts a foe down takes off the limb the blade crosses, head, arm or leg, drawn only, with no blood.
200
- - The **rail gun** is a two-handed Tesla gun with a stock, humming in your hands: hold the button and a bolt of lightning goes out, up to 30 m, for 4 s in all. An enemy it touches loses 1 health at once, then 1 a second while it holds him and for 3 seconds after, and walks no faster than 3 m/s meanwhile. One it kills is disintegrated. Rail cells on every route refill a third of it.
201
+ - The **rail gun** is a two-handed Tesla gun with a stock, humming in your hands: hold the button and a bolt of lightning goes out, up to 30 m, for 4 s in all, a capsule screwed on its top holding a third of it: an empty one, or R, is thrown off and a new one screwed on in 1.5 s. An enemy it touches loses 1 health at once, then 1 a second while it holds him and for 3 seconds after, and walks no faster than 3 m/s meanwhile. One it kills is disintegrated. Rail cells on every route refill a third of it.
201
202
  - **Health**: 5 points, a plasma hit takes 1, no friendly fire, no regeneration. At 0 a player lies down for 2 seconds, drops a carried flag, loses every weapon and comes back at a team spawn. Health packs give 2 points, ammo packs 20 shots and rail cells a third of the rail gun's lightning; a taken pack is back after 20 seconds, an ammo pack after 10.
202
203
  - **Moving**: momentum, sprint, dash, double jump, ledge grab and climb, wall-run, slide, coyote time and a jump buffer. The host decides where everyone is. Your own moves show at once (the client predicts them) and are corrected to the host's state, to the bit.
203
204
  - **The others**: drawn 100 ms in the past, interpolated between snapshots, as runners with one continuous skinned body, a natural gait and every parkour move, in their team colour, with the weapon in their hands.
@@ -231,7 +232,7 @@ The game is the movement and a capture the flag on top of it, with a tackle, a g
231
232
 
232
233
  - **The host is authoritative**: the Node server, or the host tab in local mode. It runs the players on the map.
233
234
  - **Inputs, not positions**: each client sends one 12-byte input per step at 60 Hz, holding its keys, view angles and the moment it sees the others at. It predicts its own player at once and replays what the host has not acknowledged yet.
234
- - **Snapshots** go out at 30 Hz: a 4-byte head, 47 bytes per player (position, speed, look angles, the movement state and its timers, health, ammo, weapons and swing), then the match: the captures, the clock, the packs and the two flags, 10 bytes when both are home, then the plasma balls in flight, 10 bytes each, in a compact binary format. The other players are drawn 100 ms in the past, interpolated between snapshots.
235
+ - **Snapshots** go out at 30 Hz: a 4-byte head, 58 bytes per player (position, speed, look angles, the movement state and its timers, health, ammo and magazines, weapons and swing), then the match: the captures, the clock, the packs and the two flags, 12 bytes when both are home, then the plasma balls in flight, 10 bytes each, in a compact binary format. The other players are drawn 100 ms in the past, interpolated between snapshots.
235
236
  - **Rendering**: one WebGL2 shader program and one vertex buffer, up to 16 lights, with up to 4 shadow maps drawn by the same program.
236
237
 
237
238
  ---