lokiplay 0.4.1 → 0.4.2

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.
@@ -78,32 +78,45 @@
78
78
  `authority` is `"server"` — `step`. Report the richer profile in the
79
79
  final report: values, supporting evidence, and creator-confirmed
80
80
  decisions.
81
- - `authority: "server"` is disabled in production until the sandbox gates
82
- in the server-authority plan pass; do not offer it to a creator as a
83
- working option today. If a mode still needs it, `step` must name a
84
- compiled WebAssembly module (`modulePath`, `.wasm`) exporting exactly one
85
- function, `step`, and importing nothing — no WASI, clocks, randomness, or
86
- host functions. A seed, when the game needs one, is a supplied input
87
- field, not something the module reads from the environment. Compile the
88
- game's headless simulation to that ABI yourself; do not hand the creator
89
- a module that imports anything, since the validator rejects it and the
90
- worker never mounts it.
91
- decisions.
92
- - `authority: "server"` is disabled in production until the sandbox gates
93
- in the server-authority plan pass; do not offer it to a creator as a
94
- working option today. If a mode still needs it, `step` must name a
95
- compiled WebAssembly module (`modulePath`, `.wasm`) exporting exactly one
96
- function, `step`, and importing nothing — no WASI, clocks, randomness, or
97
- host functions. A seed, when the game needs one, is a supplied input
98
- field, not something the module reads from the environment. Compile the
99
- game's headless simulation to that ABI yourself; do not hand the creator
100
- a module that imports anything, since the validator rejects it and the
101
- worker never mounts it.
81
+ - Classify authority from the code that advances match state, not from the
82
+ genre or the frame rate. Turn-based or event-driven means that state
83
+ changes only when a player action is committed. Continuous realtime means
84
+ state advances on a tick even when nobody has just pressed a button. If
85
+ that reading is ambiguous, stop and ask the creator what the match state
86
+ depends on. Do not guess.
87
+ - One `game.json` has one `authority` for the whole project. If modes
88
+ disagree, say so and ask which one this project is.
89
+ - Host is more suitable for turn-based and event-driven games. Write
90
+ `"authority": "host"`, omit `step`, and use `createSynchronizedRoom()`.
91
+ - Server is more suitable for continuous realtime games. Tell the creator
92
+ what the update path does, then ask them to confirm server. Write
93
+ `"authority": "server"` and `step`. Do not elect a player host. Server
94
+ rooms are browser-only, run in Singapore, and end if the step fails; they
95
+ do not fall back to a player. That is fairness, not lower latency.
96
+ - Before compiling `step`, change the state update so the next state depends
97
+ only on the previous state and this tick's inputs. Drawing, sound, and
98
+ asset loads stay in the browser. If the update reads the DOM, the clock,
99
+ randomness, or assets, remove those calls from it. A seed or the tick
100
+ index, when the game needs one, is an input field, not something the
101
+ module reads itself. If you cannot make that change, say so and do not
102
+ write `"authority": "server"`. Host realtime (`createRealtimeRoom()` with
103
+ `"authority": "host"`) can ship until the update is pure; say that is why,
104
+ and do not describe host as the better fit for a continuous game.
105
+ - `step` names a compiled `.wasm` module (`modulePath`) exporting exactly
106
+ one function, `step`, and importing nothing — no WASI, clocks, randomness,
107
+ or host functions. Compile it yourself. The validator rejects imports, and
108
+ the worker never mounts anything else.
109
+ - A later switch is another deploy after the creator confirms again. Rooms
110
+ already open keep the authority they started with.
111
+ - Do not ask the creator to choose server, and do not write
112
+ `"authority": "server"`, until Loki has enabled server authority in
113
+ production. Until then, continuous games use host realtime. The server
114
+ question above applies once that switch is on.
102
115
  - After inspecting and confirming each game mode's profile, choose
103
116
  `createSynchronizedRoom()` for turn-based or event-driven state, or
104
- `createRealtimeRoom()` for continuous host-authoritative simulation. Do not
105
- choose by genre or animation smoothness; choose by how authoritative state
106
- actually progresses. Do not run both room types for the same mode.
117
+ `createRealtimeRoom()` for continuous realtime. Do not choose by genre or
118
+ animation smoothness; choose by how authoritative state actually
119
+ progresses. Do not run both room types for the same mode.
107
120
  - `createSynchronizedRoom()`: define project-owned state and actions, then
108
121
  provide a reducer. Do not implement a parallel authority, version, or
109
122
  membership protocol.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lokiplay",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Command-line tools for Loki game projects and deployments.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@lokiplay/protocol": "0.4.1",
42
+ "@lokiplay/protocol": "0.4.2",
43
43
  "fflate": "^0.8.3"
44
44
  }
45
45
  }