Files
mtgodot-poc/oracle/FORMAT.md
T
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

46 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# oracle dump 二进制格式
> `oracle.c``oracle dump`)产出。libgr2 侧对拍读取器(`tools/oracle_diff/`)必须与本文件一致。
> `oracle dump` 把**层① 世界矩阵**和**mesh N 蒙皮顶点**写进**同一个文件**:先文件头,
> 再 `kind=1` 段,紧接着 `kind=3` 段(`--mesh` 未命中时 `vertex_count=0`)。全部小端。
## 文件头(所有 dump 共用)
```
magic "XORC" 4B
version u32 1
kind u32 1=层① 2=层② 3=蒙皮顶点 1
coord u32 坐标约定编码: 1
bit0 手系 (0=左手 1=右手)
bit1 单位 (0=原始 1=米)
bit2 根变换已 apply
granny_ver char[16] 选定 granny2.dll 版本串
model_path len-prefixed str
anim_path len-prefixed str
t f32 采样时刻
```
## kind=1/2 段(骨骼世界矩阵,紧跟文件头)
```
bone_count u32
matrices f32[bone_count][16] GrannyGetWorldPose4x4Array 直出(骨骼空间→世界),行主序 Granny 原生
```
> ⚠ 不是 `GrannyGetWorldPoseComposite4x4Array` —— 那个返回 `InverseWorld4x4·world` = **蒙皮矩阵**bind pose 时 ≈ I)。
> `GrannyBuildWorldPose` 的 `Offset4x4` 传的是 model 的 `InitialPlacement``GrannyGetModelInitialPlacement4x4`),
> 与 libgr2 `skeleton.initial_placement` 一致;不传的话非单位 IP 的模型(如 assassin 双 root)会差一个平移。
## kind=3 段(mesh N 蒙皮顶点,紧跟 kind=1 段)
```
vertex_count u32 (--mesh 未命中 → 0,无后续)
positions f32[vertex_count][3] GrannyDeformVertices(PositionNormal) 后的位置
```
## 坐标约定
**M0/oracle 全程 raw**`coord` = 手系按选定 DLL 实际输出、单位=原始、根变换未 apply。
libgr2 的 `gr2::Mat4` 声明同一约定(见 `docs/steps/M0-gr2-reader.md` 「约定」)。
basis fix / 单位缩放是 M1 渲染时才做的事,不进 dump。