Files
nuzlocke-tracker/.beans/nuzlocke-tracker-rfg0--core-encounter-processing.md
Julian Tabel 29b954726a Add PokeDB sprite downloading (100x100 WebP)
Download pokemon sprites from PokeDB CDN during import, cached locally
as {pokeapi_id}.webp. Replaces PokeAPI GitHub sprite URLs. ~4.6MB for
all 1119 unique sprites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 10:24:43 +01:00

1.8 KiB

title, status, type, priority, created_at, updated_at, parent, blocking
title status type priority created_at updated_at parent blocking
Core encounter processing completed task normal 2026-02-11T08:43:12Z 2026-02-11T09:12:59Z nuzlocke-tracker-bs05
nuzlocke-tracker-gkcy

Implement the core logic that transforms raw PokeDB encounter records into our internal format.

Checklist

  • Filter by game version: Given a target game slug, select only encounters where version_identifiers includes that game
  • Parse level strings: Convert "2 - 4" → min_level=2, max_level=4; "67" → min_level=67, max_level=67
  • Handle rate variants per generation:
    • Gen 1/3/6: use rate_overall directly as encounter_rate
    • Gen 2/4: rate_morning, rate_day, rate_night — flatten to max or average for encounter_rate
    • Gen 5: rate_spring through rate_winter — flatten similarly
    • Gen 8 Sw/Sh: weather_*_rate fields — flatten to max
    • Gen 8 Legends Arceus: during_* / while_* booleans — convert to a presence-based rate
    • Gen 9 Sc/Vi: probability_* fields (spawn weights, not percentages) — normalize to percentages
    • Preserve raw variant data in a way that nuzlocke-tracker-oqfo can use later
  • Aggregate encounters: Group by (pokemon, method, location_area) and merge level ranges / rates where appropriate (same logic as the Go tool's aggregation)
  • Group by location area: Collect all encounters for a location area into a route structure
  • Handle parent/child routes: Multi-area locations (e.g. Safari Zone) should produce parent routes with children, matching the existing hierarchical format

Notes

  • Rate parsing needs to handle percentage strings like "40%" as well as bare numbers
  • The Go tool aggregates encounters with the same pokemon+method at a location into a single entry with merged level ranges — replicate this