Skip to content

add BDSP blink model and state solver - #1386

Merged
Mysticial merged 1 commit into
PokemonAutomation:mainfrom
theastrogoth:bdsp-state-solver
Aug 14, 2026
Merged

add BDSP blink model and state solver#1386
Mysticial merged 1 commit into
PokemonAutomation:mainfrom
theastrogoth:bdsp-state-solver

Conversation

@theastrogoth

@theastrogoth theastrogoth commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

These are the parts that connect blinks to the RNG state

BlinkModel

Separate logic for humanoids and Pokemon

  • Humanoids advance the RNG on every tick (~1.017s) and roll to decide if they perform a blink, double blink, or nothing
  • Pokemon advance the RNG to decide how long their inter-blink intervals are (between 3 and 12 seconds)
  • If the RNG state is known, the timing of future RNG advances can be determined based on the number of Pokemon and NPCs that are blinking, even if they can't be detected or measured (like the Starly at lake Verity before picking a starter)

BlinkExtraction

Converts raw info from the detectors to BlinkSamples

  • blink_depths() normalizes match scores by the median across the entire capture and clamping to [0,1]. Lower means more likely to be a blink
  • auto_blink_threshold() picks a threshold for blink "depth" for deciding where blinks occur. The threshold is chosen by looking for a plateau where small changes to the threshold do not affect the total blink count
  • extract_blinks() lumps adjacent frames beneath the threshold into a single Blink
  • group_blinks() labels blinks that are close together as double blinks
  • fit_tick_period() uses the blinks to pick an RNG tick rate that most closely matches the observed info
  • build_samples() assigns advances to each tick during the observation period and labels where blinks occurred (at of what type)

StateSolver

Recovers the RNG state based on observations

  • separate functions for dealing with humanoid or Pokemon blinks
  • after determining the RNG state, extra blink samples are corrected to confirm it

StateReidentifier

If the RNG state has been previously determined, get a new number of advances

  • takes fewer equations to solve, so it needs fewer blinks
  • separate functions for Pokemon and humanoid blinks

@Mysticial
Mysticial merged commit 457c97f into PokemonAutomation:main Aug 14, 2026
6 of 7 checks passed
@theastrogoth
theastrogoth deleted the bdsp-state-solver branch August 14, 2026 14:32
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.

2 participants