Skip to content

Cheats: find Chinese item names by their pinyin - #1047

Closed
jyy2luck wants to merge 3 commits into
Revivedx:testfrom
jyy2luck:feat/cheats-pinyin-search
Closed

jyy2luck wants to merge 3 commits into
Revivedx:testfrom
jyy2luck:feat/cheats-pinyin-search

Conversation

@jyy2luck

@jyy2luck jyy2luck commented Nov 21, 2026 •

Copy link
Copy Markdown

What this changes

The Cheats tab shows item names in the game's text language. A controller can enter ASCII in Search, so players using Chinese game text can now look up items by pinyin. For example, luyu and lu yu find 鲈鱼 items, and kaoluyu finds 烤鲈鱼. Search still accepts names and actor IDs.

  • Pinyin matching ignores case and spaces. Either u or v matches ü. Ordinary u and v remain distinct.
  • The give command tries the exact actor ID first, then partial name and actor matches. It tries pinyin when those searches return no items. This preserves existing script lookups.
  • The app derives the pinyin buffer size from the item-name limit and checks the expansion bound against the generated table. It computes readings once per displayed item.
  • The committed table comes from Unihan 18.0.0 kMandarin. Each Han character gets one reading, so words with a different reading in context may need a shorter query. The Windows ZIP, Linux AppImage, and macOS app packaging now include the Unicode License v3 notice.
  • The Cheats search hint is updated in all 13 translation tables.

How it was tested

Built the Windows app with MSYS2 UCRT64 and tested game version 1.9.0 with Simplified Chinese text, a scratch save, an RTX 5070 with NVIDIA driver 617.14, Vulkan 1.4, a 1280×720 window, a 60 FPS cap, and frame generation off. Vulkan draw counts confirmed that the scripted run reached the world. I sent the queries with tools/swctl.py and checked the replies and item pickup log.

Query Result
luyu and lu yu 7 matches each
kaoluyu One item matched and was added to the pouch
bingleng 8 matches for the reading of 冰冷
bingdong 16 matches for the reading of 冰冻
fish 33 matches through the existing actor lookup
  • make test-pinyin passed. It checked long inputs, the u and v distinction, and the table's 26,712 characters and 413 readings.
  • A synthetic regression check confirmed that a unique actor substring still gives the original item when a second item also matches through pinyin.
  • make test-control, tools/i18n_check.py, and git diff --check passed. I checked the packaging rules and the shell scripts' syntax.
  • The live test exercised the console path. Manual controller UI testing and inspection of packaged release artifacts remain open.

Checklist

  • Based on the latest test and opened against test
  • Built and run locally, and checked in the game
  • No game files, keys, firmware, generated game code or save files in the changes

The Cheats tab lists the items under the name the game's text language gives
them, and a controller types its Search on the on-screen keyboard
(runtime/ui/osk.mm), which has only ASCII keys and no input method. A Chinese
name therefore could not be searched for at all: "fish" did find the fish,
since the actors are English (Item_FishGet_C), but 鱼 matched nothing that a
controller could type.

