Fix the per-function inventory against the clang-derived platform skeleton:
strip comments, accept indented qualified definitions in namespace blocks,
long parameter/initializer lists and all-caps qualified ctors, and skip
constructor initializer entries. Split EterBase by unit: tea/lzo/cipher/
Random/Stl/Timer/Poly become logic, the file/OS units stay platform; drop
the 8 obsolete platform stubs and regenerate audit/slices.
Baseline: logic 3343, python 5175, platform 2091 (10609), 0 done.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Mirror the remaining non-Python 2V3 closure headers (98 more, 173 total): EffectLib,
EterGrnLib, SpeedTreeLib, SphereLib, PRTerrainLib, EterImageLib, EterBase/Poly, cipher/tea,
EterLib Grp*/IME/Input/MSWindow/StateManager, GameLib actor/map/race headers, EterPack.
- SDK shims: granny.h, SpeedTreeRT.h, imm.h, Dimm.h (the SDK MIDL header, not mirrored),
dinput/d3dx8 additions; D3D8 render-state enums, FVF macros and the COM resource hierarchy;
more Win32 GDI/handle types with layout static_asserts.
- PORT edits for MSVC-permissive code (typename, friend visibility, <algorithm>, pointer→uintptr_t)
and PRTerrainLib/StdAfx.h dropping the ScriptLib/Python include.
- port_logic links the vendored cryptopp/minilzo.
- extension/src/platform: port_platform target with 103 generated stub files (1917 function
stubs, 146 static members) from the new platform_stub.py (clang -ast-dump-filter);
MT_PLATFORM_STUB() marks every unimplemented body. libmtgodot links port_platform and
port_gate.sh builds it.
Gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
76 closure headers (EterBase, EterLocale, EterPack, EterLib, GameLib, MilesLib,
EffectLib, SphereLib, EterImageLib) copied by the new port_copy.py (CP949->UTF-8,
LF, include-path case only); platform-class headers go to the mirror path too, as
the interface platform/ implements. Six manual `// PORT:` edits (Random, Singleton,
Pool, Stl, Utils, FlyTarget).
- common/D3D8Types.h: D3D8 value types with SDK values/layout, opaque COM interfaces
- common/shim/sdk (d3d8/d3dx8/mss) on every platform, common/shim/win32 off Windows
- Win32Types/Win32Crt: HRESULT, GUID, LARGE_INTEGER, LOGFONT/TEXTMETRIC, _atoi64,
CRITICAL_SECTION on std::recursive_mutex
- header gate prepends each library's StdAfx.h (40250's precompiled header)
port_gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain).
ScriptLib/EterPythonLib/UserInterface wait for 2P (their StdAfx includes Python).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
D3DXVECTOR2/3/4, D3DXMATRIX, D3DXQUATERNION, D3DXPLANE, D3DXCOLOR with
d3dx8math.inl operator semantics, plus the D3DX* functions the 2V3 slice
logic uses. Covered by port.common; port_gate passes on macOS, Android,
iOS and Windows (mingw).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
port_deps.py resolves explicit #include edges plus the implicit edges each
40250 library's StdAfx.h supplies (symbol index restricted to StdAfx-visible
headers), writes cumulative slice lists and the P0 topological order.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- keep 40250 widths/overflow semantics (Win32 long = 32-bit), fixed-width
serialized structs with static_assert, instead of copying C type names
- 2A base batch (types, header closure, port_logic target, platform stubs,
header gate, port-map re-baseline) and include-order porting
- 2R pack inventory: six EPK compression types, HybridCrypt key source,
index override order, path case, mobile delivery
- 2P: shared source list, per-platform pyconfig.h, all five platforms
- 2V minimal vertical slice; old and new paths coexist until wired
- strict asset tests (MT_ASSETS vs M2_ASSETS), RUN_AS_IS instead of N_A,
void the 6 pre-architecture 'done' functions
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Records the root/uiscript/locale comparison: npclist, msm contents and
motion/combo registration match; msm location differs; item_proto and
mob_proto use a different record layout and TEA instead of XChaCha20,
so proto.cpp cannot read them; pack contents not yet compared.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Records the decisions (mirror-layout logic port, embedded CPython 2.7 UI),
layers and code layout, batch route and status, and the directory/toolchain
setup needed to resume on another machine. Marks the older refactor plan as
superseded and points CLAUDE.md/AGENTS.md/roadmap at it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
libpython2.7.a cross-builds with NDK 27.2 (API 24) after disabling
HAVE_LANGINFO_H; 30 C modules built in. On a OnePlus 13 (API 36) the
harness runs system.py -> prototype.RunApp() and imports the root modules
with results identical to macOS (66/74; the 8 failures are stub values or
dev-only scripts). py_embed_spike.py now isolates __main__ like
CPythonLauncher and reports stdlib usage.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Handle late main-character data, guarded model construction, bounded retries and map correction. Validate player model sources and add lifecycle and real-asset visual regressions.
Include pending material and character-selection changes, updated A1 screenshot, and the detailed rendering repair plan. Hair occlusion, full UI parity and final macOS package acceptance remain unfinished.
CLIENT-GAP-FIX §2.1/§2.3/§2.4/§2.5 (+ §2.2 steps 4-5):
- §2.1 two-layer model: EntityStore is data-only. Entries are created only by
mut_spawn / mut_spawn_full / mut_spawn_main and removed only by mut_despawn /
main-vid table clear. Every other mut_* now does find-or-return with a
MT_NET_TRACE-gated debug log; no pending / replay buffer. Visibility moves to
net_world.gd::_update_visibility() — per frame it walks client.get_entities()
and mirrors is_main / AFFECT_SHOW_ALWAYS(bit 7) / IsWall(14201-14204) /
planar-distance < CHAR_STAGE_VIEW_BOUND (200*100 cm), building a node on entry
and fading + freeing it past +10 while keeping the data row (_fading guard).
Gate is fail-open when the data layer is not queryable (no get_entities /
_main_vid == 0 / no pos_cm) so existing fake-client tests are unaffected.
- §2.3 one overwrite rule: mut_spawn_full() does a clean whole-row value replace
(m_ents[vid] = e), no preservation of prior move state on VID reuse; mut_spawn()
now delegates to it. net_world._on_spawn destroys + recreates a node when the
vid already has one; mount/dismount rebuild keeps the old global_position.
- §2.4 points bounds: mut_set_points() clamps counts > POINT_MAX_NUM (255) and
zeroes the tail of a short snapshot; mut_set_point() rejects type >= 255.
- §2.5 field apply order + affect flags: new EntityStore::mut_affect_flags(vid,
lo, hi) assembles v = lo | (hi << 32) and queues a dirty tick; mut_char_update
guild/alignment/pk changes now also push Info. net_world._apply_field_updates()
applies fields in the reference call order (NetworkActorManager.cpp:470).
- §2.2 steps 4-5: mut_char_info() / mut_shop_sign() drop the touch()-creates-
entity path. Steps 1-3 (m_pending_actor two-packet merge) remain W1-owned.
Tests: ./build.sh Debug exit 0; ctest 16/16 (net.entity_store gains a §2.1
data-layer assertion block). New project/net_world_vis_test.gd for scene-node
visibility. GDScript regressions green: netbridge_test, gamescene_test,
netplay_test, p9_test, combat_fx_test, player_motion_test, net_world_vis_test.
Follow-up for W1: call mut_affect_flags(vid, affect_flag[0], affect_flag[1])
from classic_parser.cpp after GC_CHARACTER_ADD[2] / GC_CHARACTER_UPDATE
(mut_char_update has no affect param). wire_classic.h already has the wanted
static_assert on GCPoints.points.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yvAPqPivoY7vmBbzgqK4W
§1.5 CG_CLIENT_VERSION: send_client_version() now branches on locale. EUROPE
(this project's locale) sends CGClientVersion2 (header 0xf1, 67B, timestamp
"1215955205"); non-EUROPE sends CGClientVersion (0xfd) + CMake-injected
MT_BUILD_TIMESTAMP in C __TIMESTAMP__ form. New ClassicSession::set_executable_name()
(default "metin2.bin"; TODO(W0): M2Client passes OS::get_executable_path().get_file()).
m_version_sent set only after send_fixed() succeeds. wire_classic.h gains
CGClientVersion2 + size-table entry.
§1.10 fixed-length text: new extension/src/net/text_codec.h — to_wire()/
from_wire_str() apply a hard byte cap without splitting a UTF-8 multibyte
sequence; godot::String overloads are __has_include-guarded so mtnet stays
godot-free. classic_session.cpp routes 8 fixed-length name/sign/comment fills
through to_wire(); parser reads GC_CHAR_ADDITIONAL_INFO name via from_wire_str().
New net_text_codec_test (ctest net.text_codec). Locale codepage (CP949/CP1252)
transcoding remains a follow-up; wire bytes are currently UTF-8 (ASCII round-trips).
§2.2 two-packet PC/NPC merge: ClassicParser GC_CHARACTER_ADD drops invisible
races (20025/20038/20039); PC/NPC only stash a bare Entity into m_pending_actor;
everything else spawns immediately with a name from root/npclist.txt (new
npc_names.h + set_npclist_path(); $MT_ASSETS/$M2_ASSETS fallback; TODO(W0):
M2Client passes the asset root). GC_CHAR_ADDITIONAL_INFO with no pending entry
records m_last_error + m_unhandled_headers and drops (never half-creates);
on a hit it merges the pending Entity with the additional-info's 9 fields into
one mut_spawn_full() then erases the pending entry. New pending_actor_count()
test hook; net_classic_session_test updated (version assertions -> 0xf1;
stash -> merge -> spawn, immediate monster spawn, invisible-race drop,
no-pending additional-info is a no-op). Depends on W2 §2.2 steps 4-5
(entity_store mut_char_info touch / mut_shop_sign cleanup) — the merge works
with current W2 code as-is.
Build + ctest 17/17 (16 + net.text_codec); netbridge_test, p10_test green.
Docs: CLIENT-GAP.md W1 row + increment-50 change-log entry; CLIENT-GAP-FIX.md
§1.5/§1.10/§2.2 status + facts and C.5 batch record.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yvAPqPivoY7vmBbzgqK4W
Implement the in-game Help window as a 1:1 migration of uihelp.py's
HelpWindow (single-page: ENABLE_HELP_MULTIPAGE = 0 -> LoadDialogSinglePage).
- project/ui/help_ui.gd (new): loads the real helpwindow.py uiscript via
UiScript -> UiBuild; _relabel() resolves the <HELP_*>/<CLOSE> placeholders
(produced when UiManager has no locale callback) from the project Locale
table (en) with verbatim English fallbacks, covering the original script's
two duplicate help_02 rows (right/middle camera). open/close/toggle/is_open;
close_button -> close; ESC handled by the UiManager window stack.
- project/ui/system_menu_ui.gd: help_button changed from the placeholder toast
to close() + open_help(); adds const HelpUI, an injectable help_ui member,
_ensure_help() (lazy build, reuses the menu's ui/client/assets_root),
open_help(), toggle_help(); setup() gains an optional 6th arg (old 5-arg
callers unaffected).
- project/game_scene.gd: single elif in _unhandled_input — KEY_H without
ctrl/meta -> system_menu_ui.toggle_help() (Ctrl+H stays free for
/user_horse_ride).
- project/help_ui_test.gd (new): headless SceneTree test — helpwindow.py load,
19 verbatim help rows + taskbar labels bound and non-placeholder,
close_button text, rows() helper, close/open/toggle, ESC stack top,
SystemMenuUI.open_help() lazy build.
Tests: help_ui_test, system_menu_ui_test, gamescene_test, ui_test all PASS
(plus system_option_ui_test, char_status_ui_test). No build/ in this worktree
so C++ ctest not run (no C++ change). Real-server and visual (.sub textures)
not verified. Docs: CLIENT-GAP.md W3 row + increment 50 bullet;
CLIENT-GAP-FIX.md §8.3 status/改动/测试/验收 + C.5 batch record.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yvAPqPivoY7vmBbzgqK4W
Rendering fixes (real):
- m2_material shaders: cull_disabled -> cull_back (inside-of-mesh faces were
z-winning and darkening/hiding the head under the ShaderMaterial path).
- drop `* COLOR` from the shader (meshes carry no ARRAY_COLOR).
Animation: convert gr2 global poses to Godot *local* bone poses and set via
set_bone_pose (was set_bone_global_pose). MTGODOT_VERIFY=1 confirms
get_bone_global_pose(i) == conv(world[i]) for all 75 bones (<=2.6e-5).
Head/upper-armor collapse on dance_1 is NOT a Godot-route bug:
- reproduced identically in xrender-poc's bgfx demo at the same anim/t
- reproduced by the new MTGODOT_CPUSKIN=1 reference path (same LBS math as
xrender's validated skin_mesh)
- `general/wait` / `run` render correctly in all three
=> upstream libgr2 Curve::eval (degree-2 quaternion B-spline) vs Granny.
Demo default animation switched to general/wait; documented in MIDREVIEW §4
and README. Debug scaffolding gated behind MTGODOT_VERIFY / MTGODOT_CPUSKIN.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaHYEY9rwLWt21PULiYjeJ
- docs/MIDREVIEW.md: what M0'-M2.5 proved, bridge-layer LOC (~1100),
key technical conclusions (4x4 transpose, animation method B, no
handedness flip needed), remaining risks, recommendation = enter Phase 2
with a 3-item wrap-up (compare.py, dump_materials oracle, refocused perf).
- harness MTGODOT_STRESS=N: grid of N animated warriors, vsync off, dumps
test/godot-macos-stress.json. Frame times are throttle-capped in a
background window (~30fps to 50 chars, 52ms at 100); the reliable signals
are build cost ~165ms/char and the 100-char breakout.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaHYEY9rwLWt21PULiYjeJ
- extension/: godot-cpp submodule (master, API 4.7), Metin2Model node
registered, links xrender-poc/libgr2 via sibling-dir reference.
- project/: Godot 4.7 project — orbit camera + DirectionalLight3D (shadows)
+ WorldEnvironment/procedural sky + placeholder cube; main.gd probes the
extension and can run libgr2 on a real .gr2 (MTGODOT_PROBE_GR2).
- build.sh one-shot build into project/bin/.
- docs/GODOT-POC-PLAN.md (phased: Phase 1 macOS -> M0'/M1/M2/M2.5).
Verified on this machine:
[mtgodot] Metin2Model registered OK — libgr2 linked
probe_gr2(warrior_cheongrin.gr2) -> gr2 OK: format_version=6 sections=8
Metal Forward+ renders the scene (test/golden/m0-scaffold.png).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaHYEY9rwLWt21PULiYjeJ