Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

Address issues #102-#104 + P7P breeding compat floor - #105

Merged
frankieg33 merged 2 commits into
mainfrom
issues-101-104-and-p7p-compat-floor
Apr 24, 2026
Merged

frankieg33 merged 2 commits into
mainfrom
issues-101-104-and-p7p-compat-floor

Conversation

@frankieg33

Copy link
Copy Markdown
Owner

Summary

  • bug? "hide already in love" in mating pair search only hides mutual lovers #102 / request: small UI improvements for mating pair search #103 — Mating Pair Search filters now hide any in-love cat (not just mutual lovers), split into two toggles (left list + matches table), and every cat shows a ♥ when taken plus their age.
  • question about donation/exceptional score threshold and detailed scorer #104 — Donation/Exceptional thresholds can now be driven by Detailed Scoring. A new Score source combo in the thresholds dialog swaps the base-sum thresholds for Detailed Scoring floats. The Detailed Scoring view caches its adjusted totals after each recompute and emits a signal to refresh the sidebar.
  • Perf 7 Planner Making Same-Sex Pairs #101 follow-up (no code change to gate same-sex)can_breed docstring rewritten to cite the wiki formula verbatim. Same-sex pairs remain legitimate per the game's math (see issue #101 comment).
  • P7P — Min breed % — New spinbox (default 15%) on the planner controls bar. Filters candidate and rotation pairs using the wiki's compat formula 0.15 × CHA × libido × lover_mult × sexuality_mult, taking the worst-direction compat so asymmetric same-sex pairs can't slip past the floor. Foundation (user-picked) pairs bypass.
  • CSV export — Added Class, Passive Abilities, Disorders, Defects, Tags, Lovers, Haters columns.
  • StartupMainWindow.startup_save_load_finished signal replaces the fragile QTimer-probe splash hook.

Why the compat floor uses worst-direction

A bi + straight same-sex pair has very different per-direction compat because sexuality_mult is partner-anchored. Best-direction (max) let those pairs slip past a 15% floor even though half of initiations fall below the game's own 5% gate. Worst-direction (min) matches "this pair reliably produces kittens regardless of who initiates."

Sanity check at the 15% default:

Pair Compat Outcome
Straight M+F · CHA4 · libido 0.5 29.9% passes
Bi F+F · CHA4 · libido 0.5 21.2% passes
Straight+Bi F+F · CHA4 · lib 0.5 2.4% blocked
Straight M+F · CHA2 · libido 0.3 9.0% blocked
Straight M+F · CHA7 · libido 0.8 83.7% passes
Gay M+F (same gate as can_breed) 0.0% blocked

Files touched

  • src/save_parser.pycan_breed docstring only
  • src/breeding.pyestimate_breeding_compatibility + pair_breeding_compatibility
  • src/mewgenics/views/perfect_planner.py — Min breed % UI + filter
  • src/mewgenics/views/safe_breeding.py — filter semantics + ♥/age on list items
  • src/mewgenics/main_window.py — startup signal, CSV columns, detailed-score wiring, adaptive tooltips, save-load cache clear
  • src/mewgenics/app.py — splash listens on the new signal
  • src/mewgenics/dialogs.py — score-source combo + Detailed threshold spinboxes
  • src/mewgenics/utils/thresholds.py — new prefs + _DETAILED_SCORES cache + _set_detailed_scores / _get_detailed_score / _detailed_scores_ready
  • src/mewgenics/utils/cat_analysis.py_is_exceptional_breeder / _donation_candidate_base_reason branch on score source
  • src/mewgenics/models/cat_table_model.py — tooltip copy adapts to score source
  • src/breed_priority/__init__.pydetailed_scores_updated Signal + cache push after each recompute

