-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Replace gem materials with medieval Irish crops in Feudalism
Re-theme Feudalism's resource system from gemstones to medieval Irish crops (Oats, Flax, Barley, Turnip, Wheat, Mead) with feudal naming (Patrons, Smallholding/Farm/Estate tiers) and a colourblind-accessible token palette.
Problem Statement
The Feudalism example game still uses gemstone-themed resources (Emerald, Sapphire, Diamond, Onyx, Ruby, Gold) inherited from its original design. These clash with the game's medieval Irish agricultural theme. The gem terminology must be replaced with historically plausible medieval Irish crops and feudal naming throughout the codebase.
Users
Players of Feudalism who expect the game's resource system to match its feudal/agricultural theme.
- As a player, I want the resources to be medieval Irish crops so the game feels thematically grounded in its agricultural setting.
- As a player, I want token colours to visually evoke the crops they represent so resource identification is intuitive.
- As a player, I want the help text to describe the game in terms of crops and farming so the rules make sense within the theme.
Developers extending the engine who read the Feudalism source as a reference implementation.
- As a developer, I want type names and code identifiers to reflect the game's actual theme so the code is self-documenting.
Success Criteria
- All gem resource references throughout Feudalism code are replaced with crop names using the locked-in mapping (see Desired Change).
- Type system uses generic
Resource-prefixed names:ResourceType,ResourceOrWild,ResourceTokens,ResourceCost. - Token colours use a new crop-themed, colourblind-accessible palette.
- Noble tiles are renamed to "Patron" tiles (
PatronTile, etc.) in types, UI, and help text. - Card tiers are renamed to land-scale tiers (Smallholding / Farm / Estate) and "prestige" is renamed to a feudal equivalent (e.g. "Influence" or "Standing").
- Help text (
help-content.json) is fully rewritten with crop/feudal terminology. npm testpasses (all tests across the entire suite).npm run buildsucceeds.- No remaining references to gem names (Emerald, Sapphire, Diamond, Onyx, Ruby, GemColor, GemOrGold), "Noble/NobleTile", or "Tier 1/2/3" exist in Feudalism game code.
- Game balance is preserved — same number of resource types, same cost structures, same card/patron data (only names and colours change).
- The fixture transcript (
tests/fixtures/transcripts/feudalism/fixture-game.json) is regenerated with updated terminology.
Constraints
- Dependency: The Splendor-to-Feudalism rename (CG-0MM5K9VLH151FX85) must be completed first. Status: completed.
- Scope boundary: Crop icons/sprites on tokens are handled by the child work item CG-0MM5KDA9E0QG6OKY and are NOT in scope here. This item covers type/data/text/colour changes only.
- Colourblind accessibility: The new token colour palette must be chosen with colourblind-friendliness in mind (avoid relying on red/green distinction alone; consider using a well-known accessible palette such as the IBM or Wong palettes).
- Licensing: If any new assets are introduced they must be CC0/permissive.
- No gameplay changes: Card costs, patron requirements, resource counts, and all numeric game balance values remain identical — only names, colours, labels, and type identifiers change.
Existing State
The Feudalism game currently defines resources in example-games/feudalism/FeudalismCards.ts:
export type GemColor = 'emerald' | 'sapphire' | 'ruby' | 'diamond' | 'onyx';
export type GemOrGold = GemColor | 'gold';
export const GEM_COLORS: readonly GemColor[] = ['emerald', 'sapphire', 'ruby', 'diamond', 'onyx'];
export const ALL_TOKEN_COLORS: readonly GemOrGold[] = [...GEM_COLORS, 'gold'];
export type GemTokens = Partial<Record<GemOrGold, number>>;
export type GemCost = Partial<Record<GemColor, number>>;These types and gem string literals permeate 13+ files:
FeudalismCards.ts— type definitions, 90 dev cards, 10 noble tiles, utility functions, abbreviations (G/U/R/W/K/$)FeudalismGame.ts— game logic, player state, turn actionsFeudalismScene.ts— GEM_FILL/GEM_TEXT_COLOR rendering maps, all UI renderingAiStrategy.ts— AI strategy referencing GemColor, GemTokensGameTranscript.ts— transcript typeshelp-content.json— help text with gem referencesscripts/adapters/FeudalismReplayAdapter.ts— replay adaptertests/feudalism/— 4 test files (FeudalismCards.test.ts, FeudalismGame.test.ts, AiStrategy.test.ts, FeudalismLayout.browser.test.ts)
Noble tiles are typed as NobleTile and referred to as "Nobles" in UI and help. Card tiers are "Tier 1/2/3" with "prestige points."
Desired Change
Resource Mapping (locked in)
| Current Gem | New Crop | Abbreviation | Notes |
|---|---|---|---|
| Emerald | Oats | O | Staple cereal crop |
| Sapphire | Flax | F | Grown for linen production |
| Diamond | Barley | B | Used for bread and ale |
| Onyx | Turnip | T | Common root vegetable |
| Ruby | Wheat | W | Valuable grain crop |
| Gold (wild) | Mead (wild) | M | Prized drink from honey; serves as the universal/wild resource |
Type Renames
| Current | New |
|---|---|
GemColor |
ResourceType |
GemOrGold |
ResourceOrWild |
GemTokens |
ResourceTokens |
GemCost |
ResourceCost |
GEM_COLORS |
RESOURCE_TYPES |
ALL_TOKEN_COLORS |
ALL_RESOURCE_TYPES |
NobleTile |
PatronTile |
gemAbbrev |
resourceAbbrev |
gemDisplayName |
resourceDisplayName |
Thematic Renames
| Current | New |
|---|---|
| Noble / Nobles | Patron / Patrons |
| Tier 1 | Smallholding |
| Tier 2 | Farm |
| Tier 3 | Estate |
| Prestige (points) | Influence (or Standing — implementer to pick best fit) |
Token Colours
Replace GEM_FILL and GEM_TEXT_COLOR lookup maps with a new colourblind-accessible palette that evokes the crops. Implementer should select specific hex values, but they must be tested for distinguishability under common colour vision deficiencies (protanopia, deuteranopia, tritanopia).
Files to Modify
example-games/feudalism/FeudalismCards.ts— types, constants, card/patron data, utilitiesexample-games/feudalism/FeudalismGame.ts— game logic, player state, actionsexample-games/feudalism/scenes/FeudalismScene.ts— rendering maps, all UI text/labelsexample-games/feudalism/AiStrategy.ts— AI referencesexample-games/feudalism/GameTranscript.ts— transcript typesexample-games/feudalism/help-content.json— full rewrite of help textscripts/adapters/FeudalismReplayAdapter.ts— replay adapter typesscripts/generate-feudalism-fixture-transcript.ts— fixture generationtests/feudalism/FeudalismCards.test.ts— card/utility teststests/feudalism/FeudalismGame.test.ts— game logic teststests/feudalism/AiStrategy.test.ts— AI teststests/feudalism/FeudalismLayout.browser.test.ts— layout teststests/fixtures/transcripts/feudalism/fixture-game.json— fixture transcript (regenerate)
Risks & Assumptions
Risks
- Missed references: Gem string literals may exist in unexpected locations (e.g. inline comments, serialised fixture data). Mitigation: run a project-wide grep for all gem names after completion; criterion 9 explicitly requires zero remaining references.
- Colour accessibility: The new palette may not be sufficiently distinguishable for all colour vision deficiencies. Mitigation: validate chosen colours against a simulator (e.g. Coblis or Sim Daltonism) before finalising.
- Scope creep: Thematic renaming may surface opportunities for deeper gameplay or UI changes (e.g. card art, new mechanics). Mitigation: record any such opportunities as separate work items linked to this item rather than expanding scope.
- Fixture transcript drift: Regenerating the fixture may produce different game outcomes if the RNG or game logic has shifted. Mitigation: verify the regenerated fixture preserves the same game flow or update tests to match the new fixture.
- Replay adapter compatibility: Existing saved transcripts (in IndexedDB or on disk) use gem-based field names. This change will make old transcripts incompatible. Mitigation: document the breaking change; old transcripts can be discarded since this is pre-release.
Assumptions
- The rename from Splendor to Feudalism (CG-0MM5K9VLH151FX85) is fully merged and no further conflicts exist on the affected files.
- No other work items are actively modifying the same Feudalism files in parallel.
- The six crop names and "Mead" wild resource are final and will not change during implementation.
- Card numerical data (costs, prestige/influence values, patron requirements) remains identical — only labels and type names change.
Related Work
- Rename Splendor to Feudalism (CG-0MM5K9VLH151FX85) — completed prerequisite
- Add crop icons to resource tokens (CG-0MM5KDA9E0QG6OKY) — child work item, follow-on visual enhancement (out of scope here)
- The Build: PRD Milestone 3 (CG-0MM4REQ4C01X8C08) — blocked, references this game
Related work (automated report)
Work Items
-
Rename Splendor to Feudalism (CG-0MM5K9VLH151FX85, completed) — Direct prerequisite. Performed the directory/class/string rename from Splendor to Feudalism. All files this item will modify were touched by that rename, so the codebase is already in the "Feudalism" namespace. No residual Splendor references remain.
-
Add crop icons to resource tokens in Feudalism (CG-0MM5KDA9E0QG6OKY, open) — Child item handling the visual follow-on: adding crop icon sprites/graphics to tokens. Explicitly out of scope for this item but depends on the type and colour changes made here.
-
Remove tableau column headings and add gem-type placeholder sprites (CG-0MM433RWY133GN5A, completed) — Added ghost/placeholder sprites for each gem type in player/AI areas. These placeholder sprites reference gem types and will need their labels and colours updated as part of this work.
-
The Build: PRD Milestone 3 -- AI, Hints, and Undo System (CG-0MM4REQ4C01X8C08, blocked) — References the Feudalism game for transcript recording and AI. The resource rename will affect AI strategy code and transcript types that this milestone depends on.
Repository Files
example-games/feudalism/FeudalismCards.ts— Central file definingGemColor,GemOrGold, all 90 development cards, 10 noble tiles, and all resource utility functions. Primary target for type and data renames.example-games/feudalism/FeudalismGame.ts— Game logic with deep references to GemColor throughout player state, turn actions, and validation.example-games/feudalism/scenes/FeudalismScene.ts— 2362-line Phaser scene containingGEM_FILLandGEM_TEXT_COLORcolour lookup maps plus all UI rendering referencing gem names.example-games/feudalism/AiStrategy.ts— AI strategies that iterate overGEM_COLORSand referenceGemTokensfor scoring.example-games/feudalism/help-content.json— Player-facing help text with gem colour names and abbreviations throughout.scripts/adapters/FeudalismReplayAdapter.ts— Replay adapter with mirror types (SP* prefixes) that reference gem field names; will need updates for transcript compatibility.