ParseRaceMotionData now reads LoopData, MotionEventData and the per-motion
.mss sound script. ActorInstance runs the events each 1/60 s frame:
effects, sounds, splash attacks, fly shots, show/hide and warp. Player
skill and guild-skill motions are registered. ClickSkillSlot and remote
FUNC_SKILL states play the skill motions, and fly targets are synced with
the server (audit P1 #4).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Character create/delete/rename and empire selection now reach the
server, and LOGIN_SUCCESS3, PLAYER_CREATE_SUCCESS/FAILURE,
PLAYER_DELETE_SUCCESS/WRONG_SOCIAL_ID, POINT_CHANGE and CHANGE_NAME are
parsed and forwarded to the select/create windows like Windows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PHASE_SELECT returns the connection to LoginSession (cached roster,
SelectReady, later LOGIN_SUCCESS refreshes), PHASE_CLOSE goes to the
login phase, LOADING clears the player, GAME refreshes the status and
DEAD no longer leaves the game phase.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RecvWarpPacket now matches Windows: DirectEnter for the selected slot
(warp flavour, SetNewLoadingPhase) and Connect(lAddr, wPort) through
LoginClient::warp, discarding what is left on the old socket.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CMapOutdoor keeps the 3x3 terrain blocks around the player loaded and
reloads them on a block change; we loaded only the warp block, so the
map ended at its edge. Stitch the set into one TerrainHeightmap, fix the
attr.atr cell mapping, and reload terrain, areadata and water per block
from CPythonBackground::Update.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Interaction ideas from jhaizhou-ops/d2r-mobile (MIT), no code taken:
- world fingers in the bottom safe inset (gesture bar) are ignored
- SDL_EVENT_FINGER_CANCELED cancels one finger; a cancelled joystick
keeps its vector for 300 ms and a finger near the old base re-acquires it
- attack taps shorter than a frame release on the next Update
- cancelled UI touches and world taps park the pointer (no hover residue)
- long press on an empty inventory cell offers the original sort
Desktop ctest 59/59; sort sheet verified on the device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDK 62a5f5a carries the SpeedTree runtime, so the local mirror/shim is no
longer needed. attack_combo and ava2_render_3d tests called the code under
test inside assert() and segfaulted under NDEBUG; undefine it like
hardware_scene_test. android/build.sh prefers the SDK adb. Desktop ctest
59/59 incl. speedtree_forest; device 60 fps with real trees.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the EterPythonLib CSlotWindow/CGridSlotWindow mouse handlers
(select, drop, use, right click, tooltips, grid picking/CheckMoving) and
CWindowManager IsDragging/right button, which were missing so item
interaction did not work on desktop either. app.SetMouseHandler now
renders the attached icon, app.IsPressed reads real key state, desktop
double clicks reach the window manager.
The touch router maps UI touches to the original mouse: tap = click at
the touch-down point, drag = press-and-drag, double tap = double click,
long press on an item slot = touch.SetLongPressEvent, which opens the
ui_mobile_actions item sheet (use / split / quick slot via virtual
Shift/Ctrl). New ava2.inventory_touch test drives uiinventory.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Engine-free AutoHunt state machine (search/engage/loot/return/paused) driven
from the game loop through the existing manual paths: move target, target
packet, normal attack, quickslot skills, item pick-up and belt potions.
player.SetAutoHunt/GetAutoHuntState/SetAutoHuntOption with autohunt.cfg;
AUTO button on the combat wheel (tap toggles, long press opens settings).
Tests: ava2.auto_hunt, extended ava2.touch_game; 54/54.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phones and tablets pick the logical UI size from the screen (height
600..768 from the dp height, width from the aspect ratio) instead of
letterboxing 1024x768; metin2.cfg is left untouched via a display-size
override. --phone/--safe-insets/--ui-height simulate on desktop. The
mobile HUD rebuilds and re-adopts the original windows when the safe
area changes. Keeps HUD gauge backgrounds alive and fixes the step-4
disc pixel check threshold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native CDisc window for procedural round frames; ui_mobile_widgets
(RoundButton, QuickSlotDisc); HUD laid out as the phone plan: player
panel, top-right entry row with minimap, left button column, attack disc
with two quickslot rings, potion belt on quickslot page 4, exp bar. The
PC taskbar and its tooltips are hidden in mobile mode. Adds global
quickslot use/add/move for the belt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the macOS/Android data and config directory code out of main.cpp
into src/app/platform. Handle background/foreground: save config and
interface status, pause audio, cancel touch input and skip rendering
while keeping the network pumped. Map the window safe area through the
letterboxed presentation into TouchLayout and expose touch.GetSafeArea()
so the mobile HUD stays clear of notches and gesture bars.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the ActorInstanceBattle combo state machine, CRaceMotionData attack
data, player motion/combo tables, NEW_Attack + OnAttack/OnHit packets and
remote FUNC_ATTACK/FUNC_COMBO playback so keyboard and touch attacks swing
and hit on the real-server path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route each finger to UI, the attack button, a floating lower-left joystick or
the camera (drag rotate, pinch zoom, tap = world click). Touch mode is default
on Android/iOS and available on desktop via --touch / AVA2_TOUCH=1; it disables
SDL touch-to-mouse and drives app.ENABLE_MOBILE_HUD. The joystick feeds the
original camera-relative movement path and the attack button sets the same
attack-key state as player.SetAttackKeyState. New `touch` Python module; the
mobile HUD joystick and combat wheel become display-only.
Tests: ava2.touch_router, ava2.touch_game (GameWindow + mobile HUD).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Helper attachments made outside the part slots were attached to
PART_MAIN only and dropped whenever the parts were rebound (LOD level
change, shape change, slot update). They are now recorded on the actor,
attached to the drawn instance and re-attached after the slots. A slot
taking the same bone drops the helper (last writer wins, as before);
SetRace/SetModel clear them. LODs missing a helper's bone stay on
PART_MAIN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Back-to-front order for blended, non-depth-writing, water and additive
draws now uses the bounds centre of the vertices the draw indexes. The
centre of shared (immutable) geometry is cached per index range and
validated against the owning pointer; per-frame geometry is recomputed.
Depth-writing opaque draws keep the first-vertex tie-break.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port CGrannyLODController level selection: _lod_01.._03 are queued
{lod_03, lod_02, lod_01, main}, loaded lazily, and chosen from the
camera-target/camera distance bands (actors) or the building factor.
Parts, skins and the current motion follow the drawn instance.
Shipped LODs that drop an attaching bone in use (lion2_lod_02/03 lose
"saddle", shaman_miyeom_lod_* lose equip_left/right) stay on PART_MAIN,
and bone queries fall back to PART_MAIN for bones a LOD lacks.
Weapon item LODs are not ported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port CGrannyLODController::UpdateLODLevel and
CGrannyModelInstance::Update(dwAniFPS): actors whose model has a
_lod_01.gr2 sibling and stand more than 500 units from the camera
target get 30-120 animation FPS by camera distance (LODDISTANCE_ACTOR
5000, LODDISTANCE_BUILDING 25000 for models of 500+ units), and their
pose time only advances every 120/fps frames, so the SDK's cached pose
is reused in between. Restarted or switched motions re-sample at once.
The _lod_ meshes themselves are still not swapped in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDL_GPU pipeline renders into its own view-sized colour target and
already composites it over the whole render target, so routing it through
gpu_scene_texture cost one extra same-size copy per frame. The scaled
intermediate is now used only by the SDL geometry fallback; the hardware
composite upscales with linear filtering.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MapObjectManager::AppendDrawRefs references each visible object's cached
Render3DDraw (writing the per-frame light into the cache) rather than
copying the whole command (two texture strings, shared_ptrs, matrices)
every frame. main.cpp flattens owned draws and refs in submission order
(FlattenDraws) and passes a pointer list to RenderSceneGPU/RenderScene.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Colour as UBYTE4_NORM, normals as SHORT4_NORM (unit direction, the
shader renormalises), bones as UBYTE4 and weights as USHORT4_NORM.
Shader inputs keep their float/uint types, so the shaders are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenderSceneGPU resolves each draw's texture while classifying it and
sorts opaque draws by the texture handle instead of comparing paths;
invalid draws are dropped before sorting. Bumps sdk (skin cache).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Render3DDraw/HardwareBatch carry first_index/index_count; resident
meshes are uploaded once per model and groups draw with firstIndex.
Bumps sdk to 9ec7fa1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Render3DDraw/HardwareBatch hold the SDK's shared palette instead of
copying 16 floats per bone per draw, and HardwareScene re-pushes the
uniform only when the palette pointer changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Correct selection orientation, game-entry lifecycle, mounted NPCs, labels and skill panels. Add the native GPU scene path, resident geometry, bounded texture and Python caches, and collision broad phase.
Pin the independently maintained Metin2 SDK through a submodule and document reproducible setup. Include rendering regressions and macOS packaging improvements.
Validation: client Debug build and 12 targeted client tests passed; SDK build and all 14 SDK tests passed.
- gr2: BitKnit2 decompression, 64-bit LE files, compressed curves
- net: remaining GamePhase handlers, generated GC packet table
- python: event/chat/chr/minimap/guild/quest/messenger/shop-search and
other native modules ported against the AVA2 Windows client
- render: D3D8 fixed-function lighting in Gr2ModelRenderer, terrain
without baked shade; cape/NPC equipment attachment
- tests + audits updated; docs/PORT-PLAN.md and WINDOWS-PARITY.md
Batch 4 (render pipeline: background.*, app.RenderGame/UpdateGame,
camera bindings, main.cpp fake-content removal) is still in progress.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>