Skip to content

feat: Add Relationship Dynamics extension#491

Open
KenStarwind wants to merge 1 commit intoabeiro:unstablefrom
KenStarwind:feature/relationship-dynamics
Open

feat: Add Relationship Dynamics extension#491
KenStarwind wants to merge 1 commit intoabeiro:unstablefrom
KenStarwind:feature/relationship-dynamics

Conversation

@KenStarwind
Copy link
Copy Markdown

Summary

Adds a new ext/relationship_dynamics extension — an emotional engine for NPC-player relationships that separates permanent bonds (Affinity/Speed) from volatile attraction (Passion/RPM).

What it does

  • RPM/Speed/Gears model: Passion accumulates per-interaction and drives affinity gain rate
  • 5 love languages with primary/secondary NPC matching (acts_of_service, quality_time, words_of_affirmation, physical_touch, gifts)
  • 13 temperaments (Romantic → Gentle) with per-temperament passion/reunion/jealousy multipliers
  • 11 interest categories with per-NPC weights and topic-talk bonuses
  • Environmental resonance via vector similarity (MiniMe/txtai embeddings against Oghma Infinium POI data)
  • Combat passion — fighting together builds attraction, with temperament-specific bleedout responses (Bold NPCs get angry, Guarded NPCs get vulnerable)
  • Diminishing returns — exponential session decay prevents spam-talking to max affinity
  • Reunion system — time-apart spikes gated by affinity level, with IRL cooldown
  • Jealousy + conflict/repair cycle — observed flirting triggers jealousy; repair interactions get 1.5x bonus
  • 3 relationship stages (early/established/deep) with stage-appropriate context injection
  • Demisexual/asexual type filtering — relationship preference constraints respected
  • Full settings UI with per-subsystem toggles
  • Per-NPC editor panel for love languages, interests, and temperament

Integration

All external dependencies are soft-gated — no hard requirements:

  • Sharmat NsfwNpcData: class_exists() check
  • MinAI conf_opts: try/catch
  • Oghma table: try/catch
  • MiniMe embeddings: HTTP call with fallback to keyword matching

Files changed

  • .gitignore — added exception for ext/relationship_dynamics
  • ext/relationship_dynamics/ — 9 new PHP files (core class, context builder, pre/post request hooks, settings, NPC editor section, install, API, debug)
  • ui/core/config_hub.php — register extension in config hub
  • ui/core/npc_master.php — hook NPC editor panel

Test plan

  • Fresh install: visit Settings → Relationship Dynamics, verify defaults load
  • NPC Editor: open any NPC, verify RelDyn panel appears with auto-generate button
  • Talk to a follower NPC, verify passion accumulates in logs ([RelDyn-POST])
  • Talk 10+ times in a row, verify diminishing returns
  • Fight alongside follower, verify combat passion events log
  • Verify no errors when Sharmat/MinAI/Oghma are not installed (soft gates)
  • Save/reload game, verify passion values persist

🤖 Generated with Claude Code

Emotional engine for NPC-player relationships. Separates permanent
bonds (Affinity/Speed) from volatile attraction (Passion/RPM).

Core features:
- RPM/Speed/Gears model: passion drives affinity gain multiplier
- 5 love languages with primary/secondary detection
- 13 temperaments with passion/reunion/jealousy multipliers
- 11 interest categories with per-NPC weights
- Environmental resonance via vector similarity (MiniMe/txtai)
- Combat passion with temperament-specific bleedout drain
- Diminishing returns (exponential session decay)
- Reunion system (time-apart spikes gated by affinity)
- Jealousy from observed flirting + conflict/repair cycle
- 3 relationship stages (early/established/deep)
- Demisexual/asexual type constraint filtering
- Sharmat bridge (passion -> sex_disposal, gated by class_exists)
- Full settings UI with per-subsystem toggles
- Per-NPC editor panel (love languages, interests, temperament)

All external dependencies soft-gated:
- Sharmat NsfwNpcData: class_exists()
- MinAI conf_opts: try/catch
- Oghma table: try/catch
- MiniMe embeddings: HTTP with fallback to keyword matching

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant