Skip to content

Path overworld travel on the walkability grid - #14

Draft
jacobyoby wants to merge 2 commits into
mainfrom
cursor/walkability-path-2630
Draft

jacobyoby wants to merge 2 commits into
mainfrom
cursor/walkability-path-2630

Conversation

@jacobyoby

Copy link
Copy Markdown
Owner

Description

Overworld travel now walks a visible collision grid instead of remembering one blocked direction for the whole map. Dialog, menus, and which coordinate to head for are unchanged.

Builds on #13.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Related Issues

Related to #13

Changes Made

  • GameState.read_walkable_grid reads PyBoy's Pokemon collision map and folds the 18 by 20 tile view into the 9 by 10 block grid the player steps on.
  • navigation.next_step breadth-first searches that grid and returns the next button toward the goal coordinate. A wall blocks only the block it occupies, so Pallet Town's fence gap stays usable after UP has bumped a different column.
  • AgentStrategy.movement_target supplies the coordinate (Oak's tile on Pallet Town, the north edge on Route 1). The route policy uses it when the grid is available and otherwise keeps the old direction heuristic.
  • Map width and height come from wCurMapWidth / wCurMapHeight (0xD369 / 0xD368).

Testing

  • All existing tests pass
  • New tests added for new functionality
  • Tested with both Ollama and Claude providers (if applicable)
  • Tested on Windows/macOS/Linux (if applicable)

ruff check is clean on the changed files. pytest -m "not slow": 214 passed. The new cases cover an open column, a fence with one gap, refusing a step into that fence, and the route policy still taking the gap when blocked_directions contains UP.

Checklist

  • Code follows PEP 8 style guidelines
  • Code is commented, particularly in hard-to-understand areas
  • Documentation updated (README, CHANGELOG, docs/)
  • CHANGELOG.md updated
  • No ROM files included
  • No sensitive data included (API keys, etc.)
  • Tests pass locally
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 21, 2026 22:35
Keep strategy suggestions inside the policy chain, parse button tokens as whole words, and align party HP plus Route 1 map IDs with the pret layout.

Co-authored-by: Jacobrakai <jacobyoby@users.noreply.github.com>
Read PyBoy's collision map as a 9 by 10 block grid and take one step toward the goal coordinate, so a fence blocks only the column it occupies.

Co-authored-by: Jacobrakai <jacobyoby@users.noreply.github.com>
Base automatically changed from cursor/review-fixes-2630 to main September 21, 2026 23:06
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