Skip to content

Standardize shared adaptive staircase integration across games#74

Merged
acrosman merged 10 commits intomainfrom
copilot/validate-game-difficulty-consistency
Apr 23, 2026
Merged

Standardize shared adaptive staircase integration across games#74
acrosman merged 10 commits intomainfrom
copilot/validate-game-difficulty-consistency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

Difficulty progression was inconsistent across games: at least two games did not follow the shared rule of +1 level after 3 consecutive correct and -2 levels after 3 consecutive wrong. This PR completes the service adoption by ensuring all streak-based games use the shared staircase service, while preserving Otter Stop’s intended game-specific advancement semantics.

  • Shared adaptive staircase service

    • Added app/components/adaptiveDifficultyService.js to centralize streak-based difficulty transitions.
    • Added focused unit coverage in app/components/tests/adaptiveDifficultyService.test.js.
  • Game logic fixes and full service adoption

    • All streak-based games now leverage the shared service for staircase transitions:
      • app/games/otter-stop/game.js
      • app/games/field-of-view/game.js
      • app/games/directional-processing/game.js
      • app/games/sound-sweep/game.js
      • app/games/object-track/game.js
      • app/games/high-speed-memory/game.js
      • app/games/orbit-sprite-memory/game.js
      • app/games/fast-piggie/game.js
    • Preserved each game’s domain-specific difficulty representation while centralizing the streak transition logic.
    • Otter Stop follow-up fix: level-up progression is gated to correct no-go inhibitions (as intended), while any wrong response (false alarm on no-go or miss on go) contributes to the 3-wrong drop path.
  • Behavioral test updates

    • Updated game tests to assert standardized staircase behavior where impacted:
      • app/games/otter-stop/tests/game.test.js
      • app/games/field-of-view/tests/game.test.js
    • Added/adjusted Otter Stop tests to enforce no-go-gated advancement and wrong-streak regression behavior.
    • Existing tests for other games validate unchanged functional behavior after refactor.
    • Added shared-service tests to lock in cross-game behavior contract.
  • UI copy alignment (Field of View)

    • Updated player-facing guidance/messages to describe adaptive behavior clearly:
      • app/games/field-of-view/interface.html
      • app/games/field-of-view/index.js
const staircaseState = updateAdaptiveDifficultyState({
  value: level,
  wasCorrect: correct,
  consecutiveCorrect,
  consecutiveWrong,
  increaseAfter: 3,
  decreaseAfter: 3,
  harderStep: 1,
  easierStep: -2,
  minValue: 0,
});

Screenshot

Copilot AI linked an issue Apr 17, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix game difficulty inconsistency after answer sequences Standardize 3-correct/3-wrong adaptive difficulty across games Apr 17, 2026
Copilot AI requested a review from acrosman April 17, 2026 02:25
Copy link
Copy Markdown
Owner

@acrosman acrosman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like only the games in the issues were updated. But the whole point of a service like this is to support all games consistently. Ensure all games mirror the patterns by making sure they all leverage the service correctly.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

Looks like only the games in the issues were updated. But the whole point of a service like this is to support all games consistently. Ensure all games mirror the patterns by making sure they all leve...

Implemented in 57b201f (with follow-up alignment in 22b6732): all streak-based games now use the shared adaptiveDifficultyService for staircase transitions, including Directional Processing, Sound Sweep, Object Track, High Speed Memory, Orbit Sprite Memory, and Fast Piggie (Otter Stop and Field of View were already using it). Verified with targeted game tests, lint, full test suite, and final validation.

Copilot AI requested a review from acrosman April 18, 2026 01:56
Copy link
Copy Markdown
Owner

@acrosman acrosman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most games work right but Otter Stop wasn't integrated into the new service correctly. Now every response is graded as right or wrong to advance the level. It should wait until a no-go image comes around to check for advancing. Any wrong answer (selecting no-go or timing out on an otter) should be used for going back levels.

/** Current difficulty level. */
let level = 0;

/** Consecutive correct-response streak (counts correct no-go inhibitions only). */
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was important (the functionality not the comment).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8ba811d (refined in dd5fe8a). The no-go-gated advancement behavior has been restored while keeping shared service integration for staircase transitions. Screenshot:


if (correct) {
score += 1;
consecutiveWrong = 0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not have been removed. The game should only count right answers for advancement when a no-go comes around.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 8ba811d (refined in dd5fe8a). Correct streak advancement is now gated to correct no-go trials again, and targeted Otter Stop tests were updated to enforce it. Screenshot:

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 19, 2026

Most games work right but Otter Stop wasn't integrated into the new service correctly. Now every response is graded as right or wrong to advance the level. It should wait until a no-go image comes aro...

Addressed in 8ba811d (plus cleanup in dd5fe8a). Otter Stop now only advances on correct no-go inhibitions, while any wrong response (no-go false alarm or go timeout) contributes to the 3-wrong level drop path through the shared service. Screenshot:

Copilot AI changed the title Standardize 3-correct/3-wrong adaptive difficulty across games Standardize shared adaptive staircase integration across games Apr 19, 2026
Copilot AI requested a review from acrosman April 19, 2026 01:26
@acrosman acrosman marked this pull request as ready for review April 23, 2026 01:56
@acrosman acrosman dismissed their stale review April 23, 2026 01:57

Changes complete

@acrosman acrosman merged commit 5933776 into main Apr 23, 2026
6 checks passed
@acrosman acrosman deleted the copilot/validate-game-difficulty-consistency branch April 23, 2026 01:59
@acrosman
Copy link
Copy Markdown
Owner

@copilot During release build the Windows build process throws an error:

D:\a\BrainSpeedExercises\BrainSpeedExercises\node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at wrapSafe (node:internal/modules/cjs/loader:1763:18)
    at Module._compile (node:internal/modules/cjs/loader:1804:20)
    at Object..js (node:internal/modules/cjs/loader:1961:10)
    at Module.load (node:internal/modules/cjs/loader:1553:32)
    at Module._load (node:internal/modules/cjs/loader:1355:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
    at node:internal/main/run_main_module:33:47

Node.js v24.15.0
Error: Process completed with exit code 1.

How can we fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate Game Difficulty Consistancy

2 participants