@korial29/tiny-fps 0.229.1 → 0.230.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/dist/room.js CHANGED
@@ -1 +1 @@
1
- export { n as MAPS, r as RULES, t as Room } from "./assets/room-BUfNl2LM.js";
1
+ export { n as MAPS, r as RULES, t as Room } from "./assets/room-DVyCaIW2.js";
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Room } from "./assets/room-BUfNl2LM.js";
1
+ import { t as Room } from "./assets/room-DVyCaIW2.js";
2
2
  import { WebSocketServer } from "ws";
3
3
  // src/server/index.ts
4
4
  /** `/demo` → "demo", `/` → "default". Undecodable paths are kept as is. */
@@ -1,11 +1,26 @@
1
1
  import type { WorldDef } from '../shared/world';
2
2
  /**
3
- * The wreck by part, each its vertices in the renderer's format: the hull's three sections, the
4
- * hold inside the middle one, the two wings, the debris, the camps. Read from the map at the call.
3
+ * The hull paint's layer: lit paint (its colour in c.x, c.y, c.w) that the shader rules with panel
4
+ * lines and mirrors the sky in, the more the brighter its red is: soot is matt. No other
5
+ * material's band holds it.
6
+ */
7
+ export declare const HULL = -1.05;
8
+ /**
9
+ * The hull paint's pixel, in main(), before the light: `c` its colour, `n` its normal, `pw` the
10
+ * pixel's size on it. Panel lines every 2 m along the hull and round it, gone where a pixel no
11
+ * longer holds them. `hk` is its gloss.
12
+ */
13
+ export declare const PANEL = "{vec2 q=vec2(P.x,abs(n.y)>.7?P.z:P.y*1.3)*.5,d=abs(fract(q)-.5);hk=smoothstep(.25,.55,C.x);\nc*=1.-.4*hk*smoothstep(.006+pw,.006,min(d.x,d.y))*(1.-smoothstep(.02,.09,pw));}";
14
+ /** Its mirror, in main(), after the light: `k` the sky its normal `m` reflects (the lit sand under the horizon), `fr` the fresnel term; and the sand's light thrown back up under it. */
15
+ export declare const GLOSS = "c+=hk*(mix(vec3(.8,.72,.56),k,smoothstep(-.3,.05,r.y))*(.15+.6*fr)+vec3(.3,.27,.21)*clamp(.5-m.y,0.,1.));";
16
+ /**
17
+ * The wreck by part, each its vertices in the renderer's format: the hull's skin and fairings,
18
+ * the tail's and the nose's ends, what is inside the hull, the two wings, the debris (the engines, the rails), the camps. Read from the map at the call.
5
19
  */
