@korial29/tiny-fps 0.91.2 → 0.92.1
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 +6 -2
- package/dist/cli.js +4 -1
- package/dist/index.js +14 -14
- package/dist/local.js +1 -1
- package/dist/server.js +464 -91
- package/dist/types/client/body.d.ts +4 -4
- package/dist/types/client/helmet.d.ts +27 -0
- package/dist/types/client/hud.d.ts +2 -0
- package/dist/types/client/index.d.ts +2 -0
- package/dist/types/client/moonscape.d.ts +3 -0
- package/dist/types/client/render.d.ts +1 -1
- package/dist/types/client/soldier.d.ts +1 -1
- package/dist/types/client/vision.d.ts +1 -1
- package/dist/types/shared/maps.d.ts +6 -0
- package/dist/types/shared/moon.d.ts +25 -0
- package/dist/types/shared/protocol.d.ts +1 -0
- package/dist/types/shared/room.d.ts +4 -2
- package/dist/types/shared/types.d.ts +2 -0
- package/dist/types/shared/world.d.ts +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
**▶ Play it now: https://korial29.github.io/tiny-fps/**
|
|
12
12
|
|
|
13
|
-
A tiny multiplayer first-person game for the browser, written in TypeScript with raw WebGL2, no game library and no runtime dependency. It is becoming an open-air capture-the-flag between two teams of players on rooftops, inspired by Mirror's Edge: parkour movement and no CPU enemies. Today two teams play capture the flag on Highline, a symmetric rooftop map, with the parkour moves, a tackle, a plasma gun, an electric katana, a rail gun and a laser rifle ([`docs/PLAN.md`](docs/PLAN.md), [`docs/WEAPON.md`](docs/WEAPON.md)). Everything is generated in code: geometry, textures, lights. There are no images, fonts or assets to serve.
|
|
13
|
+
A tiny multiplayer first-person game for the browser, written in TypeScript with raw WebGL2, no game library and no runtime dependency. It is becoming an open-air capture-the-flag between two teams of players on rooftops, inspired by Mirror's Edge: parkour movement and no CPU enemies. Today two teams play capture the flag on Highline, a symmetric rooftop map, or on Tranquility, a moon base in a crater, with the parkour moves, a tackle, a plasma gun, an electric katana, a rail gun and a laser rifle ([`docs/PLAN.md`](docs/PLAN.md), [`docs/WEAPON.md`](docs/WEAPON.md)). Everything is generated in code: geometry, textures, lights. There are no images, fonts or assets to serve.
|
|
14
14
|
|
|
15
15
|
It started as a co-op shooter inspired by carlini's [Yet Another Doom Clone](https://github.com/carlini/js13k2019-yet-another-doom-clone) (js13k 2019). Only the ideas were reused, not the code. The renderer, the netcode and the sound come from that first game.
|
|
16
16
|
|
|
@@ -32,7 +32,7 @@ It started as a co-op shooter inspired by carlini's [Yet Another Doom Clone](htt
|
|
|
32
32
|
| `@korial29/tiny-fps/local` | Same-browser multiplayer, no server: the host runs in a tab | ~15.5 KB |
|
|
33
33
|
| `@korial29/tiny-fps/server` | Node WebSocket server (needs `ws`) | Node only |
|
|
34
34
|
|
|
35
|
-
CI checks the budgets (
|
|
35
|
+
CI checks the budgets (92 KB and 18 KB) on every pull request.
|
|
36
36
|
|
|
37
37
|
## Live demo
|
|
38
38
|
|
|
@@ -99,6 +99,8 @@ Each URL path is its own room: `/my-room` and `/other` are two separate games. A
|
|
|
99
99
|
PORT=8787 npx tiny-fps-server
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
`MAP=tranquility` plays the moon map (the default is `highline`). In local mode the host picks it with the client's `map` option, which the demo's Map menu sets.
|
|
103
|
+
|
|
102
104
|
### Sizing
|
|
103
105
|
|
|
104
106
|
The canvas fills its container, at any size and ratio. Give the container a size:
|
|
@@ -199,6 +201,7 @@ The game is the movement and a capture the flag on top of it, with a tackle, a g
|
|
|
199
201
|
- **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.
|
|
200
202
|
- **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.
|
|
201
203
|
- **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.
|
|
204
|
+
- **Tranquility**, the moon map: 160 by 280 m on the floor of a crater, under a black sky with the Earth and the stars, in a hard low sun. Gravity is half the Earth's, so a jump floats twice as high and twice as long, and everyone wears a space helmet with a glowing visor. Each team has a round dome with its flag in front, a landing pad with its shuttle, two modules joined by tubes, light masts and rovers. A rille cuts the middle: a bridge, a long jump on the west side, stepping stones on the east.
|
|
202
205
|
- **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, a rail gun rack and a laser rifle rack: run and jump up to take them. You spawn with none and carry each once taken. The first time a weapon comes to hand you switch it on, each its own way: the right thumb presses the plasma gun's button and the katana's, the left index the laser rifle's, the left hand turns the rail gun's capsule; it lights up with its sound. Drawn again, or after a swap, it lights up at once.
|
|
203
206
|
- The **plasma gun** holds 60 shots, 15 at a time in a battery in its grip: an empty one, or R, swaps it in 1.3 s, the gun dark until the new one is in: the spent battery falls to the floor, the left hand takes a new one out of a pouch on the hip and puts it in, a pause, a slap of the palm, a jolt and the gun back in aim. 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, with a rising whine and the gun shaking, 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.
|
|
204
207
|
- The **electric katana** needs no ammo; its whole blade lights up when it is switched on. 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.
|
|
@@ -218,6 +221,7 @@ The game is the movement and a capture the flag on top of it, with a tackle, a g
|
|
|
218
221
|
- [x] Multiplayer over WebSocket, or between tabs of one browser with no server
|
|
219
222
|
- [x] A brush world under an open sky: roofs at any height, gaps, floating platforms and overhangs, steps, falls back to a spawn; eight procedural materials (brick, tile, lava, stone, metal, wood, moss, grating) with bump mapping and per-material highlights; a sky with a blooming sun, a sun shadow that follows you, daylight from the sky
|
|
220
223
|
- [x] Highline, the capture-the-flag map: two towers, three routes at three heights, a plaza, wall-run and dash gaps, ledge ladders and stairs, ways back up after a miss; ROOFTOPS, a parkour course, stays as the test course of the moves
|
|
224
|
+
- [x] Tranquility, a moon base in a crater: half gravity, space helmets, domes, a rille to cross, the Earth in a black sky
|
|
221
225
|
- [x] Client-side prediction, exact to the bit, and the other players interpolated
|
|
222
226
|
- [x] A per-tick history of the players on the host, for lag compensation
|
|
223
227
|
- [x] Daylight: a sky with a blooming sun, a sun shadow that follows you, a light colour per box, haze toward the horizon
|
package/dist/cli.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { serve } from "./server.js";
|
|
3
3
|
// src/server/cli.ts
|
|
4
4
|
var port = Number(process.env.PORT) || 8787;
|
|
5
|
-
serve({
|
|
5
|
+
serve({
|
|
6
|
+
port,
|
|
7
|
+
rules: { map: process.env.MAP }
|
|
8
|
+
});
|
|
6
9
|
console.log(`tiny-fps server on ws://localhost:${port}/<room>`);
|
|
7
10
|
export {};
|