Add core encounter processing pipeline

Filter by game version, parse levels and rate variants across all
generations, aggregate encounters by pokemon+method, and build
parent/child route hierarchy. Also completes encounter method coverage
(73/73) and pokemon form mapping (1180/1181) with manual overrides.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-11 10:12:55 +01:00
parent df7ea64b9e
commit d80c59047c
5 changed files with 557 additions and 13 deletions

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-rfg0
title: Core encounter processing
status: todo
status: in-progress
type: task
priority: normal
created_at: 2026-02-11T08:43:12Z
updated_at: 2026-02-11T08:43:33Z
updated_at: 2026-02-11T09:03:52Z
parent: nuzlocke-tracker-bs05
blocking:
- nuzlocke-tracker-gkcy
@@ -15,9 +15,9 @@ Implement the core logic that transforms raw PokeDB encounter records into our i
## 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**:
- [x] **Filter by game version**: Given a target game slug, select only encounters where `version_identifiers` includes that game
- [x] **Parse level strings**: Convert "2 - 4" → min_level=2, max_level=4; "67" → min_level=67, max_level=67
- [x] **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
@@ -25,9 +25,9 @@ Implement the core logic that transforms raw PokeDB encounter records into our i
- 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
- [x] **Aggregate encounters**: Group by (pokemon, method, location_area) and merge level ranges / rates where appropriate (same logic as the Go tool's aggregation)
- [x] **Group by location area**: Collect all encounters for a location area into a route structure
- [x] **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

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-zno2
title: Build reference data mappings
status: in-progress
status: completed
type: task
priority: normal
created_at: 2026-02-11T08:43:02Z
updated_at: 2026-02-11T08:50:29Z
updated_at: 2026-02-11T09:03:01Z
parent: nuzlocke-tracker-bs05
blocking:
- nuzlocke-tracker-rfg0