Files
mtgodot-poc/docs/reference
shenandClaude Sonnet 5 47baf6c0c6 Metin2 game client (P0–P11) + mobile asset pipeline
Networked client on the existing Godot 4.7 + libgr2 renderer:
- net: m2dev wire protocol (libsodium KX + XChaCha20), auth/select/game
  phases, EntityStore world model, ~all GC/CG headers. char create/delete,
  private shop / mall / cube, SHOP_GC_START_EX, guild, party (+ CG_PARTY_SET_STATE),
  quests, dragon soul, refine, safebox, exchange.
- UI: in-game windows migrated 1:1 from the reference uiscript/root .py —
  char status (/stat), inventory+equipment, select-item ([SELECT_ITEM] quest
  token), system-option + game-option + ESC system menu, private-shop 39-grid,
  party info board, shop tabs, atlas, minimap, quickbar, chat, …
- EterGrnLib polish: GR2 material blend/two-sided, LOD crossfade, motion-event
  dispatch, contact shadow, ray-AABB picking, weapon grip pre-transform.

Portable asset IO (A1) — all extension/libgr2/formats/mtproto reads routed
through godot::FileAccess (res:// PCK works on iOS/Android); standalone-lib
*_path() kept for the non-Godot CTests. AssetResolver + PropertyRegistry
switched to a baked index (bake_asset_index.gd) instead of std::filesystem.

Mobile builds: build-{android,ios}.sh, export-android.sh, pack-assets.sh,
gen-debug-keystore.sh. Assets ship as a zip mounted at runtime by
project/asset_pack.gd (adb push now; HTTP download is a drop-in later).

ctest 10/10, 34 GDScript suites, macOS/iOS/Android all build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EJxkHiNKS4kybHS3XKyAJ
2026-08-31 20:02:12 +09:00
..

reference/ — archived from xrender-poc

These docs come from xrender-poc, the bgfx-based rendering POC that was retired on 2026-08-29 in favour of the Godot route (this repo). See ../MIDREVIEW.md for the decision.

They are kept because the reverse-engineering knowledge is route-independent and still authoritative:

file what's still useful
steps/M0-gr2-reader.md the entire .gr2 v6/v7 format breakdown that libgr2 implements — header, sections, Oodle1, self-describing type tree, granny_transform, OldCurveType B-splines, the "明确不做" table. libgr2 is vendored here now (../../libgr2).
steps/00-oracle.md how the Wine + MinGW Granny oracle works — the ground truth for libgr2 numeric verification. Oracle harness vendored at ../../oracle/.
steps/M1-static-render.md material-binding chain (granny_material.Maps[].Mapgranny_texture.FromFileName), DDS/DXT decode, the bgfx-era gotchas. The material logic maps 1:1 onto m2_material.cpp here.
steps/M2-anim-skinning.md CPU LBS formula, sample_pose retarget-by-bone-name, the Granny normal-transform (plain 3×3, no inverse-transpose) — same math the GDExtension uses. Numeric gates vs Granny (≤6.5e-5).
steps/M3-mobile.md iOS/Android notes from the bgfx shells — historical; Godot handles platform now.
steps/M4-realistic-load.md eterpack / full-load plan — deferred in both routes.
PLAN.md the bgfx-route master plan. §01 (go/no-go criteria, "工程性延期 vs 方案性死路"), §05 (format findings), §07 (visual-diff layering) are still the shared vocabulary.
DEMO-PLAN.md bgfx RHI demo design record. Mostly superseded; kept for the shader/material-stage analysis.

Relative paths inside these files (../libgr2, oracle/, test/golden/…, engine/…, app/…) refer to the old xrender-poc layout. The mapping:

old (xrender-poc) now (mtgodot-poc)
libgr2/ libgr2/ (vendored, unchanged)
formats/ formats/ (vendored)
oracle/ oracle/ (vendored; oracle.exe + granny2_x64.dll rebuilt locally)
tools/{gr2dump,gr2fuzz,oracle_diff} tools/ (build with -DMTGODOT_BUILD_TOOLS=ON)
engine/, app/, platform/, third_party/ dropped — Godot + the GDExtension in extension/ replace them
test/golden/*.png (bgfx shots) test/bgfx-reference/ (cross-check images)
test/{noise_floor,m2-numeric}.json, assets.list test/ (vendored baselines)