Skip to content

fix(game): profile ships mechanisms, demo defaults move to examples - #316

Open
prakashUXtech wants to merge 1 commit into
devfrom
fix/game-profile-demo-defaults
Open

prakashUXtech wants to merge 1 commit into
devfrom
fix/game-profile-demo-defaults

Conversation

@prakashUXtech

Copy link
Copy Markdown
Contributor

The game profile used to ship with a specific character baked in. GrudgeKernel.birth() defaulted to Bjorn the Butcher, the templated dialogue engine spoke Bjorn's lines for every NPC, the LLM prompt ignored the persona it was handed and hardcoded a butcher, GameWorld put everyone in a "tavern", and CostMeter carried a table of vendor rates. That is demo content living in a library.

What changed

GrudgeKernel.birth(name, archetype, ...) requires both arguments. persona now defaults to "I am <name>, <archetype>." for both birth() and awaken().

DialogueEngine.speak() takes npc_name. The templated lines are name-aware and trade-neutral, the same treatment speak_reputation() already had. LLMDialogueEngine.build_prompt() builds from persona and npc_name. This is the one real bug fix in here: before, Astrid the innkeeper was prompted as Bjorn the butcher whenever the LLM engine was on.

PRICING is an empty dict. CostMeter(generate, model, pricing=None) reads a caller-supplied {model: (in_rate, out_rate)} table, or the module-level dict if you populate it at startup. An unconfigured meter raises unknown model. I kept the exported name so existing imports resolve.

DEFAULT_ZONE is "start", and GameWorld takes start_zone.

Everything removed lands in examples/game/: the Bjorn constants, ButcherDialogueEngine with his original lines, birth_bjorn(), TAVERN, and the sample rate table. Both demos (npc_soul_grudge, butcher_remembers) import from there; they insert the repo root on sys.path so they still run as scripts and still load by path from test_demo_server.py.

Breaking

Four surfaces for anyone importing soul_protocol.profiles.game directly: the required birth() arguments, the speak() keyword (custom engines must accept it), CostMeter needing a pricing table, and the DEFAULT_ZONE value. All listed in the CHANGELOG.

Verification

Full suite on Python 3.12: 3264 passed, 3 skipped, no new failures. Ruff check and format clean. tests/profiles/game/test_demo_server.py exercises the relocated demo module through the real server.

GrudgeKernel.birth() requires name and archetype and derives a persona from
them. DialogueEngine.speak() takes npc_name so the templated lines and the LLM
prompt work for any character instead of a hardcoded butcher. PRICING ships
empty and CostMeter takes pricing=. DEFAULT_ZONE is "start" and GameWorld
takes start_zone. Bjorn, his scripted lines, the tavern and the sample vendor
rates live in examples/game, which both demos now import.
@github-actions

Copy link
Copy Markdown

Issues (must fix)

  • No linked issue found. PRs should reference an issue (Fixes #123).
  • No evidence of local testing found. Please include terminal output or screenshots.

Please update your PR to address these points.

@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had activity in the last 14 days. It will be closed in 7 days if no further activity occurs. If you're still working on this, please push an update or leave a comment.

@github-actions github-actions Bot added the stale label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant