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
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
// areadata.txt / areaambiencedata.txt / areaproperty.txt —— 每个区块的对象记录。
|
||||
// 对标 GameLib/Area.cpp __Load_LoadObject / __Load_LoadAmbience 和
|
||||
// MapOutdoorLoad.cpp 的 AreaProperty 解析。SHINSOO §5.3 / §5.6。
|
||||
//
|
||||
// 坐标系(W0 判明 → W3 修正,2026-08-29):areadata 的 position 是**地图全局厘米**(不是
|
||||
// 区块本地!只有 000000 因为在原点附近才看着像本地)。x 正 = 东,y 负 = 南(幅度 = 距地图
|
||||
// 北边缘),随 tile_y 增大而更负。`Area::SetCoordinate` 不偏移,正因为 position 已是全局。
|
||||
// 各区块 x∈[tile_x·25600, +25600]、|y|∈[tile_y·25600, +25600](实测 A1 全 20 区块)。
|
||||
// z 是竖直(高度)轴 cm。heightBias 加在 z 上。转换:直接 position_to_godot(x, y, z)。
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace fmt {
|
||||
|
||||
struct AreaObject {
|
||||
double x = 0, y = 0, z = 0; // 区块本地 cm
|
||||
uint32_t crc = 0; // property CRC
|
||||
float yaw = 0, pitch = 0, roll = 0;
|
||||
float height_bias = 0;
|
||||
std::vector<int> portal_ids;
|
||||
};
|
||||
|
||||
struct AreaData {
|
||||
int declared_count = 0; // ObjectCount
|
||||
std::vector<AreaObject> objects; // 实际解析到的(缺块会跳过,故可能 < declared)
|
||||
};
|
||||
|
||||
struct AreaAmbienceObject {
|
||||
double x = 0, y = 0, z = 0;
|
||||
uint32_t crc = 0;
|
||||
float range = 0;
|
||||
};
|
||||
struct AreaAmbienceData {
|
||||
int declared_count = 0;
|
||||
std::vector<AreaAmbienceObject> objects;
|
||||
};
|
||||
|
||||
struct AreaProperty {
|
||||
std::string area_name; // AreaName(去引号)
|
||||
int num_water = 0;
|
||||
};
|
||||
|
||||
bool parse_area_data(const std::string& text, AreaData& out, std::string* err);
|
||||
bool parse_area_data_file(const std::string& path, AreaData& out, std::string* err);
|
||||
|
||||
bool parse_area_ambience(const std::string& text, AreaAmbienceData& out, std::string* err);
|
||||
bool parse_area_ambience_file(const std::string& path, AreaAmbienceData& out, std::string* err);
|
||||
|
||||
bool parse_area_property(const std::string& text, AreaProperty& out, std::string* err);
|
||||
bool parse_area_property_file(const std::string& path, AreaProperty& out, std::string* err);
|
||||
|
||||
} // namespace fmt
|
||||
Reference in New Issue
Block a user