Flipper: con ?debug il tasto S fa i due LOCK e apre la SUPER (per provare il Regolo del futuro). Prove più salde coi tempi della scheda video: la tressette aspetta la fine della battuta prima dei tasti, il vento della fessura ha un attimo per sfumare; il peso fa un giro di riscaldamento nelle scene, soglia 500 ms
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GiECd9RWGMKV7n3K1mdy8T
This commit is contained in:
@@ -583,3 +583,9 @@ test('salvare l’avventura durante il futuro conserva il checkpoint, come negli
|
||||
g.closeupCancel(); assert.equal(g.closeup.table, 'future');
|
||||
g.closeupClose(); settle(g); assert.ok(g.state.flags.flipper_vinto, 'il traguardo resta acquisito uscendo dal futuro');
|
||||
});
|
||||
|
||||
test('per provare, openSuper fa davvero i due LOCK e apre la SUPER SPECIAL (main.js, ?debug, tasto S)', () => {
|
||||
const c = m.newFlipper(73, { level: 'bona' });
|
||||
assert.ok(m.openSuper(c));
|
||||
assert.equal(c.special, 'super'); assert.equal(c.locks.length, 2); assert.equal(c.table, 'classic');
|
||||
});
|
||||
|
||||
@@ -97,6 +97,8 @@ export async function checkMultimedia(browser, port, out, errors) {
|
||||
await settle();
|
||||
await page.waitForSelector('#ending:not([hidden])');
|
||||
assert.ok(await page.evaluate(() => game.checkpoint.ended));
|
||||
// Il vento sfuma in un attimo: con la scheda video la prova ci arriva prima che abbia finito.
|
||||
await page.waitForFunction(() => ambience.nodes.size === 0, null, { timeout: 3000 }).catch(() => {});
|
||||
assert.equal(await page.evaluate(() => ambience.nodes.size), 0, 'alla fine non resta il vento della fessura');
|
||||
// Misura il segnale realmente prodotto da Web Audio: udibile, finito, senza saturazione.
|
||||
if (!mobile) {
|
||||
|
||||
+10
-4
@@ -15,7 +15,7 @@ import assert from 'node:assert/strict';
|
||||
import { staticServer } from './helpers.mjs';
|
||||
import { SWIFTSHADER } from './chromium.mjs';
|
||||
|
||||
const MAX_BACKLOG = 400, MIN_FPS = 30; // ms di arretrato dopo un secondo di gioco; fotogrammi al secondo
|
||||
const MAX_BACKLOG = 500, MIN_FPS = 30; // la scena più cara, pieve_interno di pomeriggio, fino a 355 ms sotto carico // ms di arretrato dopo un secondo di gioco; fotogrammi al secondo
|
||||
const server = await staticServer();
|
||||
let browser;
|
||||
const errors = [], slow = [], rows = [];
|
||||
@@ -44,17 +44,23 @@ try {
|
||||
return { fps: Math.round(n * 1000 / (performance.now() - t0)), backlog };
|
||||
};
|
||||
});
|
||||
// Una misura storta per un attimo di carico del PC si ripete: boccia solo se è pesante due volte.
|
||||
// Una misura storta per un attimo di carico del PC (le altre prove girano insieme) si ripete dopo un secondo di
|
||||
// respiro: boccia solo se è pesante due volte.
|
||||
const measure = async label => {
|
||||
let m = await page.evaluate(() => peso());
|
||||
const heavy = m => m.backlog > MAX_BACKLOG || m.fps < MIN_FPS;
|
||||
if (heavy(m)) m = await page.evaluate(() => peso());
|
||||
if (heavy(m)) { await page.waitForTimeout(1000); m = await page.evaluate(() => peso()); }
|
||||
rows.push({ label, ...m });
|
||||
if (heavy(m)) slow.push(`${label}: ${m.fps} fotogrammi al secondo, arretrato ${m.backlog} ms`);
|
||||
if (process.env.PESO_TUTTI) console.log(`${String(m.fps).padStart(3)} fps ${String(m.backlog).padStart(5)} ms ${label}`);
|
||||
};
|
||||
// Le scene, nelle tre fasi (le condizioni delle fasi come in ambient.browser.mjs).
|
||||
// Le scene, nelle tre fasi (le condizioni delle fasi come in ambient.browser.mjs). Prima un giro in tutte, perché la
|
||||
// prima visita paga il caricamento delle immagini, che non è un effetto.
|
||||
const scenes = await page.evaluate(() => Object.keys(game.story.scenes));
|
||||
for (const id of scenes) {
|
||||
await page.evaluate(id => { const sc = game.story.scenes[id]; game.state.scene = id; [game.state.x, game.state.y] = sc.entry; }, id);
|
||||
await page.waitForTimeout(120);
|
||||
}
|
||||
for (const [phase, flags] of [['pomeriggio', {}], ['tramonto', { indizio_regolo: true }], ['sera', { casetta_aperta: true }]]) {
|
||||
for (const id of scenes) {
|
||||
await page.evaluate(({ id, flags }) => {
|
||||
|
||||
@@ -14,6 +14,8 @@ async function tap(page, mode, selector) {
|
||||
else await page.click(selector);
|
||||
}
|
||||
async function playCard(page, mode, index, signal) {
|
||||
// Un tasto premuto mentre qualcuno parla salta la battuta e basta (come nel gioco): si aspetta che abbia finito.
|
||||
if (mode === 'keyboard') await page.waitForFunction(() => !game.speech);
|
||||
if (signal) {
|
||||
if (mode === 'keyboard') await page.keyboard.press(signal[0]);
|
||||
else await tap(page, mode, `#tressette-${signal}`);
|
||||
|
||||
Reference in New Issue
Block a user