Skip to content

feat: expand item catalog with equipment, official in-game localizations, and DLC mappings - #4

Open
aiden0rchad wants to merge 1 commit into
hypery11:mainfrom
aiden0rchad:feature/item-identifiers-and-equipment
Open

aiden0rchad wants to merge 1 commit into
hypery11:mainfrom
aiden0rchad:feature/item-identifiers-and-equipment

Conversation

@aiden0rchad

Copy link
Copy Markdown

Summary

This PR addresses unidentified items (#<id> #<id>), crude developer keys (e.g. Unidentified LongDash #3017001), missing equipment/weapons/charms, and lack of localization in the item inventory view. It also integrates official publisher-shipped translations, expands the reference database with 601 equipment items, adds full DLC mappings for In the Jungle and May DLCs, and enhances item search.

Context & Root Cause

  1. Missing Equipment in reference.sqlite: The existing database only contained 563 base/Dredge items from DR_GameData_Item.json. All 601 equipment items (DR_GameData_Equipment.json, TIDs 301000143017107: rifles, shotguns, dart guns, harpoon guns, melee weapons, and charms) and 48 subequipment items were absent. Because save files store equipped and stored equipment in InventoryItemSlot under these equipment TIDs, they showed up unidentified as #3010001 #3010001, #3013111 #3013111, etc.
  2. Charm ID Collision & Raw Text Keys: For charm 3017001, the previous query matched row 1014903 in Items (an unappraised pickup whose ItemDataID happened to be 3017001). prettify stripped _Name and replaced _ with space, rendering Unidentified LongDash #3017001. In reality, equipment 3017001 is Charm_LongDash_Name — the Dolphin Necklace (돌고래의 목걸이 / 海豚項鍊), while 1014903 is the Rusty Dolphin Necklace.
  3. No In-Game Translations: Items were previously displayed only via crude string transforms on raw internal developer keys (e.g. Bacon_Relic -> Bacon Relic), completely ignoring the publisher's official localization sheets.
  4. Missing DLC 2 & DLC 4 Mappings: dlcTypeToID in IngredientOps.swift and craftDLCTypeToID in CraftMaterialOps.swift omitted DLC 2 (May / Guilty Gear 14252101) and DLC 4 (In the Jungle 14252301), leaving 156 Jungle craft materials and 134 Jungle ingredients unhandled.
  5. Duplicate Fallback #id #id: In SaveEditorModel.inventoryRows(), if an item had no name in the database, name was set to "#\(slot.itemID)". In TableRows.swift, the view displayed Text(row.name) and Text(verbatim: "#\(row.id)"), rendering #1019505 #1019505.

Changes

  • Reference Database (reference.sql & reference.sqlite):
    • Items: Expanded to 1,063 items from DR_GameData_Item.json, retaining exact existing schema and column order for 100% backward compatibility.
    • Ingredients: Expanded to 462 rows.
    • Equipment: Added 601 rows from DR_GameData_Equipment.json (guns, harpoons, charms, melee).
    • SubEquipment: Added 48 rows.
    • Translations: Added 1,236 localized item and equipment entries with en, ko, zh_hans, and zh_hant extracted directly from the game's official localization tables (ItemNameText, InstanceItemText, DLC_JungleItemText, etc.).
    • ItemLookup: Added unified VIEW across items, equipment, and subequipment.
  • Reference Resolution (Sources/DaveSaveCore/ReferenceDB.swift):
    • Prioritize direct TID matches over ItemDataID matches so equipment and charms resolve correctly.
    • Resolve localized names based on active locale (or specified locale), with English fallback, then CamelCase-spaced prettify.
    • Enhance searchItems to search across localized names in all languages, developer text keys, and numeric IDs.
    • Enhance prettify with prefix stripping (Item_JDLC_, Item_) and CamelCase splitting for untranslated DLC items (MemoryOfYoshie -> Memory of Yoshie).
  • DLC Operations (IngredientOps.swift & CraftMaterialOps.swift):
    • Added DLC 2 (14252101) and DLC 4 (14252301) to dlcTypeToID and craftDLCTypeToID.
  • UI Fallback (SaveEditorModel.swift):
    • Unknown items fall back to the localized label item (아이템 / 道具) instead of #id to avoid rendering duplicated IDs #id #id.
  • Tooling & Scripts (Scripts/build_reference_db.py & Scripts/gen_refdb.sh):
    • Added build_reference_db.py to regenerate the database and SQL dump deterministically from game data.
    • Updated gen_refdb.sh to support build_reference_db.py and verify updated row counts.
  • Tests:
    • Added Tests/DaveSaveCoreTests/NewEquipmentAndItemLookupTests.swift covering equipment lookups, charms, harpoons, multi-language resolution, search, and Jungle DLC craft materials.
    • Updated ExpandedEditingTests.swift to assert the official name Machine Component for item 1014980.
    • All 93 tests in 19 suites pass. Scripts/check_catalog.py passes all validation and terminology checks.

Verification

  • Tested against a real save file (GameSave_00_GD.sav) containing 62 inventory slots: all 62 items (including weapons 3010001, 3010011, 3011261, 3012001, harpoons 3013111, 3013132, charms 30170013017045, cutscenes 10195001019506, boat skin 1019603) resolve with 0 unidentified items in English, Korean, and Traditional Chinese.

…ions, and DLC mappings

- Add 601 EquipmentItem rows (weapons, harpoons, charms, diving gear) and 48 SubEquipment rows into reference.sqlite, mapped to their save-side equipment TIDs.
- Integrate official game localization tables across English, Korean, Simplified Chinese, and Traditional Chinese for 1,236 unique item and equipment text keys.
- Prioritize direct TID matches over ItemDataID references, ensuring charms like 3017001 resolve to their equipped charm name (Dolphin Necklace / 돌고래의 목걸이 / 海豚項鍊) rather than the raw unappraised pickup key Unidentified LongDash.
- Enhance prettify with prefix stripping (Item_JDLC_, Item_) and CamelCase handling for untranslated DLC/cutscene items (Memory of Yoshie).
- Fall back to localized "item" instead of repeating slot IDs (#id #id) when an unknown item is encountered in the inventory list.
- Support multi-language item search in ReferenceDB.searchItems matching across localized strings, developer keys, and numeric IDs.
- Add DLC 2 (May / Guilty Gear 14252101) and DLC 4 (In the Jungle 14252301) to dlcTypeToID in IngredientOps and craftDLCTypeToID in CraftMaterialOps.
- Add Scripts/build_reference_db.py to regenerate reference.sql and reference.sqlite deterministically from game tables and text assets.
- Add test suite in NewEquipmentAndItemLookupTests and update ExpandedEditingTests.
Copilot AI lite review requested due to automatic review settings September 12, 2026 22:52

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants