Skip to content

Added support for build 170934 (March 2026) hotkey format#6

Open
franzjacke wants to merge 3 commits intoPatchnote-v2:mainfrom
franzjacke:update-hkp-parser-2026
Open

Added support for build 170934 (March 2026) hotkey format#6
franzjacke wants to merge 3 commits intoPatchnote-v2:mainfrom
franzjacke:update-hkp-parser-2026

Conversation

@franzjacke
Copy link
Copy Markdown

@franzjacke franzjacke commented Apr 12, 2026

Summary

  • Added support for AoE2:DE build 170934 (current version, March 2026) which changed the .hkp binary format
  • New format wraps every hotkey record in named section markers (HandlerBaseGroupBegin/End, GroupHeaderGuard etc.)
  • Header version changed from 0x40866666 (v4.2) to 0x408a3d71 (v4.32)
  • Legacy format parsing preserved as fallback

Changes

  • Rewrote parse.py with new-format parser/unparser
  • Added analyze.py CLI tool for future format reverse-engineering
  • Fixed round-trip bug: id<=0 sentinel slots now survive serialize
  • File detection switched from size-based to filename-based (Base.hkp vs profile)
  • Stale group references (removed hotkeys) filtered from API responses
  • Added build 170934 default hotkey files
  • Bumped CURRENT_VERSION to 170934
  • Updated version display in frontend

Test plan

  • Parse + round-trip byte-for-byte on both example files
  • GET /api/upload/ returns valid hotkey JSON
  • POST upload with custom .hkp files returns 200
  • Frontend loads and displays hotkeys without errors

Edited with Claude

franzjacke and others added 3 commits April 12, 2026 06:13
The game changed the .hkp binary layout: every hotkey record is now
wrapped in named section markers (HandlerBaseGroupBegin/End,
GroupHeaderGuard) and the file is structured with named sections
(additionalHotkeysBegin, allUnitCommandHotkeys, detachedHotkeyGroups,
etc.) instead of flat count-based arrays. Header changed from
0x40866666 (v4.2) to 0x408a3d71 (v4.32).

- Rewrite parse.py with new-format parser/unparser (legacy fallback kept)
- Add analyze.py CLI tool for future format reverse-engineering
- Fix round-trip: preserve id<=0 sentinel slots via _raw_menus
- Detect Base.hkp by filename instead of file size
- Filter stale group references (removed hotkeys) from API responses
- Add build 170934 default hotkey files, bump CURRENT_VERSION
- Update displayed version in frontend Info panel

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI tool that reads custom .hkp files and generates the
key-value-modded-strings-utf8.txt used by the "TTs visible Hotkeys
(Configurable)" AoE2:DE mod to display the correct key labels on the
5x3 command grid in-game.

Usage: python -m hotkeys.hkp.keys_for_language Base.hkp [Profile.hkp] [-o output.txt]

Maps the 15 Economic Build Menu positions to their custom keycodes
and outputs IDS_MOD_TTS_VISIBLE_HOTKEYS_01 through _15 with the
correct key labels. Unbound keys are shown as empty strings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added support for all command-grid panels (Military Build Menu, Barracks,
Archery Range, etc.) via --panel flag, plus --best-fit mode that picks
the most common key per position across all panels. Added --list-panels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@franzjacke franzjacke closed this Apr 13, 2026
@franzjacke franzjacke deleted the update-hkp-parser-2026 branch April 13, 2026 13:19
@franzjacke franzjacke restored the update-hkp-parser-2026 branch April 13, 2026 13:32
@franzjacke
Copy link
Copy Markdown
Author

Reopening, I guess I deleted to much

@franzjacke franzjacke reopened this Apr 13, 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.

1 participant