The names now come with their pinyin readings, and the search looks at them
too: `luyu` finds 鲈鱼 and everything cooked from it, `kaoluyu` 烤鲈鱼,
`bingleng` the frozen fish, `yu` all 57 names with 鱼 in it. The readings are
the Unicode Han Database's kMandarin (Unicode License v3, third_party/unihan),
not the game's, so nothing of the game is shipped and every character has one:
all 819 names of a 1.9.0 game get a full reading. Tones are dropped and ü is
written u, which a `v` (a pinyin IME's key for it) also matches.

- runtime/pinyin.c, pinyin.h: a text's readings, and a search over them that
  leaves the spaces out on both sides, so syllables may be typed together.
- runtime/items.c, items.h: GameItem.pinyin, and items_matches() - the name,
  the actor or the pinyin - which the Cheats tab and the console's `give`
  command both use now (`give luyu`).
- runtime/pinyin_data.inc: 26,712 characters, from tools/gen_pinyin_table.py.
- The Search hint says it, in all 13 menu languages.

Tested: make test-pinyin (the C unit test, with gcc -fsanitize=address,undefined
too, and the table's consistency), clang -fsyntax-only on items.c with the
runtime's warning flags, and items_matches' rule run over the 819 names of a
1.9.0 RomFS: luyu 0 -> 8, kaoluyu 0 -> 1, bingleng 0 -> 8, yu 0 -> 57, and
every search that matched before still matches (fish 34 -> 34).
@jyy2luck jyy2luck closed this Nov 22, 2026
@jyy2luck jyy2luck reopened this Nov 22, 2026
Revivedx added a commit that referenced this pull request Nov 25, 2026
…onfiguration, fixes

From PRs:
- Picking another game folder clears the old setup errors (PR #975).
- --skip-launcher and --no-launcher (#970, PR #1014).
- Weapon wear down to 0.125x (PR #1012), Stamina drain 25-400 % (#968, PR #1045), Dynamic
  HUD (PR #1003), Remember menu position (#959, PR #1046), the Console key can move off F12
  (#1020, PR #1044).
- Japanese voices inside Pack/TitleBG_*.pack are redirected too (#1007, PR #1013).
- XeSS: the log names the size Dynamic picks (PR #1028); the velocity scale is set every
  frame (PR #1065).
- macOS: the system's fullscreen follows Video > Fullscreen, and the log goes to
  savagewind.log (PR #993).
- Missing or outdated shaders are precompiled before a start (PR #979).
- PGO training driver and perf tools (PRs #990, #991, #992).
- Vulkan: pre-indexed bindings, a cached identity scale table, a 4-way guest copy cache and
  batched vertex binds (PRs #1008, #1018); copies and feedback checks move to exec_copy.c
  and exec_feedback.c (PRs #1092, #1077); DLSS and frame generation share the camera
  motion, NGX parameters are cached (PR #1062, without its narrower DLSS barrier).
- Free camera keyframe paths (PR #1017), Chinese item names by pinyin (PR #1047), an
  estimated VRAM bar and higher graphics options (PR #1006).
- Reset to defaults keeps the hidden lock-on check on Guard (PRs #1086, #1085); no bare
  Sprint while the bow settles (#1051, PR #1089); quick drop after a weapon swap (PR #1069);
  72 FPS (#1080, PRs #1090, #1087).
- DLSS: DLAA, Render scale up to 100 % with temporal upscalers, no SMAA/FXAA on top
  (PR #1074); grass shimmer while running (PR #1075).
- The game code is picked only for complete x86-64 levels (PR #1060).
- Cheats: collectible hints on the map, read from the player's files (PR #976); the tab in
  sections (PR #1076); a quiet Link, the champion abilities, every shrine and tower on the
  map (PRs #1098, #1104, #1096).
- Launcher: A and Enter press Play at once, and setting up again asks first (#1079, PRs
  #1071, #1088, ported).
- Achievements (PR #236, ported), and they give the game's amiibo-only items, once per
  playthrough.
- NVIDIA DLSS frame generation, 2x/3x/4x (PR #345).
- A music volume slider (#1083, PR #1105), keep crouching after the camera (PR #1067),
  day and night length (PR #1059), three-axis mouse for shrine apparatus (PR #1094),
  sharper CJK text (PR #1107).
- The section-GC tests link on Windows (PR #1101); CI actions updated (PR #1068).

Savage Wind:
- Configuration and the in-game menu in SWMM+'s look; Install SWMM+; the Mods page lists
  and switches SWMM+'s mods; savagewind.log names the mods a run loads; the title screen
  shows the version and the mods; Enable cheats on Home.
- Video > Stars: the night sky's stars show at PC resolutions, Brightest by default.
- The sun shadow cascade cuts are dithered, so the shadow detail doesn't stop on a line
  that follows the camera (SAVAGEWIND_NO_CASCADE_BLEND=1: the game's own).
- Fixes: the HUD prompt label on the Xbox layout (#1055); Nintendo controllers stay with
  Steam Input (#136); DLSS gets the reactive mask (#1030); frame generation keeps its
  contexts when the render size changes (#1061); a far teleport moves the camera with Link;
  the conversation box on windows wider than 16:9 (#1093); tips' button marks follow A/B/X/Y
  (#1091); a damaged game code file is built again (#1084); the start backup takes the
  active save profile (#1114); ZL and ZR follow Guard and Bow once rebound (#1103); the
  free camera hides the minimap's stamps (#1117); the item list is read after the game's
  files mount; Dynamic HUD keeps the pouch replacement's row.
- Pipeline seed: 12967 pipelines (+1352, a tour of every map section).

Checked on Windows (RTX 3060): the unit tests touched by these changes pass (actions,
pc-controls, output-scale, game-cpu, launch-flags, dlc-check, mods, assists, input-focus,
gyro, control, achievements, pinyin and others), the UI text check has nothing missing,
and hidden runs reach the world at 60 fps with DLAA, DLSS, TAA and FSR 3. A play test
with a 100 % save found the item list, reward, pouch replacement and stars fixes above.

Co-authored-by: jfpaardoo <juaparpar@alum.us.es>
Co-authored-by: Fayber <contact@fayber.dev>
Co-authored-by: Quorthon13 <44161862+Quorthon13@users.noreply.github.com>
Co-authored-by: machinewrapped <10140676+machinewrapped@users.noreply.github.com>
Co-authored-by: ashe27 <6131777@gmail.com>
Co-authored-by: Kevin Peters <kevinigeligeligel@gmail.com>
Co-authored-by: B0D0PAD <107306077+B0D0PAD@users.noreply.github.com>
Co-authored-by: devall96 <313119844+devall96@users.noreply.github.com>
Co-authored-by: Paimonshen <137417967+Paimonshen@users.noreply.github.com>
Co-authored-by: lorenzo-zurini <lorenzo.zurini@icloud.com>
Co-authored-by: jiangyangyang <inuyashajyy@gmail.com>
Co-authored-by: gshlok <109033902+gshlok@users.noreply.github.com>
Co-authored-by: abdillahagil5 <192623160+abdillahagil5@users.noreply.github.com>
Co-authored-by: ShannoonRuaaa <90012158+ShannoonRuaaa@users.noreply.github.com>
Co-authored-by: jordanyoong1 <40160073+jordanyoong1@users.noreply.github.com>
Co-authored-by: DefinitelyNotSpammy <301402594+DefinitelyNotSpammy@users.noreply.github.com>
Co-authored-by: Boyce Yi <1473416941@qq.com>
Co-authored-by: byluki <steamluki424@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@Revivedx

Copy link
Copy Markdown
Owner

Thanks! This is in the test branch as part of d8c7197, with you as co-author, and it ships in Beta 1. Closing the PR here.

@Revivedx Revivedx closed this Nov 25, 2026
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.

3 participants