[GH-ISSUE #6791] [Feature]: Game Mode inventory: items keep who they are when renamed (item ids and nicknames) #3802

Closed
opened 2026-10-21 06:07:39 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Sep 27, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6791

Originally assigned to: @kolacheee on GitHub.

What problem does this solve?

Game Mode's inventory tells items apart only by their names. A stack has an id of its own, but which ITEM it is comes from its name, so renaming a stack changes what the item is:

  • Renaming a stack of Rope to "Grandpa's rope" makes it a different item. The Game Master's [inventory: action="remove" item="Rope"] no longer finds it, and a fight lists it as something else.
  • Renaming a stack to the name of another item in the same bag pours one into the other, whether or not they are the same thing.
  • The detailed inventory on the game state (what the sheet, the trackers and an encounter's prompt read) has no ids at all. The server keeps it in step by comparing names before and after each change, so a rename has to be guessed from one name disappearing and another appearing. Every guess had an edge case: four rounds of review on #6789 found another one each time.
  • A player's new item starts as a placeholder called "New item". Two placeholders are the same item until one is renamed.

Ruleset items (the next part of the ruleset items plan) need a stable identity even more: a +1 longsword the player calls "Grandpa's blade" is still a longsword to the rules.

Proposed solution

Every item has an id, and the name shown is a nickname. For every Game Mode game, with or without a ruleset:

  • Every stack knows the id of its item, and every stack of that item shares it: splits, gifts and merges keep it. A plain item's id is worked out from its own name, which a rename never changes, so two stacks created as "Rope" are the same item and nothing extra is stored. A ruleset item will store its catalog entry (<catalog>/<entry>) in the next slice.
  • Each stack keeps the item's own name, and renaming sets a nickname instead. The nickname is what the screen shows. Renaming a stack back to the item's own name clears it. Identity, merging, totals and fights never follow a nickname.
  • Naming an item (the Game Master's tags, a fight spending one) finds it by its own name or by any nickname a stack of it has, ignoring case.
  • Merging only joins stacks of the same item. Renaming never merges.
  • Adding asks for the name first: the inventory screen's Add takes a name, and adding an item that is already in the bag tops up its first stack, as the Game Master's add does.
  • The Game Master sees both names when they differ, such as "Grandpa's rope (Rope) ×2".
  • The detailed inventory is keyed by item, so it follows the stacks without guessing, and an entry keeps its description through a rename or a gift.
  • Saved games open unchanged. A stack saved without an item id gets one from its name when read, and an entry of the detailed inventory without one is matched by name once and then keeps it.

Alternatives considered

  • Keep matching by name and patch each rename case. That is what #6789 did, and each fix exposed another case.
  • Store only the shown name and work the item's own name out of its id. Names with no Latin letters (Cyrillic, CJK, emoji) cannot be worked back out of an id, so the own name is stored with the stack.

Additional context

Slice I2b-1 of the ruleset items plan, recorded as the user's ruling during #6789's review. It changes no ruleset format and needs no Capability API change. I2b-2 (ruleset items in the inventory: typed entries, the item picker, equipping and binding, placement by carrying capacity) builds on it.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Sep 27, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6791 Originally assigned to: @kolacheee on GitHub. ## What problem does this solve? Game Mode's inventory tells items apart only by their names. A stack has an id of its own, but which ITEM it is comes from its name, so renaming a stack changes what the item is: - Renaming a stack of Rope to "Grandpa's rope" makes it a different item. The Game Master's `[inventory: action="remove" item="Rope"]` no longer finds it, and a fight lists it as something else. - Renaming a stack to the name of another item in the same bag pours one into the other, whether or not they are the same thing. - The detailed inventory on the game state (what the sheet, the trackers and an encounter's prompt read) has no ids at all. The server keeps it in step by comparing names before and after each change, so a rename has to be guessed from one name disappearing and another appearing. Every guess had an edge case: four rounds of review on #6789 found another one each time. - A player's new item starts as a placeholder called "New item". Two placeholders are the same item until one is renamed. Ruleset items (the next part of the ruleset items plan) need a stable identity even more: a +1 longsword the player calls "Grandpa's blade" is still a longsword to the rules. ## Proposed solution Every item has an id, and the name shown is a nickname. For every Game Mode game, with or without a ruleset: - **Every stack knows the id of its item**, and every stack of that item shares it: splits, gifts and merges keep it. A plain item's id is worked out from its own name, which a rename never changes, so two stacks created as "Rope" are the same item and nothing extra is stored. A ruleset item will store its catalog entry (`<catalog>/<entry>`) in the next slice. - **Each stack keeps the item's own name**, and renaming sets a **nickname** instead. The nickname is what the screen shows. Renaming a stack back to the item's own name clears it. Identity, merging, totals and fights never follow a nickname. - **Naming an item** (the Game Master's tags, a fight spending one) finds it by its own name or by any nickname a stack of it has, ignoring case. - **Merging** only joins stacks of the same item. **Renaming** never merges. - **Adding** asks for the name first: the inventory screen's Add takes a name, and adding an item that is already in the bag tops up its first stack, as the Game Master's add does. - **The Game Master sees both names** when they differ, such as "Grandpa's rope (Rope) ×2". - **The detailed inventory is keyed by item**, so it follows the stacks without guessing, and an entry keeps its description through a rename or a gift. - **Saved games open unchanged.** A stack saved without an item id gets one from its name when read, and an entry of the detailed inventory without one is matched by name once and then keeps it. ## Alternatives considered - Keep matching by name and patch each rename case. That is what #6789 did, and each fix exposed another case. - Store only the shown name and work the item's own name out of its id. Names with no Latin letters (Cyrillic, CJK, emoji) cannot be worked back out of an id, so the own name is stored with the stack. ## Additional context Slice I2b-1 of the ruleset items plan, recorded as the user's ruling during #6789's review. It changes no ruleset format and needs no Capability API change. I2b-2 (ruleset items in the inventory: typed entries, the item picker, equipping and binding, placement by carrying capacity) builds on it. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3802
No description provided.