lokiplay 0.4.0 → 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.
- package/dist/AGENTS.template.md +56 -6
- package/package.json +2 -2
package/dist/AGENTS.template.md
CHANGED
|
@@ -27,6 +27,21 @@
|
|
|
27
27
|
Loki overlay shows room status, players, invite copy, and chat only; it
|
|
28
28
|
does not create or join rooms. Players still need loading, waiting, and
|
|
29
29
|
error states.
|
|
30
|
+
- Installing the SDK also does not add Match or Leaderboard screens; both
|
|
31
|
+
are required alongside create/join, and the Loki overlay never draws
|
|
32
|
+
them. Add a Match control that calls the room wrapper's `matchmake()`
|
|
33
|
+
(`SynchronizedRoom.matchmake()` / `RealtimeRoom.matchmake()`) with
|
|
34
|
+
confirmed player/team settings, plus searching, cancel (abort the
|
|
35
|
+
in-flight search), timeout, waiting, and error states. Add a per-game
|
|
36
|
+
Leaderboard using `listLeaderboard()`/`submitLeaderboardScore()` (or the
|
|
37
|
+
in-room `submitScore()` for a mid-room board), with display-name
|
|
38
|
+
collection or a sensible fallback, plus loading, empty, pagination,
|
|
39
|
+
submission, and error states. Player count, teams, and scoring stay
|
|
40
|
+
creator decisions from the confirmed profile; if the game has no numeric
|
|
41
|
+
result to store, ask the creator once what to record instead of
|
|
42
|
+
inventing a scoring rule. Leaderboards are per-game/project and available
|
|
43
|
+
to guest sessions without a creator account; client-submitted scores are
|
|
44
|
+
not an anti-cheat boundary. Public room browsing stays optional.
|
|
30
45
|
- Before configuring Loki multiplayer, inspect the game's source, existing UI,
|
|
31
46
|
configuration, documentation, tests, and finished build. Locate its game
|
|
32
47
|
modes, seats, local-player handling, AI opponents, teams, start conditions,
|
|
@@ -59,14 +74,49 @@
|
|
|
59
74
|
selection, readiness, player limits, invite and join behavior, waiting
|
|
60
75
|
states, and start conditions.
|
|
61
76
|
- Do not invent new `game.json` fields. Current manifests accept only
|
|
62
|
-
`enabled`, `authority`, `maxPlayers`,
|
|
63
|
-
|
|
64
|
-
creator-confirmed
|
|
77
|
+
`enabled`, `authority`, `maxPlayers`, `tickRate`, and — only when
|
|
78
|
+
`authority` is `"server"` — `step`. Report the richer profile in the
|
|
79
|
+
final report: values, supporting evidence, and creator-confirmed
|
|
80
|
+
decisions.
|
|
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.
|
|
65
115
|
- After inspecting and confirming each game mode's profile, choose
|
|
66
116
|
`createSynchronizedRoom()` for turn-based or event-driven state, or
|
|
67
|
-
`createRealtimeRoom()` for continuous
|
|
68
|
-
|
|
69
|
-
|
|
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.
|
|
70
120
|
- `createSynchronizedRoom()`: define project-owned state and actions, then
|
|
71
121
|
provide a reducer. Do not implement a parallel authority, version, or
|
|
72
122
|
membership protocol.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lokiplay",
|
|
3
|
-
"version": "0.4.
|
|
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.
|
|
42
|
+
"@lokiplay/protocol": "0.4.2",
|
|
43
43
|
"fflate": "^0.8.3"
|
|
44
44
|
}
|
|
45
45
|
}
|