6
20
  export declare const parts: (def: WorldDef) => {
7
21
  hull: number[];
8
- hold: number[];
22
+ ends: number[];
23
+ inside: number[];
9
24
  wings: number[];
10
25
  debris: number[];
11
26
  camps: number[];
@@ -2,7 +2,8 @@ import type { WorldDef } from '../shared/world';
2
2
  /**
3
3
  * Landfall's forest and headlands by part, each its vertices in the renderer's format: the
4
4
  * headlands' rocks, the first row's palms (TRUNKS and their twins), the trees behind, the
5
- * undergrowth and the far canopy. The lists and the relief are read here, at the call.
5
+ * undergrowth and the far canopy, and what the crash broke and burnt of them round the nose, past
6
+ * the first trunks. The lists and the relief are read here, at the call.
6
7
  */
7
8
  export declare const parts: (def: WorldDef) => {
8
9
  rocks: number[];
@@ -10,6 +11,7 @@ export declare const parts: (def: WorldDef) => {
10
11
  forest: number[];
11
12
  brush: number[];
12
13
  canopy: number[];
14
+ snags: number[];
13
15
  };
14
16
  /** Its vertices, in the renderer's format. */
15
17
  export declare const jungle: (def: WorldDef) => number[];
@@ -9,6 +9,8 @@ export declare const SEA = -5;
9
9
  * the map knows.
10
10
  */
11
11
  export declare const LIFT = 0.05;
12
+ /** How many lumps, and how far from the centre line the furthest lie, metres. */
13
+ export declare const LUMPS: number, STREWN: number;
12
14
  /** The sand and the far island, in the renderer's format. */
13
15
  export declare const shore: (def: WorldDef) => number[];
14
16
  /** The sea, in the renderer's format: drawn after everything that stands in it, blended (render.ts). */
@@ -30,23 +30,56 @@ export declare const EDGE: {
30
30
  /**
31
31
  * The wreck, a hull along x on the centre line, broken in three: each section's x0 and x1. The
32
32
  * tail is in the water, the middle on the sand, the nose in the trees; the two gaps are crossed on
33
- * foot. `r` is the hull's radius and `sunk` how deep its axis sits under r, so its back is at
34
- * 2 r - sunk over the sand. `axis` is the height of each section's axis: each lies level, 2 m in
35
- * the ground it came to rest on.
33
+ * foot. `r` is the hull's half width at the belt and `sunk` how deep its axis sits under r, so its
34
+ * back is at 2 r - sunk over the sand. `axis` is the height of each section's axis: each lies level,
35
+ * 2 m in the ground it came to rest on. The back is flat for `spine` either side of the line and
36
+ * the skin is `skin` thick: the hull is hollow.
36
37
  */
37
38
  export declare const HULL: {
38
39
  r: number;
39
40
  sunk: number;
40
41
  sections: number[][];
41
42
  axis: number[];
43
+ spine: number;
44
+ skin: number;
42
45
  };
43
46
  /**
44
- * The hull's cross-section as stacked boxes: each a height over the axis and the half width from
45
- * there up to the next. A wall under the axis, the widest at it, two shoulders and the back, flat
46
- * and 5 m wide.
47
+ * The hull's section: its half width at the height h over a section's axis. Round, 7 m at the
48
+ * belt, a keel 7 m under it and a flat back 7 m over it. Only + - * / and Math.sqrt: the host and
49
+ * the clients build the same boxes from it.
47
50
  */
51
+ export declare const section: (h: number) => number;
52
+ /**
53
+ * The heights over the axis the skin is cut at, above a section's floor: a box of skin on each
54
+ * flank from one to the next, as wide as the section half way up it. Where a line is one of DECKS
55
+ * the row under it is a floor across the hull instead.
56
+ */
57
+ export declare const LINES: number[];
58
+ /** The floors over the axis: the lower deck, the upper one (the middle section's gallery) and the back. */
59
+ export declare const DECKS: number[];
60
+ /** The section as a table, each line and the half width there. */
48
61
  export declare const RINGS: number[][];
49
- /** The middle section's hold: its floor and ceiling, the half width inside, the ends inside, the doors' x0 and x1 and their height. */
62
+ /**
63
+ * The three sections, tail first. `cut`: the lengths it is built in (x0, x1, the share of the
64
+ * section's width there, and a skin so thick that it is solid: the stern). `floor`: the lowest
65
+ * floor over the axis, solid down to the keel (the tail's is awash, the middle's is the hold).
66
+ * `holes`: in the floors, each the index in DECKS, x0, x1 and the half width (9: from skin to
67
+ * skin). `tears`: in both flanks, x0, x1 and the heights over the axis, from one of LINES to
68
+ * another. `fair`: the fairing along each flank from the belt up to the upper deck, x0, x1 and how
69
+ * far out past r; its top is a ledge. `crates`: a crate under the edge of a hole, to climb to the
70
+ * floor above: its x0 and the index of the deck it stands on (-1: the floor). It is 1 m high on
71
+ * the floor, 1.4 m on the lower deck and 2 m on the upper one: the hands reach the edge from it
72
+ * before the head is under the floor above, and the hanging body clears it.
73
+ */
74
+ export declare const SHIP: {
75
+ cut: number[][];
76
+ floor: number;
77
+ holes: number[][];
78
+ tears: number[][];
79
+ fair: number[][];
80
+ crates: number[][];
81
+ }[];
82
+ /** The middle section's hold: its floor and ceiling, the half width inside, its ends, the doors' x0 and x1 and their height. No bulkhead is left in it. */
50
83
  export declare const HOLD: {
51
84
  floor: number;
52
85
  ceil: number;
@@ -54,35 +87,32 @@ export declare const HOLD: {
54
87
  x: number[];
55
88
  door: number[];
56
89
  lintel: number;
57
- /** The two bulkheads across it (x0, x1), each with a doorway `way` wide on the centre line. */
58
90
  walls: number[][];
59
91
  way: number;
60
92
  };
61
93
  /**
62
- * Red's wing, torn at the root and lying as a ramp from the sand up to the hull's back: its root
63
- * on the middle section (x0, x1 at z = ZED / 2 + HULL.r) and its tip on the sand (x0, x1, z).
64
- * Blue's is its twin.
94
+ * Red's wing, lying from the fairing's ledge down to the sand, broken in three. `lead` and `trail`
95
+ * are its outline, x by span from the root (swept, notched, a raked tip); a metre of span is `span`
96
+ * metres on the ground. `root` is x0 and x1 at the hull. `pieces`: the span each runs from and to,
97
+ * how far it was pushed out, its top at its inner and its outer end, and how far its outline is
98
+ * sheared along x for each 1.4 m of it on the ground (it lies turned in the wing's plane). The first is
99
+ * still attached; the breaks are 3.6 m wide. `rails`: the x of the two beams that run through the
100
+ * breaks and hold the pieces, 0.45 m wide. Blue's is its twin.
65
101
  */
66
102
  export declare const WING: {
67
103
  root: number[];
68
- tip: number[];
104
+ lead: number[][];
105
+ trail: number[][];
106
+ span: number;
107
+ pieces: number[][];
108
+ rails: number[];
69
109
  };
70
110
  /**
71
- * Red's engines, torn off: the middle of each nacelle (x, z), its radius and length, lying along z.
72
- * One on the sand by the wing, run through; one in the lagoon off the tail's end, stood on.
111
+ * Red's engines, torn off: the middle of each (x, z), its radius and length. The first lies on the
112
+ * sand beside the wreck near the waterline, askew (z by x along it), burning: nobody walks through
113
+ * it. The second lies along z in the lagoon off the tail's end, awash, stood on.
73
114
  */
74
115
  export declare const ENGINES: number[][];
75
- /**
76
- * Where it burns, both halves: the foot of each column of smoke (x, y, z), how high it rises, and
77
- * its radius at the foot and at the top (client/smoke.ts draws them). Their flames burn (FLAME), so
78
- * none stands on a way across (the user, 2026-11-25): on the sand east of the rear of each nacelle,
79
- * clear of its roof and of the way through it; on the south-west corner of each engine in the
80
- * lagoon, clear of the jumps over its north half (routes.ts LAGOON); and high against each of the
81
- * hull's four broken ends, thinner, over the heads of those who cross the gaps.
82
- */
83
- export declare const FIRES: number[][];
84
- /** Metres the flames at a fire's foot reach out from its middle and up from it: smoke.ts stands three balls of 0.55 m within 0.6 of the foot's radius, up to 2.3 m. */
85
- export declare const FLAME: number[];
86
116
  /** Red's camp: the escape pod its flag stands by (x, z, radius). */
87
117
  export declare const POD: number[];
88
118
  /** The camp's ground, level. */
@@ -103,7 +133,7 @@ export declare const TRUNKS: number[][];
103
133
  export declare const CELL = 4;
104
134
  /**
105
135
  * Where the ground is level, x0, z0, x1, z1 (z in red's half) and the height: the way in to the
106
- * hold's door through the bank, the tip of the wing, the camp. Level for 6 m round each, so that
136
+ * hold's door through the bank, the sand under the tip of the wing, the camp. Level for 6 m round each, so that
107
137
  * the lattice's triangles are, and back to the sand 6 m further; none within 12 m of the next.
108
138
  */
109
139
  export declare const FLATS: number[][];
@@ -125,11 +155,28 @@ export interface Piece {
125
155
  min: Vec3;
126
156
  max: Vec3;
127
157
  }
158
+ /** How much a row of the wing stands over the next at most, metres. */
159
+ export declare const RISE = 0.15;
160
+ /** How thick the wing is at a span, drawn and collided with: a thin aerofoil, 0.6 m at the root and 0.15 m at the tip. */
161
+ export declare const thick: (v: number) => number;
162
+ /** An edge of the wing's outline at a span. */
163
+ export declare const edge: (l: number[][], v: number) => number;
164
+ /**
165
+ * Where it burns, both halves: the foot of each column of smoke (x, y, z), how high it rises, and
166
+ * its radius at the foot and at the top (client/smoke.ts draws them). Their flames burn (FLAME), so
167
+ * none stands on a way across (the user, 2026-11-25): on the back of the fallen engine, which
168
+ * burns; on the south-west corner of each engine in the lagoon, clear of the jumps over its north
169
+ * half (routes.ts LAGOON); and against each of the hull's four broken ends, thinner, 4.2 m over
170
+ * its axis: over the heads of those on the upper deck (DECKS) and under the back.
171
+ */
172
+ export declare const FIRES: number[][];
173
+ /** Metres the flames at a fire's foot reach out from its middle and up from it: smoke.ts stands three balls of 0.55 m within 0.6 of the foot's radius, up to 2.3 m. */
174
+ export declare const FLAME: number[];
128
175
  /**
129
176
  * What the scenery draws on the map's boxes, both halves, blue's mirrored: the hull's sections
130
- * (x0, x1, the axis' height), every piece of the wreck and of the camps by kind (hull, hold, heap,
131
- * frame, raft, wing, nacelle, engine, float, pod, dais, crate, shelter, panel, container, gear), and the
132
- * headlands' rocks where they stand.
177
+ * (x0, x1, the axis' height), every piece of the wreck and of the camps by kind (skin, deck,
178
+ * fairing, wingpiece, rail, fallen, heap, frame, raft, engine, float, pod, dais, crate, shelter,
179
+ * panel, container, gear), and the headlands' rocks where they stand.
133
180
  */
134
181
  export declare const LAYOUT: {
135
182
  hull: number[][];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "0.229.1",
5
+ "version": "0.230.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"