ravensight-playtest 0.13.2 → 0.16.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 +99 -4
- package/addons/ravensight_driver/driver.gd +472 -28
- package/docs/godot-driver.md +66 -2
- package/package.json +7 -5
- package/src/api/README.md +8 -1
- package/src/api/client.js +24 -1
- package/src/cli.js +14 -0
- package/src/commands/check.js +5 -2
- package/src/commands/fix.js +1 -1
- package/src/commands/run.js +26 -4
- package/src/commands/setup.js +176 -0
- package/src/packs/index.js +37 -5
- package/src/packs/keys.json +11 -0
- package/src/packs/pack-signing-hashes.json +7 -0
- package/src/packs/pack-signing-vectors.json +119 -0
- package/src/packs/signature.js +186 -0
- package/src/run/anygame/gamenotes.js +74 -12
- package/src/run/anygame/index.js +97 -34
- package/src/run/anygame/language.js +100 -10
- package/src/run/anygame/memory.js +70 -13
- package/src/run/anygame/shared-hashes.json +7 -7
- package/src/run/anygame/sound.js +59 -16
- package/src/run/args.js +2 -0
- package/src/run/claimwords.js +43 -7
- package/src/run/drivers/godot-cursor.js +96 -0
- package/src/run/drivers/godot-observation.js +29 -5
- package/src/run/drivers/godot.js +60 -5
- package/src/run/drivers/web.js +124 -14
- package/src/run/eventclaims.js +102 -6
- package/src/run/events.js +64 -6
- package/src/run/gameMemory.js +14 -5
- package/src/run/honesty.js +49 -2
- package/src/run/judge.js +22 -10
- package/src/run/liveFeed.js +254 -0
- package/src/run/personaLoop.js +103 -25
- package/src/run/pixels.js +491 -2
- package/src/run/replay.js +11 -0
- package/src/run/sdkSession.js +279 -16
- package/src/run/synthetic.js +12 -8
- package/src/run/tools.js +2 -2
package/src/run/anygame/index.js
CHANGED
|
@@ -10,15 +10,19 @@
|
|
|
10
10
|
// so the prompt cache ahead of it is untouched.
|
|
11
11
|
// - Controls. The opening turns are asked to find the controls on purpose;
|
|
12
12
|
// every input is tallied by kind with whether the screen changed.
|
|
13
|
-
// - Language. The brief's language
|
|
14
|
-
// the game as written
|
|
15
|
-
//
|
|
13
|
+
// - Language. The brief's and the game's language are detected; the persona
|
|
14
|
+
// is told to read the game as written, to quote its text as written, and
|
|
15
|
+
// to write in the report language: the studio's (the brief's
|
|
16
|
+
// play.report_language), else the one the brief asks for, else English.
|
|
17
|
+
// The report's required headings stay as they are.
|
|
16
18
|
// - Kind of game. The persona names it in a note; the play style for that
|
|
17
19
|
// kind is given back once.
|
|
18
20
|
// - Sound. On a browser game the page's audio graph is measured after each
|
|
19
|
-
// action (./sound.js):
|
|
20
|
-
//
|
|
21
|
-
//
|
|
21
|
+
// action (./sound.js): each action is "played" or "silent" in the step log
|
|
22
|
+
// and in the tool result once the game has made a sound; a finding that
|
|
23
|
+
// says an input gave no feedback is told whether a sound played there.
|
|
24
|
+
// Evidence only, never a finding of its own, never a judgement of how it
|
|
25
|
+
// sounds. On every other driver sound is listed as not checked.
|
|
22
26
|
//
|
|
23
27
|
// Nothing here calls a model, and nothing changes what a run costs to
|
|
24
28
|
// register. The pure parts (memory, control book, language, kinds, the sound
|
|
@@ -26,28 +30,40 @@
|
|
|
26
30
|
import { createMemory, cleanNote, MEMORY_MAX_CHARS } from './memory.js';
|
|
27
31
|
import { createControlBook } from './controlbook.js';
|
|
28
32
|
import { createGenre, KIND_IDS, KINDS } from './genre.js';
|
|
29
|
-
import { detectLanguage, reportLanguage } from './language.js';
|
|
30
|
-
import { createSoundLog, soundReport, SOUND_LIMIT } from './sound.js';
|
|
33
|
+
import { detectLanguage, reportLanguage, QUOTE_AS_WRITTEN } from './language.js';
|
|
34
|
+
import { createSoundLog, soundReport, soundEvidenceLine, FEEDBACK_CLAIM, SOUND_LIMIT } from './sound.js';
|
|
31
35
|
|
|
32
36
|
// A control that says the game has sound. The hosted runner's rule
|
|
33
37
|
// (lib/anygame/report.mjs SOUND_CONTROL), kept here and not in the
|
|
34
38
|
// hash-pinned ./sound.js, which both runners share unchanged.
|
|
35
39
|
export const SOUND_CONTROL = /\b(mute|unmute|sound|sounds|music|volume|audio|sfx)\b/i;
|
|
36
|
-
const
|
|
37
|
-
const NO_SOUND_FACT = /^The game made no sound in this run/;
|
|
40
|
+
const NO_SOUND_FACT = /^The game made no sound in this run:/;
|
|
38
41
|
export const NO_SOUND_CONTROL_FACT = 'The game made no sound in this run and showed no sound, music or volume control: it never created an audio context or played an audio element. It may have no sound at all.';
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
44
|
* The shared sound report with the hosted runner's one rule on top: a game
|
|
42
45
|
* that ran no audio code and showed no sound control on any screen may simply
|
|
43
|
-
* have no sound, so its silence is
|
|
46
|
+
* have no sound, so its silence is said as that. Never a finding: the shared
|
|
47
|
+
* report makes none.
|
|
44
48
|
*/
|
|
45
|
-
export function localSoundReport(summary, { soundControl = false
|
|
46
|
-
const r = soundReport(summary
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
export function localSoundReport(summary, { soundControl = false } = {}) {
|
|
50
|
+
const r = soundReport(summary);
|
|
51
|
+
if (soundControl || !r.facts.some(f => NO_SOUND_FACT.test(f))) return r;
|
|
52
|
+
return { ...r, facts: [...r.facts.filter(f => !NO_SOUND_FACT.test(f)), NO_SOUND_CONTROL_FACT] };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The line the persona gets after an action once the game has made a sound: measured, never heard, never a finding. */
|
|
56
|
+
export const soundResultLine = state => `Sound after this action, measured from the game's audio (you cannot hear it): ${state === 'played' ? 'a sound played' : 'silent'}. Evidence about feedback, never a finding on its own.`;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The game's own words in a screen as the persona is shown it: the outline's roles, refs ([e12]), points (@(93,189))
|
|
60
|
+
* and attributes ([level=1]) taken out, so a ref's "e" is not read as Portuguese "and". Used to tell the language.
|
|
61
|
+
*/
|
|
62
|
+
export function gameWords(text) {
|
|
63
|
+
return String(text || '')
|
|
64
|
+
.replace(/\[(?:ref=)?e\d+\]|@\(\s*-?\d+(?:\.\d+)?\s*,\s*-?\d+(?:\.\d+)?\s*\)|\[[a-z_-]+(?:=[^\]]*)?\]/gi, ' ')
|
|
65
|
+
.replace(/^\s*-\s*[a-z]+(?: [a-z]+)?(?::|(?=\s*"))/gim, ' ')
|
|
66
|
+
.replace(/\s+/g, ' ').trim();
|
|
51
67
|
}
|
|
52
68
|
|
|
53
69
|
// Actions between two showings of the notebook when nothing dropped out of context.
|
|
@@ -105,7 +121,7 @@ export function createLocalAnyGame({ briefText = '', controls = null, touch = fa
|
|
|
105
121
|
const report = reportLanguage(briefText, { explicit: reportLanguageHint });
|
|
106
122
|
let sound = null, soundTest = null;
|
|
107
123
|
let soundControl = false;
|
|
108
|
-
let gameText = '', gameLanguage = null, styleSaid = false, shownAt = -Infinity, shownText = '', droppedSeen = 0, actionsSeen = 0;
|
|
124
|
+
let gameText = '', gameLanguage = null, styleSaid = false, shownAt = -Infinity, shownText = '', droppedSeen = 0, actionsSeen = 0, eventsSeen = 0;
|
|
109
125
|
const stats = { asides: 0, asideChars: 0, maxAsideChars: 0, kept: 0 };
|
|
110
126
|
|
|
111
127
|
/** The lines added to the system prompt once: fixed for the run, so the cache holds them. */
|
|
@@ -118,27 +134,45 @@ export function createLocalAnyGame({ briefText = '', controls = null, touch = fa
|
|
|
118
134
|
lines.push(`- When the game itself is on screen, write one reaction note "kind: <one of ${KIND_IDS.join(', ')}>" (${KIND_IDS.filter(k => k !== 'unknown').map(k => `${k}: ${KINDS[k].examples}`).join('; ')}). The runner answers once with how that kind of game is best played.`);
|
|
119
135
|
if (continuousTime) lines.push('- Timing: this native driver does not pause the game between inputs or while you think. A genre label never establishes that time is stopped. Watch visible countdowns and respond promptly to timed choices; an untimed menu or turn can still be considered at your own pace. A countdown that runs out while you are still deciding is a limit of this runner ([too_fast]), not a fault of the game: write it as a reaction note, never a bug.');
|
|
120
136
|
lines.push('- The game may be written in any language. Read its text as written and act on what it says. When the brief names something to pick, find the option on screen that means the same in the game\'s language, and say in a "choice:" note which on-screen label you took for which words of the brief.');
|
|
121
|
-
if (
|
|
137
|
+
if (briefLanguage && briefLanguage.code !== 'en') lines.push(`- The brief is written in ${briefLanguage.name}: act on it as written.`);
|
|
138
|
+
if (report.code !== 'en') lines.push(`- Write your notes, your expectations and the prose of the report in ${report.name}, because ${report.why}. ${QUOTE_AS_WRITTEN} Keep the report's required section headings and its JSON keys exactly as they are given.`);
|
|
139
|
+
else if (briefLanguage && briefLanguage.code !== 'en') lines.push(`- Write your notes, your expectations and the report in English (${report.why}). ${QUOTE_AS_WRITTEN}`);
|
|
122
140
|
return lines.join('\n');
|
|
123
141
|
}
|
|
124
142
|
|
|
125
143
|
function sampleLanguage(text) {
|
|
126
|
-
const t =
|
|
144
|
+
const t = gameWords(text).slice(0, 400);
|
|
127
145
|
if (!t || gameText.length >= LANGUAGE_SAMPLE_CHARS || gameText.includes(t.slice(0, 40))) return;
|
|
128
146
|
gameText = `${gameText}\n${t}`.slice(0, LANGUAGE_SAMPLE_CHARS);
|
|
129
147
|
gameLanguage = detectLanguage(gameText) || gameLanguage;
|
|
130
148
|
}
|
|
131
149
|
|
|
132
|
-
/**
|
|
133
|
-
|
|
150
|
+
/**
|
|
151
|
+
* A screen the persona was shown: whether it carries a mute, sound, music or volume control, and its text into the record
|
|
152
|
+
* the notebook's numbered notes are held to (./memory.js observe; the platform repo's docs/playtest/LONG_RUN_MEMORY.md).
|
|
153
|
+
*/
|
|
154
|
+
function seeScreen(text, action = actionsSeen) {
|
|
134
155
|
if (!soundControl && typeof text === 'string' && SOUND_CONTROL.test(text)) soundControl = true;
|
|
156
|
+
if (typeof text === 'string' && text) memory.observe({ texts: [text] }, action);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The game's own analytics events since the notebook last looked (../events.js since), into the same record: a number is
|
|
161
|
+
* held under the event's and the property's own words. The persona's cursor on the log is untouched. Answers how many were read.
|
|
162
|
+
*/
|
|
163
|
+
function seeEvents(log, action = actionsSeen) {
|
|
164
|
+
if (!log || typeof log.since !== 'function') return 0;
|
|
165
|
+
const got = log.since(eventsSeen);
|
|
166
|
+
eventsSeen = got.upTo;
|
|
167
|
+
if (got.events.length) memory.observe({ events: got.events }, action);
|
|
168
|
+
return got.events.length;
|
|
135
169
|
}
|
|
136
170
|
|
|
137
171
|
/** One played action: what kind of input it was, whether the screen changed, and the screen it was played on. */
|
|
138
172
|
function afterAction({ tool, input = {}, changed, place = '', label = '', action = 0, text = '', driverError = false }) {
|
|
139
173
|
actionsSeen = Math.max(actionsSeen, action);
|
|
140
174
|
sampleLanguage(text);
|
|
141
|
-
seeScreen(text);
|
|
175
|
+
seeScreen(text, action);
|
|
142
176
|
if (place) memory.arrive(place, action);
|
|
143
177
|
// A driver that could not carry the action out says nothing about the game's controls.
|
|
144
178
|
if (driverError || typeof changed !== 'boolean') return;
|
|
@@ -208,16 +242,40 @@ export function createLocalAnyGame({ briefText = '', controls = null, touch = fa
|
|
|
208
242
|
sound = createSoundLog({ selfTest: soundTest });
|
|
209
243
|
}
|
|
210
244
|
|
|
211
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* The page's sound numbers after an action (./sound.js readSound). Answers the action's sound, 'played' or
|
|
247
|
+
* 'silent', and `say`, the line for the persona once the game has been shown to make sound; null when the
|
|
248
|
+
* sound could not be read or is not measured here.
|
|
249
|
+
*/
|
|
212
250
|
function afterSound(action, sample, { input = true, changed = null } = {}) {
|
|
213
|
-
if (!sound || !soundTest?.ok) return;
|
|
214
|
-
sound.add(action, sample, { input, changed });
|
|
251
|
+
if (!sound || !soundTest?.ok) return null;
|
|
252
|
+
if (!sound.add(action, sample, { input, changed })) return null;
|
|
253
|
+
const state = sound.at(action);
|
|
254
|
+
return { state, say: sound.summary().madeAudio ? soundResultLine(state) : null };
|
|
215
255
|
}
|
|
216
256
|
|
|
217
|
-
/**
|
|
218
|
-
function soundFindings() {
|
|
219
|
-
|
|
220
|
-
|
|
257
|
+
/** Sound never makes a finding of its own (docs/playtest/SOUND_AND_LANGUAGES.md in the platform repo): kept for callers, always empty. */
|
|
258
|
+
function soundFindings() { return []; }
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Sound as evidence on the persona's findings: one that says an input gave no feedback, and cites an action with a
|
|
262
|
+
* sound record, is told whether a sound played at that action. Answers the report (a copy when a finding changed)
|
|
263
|
+
* and the ids it changed. Severity and everything else stay as they are.
|
|
264
|
+
*/
|
|
265
|
+
function soundEvidence(rep) {
|
|
266
|
+
if (!rep || !Array.isArray(rep.findings) || !sound || !soundTest?.ok) return { report: rep, changed: [] };
|
|
267
|
+
const changed = [];
|
|
268
|
+
const findings = rep.findings.map(f => {
|
|
269
|
+
if (!f || f.severity === 'praise' || typeof f.description !== 'string' || !FEEDBACK_CLAIM.test(`${f.title || ''} ${f.description}`)) return f;
|
|
270
|
+
const cited = (Array.isArray(f.evidence) ? f.evidence : []).map(e => /\baction (\d+)\b/.exec(String(e && e.ref || ''))).filter(Boolean).map(m => Number(m[1]));
|
|
271
|
+
const action = cited.find(a => sound.at(a));
|
|
272
|
+
if (action === undefined) return f;
|
|
273
|
+
const line = soundEvidenceLine(sound.at(action), action).replace(/\bat step\b/, 'at action');
|
|
274
|
+
if (!line || f.description.includes(line)) return f;
|
|
275
|
+
changed.push(f.id);
|
|
276
|
+
return { ...f, description: `${f.description} ${line}` };
|
|
277
|
+
});
|
|
278
|
+
return { report: changed.length ? { ...rep, findings } : rep, changed };
|
|
221
279
|
}
|
|
222
280
|
|
|
223
281
|
/** What could not be checked, as capability notes (`{ input, reason }`): never findings. */
|
|
@@ -227,7 +285,7 @@ export function createLocalAnyGame({ briefText = '', controls = null, touch = fa
|
|
|
227
285
|
// Godot's audio buses could be read through the driver addon; that is not built, so nothing is claimed.
|
|
228
286
|
if (!sound && driverName && driverName !== 'cli_stdio') notes.push({ input: 'sound', reason: `sound is not measured on ${driverName}: whether the game plays sound, and where it is silent, was not checked` });
|
|
229
287
|
if (sound) {
|
|
230
|
-
const r = localSoundReport(sound.summary(), { soundControl
|
|
288
|
+
const r = localSoundReport(sound.summary(), { soundControl });
|
|
231
289
|
const why = r.notCovered.filter(n => /not checked|could not be read/.test(n)).map(n => n.replace(/\.$/, ''));
|
|
232
290
|
notes.push({ input: 'sound', reason: why.length ? why.join('; ') : 'the runner measured whether sound played and at what level from the browser\'s audio graph; how the game sounds was not judged' });
|
|
233
291
|
}
|
|
@@ -247,10 +305,15 @@ export function createLocalAnyGame({ briefText = '', controls = null, touch = fa
|
|
|
247
305
|
const notes = memory.render({ budget: 900 });
|
|
248
306
|
if (notes) lines.push(`The notebook at the end of play:\n${notes}`);
|
|
249
307
|
if (sound) {
|
|
250
|
-
const r = localSoundReport(sound.summary(), { soundControl
|
|
308
|
+
const r = localSoundReport(sound.summary(), { soundControl });
|
|
251
309
|
if (r.facts.length) lines.push(`Sound, measured by the runner (the persona did not hear the game): ${r.facts.join(' ')} ${SOUND_LIMIT} Do not describe how the game sounds anywhere in the report.`);
|
|
310
|
+
const steps = sound.steps.map(row => [row.step, sound.at(row.step)]);
|
|
311
|
+
const played = steps.filter(([, st]) => st === 'played').map(([a]) => a), silent = steps.filter(([, st]) => st === 'silent').map(([a]) => a);
|
|
312
|
+
const few = list => (list.length > 40 ? `${list.slice(0, 40).join(', ')} and ${list.length - 40} more` : list.join(', '));
|
|
313
|
+
if (r.facts.length && steps.length) lines.push(`Sound by action, measured: a sound played at action${played.length === 1 ? '' : 's'} ${played.length ? few(played) : 'none'}; silent at ${silent.length ? few(silent) : 'none'}. Sound is evidence, never a finding on its own: when a finding says an input gave no feedback, say whether a sound played at that action.`);
|
|
252
314
|
}
|
|
253
|
-
if (report.code !== 'en') lines.push(`Write the prose of report.md and every title, description and step in report.json in ${report.name}, because ${report.why}. The required section headings of report.md, the JSON keys and the enum values stay exactly as given, in English.`);
|
|
315
|
+
if (report.code !== 'en') lines.push(`Write the prose of report.md and every title, description and step in report.json in ${report.name}, because ${report.why}. ${QUOTE_AS_WRITTEN} The required section headings of report.md, the JSON keys and the enum values stay exactly as given, in English.`);
|
|
316
|
+
else if ((briefLanguage && briefLanguage.code !== 'en') || (gameLanguage && gameLanguage.code !== 'en')) lines.push(`Write the report in English (${report.why}). ${QUOTE_AS_WRITTEN}`);
|
|
254
317
|
return lines;
|
|
255
318
|
}
|
|
256
319
|
|
|
@@ -258,7 +321,7 @@ export function createLocalAnyGame({ briefText = '', controls = null, touch = fa
|
|
|
258
321
|
return { language: { brief: briefLanguage, game: gameLanguage, report }, kind: genre.digest(), timing: { continuous: continuousTime, source: continuousTime ? 'native driver capability' : 'not asserted by this runner' }, controls: book.digest(), memory: memory.digest(), sound: sound ? sound.summary() : null, soundControl, stats: { ...stats } };
|
|
259
322
|
}
|
|
260
323
|
|
|
261
|
-
return { systemText, seeScreen, afterAction, afterNote, aside, notebook, soundAvailable, afterSound, soundFindings, capabilityNotes, reportLines, digest, memory, book, genre, get report() { return report; } };
|
|
324
|
+
return { systemText, seeScreen, seeEvents, afterAction, afterNote, aside, notebook, soundAvailable, afterSound, soundFindings, soundEvidence, capabilityNotes, reportLines, digest, memory, book, genre, get report() { return report; } };
|
|
262
325
|
}
|
|
263
326
|
|
|
264
327
|
export default { createLocalAnyGame, actionOf };
|
|
@@ -147,12 +147,15 @@ export function requestedReportLanguage(brief) {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* The language the report's prose is written in: the
|
|
151
|
-
* else the
|
|
150
|
+
* The language the report's prose is written in: the studio's (the job's
|
|
151
|
+
* `report_language`), else the one the brief names for its report, else the
|
|
152
|
+
* language the brief is written in, else English. A studio that writes its
|
|
153
|
+
* brief in Japanese and wants its reports in English sets the report language.
|
|
154
|
+
* `{ code, name, why }`.
|
|
152
155
|
*/
|
|
153
156
|
export function reportLanguage(brief, { explicit = null } = {}) {
|
|
154
157
|
const told = typeof explicit === 'string' && LANGUAGES[explicit.toLowerCase().slice(0, 2)] ? explicit.toLowerCase().slice(0, 2) : null;
|
|
155
|
-
if (told) return { code: told, name: languageName(told), why: 'the
|
|
158
|
+
if (told) return { code: told, name: languageName(told), why: 'it is the report language the studio set' };
|
|
156
159
|
const asked = requestedReportLanguage(brief);
|
|
157
160
|
if (asked) return { code: asked, name: languageName(asked), why: 'the brief asked for it' };
|
|
158
161
|
const own = detectLanguage(brief);
|
|
@@ -239,13 +242,51 @@ const GOING_ON_OTHER = ['戻る', 'もどる', '閉じる', 'とじる', 'キャ
|
|
|
239
242
|
'חזרה', 'סגור', 'ביטול', 'המשך', 'הבא', 'שחק', 'התחל', 'סיום', 'דלג',
|
|
240
243
|
'ย้อนกลับ', 'ปิด', 'ยกเลิก', 'ต่อไป', 'ถัดไป', 'เล่น', 'เริ่ม', 'เสร็จ', 'ข้าม',
|
|
241
244
|
'πίσω', 'κλείσιμο', 'ακύρωση', 'συνέχεια', 'επόμενο', 'παίξε', 'έναρξη'];
|
|
242
|
-
const
|
|
245
|
+
const escRe = w => w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
246
|
+
const GOING_ON_WORD = new RegExp(`(?<![\\p{L}\\p{N}])(?:${GOING_ON_LATIN.map(escRe).join('|')})(?![\\p{L}\\p{N}])`, 'giu');
|
|
243
247
|
|
|
244
|
-
|
|
245
|
-
|
|
248
|
+
// Move-on words that are also an input of play in their own language: Spanish
|
|
249
|
+
// and Portuguese "saltar", Portuguese "pular", Italian "salta", Turkish "atla"
|
|
250
|
+
// and Swedish "hoppa" each mean both skip and jump. A label whose only move-on
|
|
251
|
+
// word is one of these is a skip only when its context says so (below).
|
|
252
|
+
// French "sauter" is a jump and never a move-on word; "passer" only passes.
|
|
253
|
+
const GOING_ON_DOUBLE = new Set(['saltar', 'pular', 'salta', 'atla', 'hoppa']);
|
|
254
|
+
// What a skip passes over: a tutorial, an intro, a cutscene, a video, a
|
|
255
|
+
// dialogue or a story scene, in the languages above. Read in a label ("Saltar
|
|
256
|
+
// escena", "Hoppa över") or in the text the control sits with.
|
|
257
|
+
const SKIP_SCENE_WORDS = ['tutorial', 'tutoriales', 'tutoriel', 'intro', 'introduction', 'introducción', 'introduccion', 'introdução', 'introducao', 'introduzione', 'introduttivo', 'introduttiva', 'introduktion',
|
|
258
|
+
'cutscene', 'cinematic', 'cinemática', 'cinematica', 'cinématique', 'cinematique', 'escena', 'escenas', 'cena', 'cenas', 'scena', 'filmato', 'filmati', 'sequenza', 'mellansekvens', 'filmsekvens', 'ara sahne', 'sahne', 'tanıtım', 'öğretici',
|
|
259
|
+
'video', 'vídeo', 'vídeos', 'videos', 'dialog', 'dialogue', 'diálogo', 'dialogo', 'dialoghi', 'diálogos', 'dialogos', 'diyalog', 'prologue', 'prólogo', 'prologo', 'história', 'historia', 'storia', 'abertura', 'över', 'handledning',
|
|
260
|
+
'opening', 'credits', 'créditos', 'crediti'];
|
|
261
|
+
const SKIP_SCENE = new RegExp(`(?<![\\p{L}\\p{N}])(?:${SKIP_SCENE_WORDS.map(escRe).join('|')})(?![\\p{L}\\p{N}])`, 'iu');
|
|
262
|
+
|
|
263
|
+
/** Whether a text names a scene a skip passes over (a tutorial, an intro, a cutscene, a video, a dialogue), in the languages above. */
|
|
264
|
+
export const skipScene = text => SKIP_SCENE.test(fold(text));
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Whether a control's label is one that moves the player on, in any of the
|
|
268
|
+
* languages above. `context` is what is known of where it sits: `inPlay`
|
|
269
|
+
* (true when the screen is judged to be play, false when it is judged not to
|
|
270
|
+
* be, null when not known) and `near` (the screen's words and the labels
|
|
271
|
+
* beside it). A label whose only move-on word also means jump ("Saltar",
|
|
272
|
+
* "Pular", "Salta") is a skip when the label itself names what it skips, and
|
|
273
|
+
* otherwise only off play: never on a screen in play, and with nothing known
|
|
274
|
+
* only when the text it sits with names an intro, a cutscene, a tutorial or a
|
|
275
|
+
* dialogue.
|
|
276
|
+
*/
|
|
277
|
+
export function goingOn(name, context) {
|
|
246
278
|
const t = fold(name);
|
|
247
279
|
if (!t) return false;
|
|
248
|
-
|
|
280
|
+
if (GOING_ON_OTHER.some(w => t.includes(w))) return true;
|
|
281
|
+
const words = t.match(GOING_ON_WORD) || [];
|
|
282
|
+
if (words.length === 0) return false;
|
|
283
|
+
if (words.some(w => !GOING_ON_DOUBLE.has(w))) return true;
|
|
284
|
+
// Every move-on word here also means jump: the context decides.
|
|
285
|
+
if (SKIP_SCENE.test(t)) return true;
|
|
286
|
+
const { inPlay = null, near = [] } = context && typeof context === 'object' ? context : {};
|
|
287
|
+
if (inPlay === true) return false;
|
|
288
|
+
if (inPlay === false) return true;
|
|
289
|
+
return (Array.isArray(near) ? near : [near]).some(x => SKIP_SCENE.test(fold(x)));
|
|
249
290
|
}
|
|
250
291
|
|
|
251
292
|
// A test code named in a brief: "code ABC123", 「コード: 4417」, "código ABC123".
|
|
@@ -278,16 +319,26 @@ export function inBrief(words, brief) {
|
|
|
278
319
|
* The prompt lines about language: what the brief and the game are written
|
|
279
320
|
* in, how to act on a brief in one language over a game in another, and the
|
|
280
321
|
* language of the playtester's own prose. `game` is null until the screen
|
|
281
|
-
* has shown enough text to tell.
|
|
322
|
+
* has shown enough text to tell. On a run where the brief or the game is not
|
|
323
|
+
* in English the report language is always said, English included, and
|
|
324
|
+
* on-screen text is quoted as written so the claim checks can find it.
|
|
282
325
|
*/
|
|
326
|
+
// What lets a claim be matched against the page's own text in any script.
|
|
327
|
+
export const QUOTE_AS_WRITTEN = 'Quote the game\'s text (a label, a button, a tutorial line) exactly as written, in quotes, untranslated.';
|
|
328
|
+
|
|
283
329
|
export function languageLines({ brief = null, game = null, report }) {
|
|
284
330
|
const lines = [];
|
|
285
331
|
const foreign = (game && game.code !== 'en') || (brief && brief.code !== 'en');
|
|
286
332
|
const differ = game && brief && game.code !== brief.code;
|
|
333
|
+
// Until the game's language is known (once it is, the lines below say both).
|
|
334
|
+
if (brief && brief.code !== 'en' && !game) lines.push(`The brief is in ${brief.name}: act on it as written.`);
|
|
287
335
|
if (game && game.code !== 'en') lines.push(`The game's text is in ${game.name}. Read it as written and act on what it says; copy "reads" in ${game.name}, untranslated.`);
|
|
288
336
|
if (differ) lines.push(`The brief is in ${brief.name} and the game is in ${game.name}: when the brief names something (a faction, a character, a level, a mode, a button), find the option on screen that means the same in ${game.name}.`);
|
|
289
337
|
if (foreign) lines.push('When you pick something the brief names, add "chose":{"brief":"<the brief\'s words>","screen":"<the label on screen, as written>"} to that plan, so the choice can be checked against the screen.');
|
|
290
|
-
|
|
338
|
+
// Quoting as written matters where the game's words are not the report's: a quote translated is one the claim checks cannot find.
|
|
339
|
+
const quote = game ? game.code !== report?.code : Boolean(brief && brief.code !== report?.code);
|
|
340
|
+
if (report && report.code !== 'en') lines.push(`Write "thought", "expect", every "notice" and anything else you write for the studio in ${report.name}, because ${report.why}.${quote ? ` ${QUOTE_AS_WRITTEN}` : ''} Keep the JSON keys and the action names in English.`);
|
|
341
|
+
else if (report && foreign) lines.push(`Write your own words in English (${report.why}). ${QUOTE_AS_WRITTEN}`);
|
|
291
342
|
return lines;
|
|
292
343
|
}
|
|
293
344
|
|
|
@@ -333,4 +384,43 @@ export function withLanguages(base, list) {
|
|
|
333
384
|
}
|
|
334
385
|
|
|
335
386
|
/** The "moves the player on" check as a pattern-shaped object, for code that calls `.test(name)`. */
|
|
336
|
-
export const GOING_ON_ANY = Object.freeze({ test: goingOn });
|
|
387
|
+
export const GOING_ON_ANY = Object.freeze({ test: (name, context) => goingOn(name, context) });
|
|
388
|
+
|
|
389
|
+
// Phrases about the tool and its evidence, in the languages above other than
|
|
390
|
+
// English (the English lists stay where they are used: lib/notice.mjs and the
|
|
391
|
+
// CLI's personaLoop RUNNER_LIMIT_TEXT). A finding or a notice written in the
|
|
392
|
+
// report's language that talks about the testing setup is about the tool,
|
|
393
|
+
// whatever language it is in. Phrases, never a word a game also uses: no
|
|
394
|
+
// "runner", "grid", "driver", "model" or "mark" on its own.
|
|
395
|
+
const TOOL_PHRASES_OTHER = [
|
|
396
|
+
// Japanese
|
|
397
|
+
'スクリーンショット', 'スクショ', 'テストツール', 'プレイテストツール', 'テスト用ツール', 'ツールの(?:制限|限界|不具合|せい|問題)', 'ツールが(?:クリック|操作|見つけ|認識|押せ|送れ)', 'ヘッドレス', 'テスト環境', '自動テスト', '描画された(?:マーク|印|番号|枠)', '重ねられた(?:マーク|印|番号|枠)', 'マークが(?:重な|かぶ|邪魔)', 'モデル呼び出し',
|
|
398
|
+
// Chinese
|
|
399
|
+
'截图', '截圖', '截屏', '测试工具', '測試工具', '工具的(?:限制|问题|問題)', '无头浏览器', '無頭瀏覽器', '测试环境', '測試環境',
|
|
400
|
+
// Korean
|
|
401
|
+
'스크린샷', '테스트 도구', '도구의 (?:한계|제한|문제)', '헤드리스', '테스트 환경',
|
|
402
|
+
// Russian and Ukrainian
|
|
403
|
+
'скриншот\\p{L}*', 'снимк\\p{L}* экрана', 'инструмент\\p{L}* (?:тестирования|для тестов|плейтеста)', 'тестов\\p{L}* (?:инструмент|сред|окружени)\\p{L}*', 'ограничени\\p{L}* инструмент\\p{L}*', 'безголов\\p{L}* браузер\\p{L}*', 'наложенн\\p{L}* (?:метк|номер|рамк)\\p{L}*', 'вызов\\p{L}* модели', 'інструмент\\p{L}* тестування',
|
|
404
|
+
// Spanish and Portuguese
|
|
405
|
+
'herramienta(?:s)? de (?:prueba|pruebas|testeo|playtest)', 'limitaci[oó]n(?:es)? de la herramienta', 'la herramienta (?:no|falló|fallo)', 'captura(?:s)? de (?:pantalla|tela)', 'entorno de prueba(?:s)?', 'navegador sin interfaz', 'marcas? (?:dibujadas|superpuestas|numeradas)', 'llamada al modelo', 'ferramenta de teste', 'ambiente de teste',
|
|
406
|
+
// French, German, Italian, Dutch, Polish, Turkish
|
|
407
|
+
'outil de test', "capture(?:s)? d'[ée]cran", 'environnement de test', 'navigateur sans t[êe]te', 'testwerkzeug', 'testumgebung', 'bildschirmfoto', 'strumento di test', 'ambiente di test', 'testtool', 'narzędzi\\p{L}* testow\\p{L}*', 'zrzut\\p{L}* ekranu', 'test aracı', 'ekran görüntüsü'
|
|
408
|
+
];
|
|
409
|
+
// Latin, Cyrillic and Greek phrases stand as words; the rest match where they are written.
|
|
410
|
+
const boundedPhrase = p => (/^[\p{Script=Latin}\p{Script=Cyrillic}\p{Script=Greek}\s'()?:|\\\[\]\-*]+$/u.test(p.replace(/\\p\{L\}/g, '')) ? `(?<![\\p{L}])(?:${p})(?![\\p{L}])` : `(?:${p})`);
|
|
411
|
+
export const TOOL_TEXT_OTHER = new RegExp(TOOL_PHRASES_OTHER.map(boundedPhrase).join('|'), 'iu');
|
|
412
|
+
|
|
413
|
+
// "There is no sound" and "the game is silent" in the languages above: the
|
|
414
|
+
// local persona hears nothing, so it is about the tool (the English rule is
|
|
415
|
+
// the CLI's personaLoop RUNNER_LIMIT_TEXT); measured sound is the runner's.
|
|
416
|
+
const NO_SOUND_PHRASES_OTHER = [
|
|
417
|
+
'音が(?:ない|無い|出ない|鳴らない|しない)', '音がありません', '音が出ません', '無音', 'サウンドが(?:ない|無い|出ない)', 'BGMが(?:ない|無い|流れない)',
|
|
418
|
+
'没有(?:声音|音效|音乐)', '沒有(?:聲音|音效|音樂)', '소리가 (?:없|안 나)',
|
|
419
|
+
'нет (?:звука|звуков|музыки)', 'без звука', 'звук\\p{L}* (?:нет|отсутству\\p{L}*)', '(?:игра|она) (?:беззвучн\\p{L}*|молчит)',
|
|
420
|
+
'no hay (?:sonido|música|efectos de sonido)', 'sin (?:sonido|audio|música)', '(?:el juego|es) (?:silencioso|mudo)', 'sem (?:som|áudio|música)',
|
|
421
|
+
'pas de (?:son|musique)', 'aucun son', 'kein (?:ton|sound|musik)', 'keine (?:musik|geräusche|soundeffekte)', 'nessun (?:suono|audio)', 'senza (?:suono|audio)'
|
|
422
|
+
];
|
|
423
|
+
export const NO_SOUND_OTHER = new RegExp(NO_SOUND_PHRASES_OTHER.map(boundedPhrase).join('|'), 'iu');
|
|
424
|
+
|
|
425
|
+
/** Whether a judgement written in a language other than English is about the testing setup and not the game. */
|
|
426
|
+
export const aboutToolOther = said => TOOL_TEXT_OTHER.test(norm(said));
|
|
@@ -23,9 +23,20 @@
|
|
|
23
23
|
// with a count of what was left out. So a plan's prompt has a fixed ceiling
|
|
24
24
|
// and the memory costs no call of its own.
|
|
25
25
|
//
|
|
26
|
+
// Held to the record (docs/playtest/LONG_RUN_MEMORY.md): a note of the
|
|
27
|
+
// playtester's own that states a number is carried into a plan only once the
|
|
28
|
+
// run's record holds that number (the same rule as the notes one run hands the
|
|
29
|
+
// next, ./gamenotes.mjs holdToRecord). The record grows as the run goes
|
|
30
|
+
// (`observe`: the game's text on screen, what was copied off it as written, the
|
|
31
|
+
// game's own events under their own words) and is bounded; a note not yet held
|
|
32
|
+
// waits, and one held stays held. The counters are the playtester's own
|
|
33
|
+
// readings of the screens and are said as such.
|
|
34
|
+
//
|
|
26
35
|
// Pure: no I/O, no page, no model. The same file is carried by the hosted runner
|
|
27
36
|
// (the platform repo, infrastructure/hosted-playtest/direct-runner/lib/anygame/memory.mjs).
|
|
28
37
|
|
|
38
|
+
import { holdToRecord, recordNumbers, withoutSteps } from './gamenotes.js';
|
|
39
|
+
|
|
29
40
|
export const MEMORY_MAX_CHARS = 1200;
|
|
30
41
|
export const FACT_MAX_CHARS = 90;
|
|
31
42
|
export const ABOUT_MAX_CHARS = 120;
|
|
@@ -41,6 +52,14 @@ export const MAX_PLACES = 80;
|
|
|
41
52
|
export const MAX_FAILS = 200;
|
|
42
53
|
// How alike two notes must be to be one note (share of their words in common).
|
|
43
54
|
export const SAME_NOTE = 0.7;
|
|
55
|
+
// The run's record a note's number may rest on, at most: plain numbers the game showed, the words its events sent numbers
|
|
56
|
+
// under, and the numbers kept a word. The least recently seen give way. And how much one look is read for numbers.
|
|
57
|
+
export const RECORD_MAX_NUMBERS = 400;
|
|
58
|
+
export const RECORD_MAX_WORDS = 80;
|
|
59
|
+
export const RECORD_MAX_VALUES = 16;
|
|
60
|
+
export const OBSERVE_MAX_CHARS = 4000;
|
|
61
|
+
export const OBSERVE_MAX_TEXTS = 60;
|
|
62
|
+
export const OBSERVE_MAX_EVENTS = 200;
|
|
44
63
|
|
|
45
64
|
const norm = s => String(s ?? '').normalize('NFKC');
|
|
46
65
|
/** A note's text made safe to carry: one line, no braces or quotes that could be read as structure. */
|
|
@@ -93,14 +112,46 @@ export function createMemory({ maxChars = MEMORY_MAX_CHARS } = {}) {
|
|
|
93
112
|
const notices = [];
|
|
94
113
|
const choices = [];
|
|
95
114
|
let now = null;
|
|
96
|
-
const stats = { renders: 0, compactions: 0, maxRendered: 0, leftOut: 0, factsDropped: 0, learned: 0, repeats: 0 };
|
|
115
|
+
const stats = { renders: 0, compactions: 0, maxRendered: 0, leftOut: 0, factsDropped: 0, learned: 0, repeats: 0, heldLater: 0 };
|
|
116
|
+
// The run's record, as holdToRecord reads one: `any` the numbers the game showed or said, `keyed` the numbers its own events
|
|
117
|
+
// sent, by word. Maps in the order last seen, so the least recently seen is the first to give way.
|
|
118
|
+
const record = { any: new Map(), keyed: new Map() };
|
|
119
|
+
const keep = (map, key, value, cap) => { map.delete(key); map.set(key, value); if (map.size > cap) map.delete(map.keys().next().value); };
|
|
120
|
+
|
|
121
|
+
/** Whether the record holds every number a note of the playtester's states (a step it names is the runner's, not the note's). */
|
|
122
|
+
const holds = text => holdToRecord([{ basis: 'playtester', text: withoutSteps(text) }], record).kept.length === 1;
|
|
123
|
+
|
|
124
|
+
/** Notes still waiting on the record, looked at again after it grew. Once held, a note stays held. */
|
|
125
|
+
function recheck() {
|
|
126
|
+
for (const f of facts) if (!f.held && holds(f.text)) { f.held = true; stats.heldLater++; }
|
|
127
|
+
if (about && !about.held && holds(about.text)) about.held = true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* What the run's record now holds: `texts` the game's own words (its text on screen, what was copied off the screen as
|
|
132
|
+
* written, what it said), `events` the game's own analytics events (`{ name, props }`). Bounded per call and in all.
|
|
133
|
+
*/
|
|
134
|
+
function observe({ texts = [], events = [] } = {}, step = 0) {
|
|
135
|
+
const t = (Array.isArray(texts) ? texts : []).filter(x => typeof x === 'string' && x).slice(0, OBSERVE_MAX_TEXTS).map(x => x.slice(0, OBSERVE_MAX_CHARS));
|
|
136
|
+
const e = (Array.isArray(events) ? events : []).filter(x => x && typeof x === 'object').slice(-OBSERVE_MAX_EVENTS);
|
|
137
|
+
if (!t.length && !e.length) return false;
|
|
138
|
+
const r = recordNumbers({ texts: t, events: e });
|
|
139
|
+
for (const n of r.any) keep(record.any, n, step, RECORD_MAX_NUMBERS);
|
|
140
|
+
for (const [w, values] of r.keyed) {
|
|
141
|
+
const held = record.keyed.get(w) || new Map();
|
|
142
|
+
for (const n of values) keep(held, n, step, RECORD_MAX_VALUES);
|
|
143
|
+
keep(record.keyed, w, held, RECORD_MAX_WORDS);
|
|
144
|
+
}
|
|
145
|
+
if (r.any.size || r.keyed.size) recheck();
|
|
146
|
+
return r.any.size > 0 || r.keyed.size > 0;
|
|
147
|
+
}
|
|
97
148
|
|
|
98
149
|
/** What the game is, as the planner put it. The first account stands until a later one says more. */
|
|
99
150
|
function setAbout(text, step = 0) {
|
|
100
151
|
const t = cleanNote(text, ABOUT_MAX_CHARS);
|
|
101
152
|
if (t.length < 4) return false;
|
|
102
153
|
if (about && t.length <= about.text.length && alike(t, about.text) >= 0.5) return false;
|
|
103
|
-
about = { text: t, step, first: about ? about.first : step };
|
|
154
|
+
about = { text: t, step, first: about ? about.first : step, held: holds(t) };
|
|
104
155
|
return true;
|
|
105
156
|
}
|
|
106
157
|
|
|
@@ -115,11 +166,13 @@ export function createMemory({ maxChars = MEMORY_MAX_CHARS } = {}) {
|
|
|
115
166
|
same.seen++; same.lastStep = step; stats.repeats++;
|
|
116
167
|
return false;
|
|
117
168
|
}
|
|
118
|
-
|
|
169
|
+
// A tutorial is the game's own words, copied: it is part of the record, as the end of a run already counts it.
|
|
170
|
+
if (kind === 'tutorial') observe({ texts: [text] }, step);
|
|
171
|
+
facts.push({ kind, text, tokens, firstStep: step, lastStep: step, seen: 1, place: place || null, held: kind === 'tutorial' || holds(text) });
|
|
119
172
|
stats.learned++;
|
|
120
173
|
if (facts.length > MAX_FACTS) {
|
|
121
|
-
//
|
|
122
|
-
const order = facts.map((f, i) => ({ f, i })).filter(x => x.i >= 8).sort((a, b) => (a.f.seen - b.f.seen) || (a.f.lastStep - b.f.lastStep));
|
|
174
|
+
// A note still waiting on the record gives way first, then the least confirmed one not seen lately; the first notes of the run stay.
|
|
175
|
+
const order = facts.map((f, i) => ({ f, i })).filter(x => x.i >= 8).sort((a, b) => (a.f.held - b.f.held) || (a.f.seen - b.f.seen) || (a.f.lastStep - b.f.lastStep));
|
|
123
176
|
facts.splice(order[0].i, 1);
|
|
124
177
|
stats.factsDropped++;
|
|
125
178
|
}
|
|
@@ -235,10 +288,12 @@ export function createMemory({ maxChars = MEMORY_MAX_CHARS } = {}) {
|
|
|
235
288
|
const caps = LEVELS[level];
|
|
236
289
|
const out = [];
|
|
237
290
|
let left = 0;
|
|
238
|
-
if (about) out.push(`The game: ${shorten(about.text, caps.about)}`);
|
|
291
|
+
if (about?.held) out.push(`The game: ${shorten(about.text, caps.about)}`);
|
|
292
|
+
// Only what the record holds is carried; the rest waits (one line, near the end).
|
|
293
|
+
const carried = facts.filter(f => f.held);
|
|
239
294
|
// Dead ends the planner named, then the ones the runner measured, the current place's first.
|
|
240
295
|
const dead = [];
|
|
241
|
-
const named = pick(
|
|
296
|
+
const named = pick(carried.filter(f => f.kind === 'dead_end'), Math.ceil(caps.dead / 2));
|
|
242
297
|
left += named.left;
|
|
243
298
|
for (const f of named.kept) dead.push(`${shorten(f.text, caps.fact)} (step ${f.firstStep}${f.lastStep > f.firstStep ? `, again at ${f.lastStep}` : ''})`);
|
|
244
299
|
const byPlace = new Map();
|
|
@@ -254,14 +309,14 @@ export function createMemory({ maxChars = MEMORY_MAX_CHARS } = {}) {
|
|
|
254
309
|
// One line per heading; the kinds that share a heading share its room.
|
|
255
310
|
for (const head of [...new Set(KIND_HEADS.map(([, h]) => h))]) {
|
|
256
311
|
const kinds = KIND_HEADS.filter(([, h]) => h === head).map(([k]) => k);
|
|
257
|
-
const r = pick(
|
|
312
|
+
const r = pick(carried.filter(f => kinds.includes(f.kind)), head === 'Learned' ? caps.rules : Math.max(1, Math.ceil(caps.rules / 2)));
|
|
258
313
|
left += r.left;
|
|
259
314
|
if (r.kept.length) out.push(`${head}: ${r.kept.map(f => `${shorten(f.text, caps.fact)} (step ${f.firstStep}${f.seen > 1 ? `, confirmed ${f.seen} times` : ''})`).join('; ')}`);
|
|
260
315
|
}
|
|
261
316
|
if (choices.length) out.push(`Chosen for the brief: ${choices.slice(-4).map(c => `${c.brief} = ${c.screen}`).join('; ')}`);
|
|
262
317
|
const ev = [events.level_done.length ? `${plural(events.level_done.length, 'level')} finished (last at step ${events.level_done.at(-1).step})` : '', events.won.length ? `${plural(events.won.length, 'win')} (last at step ${events.won.at(-1).step})` : '', events.game_over.length ? `${plural(events.game_over.length, 'loss', 'losses')} (last at step ${events.game_over.at(-1).step}${events.game_over.at(-1).place ? ` on ${placeLabel(events.game_over.at(-1).place)}` : ''})` : ''].filter(Boolean);
|
|
263
318
|
if (events.ended.length) ev.push(`the game's end reached ${plural(events.ended.length, 'time')} (last at step ${events.ended.at(-1).step})`);
|
|
264
|
-
if (ev.length) out.push(`
|
|
319
|
+
if (ev.length) out.push(`Your own readings of the screens so far: ${ev.join(', ')}`);
|
|
265
320
|
if (places.size) {
|
|
266
321
|
const all = [...places.entries()].sort((a, b) => b[1].lastStep - a[1].lastStep);
|
|
267
322
|
const shown = all.slice(0, caps.places);
|
|
@@ -269,6 +324,8 @@ export function createMemory({ maxChars = MEMORY_MAX_CHARS } = {}) {
|
|
|
269
324
|
out.push(`Places seen, newest first: ${shown.map(([k, p]) => `${p.label}${k === now ? ' (now)' : how(k)}`).join('; ')}${all.length > shown.length ? `; and ${all.length - shown.length} more` : ''}`);
|
|
270
325
|
}
|
|
271
326
|
if (notices.length) out.push(`Already reported, do not report these again: ${notices.slice(-caps.notices).map(n => shorten(n.title, caps.fact)).join('; ')}${notices.length > caps.notices ? `; and ${notices.length - caps.notices} more` : ''}`);
|
|
327
|
+
const waiting = facts.length - carried.length + (about && !about.held ? 1 : 0);
|
|
328
|
+
if (waiting > 0) out.push(`(${plural(waiting, 'note')} you wrote kept back until a screen or the game's events show the number ${waiting === 1 ? 'it states' : 'they state'})`);
|
|
272
329
|
if (left > 0) out.push(`(${plural(left, 'older note')} left out for room)`);
|
|
273
330
|
return { out, left };
|
|
274
331
|
}
|
|
@@ -312,9 +369,9 @@ export function createMemory({ maxChars = MEMORY_MAX_CHARS } = {}) {
|
|
|
312
369
|
function digest() {
|
|
313
370
|
return {
|
|
314
371
|
about: about ? about.text : null,
|
|
315
|
-
learned: facts.filter(f => f.kind !== 'dead_end').slice(0, 40).map(f => ({ kind: f.kind, text: f.text, firstStep: f.firstStep, lastStep: f.lastStep, seen: f.seen })),
|
|
372
|
+
learned: facts.filter(f => f.kind !== 'dead_end').slice(0, 40).map(f => ({ kind: f.kind, text: f.text, firstStep: f.firstStep, lastStep: f.lastStep, seen: f.seen, held: f.held })),
|
|
316
373
|
deadEnds: [
|
|
317
|
-
...facts.filter(f => f.kind === 'dead_end').slice(0, 20).map(f => ({ source: 'playtester', text: f.text, firstStep: f.firstStep, lastStep: f.lastStep, seen: f.seen })),
|
|
374
|
+
...facts.filter(f => f.kind === 'dead_end').slice(0, 20).map(f => ({ source: 'playtester', text: f.text, firstStep: f.firstStep, lastStep: f.lastStep, seen: f.seen, held: f.held })),
|
|
318
375
|
...[...fails.values()].filter(f => f.n >= DEAD_END_AFTER).sort((a, b) => b.n - a.n).slice(0, 20).map(f => ({ source: 'measured', place: f.label, input: f.input, times: f.n, firstStep: f.firstStep, lastStep: f.lastStep }))
|
|
319
376
|
],
|
|
320
377
|
places: [...places.values()].sort((a, b) => a.firstStep - b.firstStep).slice(0, 40).map(p => ({ label: p.label, firstStep: p.firstStep, visits: p.visits })),
|
|
@@ -322,9 +379,9 @@ export function createMemory({ maxChars = MEMORY_MAX_CHARS } = {}) {
|
|
|
322
379
|
choices: choices.map(c => ({ ...c })),
|
|
323
380
|
events: { levelsFinished: events.level_done.length, losses: events.game_over.length, wins: events.won.length, endings: events.ended.length },
|
|
324
381
|
reported: notices.map(n => ({ title: n.title, step: n.step })),
|
|
325
|
-
stats: { ...stats, maxChars, notes: facts.length, places: places.size }
|
|
382
|
+
stats: { ...stats, maxChars, notes: facts.length, places: places.size, held: facts.filter(f => f.held).length, waiting: facts.filter(f => !f.held).length, recordNumbers: record.any.size, recordWords: record.keyed.size, recordValues: [...record.keyed.values()].reduce((n, v) => n + v.size, 0) }
|
|
326
383
|
};
|
|
327
384
|
}
|
|
328
385
|
|
|
329
|
-
return { setAbout, learn, failed, worked, arrive, event, chose, noticed, reported, render, digest, empty, counters: () => ({ levels: events.level_done.length, losses: events.game_over.length, wins: events.won.length, endings: events.ended.length }), get place() { return now ? placeLabel(now) : null; }, get stats() { return { ...stats }; } };
|
|
386
|
+
return { setAbout, learn, observe, failed, worked, arrive, event, chose, noticed, reported, render, digest, empty, counters: () => ({ levels: events.level_done.length, losses: events.game_over.length, wins: events.won.length, endings: events.ended.length }), get place() { return now ? placeLabel(now) : null; }, get stats() { return { ...stats }; } };
|
|
330
387
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"comment": "Hashes of the files shared by the hosted runner (lib/anygame/*.mjs including gamenotes, and lib/claimwords.mjs, lib/events.mjs, lib/eventclaims.mjs) and the local CLI (src/run/anygame/*.js, and src/run/claimwords.js, src/run/events.js, src/run/eventclaims.js), taken over the code both carry (see shared.mjs or shared.js). The same file in both repos: update it in both, after copying the change.",
|
|
3
3
|
"files": {
|
|
4
|
-
"language": "
|
|
5
|
-
"memory": "
|
|
4
|
+
"language": "2b95828c77a8e82440c53d330381b7ba830796312d2ae9b7edc8fd95ff72e1ef",
|
|
5
|
+
"memory": "7cab932cd9e23ee84aa4f60d14b89e4ce2e4b0b9fc6e87c963b2d04e084256b8",
|
|
6
6
|
"controlbook": "1b388c0dd0c60f332131a095cf89eb4ee181671c60a2b4e45750a0a918c6ea9e",
|
|
7
7
|
"genre": "a52359537d277a59976bc6ce77fbc1e21303f10861ff77226164a9884d2b543b",
|
|
8
|
-
"sound": "
|
|
9
|
-
"gamenotes": "
|
|
10
|
-
"claimwords": "
|
|
11
|
-
"events": "
|
|
12
|
-
"eventclaims": "
|
|
8
|
+
"sound": "bc1264cb971417f4c6c6966ecba217721e59bc30dc069b48ade0bf8174e1444e",
|
|
9
|
+
"gamenotes": "f0ab9c9be900c17824d6e37beeead7210bfe280573860e4d0ecd4ac2edd36678",
|
|
10
|
+
"claimwords": "6cd99897a09dae67d0b657a110476fb0f8b27ae4124da9c60b79b2b0d28133b7",
|
|
11
|
+
"events": "8b1cbb4cf48b1e1e1f1de064e2f3cbf4ecd8473d4a518c20caa3c8953a3a1708",
|
|
12
|
+
"eventclaims": "11dfdd3e0928447ce3e21408c7b2f9eedb499e92ada39ca8b48222646cadc23b"
|
|
13
13
|
}
|
|
14
14
|
}
|