Skip to content

Add mutation level solver - #1418

Merged
cadon merged 2 commits into
cadon:devfrom
flintthatchwood:levels-solver
Aug 23, 2026
Merged

cadon merged 2 commits into
cadon:devfrom
flintthatchwood:levels-solver

Conversation

@flintthatchwood

Copy link
Copy Markdown
Contributor

Summary

Adds a new Level Solver tab that calculates wild, mutation, and domestic level allocations for a selected species.

Players can enter the wild levels available in their breeding collection, choose whether each stat should reach at least a target value or be maximized, and receive updated allocation suggestions automatically.

Features

  • Uses the global species selector
  • Supports per-stat At least and Maximize modes
  • Accepts fixed wild levels supplied by the player
  • Suggests mutation and domestic level allocations
  • Enforces even mutation levels because odd mutation allocations are not breed-reachable
  • Supports:
    • Server stat multipliers
    • Imprinting
    • Configurable domestic-level limits
    • Per-stat mutation limits
    • Configurable server level caps
  • Applies the existing +50 level-cap heuristic for X- and R-variant species
  • Recalculates asynchronously as inputs change
  • Allows copying the resulting allocation directly to Stat Testing

UI

  • Adds the Level Solver immediately after the Breeding Plan tab
  • Uses stable font- and DPI-aware column sizing
  • Keeps solver columns from resizing as results change
  • Displays only stats used by the selected species
image

Implementation

The optimization logic is kept in a separate LevelAllocationSolver class so it can be tested independently of WinForms.

The solver searches domestic allocations, determines the minimum mutations required for target stats, and spends remaining levels on prioritized maximize stats while respecting the configured total-level cap.

Testing

  • Added focused tests for target allocation, maximizing, imprinting, caps, mutation constraints, cancellation, and species level-cap handling
  • 13 focused solver tests passing
  • Application project builds successfully

@cadon
cadon merged commit 3658fdb into cadon:dev Aug 23, 2026
1 check passed
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