Trackers API Reference
This section provides technical documentation for the various trackers used to monitor game progress.
Achievement Tracker
trackers.achievement_tracker
Achievement Tracker for Pokemon LLM Agent.
Tracks game achievements/milestones and triggers tweet generation with customized image prompts for each achievement type.
Only triggers once per achievement type per run.
Classes
Achievement
dataclass
A triggered achievement.
Source code in trackers/achievement_tracker.py
AchievementImagePrompt
dataclass
Image generation prompts for an achievement.
Prompts are composed from 4 structured fields that are combined at runtime: - setting: background, location, camera angle - mood_expression: facial expression, emotional state - action: pose, what she's doing - extras: lighting, effects, additional elements
The positive_prompt property combines these fields into a single string.
Source code in trackers/achievement_tracker.py
Attributes
positive_prompt
property
Combine structured fields into a single prompt string.
AchievementTracker
Tracks game achievements and triggers tweet generation.
Persists state to disk to survive restarts. Only triggers each achievement type once per run.
Source code in trackers/achievement_tracker.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 | |
Functions
__init__(storage_path='data/achievements.json', reset_on_start=False)
Initialize the achievement tracker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_path
|
str
|
Path to persist achievement state |
'data/achievements.json'
|
reset_on_start
|
bool
|
If True, clear all achievements on initialization |
False
|
Source code in trackers/achievement_tracker.py
check_for_achievements(current_party, current_badges, current_map, game_state=None)
Check current game state for new achievements.
Should be called each game cycle.
Returns:
| Type | Description |
|---|---|
Optional[Achievement]
|
Newly triggered Achievement, or None |
Source code in trackers/achievement_tracker.py
clear_pending_achievement()
get_image_prompt(achievement_type)
Get the image prompt for an achievement type.
Source code in trackers/achievement_tracker.py
get_pending_achievement()
get_summary()
Get a summary of triggered achievements.
Source code in trackers/achievement_tracker.py
is_triggered(achievement_type)
mark_tweet_posted(achievement_type, tweet_url=None)
Mark an achievement's tweet as posted.
Source code in trackers/achievement_tracker.py
trigger(achievement_type, context=None)
Trigger an achievement if not already triggered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
achievement_type
|
AchievementType
|
The achievement to trigger |
required |
context
|
Optional[Dict[str, Any]]
|
Additional context (Pokemon name, badge, etc.) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Achievement]
|
The Achievement if newly triggered, None if already triggered |
Source code in trackers/achievement_tracker.py
trigger_scripted_photo(photo_type)
Trigger a scripted photo moment.
Called by ScenarioManager when scripted moment is reached. Supports all photo-type achievements (scenic, milestone, story).
Source code in trackers/achievement_tracker.py
AchievementType
Bases: Enum
All trackable achievements in the game.
Source code in trackers/achievement_tracker.py
Functions
build_dynamic_prompt_context(location='', map_type='', party=None, badges=0, recent_events='')
Build the dynamic prompt with game state filled in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
str
|
Current map/location name |
''
|
map_type
|
str
|
Type of location (city, route, dungeon, etc.) |
''
|
party
|
Optional[List[str]]
|
List of Pokemon names in party |
None
|
badges
|
int
|
Number of badges earned |
0
|
recent_events
|
str
|
Description of recent game events |
''
|
Returns:
| Type | Description |
|---|---|
str
|
Formatted prompt string ready to send to LLM. |
Source code in trackers/achievement_tracker.py
create_achievement_tracker(storage_path='data/achievements.json', reset_on_start=False)
Factory function to create an AchievementTracker instance.
Source code in trackers/achievement_tracker.py
get_achievement_image_prompts()
Get achievement image prompts, preferring YAML source.
Source code in trackers/achievement_tracker.py
get_dynamic_prompt_template()
Get the dynamic prompt template for LLM-generated image prompts.
Used for CYCLE_CHECKPOINT (progress/fallback) posts where the LLM generates prompt components based on the current game state.
Returns:
| Type | Description |
|---|---|
str
|
The system prompt template with placeholders for game state. |
Source code in trackers/achievement_tracker.py
parse_dynamic_prompt_response(response)
Parse LLM response into an AchievementImagePrompt.
Expects JSON with: setting, mood_expression, action, extras
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
str
|
Raw LLM response string |
required |
Returns:
| Type | Description |
|---|---|
Optional[AchievementImagePrompt]
|
AchievementImagePrompt or None if parsing fails. |
Source code in trackers/achievement_tracker.py
Zora Achievement Tracker
trackers.zora_achievement_tracker
Zora Achievement Tracker for LLMLetsPlay Brand.
Extends the base AchievementTracker with additional minor achievements that are posted to Zora only (not Twitter). These create a richer documentary of the Pokemon journey.
Achievement Tiers: - MAJOR: Posted to Twitter + Zora with ComfyUI-generated image - MINOR: Posted to Zora only with screenshot - PROGRESS: Fallback checkpoint posts (every N cycles with no achievements)
Key Features: - First-catch-per-species detection (derived from Pokedex state) - Route/city/dungeon transition detection - Team change tracking - HM and key item detection - Fallback progress checkpoints
Integration: - Works alongside existing AchievementTracker - Stores Zora-specific state in separate JSON file - Provides post counter queried from Zora API on startup
Classes
ZoraAchievement
dataclass
A Zora-specific achievement.
Source code in trackers/zora_achievement_tracker.py
Functions
get_title()
Generate post title based on achievement type and context.
Source code in trackers/zora_achievement_tracker.py
should_include_footer()
Check if this achievement should include cross-promotion footer.
to_dict()
Convert to dictionary for serialization.
Source code in trackers/zora_achievement_tracker.py
ZoraAchievementTier
Bases: Enum
Achievement tier determines where it's posted and image type.
Source code in trackers/zora_achievement_tracker.py
ZoraAchievementTracker
Tracks achievements for Zora posting.
Works alongside the existing AchievementTracker but tracks: - Minor achievements (Zora-only) - Caught species (for first-catch-per-species) - Visited locations (for route/city/dungeon detection) - Post counter (LLP-NNN)
The post counter is queried from Zora API on startup.
Source code in trackers/zora_achievement_tracker.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 | |
Functions
__init__(storage_path='data/zora_achievements.json', fallback_cycles=60, min_post_interval=300)
Initialize the Zora achievement tracker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_path
|
str
|
Path to persist Zora achievement state |
'data/zora_achievements.json'
|
fallback_cycles
|
int
|
Cycles without achievements before checkpoint post |
60
|
min_post_interval
|
int
|
Minimum seconds between Zora posts |
300
|
Source code in trackers/zora_achievement_tracker.py
check_for_achievements(current_party, current_map, pokedex_caught=0, game_state=None)
Check current game state for new Zora achievements.
This checks for MINOR achievements only. MAJOR achievements are handled by the main AchievementTracker and forwarded here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_party
|
List[Dict]
|
Current party Pokemon list |
required |
current_map
|
str
|
Current map/location name |
required |
pokedex_caught
|
int
|
Number of Pokemon caught (from Pokedex) |
0
|
game_state
|
Optional[Dict[str, Any]]
|
Full game state dict |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ZoraAchievement]
|
Newly triggered ZoraAchievement, or None |
Source code in trackers/zora_achievement_tracker.py
clear_pending_achievement()
get_next_post_number()
get_pending_achievement()
get_stats()
Get tracker statistics.
Source code in trackers/zora_achievement_tracker.py
mark_posted(key, coin_address=None)
Mark an achievement as posted to Zora.
Source code in trackers/zora_achievement_tracker.py
set_post_counter(count)
Set the post counter (called after querying Zora API on startup).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
Current post count from Zora |
required |
Source code in trackers/zora_achievement_tracker.py
trigger(achievement_type, context=None, unique_key=None)
Trigger a Zora achievement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
achievement_type
|
ZoraAchievementType
|
The type of achievement |
required |
context
|
Optional[Dict[str, Any]]
|
Additional context for the achievement |
None
|
unique_key
|
Optional[str]
|
Optional unique key for achievements that can trigger multiple times (e.g., "first_catch_species_PIDGEY") |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ZoraAchievement]
|
ZoraAchievement if newly triggered, None if already exists |
Source code in trackers/zora_achievement_tracker.py
trigger_from_major_achievement(achievement_type_value, context=None)
Trigger a Zora achievement from a major achievement (from AchievementTracker).
This is called when the main AchievementTracker triggers a major achievement that should also be posted to Zora.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
achievement_type_value
|
str
|
The achievement type value string |
required |
context
|
Optional[Dict[str, Any]]
|
Achievement context |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ZoraAchievement]
|
ZoraAchievement if triggered |
Source code in trackers/zora_achievement_tracker.py
ZoraAchievementType
Bases: Enum
All achievement types for Zora posting.
Major achievements match the existing AchievementType values. Minor achievements are new and Zora-specific.
Source code in trackers/zora_achievement_tracker.py
Functions
get_zora_achievement_tracker(storage_path='data/zora_achievements.json', fallback_cycles=60)
Get or create the singleton Zora achievement tracker.
Source code in trackers/zora_achievement_tracker.py
Goal Tracker
trackers.goal_tracker
Goal Tracker Module for Pokemon LLM
Implements hierarchical goal stack that persists across summaries. Provides structured goal context for LLM decision making.
Classes
Goal
dataclass
A single goal with priority and status
Source code in trackers/goal_tracker.py
GoalPriority
Bases: Enum
Goal priority levels - QUESTS are PRIMARY, healing is SECONDARY
Priority Order: 1. CRITICAL - Main story quests (deliver Oak's Parcel, beat Gyms) 2. HIGH - Quest item objectives (pick up items, find NPCs) 3. MEDIUM - Urgent needs (heal at Pokemon Center when low HP) 4. LOW - Optional (extra exploration, training)
Source code in trackers/goal_tracker.py
GoalStatus
GoalTracker
Manages hierarchical goal stack for Pokemon gameplay.
Goal hierarchy: - Main Quest: Beat the Elite Four - Milestone: Get 8 badges - Current: Beat Pewter Gym - Micro: Navigate to Pewter City - Immediate: Exit current building
Source code in trackers/goal_tracker.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
Functions
add_goal(description, priority=GoalPriority.MEDIUM, parent_id=None, context=None)
Add a new goal to the tracker
Source code in trackers/goal_tracker.py
add_quest_goal(quest_id, description, target_location=None, target_npc=None, priority=GoalPriority.CRITICAL)
Add a goal derived from a quest item pickup.
Quest goals are CRITICAL priority because the game's story progression depends on completing them. Healing can wait, but the Parcel must be delivered.
Source code in trackers/goal_tracker.py
complete_goal(goal_id)
complete_goal_by_keyword(keyword)
Find and complete a goal containing the keyword
Source code in trackers/goal_tracker.py
fail_goal(goal_id, reason='')
Mark a goal as failed and record for replay
Source code in trackers/goal_tracker.py
get_completed_goals(limit=5)
Get recently completed goals
Source code in trackers/goal_tracker.py
get_context_for_llm(team_size=0, team_pokemon=None)
Generate compact goal context for LLM injection with progress tracking
Source code in trackers/goal_tracker.py
get_current_goal()
Get the highest priority active goal
get_failure_context()
Get recent failures as context for LLM
Source code in trackers/goal_tracker.py
get_goal_hierarchy()
Get goals from highest to lowest priority (main quest โ micro)
Source code in trackers/goal_tracker.py
has_quest_goal(quest_id)
Check if we already have an active goal for this quest.
Source code in trackers/goal_tracker.py
initialize_default_goals()
Set up initial game goals
Source code in trackers/goal_tracker.py
record_failure(action, position, reason)
Record a failed action for replay context
Source code in trackers/goal_tracker.py
update_goal(goal_id, status)
Update goal status
Source code in trackers/goal_tracker.py
Coordinate Tracker
trackers.coordinate_tracker
Coordinate Tracker for Enhanced Navigation
Tracks player world coordinates over time to detect loops and measure progress toward navigation targets. Persists to disk for run continuity.
Classes
CoordinateTracker
Tracks player world coordinates to detect loops and measure navigation progress.
Key features: - Maintains history of last N positions - Detects when player visits same tile 3+ times in 10 cycles (loop) - Tracks distance to target coordinate to measure progress - Persists to disk for run continuity
Source code in trackers/coordinate_tracker.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | |
Functions
__init__(storage_path='data/coordinate_history.json', max_history=10, reset_on_start=False)
Initialize the coordinate tracker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_path
|
str
|
Path to JSON file for persistence |
'data/coordinate_history.json'
|
max_history
|
int
|
Number of cycles to keep in history |
10
|
reset_on_start
|
bool
|
Whether to clear history on initialization |
False
|
Source code in trackers/coordinate_tracker.py
add_position(cycle, x, y, map_name)
Record current player position.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cycle
|
int
|
Current cycle number |
required |
x
|
int
|
World X coordinate |
required |
y
|
int
|
World Y coordinate |
required |
map_name
|
str
|
Current map name |
required |
Source code in trackers/coordinate_tracker.py
check_target_reached(threshold=2)
Check if we've reached the target (within threshold tiles).
Returns True and invalidates target if reached.
Source code in trackers/coordinate_tracker.py
detect_loop()
Detect if player is moving in circles.
Returns description if loop detected (same tile 3+ times in history), None otherwise.
Source code in trackers/coordinate_tracker.py
get_context_summary()
Return formatted context string for LLM.
Includes: - Recent position history - Loop detection results - Target progress info
Source code in trackers/coordinate_tracker.py
get_position_at_cycle(cycle)
Get position at a specific cycle if available.
get_progress_toward_target()
Get information about progress toward current target.
Returns dict with: - has_target: bool - target_info: Target details if set - distance: Current distance to target - progress: "approaching", "stuck", "no_progress", or "wrong_map" - recommendation: What to do
Source code in trackers/coordinate_tracker.py
invalidate_target(reason)
Clear the current target when stuck or reached.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reason
|
str
|
Why the target is being invalidated |
required |
Source code in trackers/coordinate_tracker.py
set_target(x, y, map_name, reason, cycle)
Set a new navigation target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
int
|
Target X coordinate |
required |
y
|
int
|
Target Y coordinate |
required |
map_name
|
str
|
Target map name |
required |
reason
|
str
|
Why we're going there |
required |
cycle
|
int
|
Current cycle when target was set |
required |
Source code in trackers/coordinate_tracker.py
NavigationTarget
dataclass
Target coordinate the agent is trying to reach.
Source code in trackers/coordinate_tracker.py
Exploration Tracker
trackers.exploration_tracker
Exploration Tracking System for Pokemon LLM Agent
Tracks visited tiles per map to enable systematic exploration and avoid repetitive navigation patterns.
Classes
ExplorationTracker
Tracks which tiles have been visited on each map.
Enables the agent to: 1. Know what % of a map has been explored 2. Find unexplored areas to prioritize 3. Suggest next exploration targets
Source code in trackers/exploration_tracker.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |
Functions
get_context_for_llm(map_id, map_name, player_x, player_y, minimap_2d)
Generate exploration context for LLM injection.
Returns:
| Type | Description |
|---|---|
str
|
Multi-line string with exploration status and suggestions |
Source code in trackers/exploration_tracker.py
get_exploration_summary(map_id)
Get a human-readable exploration summary for a map.
Returns:
| Type | Description |
|---|---|
str
|
e.g., "PALLET_TOWN: 45% explored (18/40 tiles)" |
Source code in trackers/exploration_tracker.py
get_unexplored_directions(map_id, player_x, player_y, minimap_2d)
Analyze minimap to find directions with unexplored walkable tiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
map_id
|
int
|
Current map |
required |
player_x
|
int
|
Player X position (in minimap center coords) |
required |
player_y
|
int
|
Player Y position (in minimap center coords) |
required |
minimap_2d
|
str
|
Semicolon-separated minimap string |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List of directions with unexplored tiles, e.g., ["EAST", "NORTH"] |
Source code in trackers/exploration_tracker.py
record_visit(map_id, map_name, x, y, total_walkable=0)
Record that a tile has been visited.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
map_id
|
int
|
Game map ID |
required |
map_name
|
str
|
Human-readable map name |
required |
x
|
int
|
Tile X coordinate |
required |
y
|
int
|
Tile Y coordinate |
required |
total_walkable
|
int
|
Total walkable tiles on this map (optional, for % calc) |
0
|
Source code in trackers/exploration_tracker.py
save()
suggest_exploration_target(map_id, player_x, player_y, minimap_2d)
Suggest the nearest unexplored tile to explore.
Returns:
| Type | Description |
|---|---|
Optional[Tuple[int, int]]
|
(x, y) coordinates of suggested target, or None if fully explored |
Source code in trackers/exploration_tracker.py
MapExploration
dataclass
Tracks exploration state for a single map.
Source code in trackers/exploration_tracker.py
Attributes
exploration_pct
property
Percentage of walkable tiles that have been visited.
Functions
from_dict(data)
classmethod
Deserialize from JSON storage.
Source code in trackers/exploration_tracker.py
to_dict()
Serialize for JSON storage.
Source code in trackers/exploration_tracker.py
History Tracker
trackers.history_tracker
Screenshot History Tracker
Tracks screenshot history between cycles. Maintains history for cleanup and reference.
Classes
ScreenshotHistoryTracker
Tracks screenshot paths across agent cycles.
Source code in trackers/history_tracker.py
Functions
__init__(snapshot_dir='snapshots', max_history=2)
Initialize the tracker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot_dir
|
str
|
Directory where snapshots are stored |
'snapshots'
|
max_history
|
int
|
Number of cycles to keep (default 2) |
2
|
Source code in trackers/history_tracker.py
add_screenshot(cycle_num, path)
Register a new screenshot for the given cycle.
Adds to front of history, trims to max_history, and cleans up old files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cycle_num
|
int
|
Current cycle number |
required |
path
|
str
|
Path to the screenshot file |
required |
Source code in trackers/history_tracker.py
get_current_screenshot()
Get the path to the current cycle's screenshot (N).
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Path to current screenshot if available and exists, None otherwise |
Source code in trackers/history_tracker.py
get_previous_screenshot()
Get the path to the previous cycle's screenshot (N-1).
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Path to previous screenshot if available and exists, None otherwise |