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:
Executable
+66
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the Android APK end to end: native GDExtension .so -> Godot export -> (opt) install.
|
||||
#
|
||||
# ./export-android.sh [Debug|Release] [--install]
|
||||
#
|
||||
# Prereqs (one-time), see docs/PLATFORMS.md:
|
||||
# - Android SDK at ~/Library/Android/sdk with an NDK under ndk/<ver>
|
||||
# (sdkmanager "ndk;27.2.12479018" "platforms;android-35" "build-tools;35.0.0")
|
||||
# - JDK 17+ (brew install openjdk@21)
|
||||
# - Godot 4.7.1 export templates installed
|
||||
# - ./gen-debug-keystore.sh (once)
|
||||
# - editor_settings-4.7.tres: export/android/{android_sdk_path,java_sdk_path,debug_keystore}
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
CONFIG="${1:-Debug}"
|
||||
INSTALL=0
|
||||
[ "${2:-}" = "--install" ] && INSTALL=1
|
||||
|
||||
SDK="${ANDROID_HOME:-${ANDROID_SDK_ROOT:-$HOME/Library/Android/sdk}}"
|
||||
export ANDROID_NDK_ROOT="${ANDROID_NDK_ROOT:-$SDK/ndk/$(ls -1 "$SDK/ndk" 2>/dev/null | sort -V | tail -1)}"
|
||||
export JAVA_HOME="${JAVA_HOME:-/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home}"
|
||||
[ -d "$JAVA_HOME" ] || export JAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home
|
||||
GODOT="${GODOT:-godot}"
|
||||
ADB="${ADB:-$SDK/platform-tools/adb}"
|
||||
|
||||
case "$CONFIG" in
|
||||
Release) MODE="--export-release" ;;
|
||||
*) MODE="--export-debug" ;;
|
||||
esac
|
||||
OUT="build/export/mtgodot-poc$([ "$CONFIG" = Release ] && echo -release).apk"
|
||||
|
||||
echo ">> NDK: $ANDROID_NDK_ROOT"
|
||||
echo ">> JDK: $JAVA_HOME"
|
||||
|
||||
# 1. native GDExtension
|
||||
./build-android.sh "$CONFIG"
|
||||
|
||||
# 2. bake the AssetResolver index (PCK can't std::filesystem-scan on device).
|
||||
# Regenerate whenever assets/ changes. Harmless if assets are missing.
|
||||
"$GODOT" --headless --path project --script bake_asset_index.gd || \
|
||||
echo ">> (asset_index bake skipped — no assets on this machine)"
|
||||
|
||||
# 3. Godot export
|
||||
mkdir -p build/export
|
||||
"$GODOT" --headless --path project "$MODE" "Android" "$(pwd)/$OUT"
|
||||
|
||||
echo
|
||||
echo ">> APK: $OUT (index: $([ -f assets/asset_index.txt ] && echo baked || echo MISSING))"
|
||||
unzip -l "$OUT" | grep -E "lib/arm64-v8a/.*\.so" || true
|
||||
|
||||
# 3. optional install (+ push the asset zip if it exists)
|
||||
if [ "$INSTALL" = 1 ]; then
|
||||
"$ADB" devices -l
|
||||
"$ADB" install -r "$OUT"
|
||||
if [ -f build/export/assets.zip ]; then
|
||||
DEST="/sdcard/Android/data/org.internal.mtgodotpoc/files/assets.zip"
|
||||
echo ">> pushing assets.zip ($(du -h build/export/assets.zip | cut -f1)) -> $DEST"
|
||||
"$ADB" shell mkdir -p /sdcard/Android/data/org.internal.mtgodotpoc/files/ || true
|
||||
"$ADB" push build/export/assets.zip "$DEST"
|
||||
else
|
||||
echo ">> NOTE: no build/export/assets.zip — run ./pack-assets.sh; the world won't render without it"
|
||||
fi
|
||||
"$ADB" shell am start -n org.internal.mtgodotpoc/com.godot.game.GodotApp
|
||||
echo ">> logcat: $ADB logcat -s godot GodotError Godot"
|
||||
fi
|
||||
Reference in New Issue
Block a user