Test plan

  • Load a save, confirm P7P shows the new Min breed % spinbox (default 15).
  • Run P7P at 15% vs 0% and verify low-CHA / straight-same-sex pairs disappear at 15.
  • Confirm foundation pairs still appear at any floor value.
  • Open Mating Pair Search; toggle the two "hide in-love" buttons and verify ♥/age render in both list and matches.
  • Open Thresholds dialog, flip source to Detailed Scoring total → rows switch to float thresholds, preview text updates, and cache-missing note appears if the Detailed view hasn't run this session.
  • Open Detailed Scoring view to populate cache; verify sidebar Exceptional / Donation counts refresh to reflect the Detailed thresholds.
  • Reload the save, verify the Detailed-score cache clears (sidebar falls back to base-sum until Detailed reruns).
  • Export CSV and XLSX, verify the new columns (Class, Passive Abilities, Disorders, Defects, Tags, Lovers, Haters).
  • App startup: confirm splash closes once the save finishes loading (success path) and when a failed load retries or gives up (failure path).

Pre-existing failing tests (unrelated to this PR): test_mutation_planner_trait_table_* in tests/test_perfect_planner_ui.py.

Mating pair search (#102, #103):
- "Hide in-love cats" filters now hide any lover, not just mutual. Once a
  cat has fallen in love it can't fall in love again, so any lover is
  disqualifying for the sidebar filter semantics.
- Split into two toggles: hide in-love cats on the left list, and hide
  in-love matches on the right.
- Heart icon and age now render next to every cat in both the left list
  and the matches table.

CSV/XLSX export:
- Added Class, Passive Abilities, Disorders, Defects, Tags, Lovers,
  Haters columns.

Donation/Exceptional thresholds driven by Detailed Scoring (#104):
- New "Score source" combo in the thresholds dialog: Base stat sum
  (default) or Detailed Scoring total.
- In Detailed mode, two float thresholds replace the int spinboxes.
  Sidebar filter and tooltips adapt.
- Detailed Scoring view now caches {id(cat): adjusted_total} after each
  recompute and emits detailed_scores_updated so the sidebar refreshes.
  Cache clears on save reload so stale id(cat) keys can't leak.
- Falls back to base-sum silently when the cache isn't populated.

Perfect 7 Planner — min breeding compatibility floor:
- New "Min breed %" spinbox (default 15%) on the planner controls bar,
  persisted in session state.
- Filters candidate pairs and rotation candidates using the wiki's
  compat formula (0.15 * CHA * libido * lover_mult * sexuality_mult),
  taking the worst-direction compat so same-sex pairs with asymmetric
  sexuality can't slip past the floor.
- Foundation pairs (user-picked) bypass the filter.
- can_breed docstring updated to cite the wiki formula directly.

Splash / startup:
- MainWindow now exposes a startup_save_load_finished signal and emits
  it from both the success and failure paths, replacing the fragile
  QTimer-probe-for-worker hook in app.main.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44cc6e23d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2890 to +2891
from mewgenics.utils.thresholds import _set_detailed_scores
_set_detailed_scores(_detailed_scores_out)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep detailed-score cache complete across hidden-cat filters

This writes the global detailed-score cache from _detailed_scores_out, but that dict is populated only for the currently computed alive rows in _recompute (which can exclude cats when Hide Kittens or Hide Out-of-Scope is enabled). With Score source = detailed, cats omitted from this cache silently fall back to base-sum logic in _get_detailed_score callers, so donation/exceptional classification becomes a mixed mode depending on view filters rather than the selected score source.

Useful? React with 👍 / 👎.

Comment thread src/breeding.py
Comment on lines +97 to +101
if label == "gay":
return 1.0
if label == "bi":
return 0.5
return 0.05

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use non-extreme gay fallback when sexuality_raw is missing

When sexuality_raw is unavailable (older saves/override paths), mapping "gay" to 1.0 makes opposite-sex sexuality_mult equal cos(π/2)=0, so pair_breeding_compatibility can become zero and the new Min breed % filter rejects those pairs for any threshold above 0. The existing compatibility helper in this module uses a softer fallback (0.95) for label-only data, which preserves low-but-nonzero compatibility and avoids over-filtering label-only cats.

Useful? React with 👍 / 👎.

@frankieg33
frankieg33 merged commit 829f105 into main Apr 24, 2026
3 checks passed
@frankieg33
frankieg33 deleted the issues-101-104-and-p7p-compat-floor branch April 24, 2026 23:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant