4.2 KiB
4.2 KiB
Auto Skill + Attribute Allocation Plan
Goal
Add an optional system that automatically assigns:
- skill points
- attribute points
based on:
- active character profile (
blizz_sorc,fohdin,hammerdin, etc.) - current character level
without breaking existing manual setups.
Scope
- Planning and architecture for Botty repo.
- No forced behavior changes: feature must be opt-in.
Requirements
- Determine current level reliably at runtime.
- Select a build template by character profile.
- Apply points safely only when unspent points exist.
- Record every allocation in logs/events for audit/replay.
- Abort safely on uncertainty (wrong UI state, OCR mismatch, missing templates).
Current Level Detection Strategy
Primary path
Use player_bar.get_experience() (already used in game_stats.log_exp) to derive level from XP table.
Secondary fallback
Open character panel (C) and OCR level/name line directly from upper-left panel region.
Tertiary fallback
If OCR fails repeatedly:
- keep previous known good level for session,
- do not allocate points until confidence is restored.
Confidence rules
- Require two consistent reads before first allocation in a session.
- Reject impossible jumps (e.g., +5 levels at once).
- Persist
last_known_levelin session stats snapshot.
Build Template Model
Add config-backed build templates, e.g.:
config/auto_builds/blizz_sorc.iniconfig/auto_builds/hammerdin.iniconfig/auto_builds/fohdin.ini
Each template defines per-level targets:
- desired skill totals by level milestone
- desired attribute distribution (str/dex/vit/ene)
Example concept:
- Level 1-17: early progression targets
- Level 18-29: mid-game unlock path
- Level 30+: core skill maxing order
Runtime Flow
- Enter town and open character/skill UI.
- Detect level and unspent points.
- Load template for
Config().char["type"]. - Compute delta between current allocation and target-at-level.
- Apply points stepwise:
- attributes first (optional toggle),
- skills second.
- Verify post-apply state.
- Log allocation summary and persist snapshot.
Safety Guards
- Only run in town.
- Require stash/vendor windows closed.
- Hard cap per cycle (e.g., max 10 clicks per stat/skill group).
- On mismatch/timeout:
- stop allocation immediately,
- screenshot + structured error event,
- continue bot without crashing.
Config Additions (Planned)
In [char] or new [auto_build] section:
auto_assign_skills=0/1auto_assign_attributes=0/1auto_build_profile=(defaults tochar.type)auto_build_check_every_x_games=auto_build_safe_mode=1(extra verification)
Logging / Telemetry
Add structured events:
auto_build_check_startedauto_build_level_detectedauto_build_points_detectedauto_build_appliedauto_build_skippedauto_build_error
Include:
- profile
- level
- points spent
- before/after snapshots
UI / Input Dependencies
Need stable template references for:
- character panel level region
- unspent attribute points indicator
- unspent skill points indicator
- individual plus-buttons for stats/skills
Test Plan
- Unit tests:
- level-to-target mapping
- delta computation
- guard conditions
- Integration dry-run mode:
- compute and log planned actions without clicking.
- Live smoke tests per profile:
blizz_sorc,hammerdin,fohdin
- Regression:
- ensure normal runs unaffected with feature disabled.
Inputs Needed From You
- Screenshots for each supported class at:
- character panel open,
- skill tree open,
- visible unspent points.
- Preferred leveling templates:
- exact skill priority order by level range.
- attribute rules (e.g., str to gear breakpoint, then vit).
- Whether respec-aware logic is needed in v1.
Rollout Phases
- Phase 1: Level detection + dry-run planner only.
- Phase 2: Attribute auto-assign (safer, fewer UI branches).
- Phase 3: Skill auto-assign with full verification.
- Phase 4: Expanded profile templates + docs.
Definition of Done
- Feature is opt-in and stable for
blizz_sorc,hammerdin,fohdin. - Level detection is reliable with fallback behavior.
- No crash on detection/allocation failure.
- Full logs available for every auto-allocation decision.