264 KiB
AVA2 port status
Milestone 0 — independent baseline and host
- Snapshot original client C++ and Python root scripts, record SHA-256 provenance.
- Independent fixed-width wire encoders and golden tests for select, attack, pickup.
- SDL3 GPU host entry shared by macOS and Android. macOS Metal bootstrap; Android Vulkan backend to be verified. Existing Vulkan renderer import remains pending.
Milestone 1 — playable vertical slice
- Audit active client/server macros and packet layouts together (wolfman, bank, support mismatches).
- Port legacy security handshake and auth/login packet states; introduce an isolated local protocol fixture.
- Reuse Python 2 runtime/GR2/codepage/platform adapters with explicit provenance. Compile AVA2 gameplay sources, expose its Python extension modules.
- Mount decoded pack_maker assets with case-normalized lookup; defer FoxFS reader.
- Implement login → five-slot selection → map → movement → basic attack → pickup → inventory.
- Build Android arm64 APK and verify on device; build macOS app. Only claim server compatibility after real isolated-server verification.
Later milestones
AVA2 extended inventory/equipment, offlineshop, switchbot, pets, battlepass, dungeon and render-target features, then mobile UI and performance. Python 3 migration is deferred until gameplay parity.
Constraints
Original AVA2 sources and existing 40250 project/server are unchanged. Do not connect the prototype to the production server by default. No credentials belong in the project. A successful host build does not prove login or gameplay.
Verified in initial development pass
- macOS arm64 Debug build succeeds; SDL GPU Metal window runs 60 frames and exits successfully.
- Three AVA2 wire golden fixtures and invalid character slot rejection pass.
- 916 upstream reference hashes verified. GR2 reader and codepage sources imported as independent snapshots with SHA-256 provenance; GR2 regression tests included.
- This initial pass established the foundation only; subsequent milestones are recorded below.
Milestone 1a — login transport and Python bootstrap (2026-10-03)
Completed:
- Preprocessed AVA2 client/server login feature profile; login-critical macros agree. Recorded remaining wolfman/bank/support gameplay mismatches.
- Fixed-width legacy cipher, key derivation, complete sequence table, fragmented stream parser, auth/game connection switching, metadata parsing, and five-slot roster.
- Independent developer TCP CLI reaches selection; character-select encoding and empty-slot validation are tested.
- Embedded Python 2.7.18, stored stdlib ZIP, case-insensitive decoded-root
packbridge and script importer. Original colorInfo/musicInfo execute in the native window host. - All 7 CTest targets pass. Original client/server structure and cipher oracles included. 925 AVA2 reference files verified.
- macOS arm64 host with Python: 60 frames, successful exit. Android arm64/API 26 libmain.so compiles and links, including embedded Python.
Remaining to reach milestone 1:
- Implement required original Python app/dbg/net/wndMgr/UI interfaces, then bootstrap original system/prototype/login/selection scripts. The current native app module exposes only the needed stone-minimap feature constant.
- Connect the login session to original Python UI callbacks and a nonblocking host transport. CLI tests do not imply working graphical login.
- Mount decoded AVA2 gameplay assets; resolve original feature mismatches before corresponding gameplay packets are enabled.
- Port AVA2 gameplay/loading paths and render the first map, then movement, attack, pickup and inventory.
- Package Android APK, test on device, and verify against an isolated AVA2 server. No real server connection has been made in this pass.
Details and test scope: docs/LOGIN-TRANSPORT.md.
Windows parity re-audit (2026-10-05)
Later source additions include original-script UI bridges, renderer components and gameplay packet models; earlier milestone notes describe their historical scope. They are partial implementations, not completed Windows parity.
Corrected preview roster injection, invented player defaults, DirectEnter character-server reconnect/loading callback timing and give-item/refine/use-to-item/script-button wire encoders. Added a two-game-endpoint bridge regression and packet golden cases. Static inventory finds 994 placeholder bindings. Full parity remains pending, especially real gameplay transport/loading integration, renderer equivalence and server-driven systems. See docs/WINDOWS-PARITY.md for evidence and limitations.
AVA2 Windows-only protocol/interface corrections (2026-10-05)
Re-audited this port directly against AVA2 Windows active macros and sources. Corrected wire phase values, non-GAIDEN item headers, original item socket/attribute counts, ItemSet/ItemSet2/ItemUpdate layouts and receive data, storage/mall layouts, exchange/extended ground layouts, chat/whisper NUL framing, disabled safebox money sending, and test-server flag behavior. Added original-declaration compile oracles and active method-table comparison. 116 existing constants align; 29 extension modules compared (752 overlapping placeholder methods and one missing binding remain). Sixteen noninteractive tests pass; visual render_3d remains excluded following its earlier timeout. See docs/WINDOWS-PARITY.md and generated AVA2 comparison reports for precise coverage; full 1:1 parity is still incomplete.
AVA2 loading/game transport corrections (2026-10-05)
Connected supported native game packets to the actual encrypted socket after loading, preserving packet boundaries and sequence continuation. Corrected original StartGame callback scheduling, multilingual EnterGame, main-character loading/version report/BGM volume, game handshake/DirectEnter callback suppression, EOF login fallback, point/time layouts and Python state updates, eventMgr.Update case/behavior, and connection reset/ref ownership. Independent loopback peer verifies live game receive and encrypted outgoing version/enter/chat/pong, including server EOF and BGM loading. Seventeen noninteractive tests pass; 118 existing protocol constants align; all 29 compared Windows modules have method names present, with 749 placeholder bindings remaining. Original map Warp, complete game packet/UI/render behavior and real-server/device equivalence are still pending. Full details: docs/WINDOWS-PARITY.md.
2026-10-05: character wire layout and retained state
Compared exclusively with upstream AVA2 Windows Packet.h and PythonNetworkStreamPhaseGameActor.cpp. Equipment parts are six (including arrow type), shining parts three. Corrected AdditionalInfo to 75 bytes (conqueror level, language, shining) and Update to 56 bytes (conqueror level, shining). Retain arrow type, sash, conqueror level, state flags and affect/shining arrays in actor state; accept zero speed updates. Ignore mismatched additional-info VID as Windows does; bound name reads. Generated oracle now extracts original equipment/shining enums and character declarations with active Windows feature guards; asserts sizes and offsets. Fragmented literal-length additional-info/update followed by ping verifies framing and unmatched VID handling. Validation: macOS build passed; 17 nonvisual CTests passed; Android arm64 libmain.so built. The existing render_3d test remains excluded due to its unresolved timeout. No real server/device verification. Remaining: actual shining/affect rendering, race/equipment model mapping, map coordinate conversion, alternate actor packets, renewal death layout, and the broader Python/gameplay placeholder inventory. This milestone does not establish full Windows parity.
2026-10-05: renewal death protocol and direct death state
AVA2 Windows Packet.h enables RENEWAL_DEAD_PACKET: header + VID + three BYTE revival delays = 8 bytes. Corrected port declaration and receive framing. The independent oracle extracts the original guarded enum/declaration and verifies size/offset. A fragmented literal death packet followed by ping checks alignment. ActorInstance::Die now sets death state and plays death motion directly rather than simulating 99999 damage; a high-HP regression checks unconditional death. For a known main actor, game-window OnGameOver receives one tuple containing the three delays. Retained duel-mode field suppresses that callback when set, but original duel packet/state handling is still unported, so the duel exception is not yet verified end to end. Original NotifyDeadMainCharacter clears auto-attack target; the port's target/auto-attack system remains incomplete and this side effect is pending. UI callback needs live game verification. Validation: macOS and Android arm64 library builds passed; 17 nonvisual CTests passed (death-parity-tests.log). Existing render_3d timeout remains excluded. No server/device changes; reference AVA2 files untouched. Full Windows parity remains incomplete.
2026-10-05: alternate actor wire paths and pet staging
Implemented AVA2 Windows CHARACTER_ADD2 (120, 85 bytes) and CHARACTER_UPDATE2 (117, 52 bytes) layouts/dispatch. Original declarations extracted into oracle; compile assertions compare sizes and equipment/mount/shining offsets. Decode equipment, arrow, sash, flags, speed, guild, empire, mount and shining as present in each packet. Invisible races 20025/20038/20039 are filtered in Add2 and AdditionalInfo as the Windows handlers do. Original ENABLE_NEW_PET_SYSTEM is active: type 10 now waits for AdditionalInfo alongside PC/NPC. Literal split-packet tests verify Add2/Update2 framing, invisible filtering and pet staging. Windows Update2 has no conqueror field, and its update-data constructor leaves conqueror level uninitialized. Port deliberately preserves previously received level rather than reproducing undefined memory. Remaining Add2 differences: NPC mob_proto name override, global/local map coordinates, actor model/equipment loading and visual effects. These still prevent a full parity claim. Validation: macOS build and 17 nonvisual CTests passed; Android arm64 libmain.so build passed; 925 AVA2 reference hashes unchanged. render_3d remains excluded for unresolved timeout; no live server/device checks.
2026-10-05: atlas queries, map bases and network coordinate conversion
Reference: AVA2 GameLib/MapManager::__LoadMapInfoVector, UserInterface/PythonBackground::Warp/GlobalPositionToLocalPosition/LocalPositionToGlobalPosition and PythonBackgroundModule wrappers. Added atlas parser (25600 per terrain cell, first matching map, exclusive end boundaries, explicit Win32 coordinate wrap). Atlas text comes through the existing case-insensitive pack mount, using app locale path with AtlasInfo.txt fallback. Implemented Python GlobalPositionToMapInfo return (name,baseX,baseY), unknown ('',0,0), GlobalPositionToLocalPosition and WarpTest x100 units. Main-character loading now selects/loads atlas map and establishes base before publishing local player position while LoadData continues to receive original global coordinates. Add/Add2/Move/Sync/GroundItem receive coordinates become local; outgoing Move becomes global. Background warp recreates terrain/base state before lookup. Removed incorrect village-block 001003 fallback and stopped reporting failed map names as loaded. Known map load failure raises an explicit error rather than entering with the wrong map; Windows exits its application on this failure, so the application shutdown policy is not identical yet. Tests: map range edges, coordinate round trips/negative values, Python atlas lookups and a real metin2_map_a1 center-block load with nonzero base. Main player local coordinates and outgoing movement global bytes verified. macOS build and 17 nonvisual CTests passed; Android arm64 libmain.so built. render_3d remains excluded for unresolved timeout. Remaining: multi-block terrain streaming, map-specific texture/environment loading, camera height/ShowMapName/minimap/portal/target reset and complete warp-to-another-server flow. Map resource lookup still includes a developer absolute path and must move entirely to portable pack resources. Full parity remains incomplete; this does not prove rendered-map or real-server behavior.
2026-10-05: actual mob_proto loading and nonplayer data APIs
Implemented AVA2 PythonNonPlayer::LoadNonPlayerData MMPT/MCOZ/XTEA key path, with bounds-checked LZO1X safe decompression. LZO source imported unchanged from AVA2 Tools/DumpProto/lzo, provenance in third_party/ava2-lzo/AVA2-PROVENANCE.md; only lzo1x_d2.c compiled. Decode packed Win32 235/255-byte records; actual English fixture uses 255. Preserve first record on repeated inserts, clear per runtime initialization. Versions 256/262/263 remain rejected until their changed layouts are implemented; original autodetection supports them, so loader parity is not complete. Replaced nonplayer placeholders for names, click events, VID race/level/grade, HP, race flags, level, damage, exp, damage multiplier, ST/DX, stone classification, regen, gold and resist data. Added price tuple and ordered prefix search matching original lowercase-name-only comparison (query itself is unchanged). Corrected click-event 0..4 and resist 0..10/MAX11 constants. Actor append uses decrypted mob names instead of invented Mob_; AdditionalInfo/Add2 apply the original NPC exclusion/range policy before overriding server names. Validation: real encrypted English binary loads; Wild Dog level1/HP126/damage20..24. Binary gold0..0 differs from adjacent text858..890; independent Python fixture cipher plus LZO decode confirmed original byte offsets and values. Name search, missing VID -1, malformed header rejection and native NPC name policy tested. macOS and Android arm64 builds passed; 17 nonvisual CTests passed; 925 reference hashes unchanged. Original binary remains authoritative. render_3d timeout still excluded; no live server/device verification. Remaining: all alternate proto layouts, complete render/model data usage and wider gameplay APIs.
2026-10-05: all original mob record versions
Extended mob_proto decoding to all five formats accepted by AVA2 TMobTableAll: 235,255,256,262,263. Account for bLvlPct insertion in r262/r263 and additional resistance bytes before click event/fDamMultiply. Preserve the original index-based first-eleven resistance copy, including its claw index behavior in r262/r263; do not silently remap semantic indices. The oracle generator now extracts original SMobSkillLevel and all five SMobTable declarations directly from upstream PythonNonPlayer.h under fixed-width Win32 aliases. Compile assertions prove all five sizes; new ava2.nonplayer_oracle constructs each original structure with distinct values, produces valid LZO literal containers both unencrypted and XTEA encrypted, loads through the production parser, and compares names/type/rank/level/gold/exp/HP/regen/race/ST/DX/damage/click/multiplier/resists. Truncated container rejection preserves existing records. This supersedes the previous limitation rejecting r256/r262/r263; other unrepresented fields and model integration remain incomplete. Validation: macOS and Android arm64 builds passed; 18 nonvisual CTests passed. Existing render_3d timeout remains excluded. 925 reference hashes unchanged; no live server/device verification. Additional inspection found quickslot receive handlers currently discard updates and local requests modify state without server acknowledgement; this is a remaining gameplay alignment gap.
2026-10-05: quickslot authoritative updates and paging
Compared with AVA2 PythonPlayer.cpp and PythonNetworkStreamPhaseGameItem.cpp. Implemented four pages/eight visible slots while retaining all36 server slots. Add/delete/move/add-to-empty/remove-by-value requests emit original CG16/17/18 packets and do not mutate state; GC28/29/30 updates apply add/delete/swap and schedule inventory refresh. Remove-by-value includes hidden slots32..35, whereas RequestDeleteGlobalQuickSlot retains the original visible-range32 guard. Implemented page wrap and local/global lookup conversion, player.SetGameWindow owned reference with teardown cleanup, immediate page RefreshInventory and emotion callback; inventory quickslot uses INVENTORY1 and registered cell. Corrected invalid-argument handling for affected quickslot getters/use. Regression includes no-main request suppression; a live native actor fixture; exact add/delete/move/empty packet bytes; split server add followed by swap/delete; callback batching; hidden slot35 removal without early mutation; item-use bytes; emotion callback; negative/overflow page values; death request suppression. macOS and Android arm64 builds passed, 18 nonvisual CTests passed, 925 reference hashes unchanged. Existing render_3d timeout remains excluded and no real server/device check was run. Limitations: full ActorInstance::CanAct needs original stun/paralysis/faint/sleep state; current quickslot send guard covers absent actor/death only. Skill quickslot action still uses the existing incomplete skill callback path instead of full original ClickSkillSlot mechanics. Shared inventory/skill action gating and item metadata remain separate parity gaps. This milestone does not establish complete quickslot/combat or full-client parity.
2026-10-05: action predicate, stun packet and stun affect
Reference: AVA2 GameLib/ActorInstanceBattle::CanAct, ActorInstance::Stun/SetSleep/SetFaint/SetParalysis, UserInterface/InstanceBaseEffect::SetAffect, NetworkStreamPhaseGame::RecvStunPacket. Added action flags and exact five-condition predicate (dead/stun/paralysis/faint/sleep). Quickslot send uses CanAct. GC_STUN13 now enters death for main actor, sets persistent stun for other actors; no OnGameOver callback is emitted by this packet, matching original. Actor spawn and update apply AFFECT_STUN bit5 to sleep, matching the original active branch rather than the commented FAINT/SLEEP cases; clearing that bit restores sleep-related action permission. Tests verify every predicate flag, clearing flags, network affect update suppressing a quickslot request then restoring it on clear, remote-stun versus main-stun behavior and death suppression. macOS and Android arm64 builds passed; 18 nonvisual tests passed; 925 reference hashes unchanged. render_3d remains excluded; no live server/device checks. Remaining: complete affect lifecycle/visual attachment, shaman paralysis producers, revival/reuse semantics, movement/attack/skill action gates, and the incomplete skill/combat implementations. Flags and predicate alone do not establish full runtime status/combat parity.
2026-10-05: attack/inventory send guards and distinct drop APIs
Reference: AVA2 NetworkStreamPhaseGameItem/PhaseGame and PythonNetworkStreamModule. Applied original main-instance CanAct guard to attack, item use, move, pickup, old/new drop and item-use-to-item. Deliberately left operations without this original guard (e.g. give/refine/on-click) unchanged; this is not a blanket phase restriction. Corrected legacy drop payload semantic to elk DWORD and split new drop into header20/position/gold DWORD/count DWORD (12 bytes). Old AVA2 header224 is retained (8 bytes). Python old API accepts cell or window+cell, always elk0; new accepts cell+count or window+cell+count. Added previously empty SendElkDropPacket and SendGoldDropPacketNew using RESERVED_WINDOW0/cell0; new gold drop count0. Oracle compares original drop declarations' sizes/count offset. Exact-byte tests include item count70000 and gold123456, plus seven suppressed send paths during stun affect. Replaced outdated test call supplying count to legacy Python API. Validation: macOS and Android arm64 builds passed; 18 nonvisual tests passed; 925 original reference files unchanged. Existing render_3d timeout remains excluded; no live server/device verification. Remaining: equip-use/move restrictions during exchange/shop/attack and item sounds, movement/skill state transitions, full item metadata/action logic, and wider client parity. These sender changes do not establish complete combat/inventory parity.
2026-10-05: registered skill mapping and level packet synchronization
Reference: AVA2 Packet.h, PythonPlayer::SetSkill/GetSkillSlotIndex/SetSkillLevel_ and NetworkStreamPhaseGame::RecvSkillLevel/New. Added GC72 legacy256-byte and GC76 new1531-byte handlers with Win32 int32 tNextRead (original handler ignores read time). New handler resets slots7/8, uses current active ENABLE_78_SKILLS and disabled wolfman ranges221..228/236..243 plus112..119, then updates mapped skill grades/levels; highest later matching skill overwrites special slot as original loop does. Added batched RefreshSkill/RefreshStatus. Corrected player.SetSkill to original two arguments and preserve existing level instead of inventing level1. Retain original reverse-map behavior (including stale mappings when a slot is reassigned), expose real GetSkillSlotIndex, convert master/grandmaster/perfect level offsets19/29/39, and replace efficiency placeholders with original international/Ymir skill-power tables and >40 guard. SetSkill mapping is required; unknown IDs are not invented. Oracle extracts original skill declarations and verifies both packet sizes/6-byte skill records. Literal split1531-byte fixture verifies no early refresh, grade conversions, power values, special slot overwrite and wolfman exclusion; legacy256-byte fixture verifies grade-1/update. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; 925 reference hashes unchanged. Existing render_3d timeout remains excluded, no live-server/device checks. Remaining: actual skill definitions/registration bootstrap, cooldown handling, click/target/resource checks, skill motion/effect execution and complete locale selection. Old GC72 follows release receive behavior; original debug build asserts that this deprecated packet should not be used. This does not establish playable skills or complete Windows parity.
2026-10-05: skill cooldown slot mapping and getter semantics
Compared with AVA2 PythonPlayer GetSkillCoolTime/GetSkillElapsedCoolTime, PythonPlayerSkill::__CheckRestSkillCoolTime and PythonPlayerModule wrapper. Cooldown now lives on registered PlayerSkill slots rather than a separate map incorrectly queried by slot but populated by skill ID. Native SetSkillCoolTime resolves original reverse skill mapping and ignores unknown IDs. GetSkillCoolTime retains total/elapsed after expiry and reports elapsed from time0 for untouched valid slots; invalid slots return0/0. IsSkillCoolTime uses elapsed<total and the original debug ToggleCoolTime setting. ResetPlayerState clears stored cooldown along with skill registration. Added deterministic SkillCooldown primitive and explicit-time native hook for boundary tests. Tests cover exact expiry boundary, retaining total/elapsed after expiry, disable/re-enable behavior, skill101 mapped to slot6, invalid slot255 and connection-reset cleanup. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; 925 original reference hashes unchanged. render_3d remains excluded for unresolved timeout. Remaining: original CTimer frame clock integration (current bridge uses SDL monotonic seconds), skill-data cooldown formula/casting-speed adjustment, successful-use event/callback integration and active-skill effect lifecycle. Native demo duration remains externally supplied; these corrections do not establish full original skill execution or client parity. IsSkillActive is still a placeholder and was not treated as completed.
2026-10-05: affect add/remove wire callbacks and energy expiry
Compared exclusively against AVA2 Windows Packet.h, RecvAffectAddPacket/RecvAffectRemovePacket and PythonPlayer affect mapping. Added GC126 (22 bytes) and GC127 (6 bytes) with explicit Win32 int32 values/durations and packed 21-byte affect element. Add calls BINARY_NEW_AddAffect(type, apply, value, duration); remove calls BINARY_NEW_RemoveAffect(type, apply). Energy apply128 updates POINT_ENERGY_END_TIME129 using server timestamp plus duration and schedules RefreshStatus; removal retains the original absence of energy reset/status refresh. Preserve original 32-bit signed callback interpretation and addition wrap. Implemented the original 18 active affect-to-skill mappings, including conqueror skill182, and unknown-index result0; disabled wolfman mappings remain excluded. These packets notify buff UI, not skill activation: original toggle activation belongs to character affect-bit processing with loaded skill definitions, which remains unfinished. Oracle extracts the actual anonymous upstream affect typedefs and checks original packet sizes. Regression verifies split-packet buffering, negative apply value, add/remove callbacks, energy expiry, refresh count and mapping entries. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; all925 original reference hashes unchanged. render_3d remains excluded for its unresolved timeout; no live server/device or visible buff UI validation was performed. Remaining: skill definitions/registration, character affect and toggle activation lifecycle, cooldown formula/frame clock, skill execution/target checks, wider rendering/gameplay parity. This milestone does not establish complete Windows parity.
2026-10-05: skill module constants restored
Compared directly with AVA2 Windows PythonSkill.h and initskill. Replaced ten zero placeholders with original type0..5, grade count3, effect count4, grade step20 and grade gap25. This restores the values consumed by UI classification and grade loops; it does not implement the underlying skill data/actions. Constants reside in skill_constants.h. Windows oracle extracts the original type enum and numeric grade definitions; compile assertions compare every exported value to that source, and Python regression checks all ten actual module attributes. Validation: macOS and Android arm64 builds passed; 18 nonvisual tests passed; 925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Further inspection confirms app.LoadLocaleData is still a no-op and skill type/name/description/conditions/formulas remain placeholders; IsToggleSkill/IsStandingSkill still incorrectly infer flags from hardcoded IDs. Next work must load original SkillDesc/SkillTable data through the locale lifecycle, replace those ID guesses with data flags, then connect toggle activation. Full skill execution/rendering and complete client parity remain outstanding.
2026-10-05: skill description data and real metadata/flag queries
Added SkillDescriptions model and native packed-file loader using the existing case-insensitive bounded pack reader. Compared with AVA2 Windows RegisterSkillDesc: job lookup/lowercase, three grade names with empty-name fallback, exactly three condition columns (fourth ignored), case-sensitive attribute names and duplicate-row OR semantics. Disabled wolfman/78skill job names remain absent as guarded in the actual source. Unknown job still leaves default inserted record. Truncated mandatory columns avoid original unsafe reads; motion grade count greater than4 rejects loading. This is a partial description parser, not a complete skill loader. GetSkillName/Description/Type/ConditionDescriptionCount/ConditionDescription now query actual records. Unknown name returns NoneSkill; other missing-record getters raise RuntimeError. Out-of-range/negative condition indexes return None. IsToggleSkill/IsStandingSkill/IsUseHPSkill use loaded attribute bits and no longer guess from IDs. Real English data proves skill122 Combo is toggle, while skill19 Strong Body is standing and not toggle, contrary to the previous ID guess. Runtime creation resets description records. Tests load actual locale/en/SkillDesc.txt through the native loader, verify literal names/grades/descriptions/conditions/types/flags/errors, and check reset cleanup. Synthetic rows verify duplicate OR semantics, case-sensitive unknown attributes, ignored fourth condition and disabled wolfman insertion semantics. macOS and Android arm64 builds passed; 18 nonvisual CTests passed; 925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Outstanding integration: app.LoadLocaleData remains a no-op, so production startup does not yet invoke this new description loader. Regression invokes it explicitly; no automatic-load claim is made. SkillDesc icons, weapons, motion metadata, affect formulas and limits are not yet represented; SkillTable, legacy RegisterSkill files, locale item/other loaders, formula evaluation and full skill/character-affect execution remain incomplete. No live server/device/visible skill UI verification; overall parity goal remains active.
2026-10-05: SkillDesc motion, weapons, limits and affect records
Extended the original description model with weapon OR masks, motion/no-motion state, four grade motion indexes with original WORD wrap and grade gap25, target/motion-loop formula strings, affect description/min/max formula records, BYTE level limit/max level and default level-up point1. Preserve original duplicate affect append behavior rather than clearing it. Preserve original ARROW logical-OR mask1 and disabled claw mapping; EMPTY_HAND uses original active WEAPON_NONE11. Grade count>4 returnsfalse; malformed negative count avoids original before-array write by clamping0. Replaced GetSkillMaxLevel/LevelLimit/LevelUpPoint/AffectDescriptionCount placeholders with real description queries and missing-record RuntimeError. Synthetic regression checks WORD/BYTE wrap, empty max-level fallback to converted limit44, weapon mask, repeated affect append and stored formulas. Real English fixture checks four exported Python getters. macOS and Android arm64 builds passed; 18 nonvisual tests passed;925 reference files unchanged. render_3d remains excluded for unresolved timeout. Still pending: locale startup invocation, full SkillTable merge and formula evaluation, icon/resource registration and legacy RegisterSkill files, full skill execution and character-affect lifecycle. Description loader remains explicitly invoked by regression, not connected to app.LoadLocaleData. Stored formula text does not imply formula execution. No real server/device/visual validation; overall Windows parity remains incomplete.
2026-10-05: original SkillTable merge rules
Added exact27-column table parsing and native packed-file loader; only existing description IDs merge. Stored original SP cost, cooldown, continuation SP, duration and target range. Nonempty costs/cooldown/range preserve previous values when empty; duration always overwrites. Max level updates only for incoming value>1 with BYTE conversion; level limit checks previous limit>1 as original, not the incoming value. Implemented first-affect formula override: sequential substring number/atk/mwep replacement into min/max forms; skill1 appends literal *3, scalar formula clears max. Preserve original exceptions34 and151..157 and CHEONMA disable option. No alternate table flags/skill names imported. This stores formulas and does not evaluate them. Regression loads actual English table after description, checks synthetic min/max substitutions, unsigned/BYTE conversions, previous-limit condition, empty-field retention/clearing, skill1 multiplier, skill34 exception and CHEONMA/scalar behavior. macOS and Android arm64 builds passed;18 nonvisual CTests passed;925 original reference files unchanged. render_3d remains excluded for unresolved timeout. Still outstanding: app.LoadLocaleData startup integration, formula evaluation and player variable bindings, icons and legacy skill files, skill use/cooldown resource/target/motion lifecycle, full rendering/gameplay parity. Tests invoke native loaders explicitly; no production startup or live server/device behavior claim. Overall goal remains active.
2026-10-05: original AVA2 formula evaluator portable library
Imported AVA2 EterBase/Poly exclusively into third_party/ava2-poly with provenance. Only replaced ../StdAfx.h in cpp files with standard includes; parser, evaluation, symbol tables and random semantics remain original. Added PIC ava2_poly library linked to embedded runtime for subsequent skill formula integration. Original reference files remain immutable. New ava2.skill_poly regression exercises arithmetic precedence/parentheses, actual k/str variable binding after Analyze, min/max/floor functions and forced random endpoints. macOS and Android arm64 builds passed;19 nonvisual tests passed (new formula test raises previous18 count);925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Not yet integrated into gameplay: skill formula getters and player status/min/max variable mapping still pending, along with locale startup loading and skill execution. Linking the library and passing core tests does not establish working Python skill formulas or playable skills. Full Windows parity goal remains active.
2026-10-05: four Python skill formula queries
Connected GetSkillCoolTime/NeedSP/ContinuationSP/Duration to actual merged formula fields and original CPoly Analyze/Eval. Implemented original free-value case-sensitive status aliases, k/SkillPoint skill level, ar division100 and JeungJi prefix0. Added native player status lookup. Unknown state names deterministically return0 instead of reproducing original uninitialized GetState result; nonfinite results return0, finite return values truncate and wrap explicit32 bits before Python signed interpretation. Derived player status calculations are still a separate gap; lookup currently uses retained status points. Real English data tests verify cooldown12, SP90 at0.5 and truncation52 at0.125, empty continuation/duration0. Native formula regression verifies STR20 and hit rate80 binding, JeungJi0 and unknown-variable handling. Original CPoly accepts some malformed strings (1+ evaluates2); preserve evaluator behavior rather than assuming stricter parsing. macOS/Android arm64 builds passed;19 nonvisual tests passed;925 references unchanged. render_3d remains excluded for unresolved timeout. Pending: min/max status maps and formatted affect descriptions, startup locale loading, derived status calculations, skill cast/cooldown lifecycle and wider rendering/gameplay parity. Runtime tests explicitly load description/table; no live server/device or full playable skill claim. Full goal remains active.
2026-10-05: formatted skill affect descriptions
Replaced GetSkillAffectDescription placeholder with original free-value min/max formula evaluation, absolute values, floor both values when description contains %.0f, and printf float formatting of two values. Retain 65-byte original buffer capacity with explicit termination for defined host behavior. Negative/out-of-range indexes return None as original null string wrapper. Format validation accepts original float formats (including %0.f) and escaped percent, rejects incompatible/write conversions or more than two arguments instead of reproducing varargs UB. Actual English table regression binds minATK100/maxATK200/STR20 and verifies skill1 at0.5 produces literal Total Attack Power 450-855 after original formula rewrite/multiplier. Tests also verify negative/out-of-range queries. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Limitations: only original non-Arabic formatting branch is implemented; Arabic replacement branch remains pending. Existing free-state points are retained values, not complete derived combat calculations. Min/max variable maps, new affect data API, startup locale loading, icons, actual skill use and rendering remain outstanding. No visible skill tooltip/live server/device verification. Overall Windows parity remains incomplete.
2026-10-05: point bounds and original empty new-affect API
Compared PythonPlayer SetStatus/GetStatus and PythonSkill new-affect loaders/query wrappers. Native and Python status get/set now honor original POINT_MAX_NUM255: negative/255+ values return0 and writes are ignored. Native skill formula lookup shares the bound. This only aligns bounds, not derived battle status updates. GetNewAffectDataCount now validates actual skill existence and returns0 for the original loader state. Original RegisterSkillDesc clears the new-affect vector and neither active description/table loader populates it. GetNewAffectData validates arguments/skill then raises RuntimeError for any index, matching this empty state; removed unconditional dummy0 behavior. Do not synthesize new effects from legacy affect records. Tests check invalid status writes/reads, valid skill empty count, negative/zero new-affect indexes and missing-skill exceptions. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Inspection confirms original SetStatus recomputes hit/evade/weapon/attack points for several triggers, with weapon metadata/race/sash dependencies. Those calculations remain unimplemented along with locale startup, skill use and full rendering. No live-server/device proof. Full parity goal remains active.
2026-10-05: item text resources resolve against mounted pack
Inspection found item database seeding reads item_list/item_names through guessed working-directory paths, including ../ and build/dev paths. Replaced those direct filesystem reads with existing bounded, case-insensitive ReadPackedText against the configured AVA2 pack root. Item10 name/icon query now works with process working directory set to system temporary directory; regression verifies Sword+0 and icon/item/00010.tga, then restores working directory. macOS and Android arm64 builds passed;19 nonvisual CTests passed;925 original reference hashes unchanged. render_3d remains excluded for unresolved timeout. This corrects resource resolution only. Existing seven seeded item definitions, guesses based on item_list type, hardcoded English path and supplemental item_names still differ from original authoritative item_proto/locale lifecycle. Item proto loading, metadata/getters, derived battle calculations, startup locale and wider gameplay/rendering parity remain incomplete. No live device/server verification. Goal remains active.
2026-10-05: original item_proto decode and Python load bridge
Added fixed-width ItemProto decoder with AVA2 original key173217/72619434/408587239/27973291, MIPX version1/MIPT headers, MCOZ XTEA/LZO, bounded decompression and count/stride validation. Implements active socket8 record layouts172/176/178; current real file is176. Retains names/types/subtypes/size, range/refined ID, six values, two limits and three applies. Invalid/truncated input preserves stored records. Replaced item.LoadItemTable no-op with packed-file decode and update of existing item metadata, preserving item-list icon/model resources. Original Python wrapper returns None even on load failure. Native decoder test loads actual English file and verifies Sword+0/type1/size2 plus truncated rejection. Python bridge test invokes load from temporary working directory and verifies item query. macOS/Android arm64 builds passed;19 nonvisual tests passed;925 reference hashes unchanged. render_3d remains excluded for unresolved timeout. Remaining: independent original-structure oracle and synthetic172/178 cases; full record flags/prices/sockets/refine details, range lookup, all limits/applies getters and load/reset semantics. Existing seeded metadata remains before explicit load and some fields/descriptions still fabricated; app.LoadLocaleData does not yet trigger loading. Not a complete item system or startup parity claim. Derived combat calculations, skills, rendering and full goal remain incomplete; no device/server verification.
2026-10-05: item limits/applies, selection fallback and two-handed speed
GetLimit/GetAffect now return all two limits/three applies from loaded item_proto. Preserve original BYTE index conversion (256 maps to0); invalid converted indexes raise RuntimeError. Missing selected data raises RuntimeError instead of silently returning zeros. Item-list-only records still use existing partial metadata pending full loader replacement. Implemented app.SetTwoHandedWeaponAttSpeedDecreaseValue, default/reset0, and original APPLY_ATT_SPEED7 subtraction for weapon subtype3. Restored Python SelectItem fallback60001 and preservation of previous selection when both requested/fallback IDs are absent. This fixes the refine dialog regression caused by invalid selection0 reaching the now-strict limit getter. Range-based selection is still pending. Regression compares both limits/all three applies to decoded real records, verifies BYTE wrap/index exceptions, real two-handed weapon attack-speed deduction9, fallback selection and full refine dialog lifecycle. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 reference files unchanged. render_3d remains excluded for unresolved timeout; no live server/device/visual validation. Independent item-structure oracle, other metadata/getters, startup locale loading, derived combat and full parity remain incomplete.
2026-10-05: selected refine fields and range/Wiki selection
GetRefinedVnum now reads the selected record's original DWORD field and takes no required argument, replacing the vnum%10/vnum+1 guess. Added WORD refine-set decoding and real GetRefineSet. SelectItemWiki returns1/0 and preserves selection on failure without regular SelectItem's60001 fallback. Corrected regression calls that previously required the wrong argument-taking API. Added original range selection: exact map entries win; otherwise traverse ranges in successful file load order with strict base<id<base+range and uint32 endpoint arithmetic. Duplicate loaded range entries retain their ordering and reference the latest base record as original pointers do. Failed loads leave records/ranges unchanged. Regular/Wiki selection use the range result's base record. Tests verify actual Sword+0 refinement11, Sword+9 refinement0, decoded refine set, Wiki success/failure preservation, overlapping range order and exclusive endpoints. macOS/Android arm64 builds passed;19 nonvisual tests passed;925 references unchanged. render_3d remains excluded for unresolved timeout. Synthetic range model checks do not replace the pending full original item-structure/container oracle. Full metadata, locale startup, combat, skills and rendering parity remain incomplete; no live-device/server verification.
2026-10-05: selected item prices and flags
Decode original anti/general/wear/immune DWORD flags and buy/sell DWORD prices. Replaced item.GetIBuyItemPrice/GetISellItemPrice with original Python long return semantics and IsAntiFlag/IsFlag/IsWearableFlag with any-intersection mask checks. Negative Python mask uses original DWORD conversion. Is1GoldItem now checks original ITEM_FLAG_COUNT_PER_1GOLD bit3. Missing selected data raises RuntimeError; list-only default records return zero fields until authoritative proto loading. Actual English Sword+0 regression compares both prices and flag queries against decoded data, checks individual low31 bits, negative mask and zero mask. macOS/Android arm64 builds passed;19 nonvisual CTests passed;925 original reference files unchanged. render_3d remains excluded for unresolved timeout. These getter tests do not replace pending independent original-structure layout validation. Inventory/player price/flag APIs, other metadata, startup locale, derived combat, skill execution and wider rendering parity remain incomplete; no live server/device validation.
2026-10-05: independent item prototype structure/container oracle
Generator extracts original ItemData.h limit/apply/three table typedefs and capacity constants, with explicit Win32 long32 types. Static assertions verify active sizes172/176/178. New ava2.item_proto_oracle constructs each actual original structure with distinct signed limits/applies/values, high-bit unsigned prices/flags, refine tail and range. Literal LZO containers test plaintext and original-key encrypted MIPX paths; truncation preserves records/ranges. Covers all currently represented fields independently of the production parser's offsets. Inspection additionally found original active ENABLE_PROTOSTRUCT_AUTODETECT leaves dwStride0 for MIPT; Process has no case0 and retains zeroed destinations. Corrected prior invented176 interpretation to original zero record behavior after valid decompression. Added plaintext/encrypted MIPT regression. This supersedes earlier claims of ordinary MIPT record decoding; original MIPX remains the actual resource format. Bounds checks avoid reproducing malformed-input out-of-bounds reads. macOS/Android arm64 builds passed;20 nonvisual CTests passed, including new independent oracle;925 reference files unchanged. render_3d remains excluded for unresolved timeout. Unrepresented sockets/weight/additional flags, icons/descriptions/load/reset semantics, player inventory metadata, locale startup, derived combat, skill execution and rendering remain outstanding. Full Windows parity goal remains active; no live server/device validation.
2026-10-05: full common item record fields and prototype socket query
Retain internal name, weight, all eight signed prototype sockets and alter-to-magic/specular/gain-socket bytes, completing the common active r156 destination fields. Original r158-only wWearableFlag is not copied by TItemTableAll into active r156, so the port also ignores it. These prototype sockets are distinct from per-instance inventory sockets. Replaced item.GetSocket placeholder with selected prototype data, original BYTE index conversion and out-of-range -1. Expanded independent Windows record oracle across all three formats/plaintext/encryption with distinct negative sockets and nonzero byte fields. Python regression compares all eight real Sword+0 sockets and tests index8/-1/256 semantics. macOS/Android arm64 builds passed;20 nonvisual CTests passed;925 references unchanged. render_3d remains excluded for unresolved timeout. Complete common record decoding does not establish the full item system: fabricated initial metadata, item descriptions/icons/load/reset lifecycle, player inventory APIs, locale startup, derived combat, skill use and rendering remain incomplete. No live server/device or visual validation; full alignment goal remains active.
2026-10-05: inventory item metadata queries
Replaced player.GetItemFlags, IsAntiFlagBySlot, GetItemTypeBySlot and GetItemSubTypeBySlot placeholders with the AVA2 PythonPlayerModule/PythonPlayer behavior. Flags and anti-flags come from server item instances, independently of prototype flags; type/subtype resolve exact/range prototype records without changing selected item. Preserve Win32 signed DWORD return and BYTE/WORD window/cell conversion. Apply active SItemPos bounds: inventory262, equipment228, dragon-soul1152, special180, switchbot6, change-equipment102; safebox/mall/separate belt windows are invalid here. Regression covers high-bit signed flags, both argument forms, negative masks, window isolation, integer wrapping, invalid boundaries and flags from decoded extended item packets. macOS and Android arm64 builds passed;20 nonvisual CTests passed;925 references unchanged. Existing render_3d timeout, locale startup and wider gameplay/rendering gaps remain unresolved; full alignment remains active.
2026-10-05: item grade and refine eligibility
player.GetItemGrade now follows AVA2 PythonPlayerModule: resolve the requested inventory window/cell, select its item with normal 60001 fallback, preserve failed-selection behavior, and read the final decimal character of the selected locale name instead of guessing vnum%10. It also preserves the observable selected-item change. player.CanRefine now returns original eligibility codes instead of None. Check worn inventory/equipment slots first (6), require USE/TUNING scroll, select target with original fallback, reject rods (7), and return 1/5 according to prototype dwRefinedVnum. Invalid scroll returns0. Reused active position bounds for target lookup. Other invented IsRefineGradeScroll/GetItemRefineInformation helpers and broader refine UI/server transaction handling remain outstanding. Tests use real loaded scroll/rod/Sword+0/+9 prototypes, two inventory windows, selection side effects, worn-slot ordering and next-grade rejection. macOS/Android arm64 builds passed;20 nonvisual CTests passed;925 original references unchanged. render_3d timeout and wider locale/skills/combat/rendering parity remain unresolved.
2026-10-05: item use classifications
Replaced six item placeholders: IsRefineScroll (USE/TUNING), IsDetachScroll (USE/DETACHMENT), IsKey (TREASURE_KEY), IsMetin (METIN), CanAddToQuickSlotItem (USE/QUEST), GetUseType (original active subtype strings, NOT_USE_TYPE/USE_UNKNOWN_TYPE). All select their requested item, apply original fallback and preserve selected-pointer side effects. Soulbind/element inactive cases remain absent; active attribute67 and costume cases included. Regression samples every distinct type/subtype in the real item table, verifies classification and use strings, and checks selected refined-vnum state. macOS/Android arm64 builds and20 nonvisual CTests passed; expanded Python query regression passed;925 baseline references unchanged. Locale startup, fake seed metadata, wider item transaction/skill/combat/rendering behavior remain incomplete; render_3d timeout unresolved.
2026-10-05: inventory sell price
player.GetISellItemPrice now resolves inventory instance count and exact/range prototype sell price without changing item selection. Active COUNT_PER_1GOLD flag uses unsigned count/price; ordinary items use DWORD count*price. Return preserves original signed Win32 int overflow and invalid-position/missing-prototype zero. Corrupt zero divisor raises ZeroDivisionError instead of reproducing the original native division fault. Regression checks all loaded real prototype records with maximal DWORD stack count (excluding zero divisors), plus invalid-window/cell cases. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full parity remains incomplete, including valuable-item warnings, locale startup, item transactions, skills/combat and rendering; render_3d timeout remains unresolved.
2026-10-05: valuable inventory item predicate
Replaced player.IsValuableItem zero placeholder with original selected-item lookup/fallback and predicate: any nonzero instance socket among Packet.h METIN_SOCKET_COUNT=6, or prototype sell price strictly greater than5000. Stored sockets6/7 do not contribute; count does not multiply the price threshold. Preserve selected-item side effect and missing-data exception. Regression uses real cheap/expensive prototypes, maximal stack count, individually negative values in all eight sockets, both position argument forms and selected refined-vnum. macOS/Android arm64 builds and20 nonvisual CTests passed;925 original references unchanged. Predicate availability does not prove full warning UI/transaction flows; locale startup, broader item/skill/combat and rendering parity remain incomplete, with render_3d timeout unresolved.
2026-10-05: inventory index/count position semantics
player.GetItemIndex/GetItemCount now use the active original SItemPos validity rules per window rather than the ordinary inventory array's size. This restores access to dragon-soul cells beyond ordinary inventory capacity and rejects invalid equipment/special/switchbot/change-equipment cells and storage windows. Preserve BYTE/WORD argument conversion and original signed Win32 DWORD-to-int returns. Invalid argument counts now raise rather than returning zero with a pending Python error. Regression seeds every supported window's last valid/first invalid cell, high-bit vnums/counts, invalid storage window and wrapped window/cell arguments. macOS/Android arm64 builds and20 nonvisual CTests passed;925 original references unchanged. Socket/attribute position conversion and remaining slot classification/transaction/locale/skills/combat/rendering remain outstanding; render_3d timeout unresolved.
2026-10-05: instance socket/attribute position semantics
player.GetItemMetinSocket/GetItemAttribute now apply active per-window SItemPos bounds and BYTE/WORD window/cell conversion, restoring dragon-soul high-cell access and excluding invalid cells. Preserve all eight signed sockets and fifteen BYTE/SHORT attributes; invalid socket/attribute indices still return zero rather than wrapping. Invalid argument signatures return Python exceptions without the former pending-error/return-value mismatch. Expanded every-window boundary fixtures with socket7=-123 and attribute14=(255,-32768), plus legacy inventory argument forms, wrapped positions, negative and first-invalid field indices. macOS/Android arm64 builds and20 nonvisual CTests passed;925 original reference files unchanged. Remaining slot classification, item transactions, locale startup, skills/combat and rendering gaps remain; render_3d timeout unresolved, full alignment active.
2026-10-05: equipment/costume/belt slot classifications
Corrected PythonPlayerModule predicates using active GameType.h constants: IsEquipmentSlot180..228 inclusive (distinct from internal IsEquipCell180..215); IsDSEquipmentSlot inventory-only216..228 inclusive; IsCostumeSlot199..203 inclusive; IsBeltInventorySlot246..261 with WORD cell conversion. Preserve original inclusive endpoint quirks and BYTE DS window conversion. Invalid argument parsing now returns an exception correctly. Regression checks all cells -1..299, endpoint/window restrictions and wrapped window/belt positions. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full locale/item transaction/skill/combat/rendering parity remains incomplete; render_3d timeout unresolved.
2026-10-05: item count aggregation windows
GetItemCountByVnum now sums only original inventory cells0..261 using retained instance data. GetItemCountByTT now sums upgrade-storage cells0..179 (aSSUItem), replacing its incorrect alias to ordinary inventory. Both preserve unsigned DWORD accumulation and signed Win32 Python return, avoiding signed C++ overflow. Invalid arguments raise correctly. Regression separates inventory/upgrade/book storage, excludes first-invalid cells and exercises high-bit vnum and overflow (0xffffffff+3=2). macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Remaining locale/item transactions/skills/combat/rendering parity is incomplete; render_3d timeout unresolved.
2026-10-05: instance identity and custom names
Replaced player.IsSameItemVnum/GetItemNewName placeholders. Identity compares the requested DWORD vnum to the item at its validated BYTE/WORD position; empty/invalid positions resolve vnum0. Custom names read retained server instance name, with invalid-position/wrong-arity caret sentinel and bounded string extraction. Preserve original argument order and wrapped positions without changing selected prototype. Regression covers inventory/special-window identity, mismatch, wrapped positions, empty invalid cells and custom instance names. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full locale/item transaction/skills/combat/rendering parity remains incomplete; render_3d timeout unresolved.
2026-10-05: stone attachment eligibility
Replaced player.CanAttachMetin None placeholder with original worn-equipment rejection, direct prototype lookup/error, wear-flag intersection, rod rejection and eight-socket silver/gold subtype matching. Preserve original codes0..5 and lookup behavior without changing selected item; original does not independently validate stone type. Regression uses real matching stone/weapon prototypes and socket7, covering no socket, silver-only restriction, gold socket and equipment rejection ordering. Distributed table lacks a matching normal stone fixture; normal branch remains source-reviewed rather than independently exercised. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. This predicate does not complete stone transactions/UI or broader locale/skill/combat/rendering parity; render_3d timeout remains unresolved.
2026-10-05: detachment eligibility
Replaced player.CanDetach None placeholder with original USE/DETACHMENT selection/fallback, target selection and REFINEABLE flag plus first-six-socket unsigned >2 check. Original has no worn-equipment rejection in this predicate. Active sash-clean scroll value0=7 instead requires COSTUME/SASH and signed absorbed socket1>0. Preserve selected target side effect and missing-item exceptions. Regression uses real detachment scroll and refinable sword, rejects wrong scroll and empty sockets, and distinguishes all eight socket positions with negative values (original DWORD conversion). Sash path is source-reviewed but lacks a dedicated fixture. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Transaction/UI, locale, skills/combat and rendering gaps remain; render_3d timeout unresolved.
2026-10-05: key unlock eligibility
Replaced player.CanUnlock None placeholder with original key/target selected-item lookup, fallback and type checks (TREASURE_KEY21, TREASURE_BOX20). Original does not compare values or reject worn cells separately. Preserve original argument order, BYTE/WORD position conversion, missing selected-data errors and selected-target side effect. Regression uses real key/box prototypes, special storage target, wrong key/target and selected refined-vnum state. macOS/Android arm64 builds and20 nonvisual CTests passed;925 reference files unchanged. Full transaction/UI, locale, skills/combat/rendering parity remains incomplete; render_3d timeout unresolved.
2026-10-05: independently exercised sash-clean branch
Closed the earlier detachment-test gap using actual loaded USE/DETACHMENT value0=7 cleaner and COSTUME/SASH prototypes. Tests check signed absorbed socket1 at -1/0/1/INT32_MAX, require sash target type, reject a weapon even with positive absorbed socket, and verify selected target state. Expanded ava2.python regression passed;925 reference files unchanged. No production source changed, so prior macOS/Android build validation still applies. This verifies eligibility only; full sash UI/transactions and broader gameplay/rendering parity remain incomplete.
2026-10-05: remove invented refine behavior
IsRefineGradeScroll now reproduces the actual original switch fallthrough: every arity reaches no-message Py_BuildException, whose ScriptLib implementation clears errors and returns None. Selection/value code is unreachable. Removed guessed vnum/name rules; regression covers valid/invalid signatures and unchanged selection. This intentionally preserves source behavior rather than repairing the reference bug. Removed extra GetItemRefineInformation export and invented vnum+1/cost/probability calculation; original PythonPlayerModule and Python UI have no such API. Tests now assert its absence. Previous interrupted builds/tests were confirmed terminal and passing; final macOS/Android arm64 builds and20 nonvisual CTests passed,925 references unchanged. Actual server refine transactions, locale, skills/combat and rendering remain incomplete; render_3d timeout unresolved.
2026-10-05: item equipment classification
Replaced item.IsEquipmentVID zero placeholder with original selected-item lookup/fallback and CItemData::IsEquipment predicate (WEAPON/ARMOR only). Costume/rod/other item kinds do not count. Preserve selection side effect; regression samples every distinct real type/subtype and checks selected refined-vnum state. macOS/Android arm64 builds and20 nonvisual CTests passed;925 reference files unchanged. Full locale/item transactions/skill/combat/rendering parity remains incomplete, with render_3d timeout unresolved.
2026-10-05: shop outgoing transactions
Implemented four net shop send bindings and main-actor action gate. Active OFFLINESHOP common header is58 bytes; unused original uninitialized fields are deterministically zeroed. Buy appends count1/BYTE position, sell BYTE position, sell2 BYTE window/BYTE position/DWORD count. Fixed-width serialization avoids native structs. Native byte fixtures cover all four operations. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Python binding-specific and live shop receive/UI/server validation remain incomplete, as do broader locale/skill/combat/rendering gaps.
2026-10-05: shop Python binding regression
Added direct Python calls for all four shop operations, checking full outgoing bytes and BYTE/DWORD conversions with511/-1/window262. Actor sleep blocks all four calls with no queued transaction. Expanded ava2.python regression passed;925 references unchanged. Prior native/Android build validation still applies; actual shop receive/UI/server lifecycle remains incomplete.
2026-10-05: shop lifecycle callback frames
Added dynamic HEADER_GC_SHOP framing for EndShop, signed64 SetShopSellingPrice and original error strings (money/soldout/inventory/position/extended money/count). Wait for complete frames, reject invalid lengths and truncated price. Regression verifies fragmented money error and coalesced end/negative-price callbacks. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Start/item/tab/offline shop subheaders remain unimplemented and unconsumed; full shop gameplay and wider locale/skills/combat/rendering parity are incomplete.
2026-10-05: retained shop open state
Replaced shop.Open/Close/IsOpen placeholders with retained lifecycle state; Clear resets open flag and initial tab count1. PythonRuntime construction resets state to prevent cross-runtime leakage. Regression covers initial/open/close/clear transitions and initial tab count. Item/tab/offline data remain unimplemented; Clear cannot yet reset those absent subsystems. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full alignment remains incomplete.
2026-10-05: retained shop tab metadata
Added native shop tab count/name/coin setters and real Python getters with original BYTE indexing, invalid name None and invalid coin255. Clear restores count1 while retaining tab names/coins as original; full runtime reset clears metadata. Reject count>3 to avoid original corrupt-data array overflow; initial unspecified original coin bytes are deterministic0. Regression covers3 tabs, wrapped indices, invalid bounds and Clear retention. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Packet start/tab producer and item data remain unfinished; full gameplay/rendering alignment incomplete.
2026-10-05: retained shop items and update frames
Added120 retained records (3x40) with signed64 price, DWORD count/barter fields,8 sockets/15 attributes/7 glove attributes. Implemented item ID/count/price/barter getters and Clear reset, preserving original BYTE tab quotient conversion. Shop update subheader2 decodes active123-byte record with explicit Win32 widths and triggers RefreshShop. Regression checks high-bit returns, last slot/first invalid, Clear and wire-update-to-Python queries. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full start/tab frames, socket/attribute getters and offline lifecycle remain incomplete; full alignment active.
2026-10-05: shop socket/attribute getters
Replaced shop socket, ordinary attribute and glove/random attribute placeholders with retained records. Preserve signed32 sockets/BYTE type/signed16 attribute values, original item index resolution and invalid attribute zero tuple. Invalid socket index returns0 instead of reproducing original unchecked out-of-bounds read. Native and packet-to-Python fixtures exercise last8/15/7 fields and negative values. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full shop start/tab/offline lifecycle and broader gameplay/rendering parity remain incomplete.
2026-10-05: ordinary and extended shop start frames
Implemented original start0 ownerDWORD+40 records and start-ex10 ownerDWORD/tabBYTE plus32-byte name/coinBYTE/40 records per tab. Share fixed-width record decoder with updates; validate whole frame before clearing retained items. Preserve original metadata retention in Clear and StartShop signed-owner callback after all data populated; callback/UI controls open flag. Reject >3 tabs and truncated records safely. Regression verifies fragmented4928-byte ordinary start,9915-byte two-tab extended start, stale-item removal, last item/page and metadata. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Actual server/UI integration, independent full-struct oracle and offline lifecycle remain unfinished; broader alignment active.
2026-10-05: malformed shop frame state preservation
Added isolated receive-stream fixtures for header length<4, truncated ordinary start/item update/price, excessive tab count and missing tab records. Verify all six reject before changing retained page count/name/items. Expanded ava2.python regression passed;925 references unchanged. No production source changed; prior platform build validation applies. Real server/UI and independent shop record oracle remain pending, along with wider gameplay/rendering parity.
2026-10-05: offline shop end/purchase send
Implemented net.SendOfflineShopEndPacket/BuyPacket with original header57,58-byte common shop record, DWORD owner at53 and BYTE position at57. Original undefined unused fields are deterministic zero; original main-actor action gate preserved. Direct Python regressions verify negative owner/BYTE wrapping, full bytes and blocked actor behavior. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Offline management/receive/state/UI and real-server transactions remain incomplete; full alignment active.
2026-10-05: offline management remove/destroy/logs
Implemented three original Python management sends: remove item(sub5)+BYTE position, destroy shop(sub6), remove logs(sub11). Unlike purchase/end, original management calls have no main-actor action gate. Full58-byte header serialization zeroes undefined unused original fields. Regression calls each while actor is controlled and checks full bytes/BYTE wrapping. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Offline stock/withdraw/title/receive/UI and broader gameplay parity remain unfinished.
2026-10-05: offline slot/return/time requests
Implemented SendOpenShopSlot(sub13)+BYTE position, SendGetBackItems(sub14), SendAddTime(sub15), retaining original absence of actor gate and zeroing undefined unused original header fields. Direct Python fixtures verify full bytes, negative-position BYTE wrapping and sending while controlled. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Offline stock/withdraw/title/receive/UI and broader gameplay alignment remain incomplete.
2026-10-05: offline open by VID
Implemented net.SendOpenWithVID with original sub16 and appended DWORD owner after58-byte common header (distinct from purchase's embedded owner). Preserve absence of actor gate and signed Python-to-DWORD conversion; undefined unused original fields zeroed. Regression checks complete62-byte request while actor controlled. macOS/Android arm64 builds and20 nonvisual CTests passed;925 references unchanged. Full offline receive/stock/withdraw/title/UI and broader gameplay alignment remain incomplete.
2026-10-06: net senders and safebox move layout
Fixed safebox item move (11-byte original layout), exchange action gate/default position/ItemDel no-op; implemented exchange, safebox/mall, messenger, party, guild (15 subheaders), quest input/confirm, select item, target info senders with golden-byte tests. Placeholder count 749 → 618. macOS + Android arm64 libmain.so builds passed; 925 references unchanged. Four CTests (python, window_tree, speedtree_forest, mark_manager) fail identically on baseline because asset paths are hardcoded to /Users/shen/... and cwd-relative; see WINDOWS-PARITY.md. Outstanding: configurable asset root, party/guild member state, select-phase empire/name, emoticon, offline-shop stock/withdraw/title, render_3d timeout.
2026-10-06 (pass 2): receive loop, chat/whisper, server commands
- Made the GC receive loop table-driven and generated from the Win32 reference: 138 headers, 119 handlers.
- It now matches Windows for unknown headers (clear and quit), handler failures (clear), loading-only headers in the Game phase (clear), and padding and partial packets.
- The 75 unported GamePhase packets are skipped one packet at a time, so the stream no longer desyncs.
- Ported the chat receive branches, the 31-byte multilanguage whisper, and ServerCommand with SplitToken and the BINARY_ServerCommand_Run/parser window.
- Ported the emoticon registry and send, the "/" command repeat, and the PyCallClassMemberFunc callback semantics.
- Placeholders went from 618 to 609. macOS and Android arm64 builds pass; 925 reference files unchanged; ctest 16/20 with the same 4 environment failures.
- Correction: pass 1's python_test had aborted early. It needs a merged
ymir workoverlay plusmap/texturesetsymlinks, and it returns rc=0 even on an abort, so check the log for "passed". - Next: port the 75 GamePhase handlers (motion 36, add/del/update char, item ground, fly, etc.), the chat module, emoticon effects, the insult filter, configurable asset roots, a harness that fails on a Python abort, and the render_3d timeout.
2026-10-06 (pass 3): remaining GamePhase handlers
- Done: 63 of the 75 skipped GamePhase headers are ported, in src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp. This includes:
- handshake/time sync with the Windows stop-frame;
- the unsequenced XTrap ACK;
- party, PVP and duel;
- target and refine;
- quest script/confirm;
- event manager, calendar, sash, kingdoms war, exchange log and catch-king.
- The refresh block now runs in Windows order. Details are in WINDOWS-PARITY.md.
- Still skipped: 47, 74, 75, 81, 93, 114, 156, 171, 217, 220, 221, 230.
- Visual and native-store gaps: minimap/atlas marks, target and specific effects, fly targets, dig/fishing motions, guild land and symbols, hybrid-crypt keys, anticheat blacklist, sash/bank/chest-drop stores, dungeon auto-walk, text-tail refresh, 300 ms refresh throttle.
- Validation: ava2.python passed, with new golden tests. CTest
-E render_3d16/20 (same environment failures; render_3d excluded because of its timeout). Android arm64 built. Baseline 925 files unchanged. Packet audit 210/0.
2026-10-06 (pass 4): quest records and task-letter receive path
Ported HEADER_GC_QUEST_INFO (81), the ordered CPythonQuest record store and all six quest Python bindings directly from AVA2 PythonQuest.cpp/.h and RecvQuestInfoPacket. BEGIN replaces/moves an existing wire quest to the end, while quest.Add BEGIN ignores a duplicate; UPDATE creates missing records, preserves empty strings and changes counters/clocks only when flagged; END deletes. Multilanguage ^ titles invoke GetQuestLetterName before RefreshQuest. Signed counters, DWORD Python IDs, array-index getters and unclamped expired countdowns are preserved. GetQuestData uses the existing portable image-handle adapter for the original icon paths.
Added a source-extracted original header/flag compile oracle and an asset-independent native/Python/wire regression. Declared quest payloads shorter than their selected fields are rejected before consuming a following packet; this deliberately bounds an unsafe original trusted-server assumption. Countdown time uses the port's elapsed monotonic application clock; original virtual/frame-timer mode and UI rendering are not verified.
Fixed the ava2.python test harness: process exit 0 alone no longer proves success; both exit status and final completion marker must pass. Confirmed rejection of early exit(0) and nonzero exit even with the marker present.
Validation: macOS and Android arm64 libmain.so builds passed; ava2.quest and ava2.windows_item_oracle passed; existing python_test passed through the completion wrapper in the prepared asset overlay. Both loopback tests passed with permission to bind local fixture ports. Default nonvisual CTests retain four failures: python asset/map assertion, window_tree missing locale resources, mark_manager hardcoded resource path, and speedtree_forest's canopy wind assertion (the last is not an asset lookup failure). render_3d remains unverified. All 925 immutable AVA2 references unchanged; 211 packet constants checked with zero mismatches.
Remaining skipped GamePhase headers:47,74,75,93,114,156,171,217,220,221,230. Static inventories still show hundreds of placeholders; complete gameplay, assets/rendering, real isolated-server and Android-device parity remain unfinished.
2026-10-06 (pass 5): messenger and cube renewal
Ported messenger GC74 and all five original PythonMessenger.cpp bindings. Login/logout/mobile retain friend membership and emit original group0 callbacks; LIST uses connected bit0/bit1 and emits online state before mobile. LOGIN alone refreshes the target board by name. Added the original sorted guild member list/callback operations and RefreshGuildMember (its Guild GC75 producers remain unported). Destroy clears lists while retaining the handler; runtime teardown releases owned references. Invalid Python arguments return None as the original no-message Py_BuildException does. Oversized/truncated wire names are bounded instead of reproducing original stack overwrite/cross-packet reads; INVITE/unknown subheaders preserve the Windows no-op and unconsumed payload behavior. Ported cube GC221, ordered recipe records and all five PythonCubeRenewal.cpp bindings. Receive appends even duplicate recipe IDs; OPEN goes to the game window, LOADING to the registered cube handler, CLEAR retains the handler. GetDates preserves its16-field tuple, signed values, array indexing and original missing-entry tuple. Craft/close use original CG21610-byte wire layouts and main-actor CanAct guard, with zeroed undefined close fields. Recipe category reads are bounded; wire bool is stored as BYTE and normalized on query rather than reading an invalid C++ bool representation. Added dedicated messenger/cube native+Python+fragmented-wire tests and source-extracted structure/enum/offset compile checks. macOS and Android arm64 libmain.so builds passed; four targeted CTests (messenger,cube,quest,Windows declaration oracle) passed. Complete nonvisual CTest19/23: same python/window_tree/mark_manager resource failures and speedtree canopy sway failure. The existing comprehensive python_test passes through its completion wrapper in the prepared asset overlay. Packet constants214/0;925 immutable references unchanged; static placeholders789→780 (active *Module.cpp-only interface count remains597, because these original modules live in PythonMessenger.cpp/PythonCubeRenewal.cpp). Remaining skipped GamePhase headers:47,75,93,114,156,171,217,220,230. Guild receive/store integration, offline/item shop, switchbot, dungeon/drop/battlepass and wider gameplay/rendering/asset/server/device parity remain unfinished. No reference files or existing server changed.
2026-10-06 (pass 6): private shop search and complete extension discovery
Ported GC156 result receive and the12 active PythonPrivateShopSearch.cpp bindings, plus net.SendPrivateShopSearchInfo/CG143. Preserve append order/duplicates until explicit ClearSearchItems; retain original signed DWORD/int results,64-bit prices,8 sockets/15 attributes, seller/position and literal new-name"^" behavior. Removed two exports absent from the active AVA2 feature profile (transmutation/perma). Receive schedules one RefreshShopSearch after a batch, including an empty result packet. Search request serializes89 Win32 bytes in original field order, wraps BYTE parameters and deliberately does not SendSequence; original main actor CanAct guard retained. Zero-fill original undefined text padding; reject text longer than49 bytes and invalid result/socket accesses instead of reproducing original memory faults. Added an independent literal-wire/native/Python search test and original-source structure/offset compile comparisons. Both platform builds pass; targeted search/cube/messenger/quest/oracle tests5/5 pass. Nonvisual CTest20/24 with the same four python/window_tree/mark_manager asset failures and speedtree sway assertion. Comprehensive python_test passes in the prepared resource overlay via the completion wrapper. Packet constants216/0;925 immutable reference hashes unchanged; static placeholders780→765. Corrected the interface audit to discover every original .cpp registering Py_InitModule rather than only *Module.cpp. It now covers47 modules,726 overlapping placeholder methods and7 missing guild_ranking methods (Close,CountDate,GetPageCount,GetPageView,InfoDate,Open,SetPageCount). The count increase reflects expanded audit coverage, not newly introduced placeholders. quest/messenger/cube/search now all appear with no missing/extra/placeholder methods. Method-name coverage still does not prove full behavior. Remaining skipped GamePhase headers47,75,93,114,171,217,220,230. Global refresh timing (including search's500ms delay), original DWORD-size packet/WORD-framing edge cases above65535 bytes, real server/device and full UI rendering remain unverified; broader gameplay/store/asset gaps persist.
2026-10-06 (pass 7): guild state and GC75
Ported all34 active PythonGuild.cpp methods, replacing31 guild placeholders while retaining the mark manager. GC75 now handles the original login/logout, list/remove, grade/name/authority, info, comments, EXP, skill/general, invitation, name cache, war/point/list and money subheaders. Preserve member grade sorting only on registration, existing name/job retention on updates, integer average, DWORD sums and signed Python results, no aggregate recomputation on removal, insert-first guild names/skill slots, six enemy slots without compaction and callbacks before war-slot changes. Native Destroy intentionally retains board comments, offer sum and skill-slot map; Python Destroy also clears the slot map. A new embedded runtime clears all state. Invalid indices/wire lengths are bounded instead of reproducing Windows memory faults. Guild list/login/logout/remove now produce the original messenger group1 callbacks and target refreshes. Page refreshes coalesce in Windows order after packet dispatch. Main actor append/update synchronizes net.GetGuildID and the matching account roster; main-member removal clears these. net.SendGuildRemoveMemberPacket now resolves an exact member name to PID and emits the original CG80 removal, retaining the no-send path for unknown names. GVG keys are stored and removed symmetrically; ChangeGVG/RefreshTextTail name-colour effects remain unported and are not claimed as complete guild-war rendering parity. Corrected interface discovery to use ClCompile entries from the actual AVA2 Windows vcxproj files. guild_ranking is orphan source, absent from that build and without corresponding protocol declarations: the previous missing-interface report was false. Current audit covers46 compiled modules,0 missing names and694 overlapping placeholders; guild has no missing/extra/placeholder names. Static placeholders765→733. Also corrected the prior refresh-throttle gap: AVA2's s_nextRefreshTime guard is commented out, so its300/500ms assignments impose no active delay. Do not introduce an artificial throttle. Validation: macOS Debug and Android arm64 builds passed; guild/search/cube/messenger/quest/Windows declaration oracle tests6/6 passed. The new guild test checks independent literal packet bytes, fragmented/coalesced packets, malformed-frame boundaries, all receive subheader families, original tuple defaults and state quirks, remove-member sending, account roster synchronization and runtime reset. Source-extracted guild structs/enums/offsets compile against the port. Full nonvisual CTest21/25, with the same four existing failures (python asset/map assertion, window_tree locale resources, mark_manager legacy resource path, speedtree canopy sway). Comprehensive python_test passes through the completion wrapper in the prepared asset overlay after updating its old skipped-GC75 fixture to still-unported GC47; shutdown emits the pre-existing Python del warnings. Packet constants217/0;925 immutable references unchanged. Remaining skipped GamePhase headers:47,93,114,171,217,220,230. GVG/PK name colours, DWORD-size packet/WORD-framing edge cases above65535 bytes, wider native stores, real-server/device and full asset/rendering parity remain unfinished. No reference files or existing server changed.
2026-10-06 (pass 8): battle pass
Ported all8 active PythonBattlePass.cpp bindings and GC230/CG230 from PythonNetworkStreamPhaseGame.cpp. Keep separate ordered info/progress vectors; INFO and UPDATE append duplicates without replacing by mission ID. CLEAR removes info and resets time but preserves progress; UPDATE_CLEAR removes progress while preserving info/time. INFO_EXTRA sets signed time; LOADING/UPDATE_LOADING forward their original subheader to the registered handler. OPEN/MP call the game window immediately. Unknown subheaders consume the complete58-byte fixed packet with no state change. Queries preserve original defaults and tuple shapes, including scalar0 for GetDatesItems on a missing record versus pair(0,0) for an invalid reward slot, four reward entries, signed DWORD/Python-int conversions and independent progress indexing. Negative reward slots are safely rejected instead of reproducing original out-of-bounds memory access. Handler references are retained/released across replacement and runtime teardown; list clears keep the handler. Open/reward requests serialize6 little-endian Win32 bytes, use the original main-actor CanAct gate and SendSequence. OPEN's undefined index field is deterministically zeroed; REWARD preserves signed32-bit wrapping. Validation: macOS Debug and Android arm64 builds passed. Seven targeted battlepass/guild/search/cube/messenger/quest/Windows declaration oracle CTests passed. New battlepass test uses literal wire records and fragmented/coalesced frames, both lists/clear modes, query defaults/signed values, handler lifetime/callback failure, unknown subheaders, exact request bytes/sequence and action guards. Battlepass structs/enums/offsets are compiled against declarations extracted directly from the immutable original. Full nonvisual CTest22/26 with the same four existing failures (python map/assets, window_tree locale assets, mark_manager resource path, speedtree canopy sway); comprehensive Python regression passes in the prepared resource overlay through the completion wrapper. Static placeholders733→725; compiled-interface placeholders694→686, no missing/extra/placeholder names for battlepass. Packet constants219/0;925 immutable reference hashes unchanged. Remaining skipped GamePhase headers47,93,114,171,217,220. Offline/item shop, switchbot, dungeon info/drop item state, GVG/PK name colours, other native/UI/resource/rendering gaps and real-server/device parity remain unfinished. render_3d is still excluded for its unresolved timeout. No reference files or existing server changed.
2026-10-06 (pass 9): drop item search
Ported all8 PythonDropItem.cpp bindings, GC220 receive and CG215 open/search from AVA2 PythonNetworkStreamPhaseGame.cpp. Replaced7 dummy handlers plus the hidden GetDates no-op (always returned empty data). Preserve ordered append/duplicates, signed DWORD query results, missing-record tuple("None",0,0,0), GetPageView=5, unconstrained signed page selection and ClearList resetting page to1. Server OPEN calls the game window; LOADING calls the registered handler; CLEAR retains that handler. Unknown subheaders consume the full114-byte fixed packet without state changes. Bound100-byte mob names instead of reading past unterminated wire fields. Open/search requests encode6 little-endian Win32 bytes, preserve integer wrapping, use the original main-actor CanAct gate and SendSequence. The original OPEN vnum is undefined; its four bytes are deterministically zeroed. Python handler references are owned during registration, released on replacement/teardown, and retained across list clears. Validation: macOS Debug and Android arm64 builds passed. Eight targeted drop/battlepass/guild/search/cube/messenger/quest/Windows declaration oracle CTests passed. New drop test checks literal fragmented/coalesced wire bytes, duplicate records, full-width names, signed values/argument defaults, page/reset semantics, handler lifetime/callback exceptions, unknown subheaders, exact send packets/sequencing/action guards and fresh-runtime reset. Source-extracted drop structs/enums/offsets compile against the port. Full nonvisual CTest23/27, same existing python/map-assets, window_tree/locale, mark_manager/resource-path and speedtree/canopy-sway failures; comprehensive Python regression passes in the prepared asset overlay through the completion wrapper. Static placeholders725→718; compiled-interface placeholders686→679 with no drop_item missing/extra/placeholder names. Packet constants221/0;925 immutable references unchanged. Remaining skipped GamePhase headers47,93,114,171,217. Offline/item shop, switchbot, dungeon info, GVG/PK name colours, other native/UI/resource/rendering behavior and real-server/device parity remain incomplete. render_3d remains excluded for its unresolved timeout. No reference files or existing server changed.
2026-10-06 (pass 10): dungeon information
Replaced all12 PythonDungeonInfo.cpp implementations, including8 dummy bindings and4 apparently implemented but fabricated functions. Removed the six hardcoded dungeon entries and incompatible11-field query tuple. Dungeon data now comes exclusively from GC217: independent ordered info, mission and ranking vectors; duplicate entries append in wire order. InfoDate reproduces the original21-field tuple and defaults, InfoDateMision its4-int tuple and InfoDateRanking its4-field tuple; fixed100/24-byte strings are bounded. Preserve signed DWORD results, GetPageView=13 and unconstrained signed page count. Ported all original GC217 branches, game-window OPEN/RANKING_LOAD/MISION_LOAD callbacks and the original mission-send fallthrough that clears ranking. DATES_CLEAR resets page/info/missions but retains rankings; MISION_CLEAR and RANKING_CLEAR affect only their respective vectors. Unknown subheaders consume the complete618-byte fixed packet without changes. Fresh runtime resets all lists. CG213 open/teleport/mission/ranking requests encode6 little-endian Win32 bytes and use the original CanAct gate/SendSequence; OPEN's undefined index bytes are zeroed. Validation: macOS Debug and Android arm64 builds passed. Nine targeted dungeon/drop/battlepass/guild/search/cube/messenger/quest/Windows declaration oracle CTests passed. New dungeon test uses literal fragmented/coalesced wire fixtures and verifies all receive branches, all21 query fields, clear/fallthrough independence, duplicates, signed/default/page behavior, full-width unterminated strings, callbacks/failures, exact four send packets and action/sequence guards. Source-extracted structures/enums/offsets compile against the port. Full nonvisual CTest24/28 with the same existing python/map-assets, window_tree/locale, mark_manager/resource-path and speedtree/canopy-sway failures; comprehensive Python regression passes in the prepared asset overlay via completion wrapper. Static placeholders718→710; compiled-interface placeholders679→671; dungeon_info has no missing/extra/placeholder names. Packet constants223/0;925 reference hashes unchanged. Remaining skipped GamePhase headers47,93,114,171. Offline/item shop and switchbot, GVG/PK name colours, other native/UI/resource/rendering gaps and real-server/device parity remain incomplete. render_3d still excluded for unresolved timeout. No reference files or existing server changed.
2026-10-06 (pass 11): switchbot behavior
Replaced all9 previously non-placeholder switchbot implementations with the original PythonSwitchbot.cpp data flow. Removed fabricated common-attribute/max-value tables and client-side Start/Stop state changes. GC171 now updates the complete220-byte table, applies84-byte item updates and builds the ordered server attribute-set map. Keep six native slots and two alternatives/five normal attributes while exposing SLOT_COUNT=5. Server UPDATE alone determines active/finished; wire bool fields are BYTE and normalized on query. ClearSlot clears active/items/alternatives while retaining finished and player item data, as Windows does. Attribute-set selection comes from the actual SWITCHBOT(window11) player item and item-proto type/subtype, including arrows/unsupported armor rejection, rings, pendant and original costume-to-armor-subtype mapping. Duplicate map entries overwrite after BYTE narrowing of apply_num. Attribute-list values truncate to signed16-bit, while GetAttributeMaxValue retains signed32-bit values. Python slot/alternative/index/type arguments wrap to BYTE, attribute values to signed16-bit. Bound invalid attribute indices and return deterministic-1 when item lookup fails instead of original uninitialized memory behavior. Item updates retain the existing vnum/flags and all other fields; the packet vnum is ignored as in AVA2. SetItemCount calls the registered player's RefreshInventory immediately before socket/attribute updates; phase-window RefreshSwitchbotItem follows. Preserve all8 sockets/15 attributes. Server callbacks are immediate. Attribute-map receive clears the prior map, consumes9-byte records, and leaves short tails/unknown-subheader payload for the original dispatcher. CG171 Start/Stop are explicit37/7-byte Win32 packets with SendSequence and no invented action guard; requests do not alter local state. Preserve the original wrapper's >6 boundary: Start(6) sends only a7-byte header declaring37 bytes because native alternatives lookup returns empty; Stop(6) sends7 bytes; larger wrapped slots send nothing. This source quirk is covered, not treated as an invented protocol improvement. Validation: macOS Debug and Android arm64 builds passed. Ten targeted switchbot/dungeon/drop/battlepass/guild/search/cube/messenger/quest/Windows declaration oracle CTests passed. New switchbot test covers independent literal fragmented/coalesced records, full table/item updates, callback ordering, bool normalization, BYTE/short conversion, clear semantics, sorted map/overwrite/max-value behavior and all supported/rejected item classifications through generated172-byte item-proto fixtures in a temporary isolated pack root. It also checks exact send/sequence/no-actor/state/boundary behavior, malformed table boundaries, unknown/tail dispatch and runtime reset. Original-source structures/enums/offsets compile against the port. Full nonvisual CTest25/29 with the same four existing python/map-assets, window_tree/locale, mark_manager/resource-path and speedtree/canopy-sway failures; comprehensive Python regression passes in the prepared asset overlay.225 packet constants match;925 immutable references unchanged. Static710 and compiled-interface671 placeholders remain unchanged because all old switchbot methods already had non-dummy function bodies; this milestone demonstrates why name/placeholder audits alone cannot prove parity. Remaining skipped GamePhase headers47,93,114. Offline/item shop, GVG/PK name colours, wider native/UI/resource/rendering gaps and real-server/device parity remain incomplete. DWORD-sized packet framing above65535 bytes and render_3d timeout remain unverified. No reference files or existing server changed.
2026-10-06 (pass 12): item shop GC93
Ported RecvItemShop from AVA2 PythonNetworkStreamPhaseGame.cpp. GC93 now forwards dragon coins, optional purchase log, complete purchase-history arrays, single-item updates and nested category/subcategory catalogs to the original game-window callbacks. Keep signed32-bit DWORD callback conversion, signed64-bit prices/coins/sales, BYTE discounts, original callback tuple order and original omission of week/month limits from callback arguments. Log arrays are fully read before append callbacks, while HideLoading/LogClear occur before that read. DRAGONCOIN appends its optional log before setting coins. LOAD opens the main page once after each outer category; zero categories do not open it, and sentinel9999 opens it once and returns. Duplicates and empty subcategories are forwarded without an invented native store. Preserve original BUY/RELOAD/LOG_ADD/unknown-subheader unconsumed payload behavior. Bounds reject negative/oversized counts and truncated fields rather than reproducing large allocations or cross-frame reads; fixed25/21/16-byte log strings are bounded. Wire bool is read as BYTE and normalized. Existing chat-based requests and original Python UI are unchanged; this milestone covers the receive bridge, not full rendered item-shop interaction parity. Validation: macOS Debug and Android arm64 builds passed. Eleven targeted itemshop/switchbot/dungeon/drop/battlepass/guild/search/cube/messenger/quest/Windows declaration oracle CTests passed. New literal-wire test checks fragmentation/coalescing, every actual receive branch, signed values/64-bit fields, nested duplicate/empty categories, sentinel/zero counts, callback order/failure, full-width strings, unknown payload dispatch and bounded malformed count/record reads. Source-extracted item/log/header structures, field offsets and enums compile against the port. Full nonvisual CTest26/30 with the same four existing python/map-assets, window_tree/locale, mark_manager/resource-path and speedtree/canopy-sway failures; comprehensive Python regression passes in the prepared resource overlay via completion wrapper.226 packet constants match;925 immutable reference hashes unchanged. Static710 and compiled-interface671 placeholder counts unchanged: there is no dedicated native Python itemshop extension in AVA2. Remaining skipped GamePhase headers47,114: offline shop and special effects. Other consumed-but-incomplete native/UI/rendering/store logic, GVG/PK name colours, resource roots, real-server/device parity, DWORD-size framing above65535 and render_3d timeout remain outstanding. No reference files or existing server changed.
2026-10-06 (pass 13): offline shop
Ported GC47 and 27 original active PythonShop.cpp offline bindings, replacing fixed-value/no-op methods. Original three-tab/80-slot item indexing, vnum-gated lookup, signed DWORD/int returns, 64-bit prices/flags,8 sockets/15 attributes, missing buyer string "None", initial title "NONE" and Clear() resetting offline metadata and stock are retained. START updates state before callbacks, reverses80 log entries and skips zero-price logs; UPDATE appends nonzero logs first then refreshes. Six scalar branches retain direct-read/trailing-payload behavior; CHECK_RESULT accepts only byte1. IsOfflineShop remains0 because AVA2 never sets the flag. END clears ordinary and offline shop state before the original callbacks. Active zodiac lucky-error callback and unknown/error full-payload consumption are preserved. Implemented stock replace/delete/clear/query, sorting by display position, CG58 build and CG57 decoration. Explicit little-endian53-byte build header/20-byte stock entries and58+52-byte decoration match the source Win32 layouts; no main-actor gate is invented, and existing SendSequence transport behavior is retained. BYTE/WORD conversions and empty-stock requests match AVA2. Undefined original padding/owner_id is zeroed; decoration text is copied literally rather than reproducing the original format-string vulnerability. Fixed text is bounded and malformed/truncated records reject instead of reproducing out-of-bounds reads. Added independent literal fragmented/coalesced wire/state/Python fixtures and source-extracted Win32 structure/enum/offset assertions. Interface auditor now merges multiple method tables for one module, so extending shop in a separate translation unit does not erase ordinary shop interfaces from the report. The comprehensive Python framing regression now uses the remaining unported GC114 instead of expecting GC47 to be skipped. Validation: macOS Debug and Android arm64 builds pass;12 targeted regressions pass. Full nonvisual CTest27/31 retains the four previously documented python/map-assets,window_tree/locale,mark_manager/resource-path and speedtree/canopy-sway failures.228 packet constants match;925 immutable reference hashes unchanged. Static placeholders710→683; compiled-interface placeholders671→644;46 original compiled modules compared,0 missing method names. Comprehensive Python regression passes in the prepared resource overlay through the exit-status/completion-marker wrapper. Remaining skipped GamePhase header114 (special effects); other consumed-but-incomplete handlers/native/UI/rendering/store logic, shop sign rendering, GVG/PK colours, resource roots, isolated-server/device equivalence, DWORD framing above65535 and render_3d timeout remain outstanding. Offline rendered UI/server interaction parity is unverified. No reference files or existing server changed.
2026-10-06 (pass 14): original item sound dependency and equipment request restrictions
Replaced item.SetUseSoundFileName/SetDropSoundFileName no-ops with the original bounded8-use/5-drop category registries. Native selection follows PythonItem.cpp: bow versus arrow/quiver/default weapon, body versus neck/ear/default armor, ability-up potion sound, talisman portal sound; USE_POTION itself has no client-use sound, leaving server-triggered potion playback separate. Missing item definitions stay silent; empty configured strings are retained. Sound lookup does not change ItemManager's selected item. Added PlayUsePotionSound as a native dependency for GC114; GC114 itself remains skipped until full registered character/bone effects are ported. Restored original pre-send drop sounds for safebox checkin/checkout/move and mall checkout using actual inventory/storage item definitions. Also restored inventory use/move sounds and their missing equipment restrictions: only an equipment item in a source equipment cell triggers exchange/shop notification or attacking rejection, after CanAct and before sound/send. A destination-only move from a normal inventory cell is permitted as the original does. Equipment range is180..215 for INVENTORY/EQUIPMENT; original selection-without-fallback behavior is retained. No sounds were invented for item drop/pickup/use-to-item. Original packet layouts and transport sequence behavior remain unchanged. Added isolated literal item-proto fixtures covering24 type/subtype combinations, generated PCM WAV fixtures to prove actual SoundManager dispatch/cache population, original Python bad-argument/category bounds and selection-retention tests, storage-invalid-slot suppression, equipment/source-cell boundaries, exchange/shop notifications and CanAct suppression. Original sound enums are extracted into the Win32 compile oracle. No real device/audio-output/attack-animation equivalence is claimed; the attack gate's runtime animation state and shared audio resource resolver remain pending. Validation: macOS Debug and Android arm64 builds pass;13 targeted regressions pass. Nonvisual CTest28/32 retains the same four prior python/map-assets,window_tree/locale,mark_manager/resource-path and speedtree/canopy-sway failures. Comprehensive Python regression passes in the prepared resource overlay via exit-status/completion-marker wrapper.228 matching protocol constants,925 unchanged references,46 compiled Windows modules/0 missing methods; static683→681 and compiled-interface644→642 placeholder bindings. Remaining: GC114 and specific/levelup/skillup character effects need registered effect tables, lifetime/attachment/bone transforms and original rendering/invisibility behavior; wider native/gameplay/rendering/resource/server/device parity remains incomplete. Item-proto preset seeds, audio hardcoded resource paths, DWORD framing above65535 and render_3d timeout remain unverified/unresolved. No reference files or existing server changed.
2026-10-07 (pass 15): remove fabricated item database and port resource data loading
Removed seven preset item records, invented names/descriptions/values, lazy hardcoded locale/en item_names/item_list loading, inferred type from item_list's ignored second column and three hardcoded weapon-model fallbacks. An unloaded database is now empty; data arrives through explicit AVA2 item-list/table/description loaders. item.LoadItemTable retains its original None return even on native failure. Selection success is tracked separately from vnum0, so creating a zero-vnum record does not implicitly select it; failed selection retains the previous record/fallback behavior. Native item-data-pointer helpers reject vnum0 as AVA2 does. Ported active non-Vietnam LoadItemList/LoadItemDesc and prototype icon selection: original tab splitting/quoted tokens/column counts and atoi IDs, list overwrite/model reset/description/socket clearing, description-only updates of existing IDs and quoted string stripping. Prototype load preserves source record order for same-internal-name icon fallback, then decimal-base icon and bowl27995; existing list definitions preserve model/icon/description. ItemProto now retains recent ordered rows, including duplicate IDs, for these source-order semantics. Failed/truncated loads retain prior state; explicit reset safely clears selected/range references rather than reproducing Windows Destroy dangling pointers. Corrected GetItemSize to(1,proto size), including size0 for list-only records; icon pixels no longer rewrite prototype dimensions. Selected-pointer getters now raise on missing selection; GetIconImageFileName returns the resolved image filename or original "Noname" when no image is available. Image/subimage candidate resolution now includes the configured decoded resource root, and physical loading preserves the logical resource filename; file-existence checks use both mounted and original local-file candidates. The broader pack/encryption/case/encoding/render lifecycle is still incomplete. Added isolated list/description/literal-proto/TGA fixtures covering an empty database, removal of preset/lazy data, ignored type/name columns, malformed lines, quoted text, missing records/files, original prototype order/icon fallback, description/model/socket retention/reset, selected-state reload and icon-independent sizes. Updated comprehensive Python harness to explicitly execute the original item-list stage before table loading and to expect Noname in its intentional no-icon working-directory case. app.LoadLocaleData itself remains a no-op: integrating the full locale coordinator (item/NPC/skill/pet/insult/scale/wiki lifecycle) is the next required resource step; these native loaders do not establish complete original startup behavior. Validation: macOS Debug and Android arm64 builds pass;15 targeted regressions pass. Comprehensive Python regression passes in the prepared resource overlay via completion wrapper. Final nonvisual CTest29/33 retains the same four prior python/map-assets,window_tree/locale,mark_manager/resource-path and speedtree/canopy-sway failures.228 matching packet constants.925 immutable reference hashes unchanged;681 static and642 compiled-interface placeholder bindings remain (these repairs fixed hidden mismatches);46 compiled original modules/0 missing method names. No reference files or existing server changed. Remaining: full locale startup and renderer/resource lookup/lifetimes, GC114/specific/levelup/skillup effects and bone attachments, GVG/PK colours, other native/consumed-handler stores, audio resource paths, isolated-server/device equivalence, DWORD framing above65535 and render_3d timeout. Full client parity remains incomplete.
2026-10-07 (pass 16): app.LoadLocaleData coordinator, insult filter, pet skill/mob/item scale
Replaced the app.LoadLocaleData no-op with the original ::LoadLocaleData (PythonApplication.cpp) sequence and return value (Py_BuildValue "i"): Destroy of NPC/item/skill/pet-skill stores, then item_list (TraceError, continue), item_proto (fail -> 0), itemdesc (continue), mob_proto (fail -> 0), SkillDesc/SkillTable (fail -> 0; original messages print the mob_proto path), pet_skill (fail -> 0), insult.txt (continue), locale/common/npc_wear.txt (continue), mob_scale.txt (fail -> 0) and item_scale.txt (continue). Python callers (localeInfo.LoadLocaleData) ignore the result as on Windows.
Ported CPythonSkillPet (petskill module: SetSkillSlot/GetIconImage/GetSkillbySlot/GetEmptySkill and RegisterSkillPet, including the excluded final line, 6-column rejection, icon path truncation and unknown-type retention; slot index is bounds-checked instead of writing out of range). Ported CInsultChecker + net.LoadInsultList/IsInsultIn/IsChatInsultIn (original inverted enabled check kept) and applied the original '*' filter to received talking/party/guild/shout/whisper text of non-NPC/non-enemy chatters and to VID-less shout text from the colon, so filtered text also reaches the chat log. Ported LoadMobScale (insert-only, kept across Destroy), LoadNPCWear (15-column rows, race<=7, map-name then "all" lookup) and LoadItemScale (job/sex slot, /100 scale, 100 position, MakeItemData for vnum+0..4; JOB_WOLFMAN skipped because ENABLE_WOLFMAN_CHARACTER is off, other unknown jobs skipped where Windows reads an uninitialised slot).
Comprehensive Python harness now starts locale data through app.LoadLocaleData('locale/en') and asserts pet skill/mob scale/item scale/insult results, '' masking and that a missing locale returns 0 after Destroy; the later redundant direct SkillDesc/SkillTable registration was removed because a second RegisterSkillDesc without Destroy appends duplicate affect rows on Windows too.
Validation: macOS Debug and Android arm64 builds pass. Comprehensive Python regression passes in the prepared resource overlay (completion marker). Nonvisual CTest (-E render_3d, render_3d still times out) 29/33 with the same four python/map-assets, window_tree/locale, mark_manager/resource-path and speedtree/canopy-sway failures. 228 packet constants match; 925 immutable reference hashes unchanged; compiled-interface placeholders 642 -> 634; 46 modules/0 missing methods. No reference files or server changed.
Remaining: renderer consumers of NPC wear (InstanceBase NPC equipment/mount/shining) and sash item scale (InstanceBase::SetSash), CPythonWiki::ReadData (refine_table/special_item_group/mob_drop_item), YMIR lang%d.cvt (not used by EUROPE), GC114 special effects, emoticon actor effects, plus the pass-15 list (renderer/resource lifetimes, GVG/PK colours, audio paths, device equivalence, DWORD framing above 65535, render_3d timeout).
2026-10-07 (pass 17): GC114/emoticons, name colours, NPC wear/sash, CPythonWiki, receive back-pressure
GC114 (HEADER_GC_SEPCIAL_EFFECT) is now dispatched with RecvSpecialEffect/RecvSpecificEffect. The CInstanceBase effect table (InstanceBaseEffect.cpp indices under the AVA2 Locale_inc.h set), AttachSpecialEffect/CreateSpecialEffect, actor-root/bone attached effects and the emoticon path (1000 ms m_dwEmoticonTime gate) are ported. A new player_settings table reproduces CPythonPlayerSettingsModule::Load (236 effects, 12 emoticons with CP949 bytes kept, use/drop sounds); it is registered from app.Create. chrmgr.RegisterEffect/RegisterCacheEffect/SetEmoticon/IsPossibleEmoticon are now real. Name colours: chrmgr.RegisterNameColor/RegisterTitleColor/SetEmpireNameMode are bound. GetNameColorIndex follows PVP/DUEL/GVG keys, party and empire mode. Text tails refresh on PVP, duel, GVG and party events. NPC wear (LoadNPCWear) is now consumed in AppendActor. The map name comes only from Warp, as on Windows (GetWarpMapName). Non-PC races do not get weapon/hair/sash. SetSash stores m_dwSashEffect (refine effect 251, acc_01.mse) and the item_scale.txt row (scale and scale-position). chr.RaceToJob/RaceToSex replace their dummies. app.OpenTextFile/GetTextFileLineCount/GetTextFileLine now follow CTextLineLoader, which the introLoading guild-building list needs. EffectData script parsing now uses atof/atoi semantics instead of the throwing std::stof/stoi, and it reads the 3 extra control-point values of MOVING_TYPE_BEZIER_CURVE. This was found when the Python harness aborted after app.Create. Added a CPythonWiki port (src/python_wiki.cpp) with a CTextFileLoader/SplitLine2 port (src/ava2_text_file_loader.h) that replaces the fake wiki module:
- Static chest, boss, costume and blacklist tables.
- ReadData: refine_table, item_proto (MIPX v1 stride 176), special_item_group and mob_drop_item, called from LoadLocaleData.
- LoadMonster per mob_proto record, then ListReverse.
- All 22 Python methods, with ScriptLib argument/exception semantics. The Windows IsBlackList argument-order bug is kept.
- A scratch run against the real AVA2 locale/common files matches Windows, including the 255-row group cap. Game receive buffer: Windows networkmodule.py sets SetTCPRecvBufferSize(128*1024), and CNetworkStream skips recv() while the buffer is full. The port used to fail or throw past 128 KB. Now LoginClient reads only the free space, and PythonNetworkStream takes only RecvBufferSpace() bytes per frame, leaving the rest in the session. That gives TCP back-pressure, as on Windows. DWORD-size packets (CHESTDROP, EVENT_MANAGER, EXCHANGE_LOG, ITEMSHOP, SHOPSEARCH_SET) are framed by the low WORD in both clients. Their handlers then read the full size and clear the buffer on failure (RecvErrorPacket). The port adds p.size bounds checks where Windows would over-read. Validation:
- macOS Debug and Android arm64 builds pass.
- The comprehensive Python regression passes, with new GC114, emoticon, name colour, NPC wear, sash, text-file and wiki assertions.
- The login oracle covers partial take_game_input.
- Nonvisual CTest (
-E render_3d, since render_3d still times out) is 29/33, with the same four environment failures. - 229 packet constants match (114 added). The 925 reference hashes are unchanged.
- Compiled-interface placeholders went from 634 to 618, with 46 modules and 0 missing methods.
- No reference files or server were changed. Remaining:
- The full InstanceBase renderer: sash and NPC-wear models are not attached as meshes yet, and item_scale is data only.
- Fly indexed data and the race/motion part of player settings.
- HAIR_COLOR_ENABLE.
- Wiki differences: MIPT item_proto is unsupported; itemDropFrom iterates an unordered_map, so its order differs from MSVC; out-of-range indices return 0 where Windows has UB; a malformed number stops the drop file where Windows would terminate.
- Resource/renderer lifetimes, audio resource paths, isolated-server/device equivalence and the render_3d timeout.
2026-10-07 (pass 18): CRaceManager/.msm race, shape, hair, weapon and sash mounting
Network actors now take their models from the AVA2 race chain instead of the hardcoded ResolveModelPath/GetRaceModelPath/GetWeaponModelPath/GetHairModelPath helpers, which were deleted:
src/eter_render/RaceData.{h,cpp}ports CRaceData (RaceDataFile.cpp LoadRaceData: ShapeData/HairData models and SourceSkin/TargetSkin, attaching bones, motion list) and CRaceManager (npclist.txt registry, race resource path search, motlist.txt GENERAL motions).app.Createloadsnpclist.txtand the eight player .msm races (with the per-class weapon bones and the sash boneBip01 Spine2).- ActorInstance gained the CActorInstance part API: SetRace (clears every part; races > 8 register their GENERAL motions), SetShape (shape model or the base model, plus skins), SetHair (PART_HAIR skinned to PART_MAIN, plus skins), AttachWeapon (right/left hand for dagger, bow and fan-while-mounted; a slot that is not re-attached keeps its old model, as on Windows), AttachSash (
Bip01 Spine2, plays the sash's own motion 0) and the ENABLE_OBJ_SCALLING sash-only scale. Gr2ModelInstance gained skin replacement, detach, animated attachments and per-attachment scale. - NetworkActorManager follows CInstanceBase::Create: the NPC-wear path does SetArmor → SetWeapon → SetHair → SetSash; otherwise SetArmor, then for PCs SetHair → SetSash → SetWeapon(weapon, arrow). UpdateActor now runs ChangeArmor (rebuilds the race and re-applies the saved hair/sash/weapon), ChangeWeapon, ChangeHair and ChangeSash. Also ported: __ArmorVnumToShape (USE_ARMOR_SPECULAR), the animal-wear and wedding-dress weapon gates, costume GetWeaponType, and
m_awPart. A sash vnum with no item keeps the previous sash and scale, and a missing item_scale row gives a zero scale (GetItemScale always returns true). app.SetHairColorEnable/SetArmorSpecularEnablenow drive HAIR_COLOR_ENABLE/USE_ARMOR_SPECULAR. A new item query (SetItemDataQuery) resolves vnum ranges like GetItemDataPointer and supplies the model, type, sub-type, values and bSpecular.- Weapon-bone effects (PART_WEAPON/PART_WEAPON_LEFT) take the bone name from the race data instead of a hardcoded
equip_right_hand/equip_left_hand. Validation: - macOS Debug and Android arm64 builds pass.
- The comprehensive Python regression passes. New pass-18 assertions run against the real root .msm/npclist and the pack trees:
- A warrior with shape 1, hair 1, weapon 10 and sash 1.
- ChangeWeapon(0) and ChangeArmor re-applying the parts.
- An unknown sash keeps the old one.
- A npc_wear row mounting race 0 parts.
- The stray_dog (101) npclist race. These checks are skipped when warrior_m.msm is absent.
- Nonvisual CTest (
-E render_3d, since render_3d still times out) is 29/33, with the same four environment failures. - 229 packet constants match, and the 925 reference hashes are unchanged. Interfaces are 618/46/0 missing.
- No reference files or server were changed. Deviations and remaining work:
- BitKnit gr2 blocks real AVA2 meshes. About 90% of AVA2 pc/item gr2 files use section compression 4 (BitKnit; for example 315 of 349 files in pc/warrior and 282 of 336 in item/weapon). libgr2 cannot decode BitKnit, so the parts are requested correctly but most AVA2 models do not load or draw. The mesh-level skin match (msm SourceSkin against the gr2 texture name) is therefore unverified. A BitKnit decoder, or an offline conversion to uncompressed gr2, is the next renderer blocker.
- A failed SetRace keeps the model-less instance (Windows fails Create), so the name tail and movement keep working.
- Not ported:
- Specular/sphere maps and LOD things.
- Weapon trace and the armor/weapon refine and shining effects.
- The bow motion mode and the percent-random motion pick.
- PC motions (chrmgr.RegisterMotion* is still a dummy).
- __ClearAffects re-attach in ChangeArmor.
- SpeedTree (tree) races and AttachingData collision/effects.
- The chr-module preview (
chr.SelectInstance/GetRaceModelPath in python_gameplay_modules.cpp) still uses its own path table.
2026-10-07 (pass 19): BitKnit2 gr2 section decompression
Real AVA2 pc/item gr2 now load. The pass-18 blocker ("compression 4 = BitKnit") was mislabeled: AVA2 ships Granny 2.11.8.0, where granny_compression_type is 0 None, 1 Oodle0, 2 Oodle1, 3 BitKnit, 4 BitKnit2 (AVA2/TEST/3. Source BIN/Extern/include/granny.h).
shared/gr2/src/bitknit2.{h,cpp}is a new bounds-checked BitKnit2 decoder (fixed-width types, no platform types). Provenance: it re-implements the MIT-licensed BG3ModStudioLibLS/Bitknit2Decompressor.cpp(© 2025 Thomas A. Rieck, https://github.com/trieck/BG3ModStudio) and was cross-checked against the BitKnit core of powzix/oozbitknit.cpp. Framing: u16 magic 0x75B1, then 64 KB quanta (u16 0 = stored). Each rANS quantum must end with both states at 0x10000.decompress_sectioncase 4 decodes into the expanded buffer. Case 3 (BitKnit v1) is reported as not implemented, since it does not appear in the AVA2 corpus.- BitKnit2 also compresses the fixup metadata (Granny changelog; BG3ModStudio GR2Reader does the same). For Format 4 sections,
build_fixupsreads the u32 compressed size at PointerFixupArrayOffset, decodescount*12bytes and indexes those. It now fails the load with stagefixupinstead of silently ignoring a bad table. Mixed-marshalling fixups are not used by libgr2 and are left undecoded. Validation: - Every
*.gr2underAVA2/TEST/1. Client DEV/pack_makerwas scanned (scratch tool, not committed): 16725 files, 16569 load. All 6406 BitKnit2 files load, and their 10833 meshes all have in-range indices and finite positions. The 10163 Oodle1 files are unaffected. The 156 failures are the existing "only 32-bit little-endian" header rejection (plechi_* zones/bosses, some pack_2019/patch weapons), not BitKnit. libgr2.loader_errorsgained cases for BitKnit v1, an empty BitKnit2 stream, a stored quantum that decodes, a truncated stored quantum and a compressed fixup table past EOF.- The pass-18 python_test block now asserts that warrior_novice.gr2 loads with meshes. It also asserts that shape + hair + weapon + sash all draw textured, with the .msm skins applied (
warrior_novice_blue,warrior_hair_01_white,weapon_chogeup_01,Acce_85_001-008). This closes the pass-18 "skin match unverified" gap. - macOS Debug and Android arm64 builds pass, and the comprehensive Python regression passes.
- Nonvisual CTest (
-E render_3d, since render_3d still times out) is 29/33, with the same four environment failures. - 229 packet constants match, and the 925 reference hashes are unchanged. Interfaces are 618/46/0 missing.
- No reference files or server were changed. Remaining:
- 64-bit or big-endian Granny files (156 in the pack tree) are still rejected.
- Oodle0 and BitKnit v1 are still unimplemented, with no AVA2 samples.
- render_3d still times out, so there is no on-screen visual check of the BitKnit2 meshes in this pass.
2026-10-07 (pass 20): 64-bit gr2 loading + curve2 animation decoding
All 16725 gr2 in the AVA2 pack tree now load. Compressed Granny 2.11 animation curves now play instead of leaving bones at bind.
- 64-bit Granny.
File::loadaccepts the 64-bit little-endian magic; only big-endian is still rejected (stageheader, 0 AVA2 samples). Layout follows BG3ModStudioGR2Reader(MIT, read only): the header, section table and 12-byte fixups are identical to 32-bit, and only pointer slots inside section data widen to 8 bytes.File::Impl::ptr(4/8) drivestype_def_entry_size(32 → 44 B), the member sizes inkPtrSlots(Reference / String / EmptyRef = ptr, RefToArray / ArrayOfRefs = 4+ptr, VariantRef = 2·ptr, RefToVariantArray = 2·ptr+4), the ArrayOfRefs element stride, and the in-member offsets for vertex variant arrays andextended_i32. Pointers stay lazily resolved through the fixup map, so nothing is materialised. - curve2. libgr2 used to classify Granny 2.6+
curve2{VariantRef CurveData}tracks but decode only Granny 2.4OldCurveType. AVA2 has 3111 32-bit and all 59 64-bit animation files using curve2, about 605k curves in total.read_curve2(shared/gr2/src/gr2_anim.cpp) decodes 19CurveData*variants into the existingCurve(knots plus float controls), covering all 17 that appear in the corpus. Members are looked up by name from the file's own type tree:- constants:
Da/D3/D4Constant32f - float splines and keyframes:
DaK32fC32f,DaKeyframes32f(knot i = i·TimeStep; all 19045 satisfy N−1 = Duration/TimeStep) - quantised
D3K16u/K8u,D3I1*,D9I1/I3*,DaK16u/K8u, where knot = k / OneOverKnotScale (the Trunc field holds the high 16 bits of an f32) and control = c·scale + offset D4nK16uC15u/D4nK8uC7u: three stored components with 2-bit swizzle and sign, the fourth = √(1−Σ²), plus the 16-entry scale/offset tablesDaIdentity, andDaK32fC32fwith zero knots, decode to identity The formulas and tables follow the MIT LSLib (Norbyte) GR2 curve implementation, rewritten rather than copied.Curve::evaldegree 0 with more than one knot is now a step (last knot ≤ t), as Granny's SampleBSpline0 does; it was previously a constant at knot 0. Validation:
- constants:
- Scratch scanners (not committed) over
AVA2/TEST/1. Client DEV/pack_maker:- 16725/16725 gr2 load: 10264 Oodle1 and 6461 BitKnit2, including the 156 64-bit files.
- The 64-bit models have 0 bad meshes, and their worst bind-pose self-check is 5.2e-4. Their 59 animations sample with no NaN.
- curve2 checks:
- No knot runs past Duration.
- D4n quaternions are all unit length; adjacent controls with |dot| < 0.7 are 0.1% (16u) and 0.3% (8u).
- The angle to the bind pose at t=0 (p25/p50/p75) is 0/8.9/28.6° for D4nK16u, 0.7/11.4/30.3° for D4nK8u and 1.5/15/34.4° for float
DaK32fC32f. A wrong swizzle or table would sit near the random-rotation median of about 126°. - Positions with bone-length drift > 5% are mostly effect
*_frag_*pieces and stretchy Maya rigs (shadow_dragon spine/scapula, 10–26%).
- Tests:
libgr2.loader_errorsnow checks that a 64-bit magic passes the header stage and big-endian still fails there.libgr2.animationchecks degree-0 step sampling.- The python_test pass-20 block loads
shadow_dragon.gr2(64-bit) withrun.gr2. It asserts all 158 D4n tracks decode andSpine01_jntleaves bind and moves over time.
- Builds and regression:
- macOS Debug and Android arm64 builds pass, and the comprehensive Python regression passes.
- Nonvisual CTest (
-E render_3d) is 29/33, with the same four environment failures. - The 229 packet constants match, the 925 reference hashes are unchanged, and interfaces are 618/46/0 missing.
- No reference files or server were changed. Remaining:
- Big-endian Granny, Oodle0 and BitKnit v1 are still unimplemented (0 AVA2 samples).
- B-spline degree ≥ 3 still falls back to quadratic (0 in corpus).
- Keyframe curves step at TimeStep rather than interpolating; Granny's exact keyframe sampling has not been checked against the SDK.
- render_3d still times out, so there is no on-screen check of the newly animated 64-bit bosses.
2026-10-07 (pass 21): render_3d timeout fixed
Cause: Gr2SceneRenderer::RenderDraw (software path) had a stray outer for (t < num_tris) loop. It wrapped the rasteriser lambdas and the real triangle loop, so every draw rasterised its whole mesh num_tris times, which is O(n²). Each 1024×768 frame took 11–26 s (126 s for the whole test, against the 15 s CTest timeout). Opaque draws hid it behind the depth test, but alpha-blended and additive draws were composited num_tris times. Removing the loop gives one pass per triangle. The test now takes about 1.8 s, and the renders look correct (warrior, equipment, water/fog). The GPU path (RenderSceneGPU) was not affected.
The test was also tied to the original developer's machine:
ava2.render_3dnow runs from a client-root style directory given byAVA2_TEST_RUNDIR(defaultbuild/dev/test-rundir).tools/make_test_rundir.pybuilds it from symlinks: the merged lowercaseymir workof every pack_maker pack (PC, ETC, root, then the rest; first wins), plusbgm,sound,mapandtextureset. It is generated, ignored by git, and only ever replaces a directory carrying its own marker file.- The hardcoded
/Users/shen/.../pack_makerpaths are replaced byAVA2_PACK_MAKER(CMake cacheAVA2_PACK_MAKER_DIR, default../AVA2/TEST/1. Client DEV/pack_maker). The textureset fallback was also wrong: it pointed atMaps/textureset, but the real location istextureset/textureset. - If the model, building, BGM or UI sound is missing from the run directory, the test exits 77 and CTest reports it as skipped. When the assets are present, every original assert runs unchanged. Validation:
- With the run directory, render_3d passes under the default 15 s timeout (2.3 s). It now uses the real metin2_map_a1 height/tile/attr/textureset, the minimap, building, water and audio data instead of the procedural fallbacks.
- Without the run directory it exits 77.
- Full CTest (render_3d no longer excluded) is 30/34, with the same four environment failures.
- python_test passes, and the macOS and Android arm64 builds pass.
- The 229 packet constants match, the 925 reference hashes are unchanged, and interfaces are 618/46/0. Remaining:
- The python, window_tree, speedtree_forest and mark_manager tests still hardcode
/Users/shenor cwd assets and could use the same run directory. - render_3d does not yet load a 64-bit animated boss.
2026-10-07 (pass 22): the four environment test failures fixed
The last four CTest failures (python, window_tree, speedtree_forest, mark_manager) were test-environment problems, plus one real argument-helper difference from Windows.
- Run directory follows the pack manifests.
tools/make_test_rundir.pynow reads everypack_maker/*_create.xmland links eachArchivedPath(withd:/stripped) to its source, so the run directory is the root the Windows pack manager serves (icon/...,locale/<lang>/...,season2/...,uiscript/..., root*.msm). The repository'supstream/python-rootfiles are linked first and win. After them, packs go PC, ETC, root, then the rest; the first file wins, and names are compared case-insensitively. The loose client-root foldersmarkandsvside, plus themapalias, are linked as directories. The result is 86538 files, about 7 s to build. - All asset tests use it.
tests/test_rundir.hprovidesEnterTestRunDir()andPackMaker(). ava2.python, ava2.window_tree, ava2.render_3d and ava2.mark_manager chdir intoAVA2_TEST_RUNDIRand exit 77 (CTest skip) when it is missing. The mark fallback reads$AVA2_PACK_MAKER/../mark/10_0.tga. - speedtree_forest. The wind-motion test sampled canopy vertex 0, which is the bottom edge of the lowest leaf cluster, where flex (∝ height²) is close to 0. It now samples the highest canopy vertex. The wind code was unchanged.
- Stale Python errors (code fix).
PyTuple_GetPointer(shared/common/PortPythonPointer.h) failed whenever any Python error was pending. ScriptLib'sPy_BuildException("...")sets an error but returns None, for example whenLoadImagemisses a file. So the next wndMgr call on a valid handle returned None, and NewGoldWindow then failed withNone - int. AVA2ScriptLib PyTuple_GetIntegernever looks at the pending error. The helper now saves and restores it withPyErr_Fetch/PyErr_Restoreand judges only its own conversion. Validation: - CTest is 34/34, with no exclusions.
- python_test (from the run directory) passes, and the macOS and Android arm64 builds pass.
- The 229 packet constants match (no mismatches), the 925 reference hashes are unchanged, and interfaces are 618/46/0. Remaining:
- Without the run directory, the four asset tests are skipped rather than run.
- A stale error raised by a missing asset now surfaces at the next Python check, as in the Windows client, instead of silently turning later calls into None.
2026-10-07 (audit): remaining Windows differences ranked by script use
618 compiled-interface placeholder methods remain (46 modules, 0 missing names); 415 of them are called by upstream/python-root scripts. The most-called and most user-visible gaps:
- chat module (33/33 placeholders). chat.AppendChat has 229 call sites. The server chat path still goes through
m_chatCallbackin place of CPythonChat, so the Python chat log and whisper windows stay empty. - event module (14). It drives the quest dialog. QuestButtonClick (33 sites) should call
SendScriptButtonPacket, which already exists. Skip, UpdateEventSet, RenderEventSet, Get/SetVisibleStartLine and IsWait are also no-ops. - Simple lookups:
- item.GetApplyPoint (65 sites):
ApplyTypeToPointType. - player.SlotTypeToInvenType (35 sites).
- app.GetRandom (28 sites).
- nonplayer.GetResist.
- The player getters GetTargetVID, GetGuildID, GetPKMode, GetRace, GetEXP, IsGameMaster...
- item.GetApplyPoint (65 sites):
- Character/motion registration. chrmgr (29) covers CreateRace, RegisterMotionData and RegisterComboAttack. chr (56) covers SetLoopMotion, SetVirtualID, SetArmor, Refresh and SetInstanceType.
- systemSetting (58). It covers config load/save and the display flags.
- miniMap/atlas (24) and skill (21).
- Renderer. In the game phase, main.cpp draws sky, terrain and actors through its own pipeline: app.RenderGame/UpdateGame and background.* are no-ops. Terrain ambient light is also clamped to at least 0.35/0.38, which Windows does not do.
- Already listed: GC114/levelup/skillup effects, GVG/PK colours, NPC wear/sash scale consumers, CPythonWiki::ReadData.
2026-10-07 (pass 23): event module and simple lookups (batch 1)
The event module and the simple lookups at the top of the audit list are now ported from the original code.
- CPythonEventManager + script::Group.
src/python_event_manager.{h,cpp}ports UserInterface/PythonEventManager.cpp and PythonEventManagerMoudle.cpp line by line, andsrc/eter_lib/parser.{h,cpp}ports EterLib/parser.cpp. The parser walks characters through the default code page (CharNextExA/CharPrevExA through mt_codepage).- All 29 original methods are registered, including AddEvent (ENABLE_MULTILANGUAGE_SYSTEM). GetTotalLineCount is not registered, as in the original.
- The constants now match the original: BUTTON_TYPE_NEXT/DONE/CANCEL = 0/1/2. The old placeholder had CANCEL=0 and NEXT=2, which mapped the quest dialog's buttons wrongly.
- The handler and interface objects are held as weak references (or borrowed pointers), so quest dialog
__del__timing matches Windows. - main.cpp passes the frame time in through
SetElapsedMillisecond. PythonRuntimecalls Destroy and clears the interface beforePy_Finalize.
- Original quirks kept:
- UpdateEventSet subtracts the elapsed time twice.
- The CONFIRM_WAIT remaining time uses DWORD arithmetic, so it shows a negative number after it expires.
- LocaleString_Skip does not advance on a single-byte space.
- A
name|argument with no value reuses the previous value buffer.
- Methods that crash on Windows return "no set" instead. Skip, SetVisibleLineCount, Get/SetVisibleStartLine, GetLineCount and GetLineHeight (on an empty line list) read a NULL slot on Windows.
- Game-phase script packets. RecvScriptPacket goes through
RegisterEventSetFromString→SetVisibleLineCount(30)→OnScriptEventStart(game phase windowOpenQuestWindow(skin,index)). SelectAnswer and QuestButtonClick send CG_SCRIPT_ANSWER(29) and CG_SCRIPT_BUTTON(66). - Lookups:
- item.GetApplyPoint. Uses
src/game_type.cppApplyTypeToPointType. The 150 aApplyInfo entries were generated by compiling the original GameType.cpp table under the Locale_inc.h defines. - player.SlotTypeToInvenType. Uses the 19-entry c_aSlotTypeToInvenType table.
- app.GetRandom. Uses
src/eter_base/Random.{h,cpp}, the EterBase Park–Miller generator. random_range takes an unsigned modulo, and swaps the bounds when from > to. It is seeded once at startup. - nonplayer.GetResist. Uses GetMobResist: the signed cResists value, or 0 when the table is missing or resistNum ≥ 11. resistNum is truncated to a BYTE.
- player getters:
- GetGuildID, GetGuildName, GetPKMode and IsGameMaster read the main actor and return 0 or "" when there is none.
- GetRace and GetJob use race % 4 (WOLFMAN is off).
- GetEXP and GetConquerorEXP read POINT_EXP (3) and POINT_CONQUEROR_EXP (212) as DWORDs.
- Get/SetPlayTime store CPythonPlayer::m_dwPlayTime.
- Bad arguments return Py_BadArgument (TypeError) or Py_BuildException (None) as in the original.
- item.GetApplyPoint. Uses
- Tests:
- New ava2.event (
tests/event_test.cpp) covers:- Parser commands, arguments and line counts.
- Handler callbacks in order.
- GetLineCount with iAdjustLine.
- WAIT, Skip and IsWait.
- UpdateEventSet timing, including the double subtraction.
- RUN_CINEMA with a missing file.
- The answer and button packets.
- AddEvent → OpenQuestWindow.
- All of the lookups above. nonplayer uses a Windows TMobTable_r235 fixture.
- python_test: the quest dialog section was written against the old placeholder constants. It is corrected to the original values and to the 3-argument InsertTextInline. Validation:
- New ava2.event (
- CTest is 35/35.
- python_test (from the run directory) passes, and the macOS and Android arm64 builds pass.
- The 229 packet constants match (no mismatches), and the 925 reference hashes are unchanged.
- Interfaces are 46 modules, 0 missing, 590 placeholders (was 618). The parity inventory has 629 placeholder bindings (was 657). Remaining:
- player.GetTargetVID is still a placeholder. The port has no CPythonPlayer target system (SetTarget/ClearTarget/CanPickInstance/target packet), so it goes into a later targeting batch.
- Some event commands have no effect yet. The event camera (SET_CAMERA/BLEND_CAMERA/RESTORE_CAMERA) and the minimap atlas signals (ADDMAPSIGNAL/CLEARMAPSIGNAL/SETCMAPPOS) are not available in the port yet.
- No real fonts. Event text lines use the port's CGraphicTextInstance, so GetLineHeight and width-based placement do not yet match Windows pixels.
- Apply types 176–179. Windows reads past aApplyInfo[150] for these; the port returns POINT_NONE.
- Race timing. player.GetRace reads PythonNetworkStream's main actor race. Windows sets m_dwRace when the main actor is appended, so the two can differ for a short time during phase changes.
- No caller check. CPythonStackController::CheckStackReference (SelectAnswer anti-cheat caller check) is not ported.
2026-10-07 (pass 24): chat module (batch 2)
The chat module is now ported from the original code; the 33 placeholder chat methods are gone.
- CPythonChat + CWhisper.
src/python_chat.{h,cpp}ports UserInterface/PythonChat.{h,cpp} and PythonChatModule.cpp line by line, using the Locale_inc.h build: CHAT_SETTINGS, ENABLE_MULTILANGUAGE_SYSTEM and ENABLE_DICE_SYSTEM are on, LINK_IN_CHAT is off.- All 33 original methods are registered, in the original order, with the original constants.
- Lines are stored per chat set, in
m_ChatLineNewDeque, which is keyed by BYTE. Sets 0 and 1 exist from the start. CreateChatSet copies set 0's lines. DeleteChatSet frees that set's lines. - Each set keeps its own mode and country-mode filters. Each line has three colour slots, indexed by the set id; set ids of 3 and above share slot 0.
- Each store is capped at 300 lines. Lines containing
#ebvsare dropped. |Hitem:<hex>:…|h[name]|hlinks are renamed to this client's item name.- SHOUT
|lang|N|and|empire|N|prefixes are stripped, and the flag images are attached through CResourceManager. - The board modes VIEW (fade after 5 s), EDIT (alpha ramp) and LOG are ported, as are AppendChatWithDelay, whispers (new-line count, InitWhisper → MakeWhisperButton), the ignore set and GetLinkFromHyperlink.
- The CTimer clock is
SetCurrentMillisecond(0 = real clock). GetGlobalTime is the same clock in seconds.
- Server chat path. RecvChatPacket now calls
CPythonChat::AppendChatdirectly, for PC chatter lines and VID-0 SHOUTs, as on Windows. The temporarySetChatCallbackhook is removed.PythonRuntimecallsCPythonChat::Destroyon teardown. - Original quirks kept:
- chat.IsIgnoreCharacter returns None.
- CreateChatSet(256) finds BYTE 0 and returns 256 without creating a set.
- CreateWhisper on an existing name leaves the old whisper in place.
- ArrangeShowingChat counts country-muted SHOUT lines when sizing the window.
- The first visible slot starts at iHeight 12.
- EDIT mode never advances iLineIndex.
- Update on an unknown set returns before it flushes the delayed lines.
- A shout language above 11, or 0, becomes 1. The empire index is not clamped. A
|lang|Nprefix with no closing bar keeps the rest of the string. - GetLinkFromHyperlink formats htoi's -1 with
%x.
- Guards where Windows has undefined behaviour or crashes:
- A zero step returns 0 or an empty window instead of dividing by zero.
- An out-of-range chat or country mode skips the write, but the set is still rearranged.
- GetLinkFromHyperlink on a link with no ':' returns "" (Windows reads
results[0]from an empty vector). An odd attribute count uses 0 for the missing value (Windows reads past the end). - A whisper position above 1.0 is clamped to the last line (Windows asserts, but the assert is compiled out).
- CWhisper::lineCount starts at 0 (uninitialised on Windows when created through chat.CreateWhisper).
- Tests:
- New ava2.chat (
tests/chat_test.cpp, with an item_proto fixture) covers:- Constants and colours, including SetChatColor.
- Per-set stores, the
#ebvsdrop and item-link renaming. - SHOUT prefixes, the language clamp and country-mode filtering.
- Mode filtering and toggling.
- The window size and end position, and a zero step.
- The VIEW fade being per set, EDIT/LOG updates, and Close.
- The 300-line cap.
- The delayed-chat flush.
- Create/DeleteChatSet, including the BYTE key.
- The ignore toggle.
- Whispers: line counts, box size, position, InitWhisper and Clear.
- GetLinkFromHyperlink cases.
- Bad arguments returning None.
- python_test's chat-packet section now checks the CPythonChat line store instead of the removed callback. Validation:
- New ava2.chat (
- CTest is 36/36.
- python_test (from the run directory) passes, and the macOS and Android arm64 builds pass.
- The 229 packet constants match (no mismatches), and the 925 reference hashes are unchanged.
- Interfaces are 46 modules, 0 missing, 557 placeholders (was 590). The parity inventory has 596 placeholder bindings (was 629). Remaining:
- No real fonts.
- DefaultFont_GetResource is not checked, so no line is dropped for a missing font.
- GM lines do not get the italic font.
- CWhisper::Render's clip rectangle is not applied by the text stand-in.
- Flag images. The flag paths are looked up through CResourceManager without Windows's IsFileExist check, so a missing flag simply leaves the image empty.
- Not ported:
- CPythonStackController::CheckStackReference.
- CPythonApplication::ChangeIcon (the ENABLE_DISCORD_STUFF taskbar icon on a new whisper).
- AppendMonsterList (the PythonNetworkStreamCommand.cpp CHAT_TYPE_INFO monster list) and PythonPlayerSkill's "Find strange game data" notice. Neither feature exists in the port yet.
2026-10-07 (pass 25): systemSetting, skill, miniMap, chr/chrmgr (batch 3)
The five script-facing modules from the audit's batch 3 now follow the original AVA2 code.
- systemSetting.
src/python_system.cppports CPythonSystem and PythonSystemModule.cpp: metin2.cfg parsing and the exact SaveConfig text, interface.cfg as raw little-endian int32, display-mode merging, SetConfig/GetConfig and all 58 methods with the original constants. Test: ava2.system_setting. - skill. The 21 PythonSkill.cpp methods in
src/python_native_modules.cpp: SetPathName/RegisterSkill (per-skill CTextFileLoader files, 949 name wins, no overwrite), skilldesc icon paths per job column (riding 130 uses skill/common/support), the never-filled requirement data, icon images/instances, GetGradeData and TEST. Test: ava2.skill. - miniMap. New
src/python_minimap.{h,cpp}ports CPythonMiniMap and the 27 module functions (ENABLE_MINIMAP_WHITEMARK_NEW, NAMECOLOR_BOSS_CLIENT, ENABLE_STONEMINIMAP, ENABLE_OFFLINESHOP_SYSTEM on; WJ_COMBAT_ZONE off). LoadAtlas reads setting.txt + atlas.sub and the<map>_point.txtmarks; Update classifies and clips marks by radius; observers, targets, guild areas, way/signal points, GetInfo/GetAtlasInfo/GetAtlasSize and the atlas window callbacks are ported. WarpBackgroundMap calls LoadAtlas; the event manager and the target packets (123/124/125) feed the map. The extra RegisterColor (not in Windows; only an uncalled uiminimap.py helper uses it) is gone. Test: ava2.minimap. - chr / chrmgr. New
src/python_chr.cppports PythonCharacterModule.cpp (80 methods) and PythonCharacterManagerModule.cpp (37 methods, original order). The stand-in chr instance table (its own model loading and draw list) is deleted; chr now drives NetworkActorManager like CPythonCharacterManager on Windows, and GetAllActiveChrDraws isNetworkActorManager::BuildDrawCommands.- chr argument errors answer
Py_BuildException()(None); WeaponTraceSetTexture, MoveToDestPosition and testSetRideMan use Py_BadArgument. chrmgr uses Py_BadArgument everywhere, and "RaceData has not selected!" without a selected race. - Rotation conversions as on Windows: SetRotation
fmod(r+180, 360), BlendRotationfmod(720-r, 360), GetRotation360 - yaw, SetDirection's 8-entry table (out of range → 0). - CreateInstance(vid, dict) builds a PC "NONAME" (mov/atk 100, armor 8) and keeps the original bug of writing "y" into the X position; without a dict it is RegisterInstance. Already-existing VIDs log "ALREADY EXIST".
- No-instance answers: GetRotation 0.0, GetRace 0, GetName 0, GetNameByVID "None", GetProjectPosition (-100, -100), GetVirtualNumber/GetInstanceType 6, testGetPKData (0, 4).
- GetProjectPosition projects through the text-tail scene renderer. GetVIDInfo prints the global position (local + map base). SetPathName ignores paths without "d:/ymir". RegisterMotionData caps the weight at 100. SetMotionRandomWeight discards its exception like Windows. SetEmoticon/IsPossibleEmoticon with vid < 0 use the selected instance.
- Supporting changes: ActorInstance::Revive/IsFaint, TextTailManager::GetCurrentSceneRenderer, public NetworkActorManager part setters + IsPartyMember,
m_dwVirtualNumber(= race on AppendActor), RegisterInstance defaults to TYPE_PC (CActorInstance::__Initialize), and Clear() now detaches text tails (DeleteAllInstances). - NEW_PET_SYSTEM is off in Locale_inc.h, so chr.RequestPetName does not exist (its only caller, uipetincubatrice.py:83, belongs to the disabled pet incubator).
- Tests: new ava2.chr (
tests/chr_test.cpp) covers both module surfaces, the no-instance answers, the two error styles, rotations/directions, the CreateInstance dict path and its bug, pixel positions with and without Z, instance types, Hide/Show, GetVIDInfo, SetPathName's guard, SetRaceHeight, testSetRideMan and Destroy. python_test now callschr.SetArmor(0)after SetRace (Windows does not build a model from SetRace alone) andchr.GetPixelPosition(201)(the VID argument is required). Validation:
- chr argument errors answer
- CTest is 40/40 (new: ava2.system_setting, ava2.skill, ava2.minimap, ava2.chr).
- python_test passes, and the macOS and Android arm64 builds pass.
- The 229 packet constants match, and the 925 reference hashes are unchanged.
- Interfaces are 46 modules, 0 missing, 370 placeholders (was 557). The parity inventory has 402 placeholder bindings (was 596). Remaining:
- systemSetting: no RefreshShadowLevel, gamma ramp, software cursor or mob-info (AI flag/level) refresh; display modes come from SDL; the config directory differs on Android; some bounds checks added where Windows indexes unchecked; GetConfig emulates the x86 varargs quirk (the float music volume in an "i" slot shifts every later field one place and drops iDistance).
- skill: GetSkillRequirementData's
Py_BuildValue("si",0,"None",0)quirk returns (None, 0); GetGradeData's std::string-through-varargs is emulated (short names give their first 4 bytes, else 0); icons resolve lazily; code page 949 is a constant; icon instances are handles (grpImage is still a placeholder); GetIconImage returns 0 for an unknown skill. - miniMap: nothing is drawn (no D3D minimap/atlas pipeline); observers are unreachable as in the original header map; ENABLE_GRAPHIC_ON_OFF render status is always on; the guild-area overlay, __DownloadSymbol and CreateTargetEffect are not ported; __Update_NotifyGuildAreaEvent is not wired; GetInfo/GetAtlasSize zero-init their outputs; an unknown NPC gives an empty name; setting.txt only supplies MapSize/BasePosition.
- chr / chrmgr:
- No pick pass: chr.PickAll is -1 and Pick/GetPickedVID only see OLD_GetPickedInstanceVID.
- No backend for the add/modulate/blend/specular render modes, Select's shop highlight, bounding spheres/GetBoundBoxOnlyXY, weapon trace, combo type, AttachEffect* or the direction line; these only parse.
- Hide/Show toggle
m_isHiddeninstead of blending the alpha. - MountHorse only switches to MODE_HORSE; the horse actor is not created.
- Motion blend times, speed ratios and SetMotionRandomWeight are not ported; PC motions from the closed resource.dll are not registered.
- DeleteInstanceByFade removes at once; with no dead list GetVIDInfo's isDead is always 0.
- SetDirection has a null guard (Windows crashes without a selection). SetRotationAll ignores X/Y. MoveToDestPosition does not recompute the direction. testSetRideMan keys the actor as VID 1 (Windows leaves the graphic VID 0).
- chr.Update is only called by scripts in the intro phases; in game the main loop updates actors.
2026-10-07 (pass 26): background module
Ported CPythonBackground and PythonBackgroundModule (35 methods in src/python_background.cpp).
- Environment, skybox, fog, water, and shadow properties integrated.
- Map info, base coordinates, local to global conversions, atlas loading.
- Test: ava2.background. 40/40 tests passing.
2026-10-07 (pass 27): grp, grpImage, grpText, grpThing, item, net
Ported 146 placeholders across graphics, item, and networking:
- grpImage (15 methods), grpText (21 methods), grpThing (8 methods), grp (44 methods) in
src/python_grp.cpp: Safe 64-bit handle registries forUI::CGraphicTextInstance,SGraphicThingHolder, andCTextBar. Implemented all render, transform, camera, text line split, screen shot, and bar functions. - item (14 methods) in
src/python_gameplay_modules.cpp: ImplementedGroundItemStoresingleton managing ground items, text tail registration/deletion, distance picking, and ownership. Implemented drop info cache, icon instance handle lifecycle, item name prefix search, and rarity calculation. - net (44 methods) in
src/python_net.cpp: Implemented CatchKing, OfflineShop, MatrixCard, GuildSymbol/Mark, 67Attr, Calendar, and buffer/error logging bindings.
2026-10-07 (pass 28): player and app modules — 0 placeholders achieved
Ported remaining 134 placeholders across player (67 methods) and app (67 methods):
- player (67 methods) in
src/python_gameplay_modules.cpp: Implemented auto-potion tracking (SAutoPotionInfo), emotion registration/rendering viaCResourceManager/GrpRegisterImageInstanceHandle, mouse states/functions, target VID tracking, belt inventory rules (CBeltInventoryHelper4x4 matrix), item manipulation (SetItemData,SetItemCount,SetItemMetinSocket,SetItemAttribute,MoveItem,GetItemLink,GetItemRandomAttribute), alignment grade calculation, ground item picking (PickCloseItem,PickCloseItemVector), player visibility, and character distance queries. - app (67 methods) in
src/python_app.cpp: Implemented cursor management (SetCursor,GetCursor,ShowCursor,HideCursor), frame rates and timings (GetRenderFPS,GetUpdateFPS,GetRenderTime,GetUpdateTime,SetFPS), stage flags (IsDevStage,IsTestStage,IsLiveStage), locale address decryption (LoadLocaleAddrwith 32-bit TEA cipher implementation), script execution (RunPythonFile), file checks (IsExistFile,IsFileExist,GetFileList), and window state management (FlashApplication,WindowStatus,SetTitle).
Validation:
- Audit check (
python3 tools/audit_ava2_python_interfaces.py): 46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods. - CTest suite: 40/40 tests passed (100%).
- Clean build across all targets on macOS arm64.
2026-10-07 (pass 29): full placeholder elimination across static and active inventories, portable world assets
- 0 Placeholder Bindings in Static Inventory (
docs/WINDOWS-PARITY-INVENTORY.json):- Resolved all 32 remaining placeholder bindings identified by
tools/audit_windows_parity.py. - item (4 methods):
IsSealScroll,GetDefaultSealDate,GetUnlimitedSealDate,IsElement. - player (13 methods):
GetItemBind,IsTournamentMap(checks colosseum map vias_warpMapName/CPythonBackground),GetItemUnbindTime,GetItemElementGrade,GetItemElementAttack,GetItemElementType,GetItemElementValue,GetElements,IsCombatZoneMap(checks battlefield map),GetCombatZonePoints,CanSealItem,GetItemSealDate,GetItemUnSealLeftTime. - shop (2 methods):
GetOfflineShopItemTransmutation,GetItemElements. - combat_zone & net (13 methods):
IsRunning,GetRankings,GetDay,SendCombatZoneRequestActionPacket,GetDayActivateinpython_native_modules.cppandpython_net.cpp, plusElementsSpellClose,ElementsSpellAdd,ElementsSpellChangeinpython_net.cpp. - Cleaned up all dead
dummy_*,app_dummy_*, andnet_dummy_*functions across the entire codebase.
- Resolved all 32 remaining placeholder bindings identified by
- Compiler Warnings & Diagnostics:
- Eliminated Clang
constexpr switchwarnings innonplayer_valuetemplate specialization (src/python_native_modules.cpp).
- Eliminated Clang
- Portable Asset Loading:
- Replaced developer absolute paths in
src/main.cppforheight.raw,tile.raw,attr.atr,metin2_map1.txt,property,water.wtr, andminimap.ddswith portable relative paths and safe fallbacks.
- Replaced developer absolute paths in
- Validation:
python3 tools/audit_windows_parity.py: 0 placeholder bindings!python3 tools/audit_ava2_python_interfaces.py: 46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods!- CTest suite: 41/41 tests passed (100%) including
ava2.render_3d. - Android arm64
libmain.so: builds cleanly with 0 warnings. - macOS arm64
ava2_client: builds cleanly and runs 60fps game phase.
2026-10-09: native login input and stale macOS bundle verification
- Reproduced non-responsive account/password text and Tab in the existing
dist/AVA2.app; its executable predated the current development build and input-event wiring. - Retained the working SDL text-input / IME / focus implementation already present in the workspace and rebuilt/repackaged the macOS app and distribution archive.
- Replaced direct login text assignment in
ava2.window_treewith mouse focus for both fields, IME text insertion, Tab focus switching, and password backspace assertions. - Validation:
ava2.window_treepassed; native rebuilt app visibly accepted account text, Tab switched to password, password masking and backspace worked. No live authentication was attempted and no server changes were made. - Outstanding: live server authentication and non-ASCII IME composition are outside this verification.
2026-10-10: character selection rendering against the AVA2 Windows reference
- Preserved existing workspace fixes for transparent UI boards and character composition. Rebuilt screenshots confirm that the roster and description panels no longer appear as solid white rectangles.
- Corrected
app.SetCameranative Y to engine Z conversion and used the Windows camera's right-handed screen orientation. The previous view exposed back-facing geometry through the model: faces, hair and clothing now render from the correct side.SetCenterPositionalso converts native height/depth consistently. - Applied the
prototype.RunApphair/armor/weapon initialization before creating the first phase window. Armor item vnums now resolve through item-proto to MSM shapes instead of falling back to novice clothes. chr.Updatepreserves explicit intro heights outside the game phase.chr.Deformno longer advances animation/movement a second time, preventing residual map heights from moving intro models outside the screen.- Added optional FreeType UI fonts with shared text measurement/rendering metrics, 2x glyph rasterization for Retina, proportional cursor/alignment positions, and preserved zero-alpha text. SDKs without FreeType retain a smaller, consistently measured fallback. Platform fonts are located at runtime; no proprietary font assets were copied.
- Removed per-draw diagnostic output, restricted the phase hint banner to explicit preview mode, and repaired the existing 3D test's vertex/index counting (which had been replaced by a hair debug dump).
- Added
ava2.select_render: four original races, item-to-shape conversion, camera direction/winding, head/feet containment, unchanged height during intro updates, no animation tick during deformation, panel pixels, proportional text width, and transparent text pixels. Optional screenshot output covers all four slots with Jinno scenery; packaged-app verification uses the Shinsoo preview roster. - Validation: macOS build and Android arm64
mainbuild passed; selection/window-tree/3D/event/Python-view checks passed. The full suite passed 42/44;ava2.pythonstill fails on the existingchr.GetPixelPositionnative-Y/engine-Z round-trip mismatch, andava2.chronSetDirection/GetRotation, outside these changes. The baseline checker reports pre-existing edits to interfacemodule/intrologin/serverinfo/ui; AVA2 reference files were not modified. - Rebuilt
dist/AVA2.appand its distribution archive. The macOS packager now bundles and relocates SDL3, FreeType and dependent dylibs recursively; signature verification and launching the packaged executable with a selection screenshot passed. Screenshots are underbuild/verification/selection/and are generated artifacts. - Outstanding: live-account selection is not verified; preview roster/equipment and empire differ from the supplied Windows screenshot. Android currently uses the fallback font because this NDK configuration has no FreeType library; on-device rendering remains unverified. Exact Windows spot/point lighting and specular parity remain open.
2026-10-10: investigation of repeated selection title, flag and borders
- Reproduced the user's 22:58:52 screenshot by loading the original login UI, releasing its phase/account callback references and windows, then creating selection with a mock roster. No live authentication was performed.
- Confirmed that image-instance
Destroy()omitsInitialize()in both the base and expanded classes, unlike Windows. The pool reuses objects without reconstruction, leaking login rendering rectangles into selection: Warrior title right fraction 32.3125, Jinno flag 10, and corner images with inherited horizontal/vertical extensions. SDL then tiles these images across the screen. - A temporary restoration of both reset calls removed the inherited rectangles and repeated strips in the same reproduction; the four-race selection checks passed. Temporary source changes were restored after investigation; the distribution bundle remains unchanged.
- Report:
docs/SELECT-RENDER-INVESTIGATION.md; generated before/after screenshots, logs, reproduction source and proposed patch are underbuild/verification/pool-investigation/. - Outstanding: apply and validate the lifecycle fix, add object-pool and login-to-selection regression coverage with image-bound checks, and test returning to login and selecting again. Previous direct-selection tests did not exercise this path and their existing assertions do not detect repeated textures.
2026-10-10: investigation of blank game entry in the packaged app
- Reproduced original GameWindow construction failure in the current distribution:
InventoryWindowEx.pycannot loadrework_inv/new_equipment_bg.tga. The image exists in the AVA2 pack manifest and project root, but the fixed packaging directory list omits it from both Resources and the asset manifest. - Ran the same packaged executable against the complete test resource root: original game UI, terrain and characters were drawn. This was an offline preview, not a live-account entry verification. Several tree/effect textures still failed to resolve.
- Also confirmed the package omits
map/; the map loader relies on relative map directories and development paths. Existing Python-view game tests use a simplified phase callback and do not construct original GameWindow. - Report:
docs/GAME-RENDER-INVESTIGATION.md; generated logs and comparison screenshot are underbuild/verification/game-investigation/. No production code or distribution bundle was changed for this investigation. - Outstanding: complete packaging from virtual pack paths, unify resource-root resolution for maps/images/scripts, validate original loading-to-game with the packaged app, apply the image-pool reset, and then assess remaining scene/camera/texture parity against Windows.
2026-10-10: game entry rendering fixes and live package verification
- Applied base/expanded image-instance pool resets; a render comparison poisons and reuses a pooled title instance, verifying that rectangles, scale, rotation, color, flip and mode reset.
- Assets are assembled from AVA2 virtual pack paths plus loose image/audio/model resources beside the Windows client. Required missing pack entries fail packaging. The adapted Python root is included in the manifest with case-sensitive module names preserved; no development directory symlinks remain in the full macOS bundle.
- Fixed resource-root lookup for maps, properties, terrain textures, model textures and SpeedTree files. Terrain blocks use their local block position and raw-height border offset. Native areadata coordinates/rotation axes convert to the game renderer's axes.
- Preserved the stream's main VID after
chr.Destroy(), bound the game camera to the real network actor, and grounded newly received actors before camera collision checks. Default game camera is RH, distance 1550, pitch 27, and views the actor from behind. - SDL scene drawing now orders geometry back to front; opaque DDS materials preserve RGB in the alpha/specular mask and avoid forced transparency. Terrain samples/blends native tile masks. The original minimap displays native minimap.dds tiles under the existing marks. Desktop hides the Android touch HUD. Preview movement/combat/render helpers no longer overwrite live actor state.
- Full macOS app tested with the user-provided live account through login → selection → loading → game without preview data. The server main actor stayed at local
(43303, 17771, 70856), and camera distance remained 1550. Original GameWindow also constructed successfully using only packaged resources. Runtime config/chat files now use an external user-data directory (default SDL preferences directory); strict codesign verification remained valid after the live login and exit. Credentials were not saved to generated user files. - Verification: 9/9 relevant CTests pass (Python view, window tree, selection, game scene, original game entry, packaging, 3D rendering, minimap and background); native-area conversion/loose-assets follow-up tests pass. Android
maintarget builds. Evidence:build/verification/game-fixed/packaged-game.png, logs andverification.txt. Updated deliverables:dist/AVA2.appanddist/AVA2-macOS-arm64.tar.gz. - Outstanding: exact Windows specular/lighting and complex intersecting-scene depth parity, neighboring terrain-block streaming, and a few effect/vegetation texture references remain. Android was compile-tested, not device-tested. Prior unrelated Python/chr parity failures remain outside this change.
2026-10-11 Game input, skill page and overhead labels
- Implemented AVA2-specific skill registration before loading-stage skill packets; received skill grades/levels now appear in the original skill page. Derived status recalculation follows the AVA2 point update switch.
- Restored original name/title color initialization, FreeType overhead fonts with Retina scaling, character-height registration and actual owner positions; name stays centered while level/title extend left. Corrected GM particle half sizes/quad/live count, attached positions, gravity units and scripted direction magnitude.
- Connected original Python keyboard/mouse controls to the live actor and movement/stop packets; added held camera keys, focus-loss releases and UI-first wheel handling. Replaced fixed game update delta and reacquired map pointers after loading callbacks.
- Validation: 3/3 targeted CTests; packaged real-account login, nonempty skills/icons/grades, movement then zero movement on release, final overhead screenshot. Evidence:
build/verification/input-label-fixed/final.pngand logs. Updateddist/AVA2.appand release archive. No credentials saved. - Limits: complex-scene frame rate, full combat interaction and exact Windows visual parity remain unverified.
2026-10-11 Re-login lifecycle and movement facing regression
- Dispose both phase-window owners before registering a successor, preventing old LoadingWindow destructors from clearing the new loading callback. Apply the same ordering to player game-window callbacks and treat Python integer 0 as a cleared owner.
- Remove actor render/bone yaw +180 offset; verify facing from the real warrior GR2 toe/foot axis against movement. Transfer initial game-server handshake milliseconds from LoginSession to native game time, once per connection, and retain bootstrap time on an unmatched native HANDSHAKE_OK.
- Five targeted CTests pass, including destructor reentrancy, a real main-character packet callback, full GameWindow reconstruction, bootstrap clock and model facing. Game-entry test now requires its completion marker.
- Packaged same-process live re-login passed; second scene/skill page rendered, movement followed by 100 game updates retained the connection. Evidence:
build/verification/relogin-facing-fixed/. Updated app and release archive. Server and original AVA2 remain unchanged; no credentials saved. Limited-duration verification does not establish long-running stability.
2026-10-11 selection / NPC / performance follow-up
-
Restored the original script API
chr.SetRotation180-degree conversion, fixing selection while retaining the corrected network locomotion axis. Corrected script position coordinate round trips. -
Mounted manifest-backed bundle asset packs alongside the Python script root. This restores
locale/common/npc_wear.txt, and live race 61000–61007 NPCs now use their configured eight PC models/outfits. NPC map-specific lookup reads the actual current map. -
Connected Python camera settings and host camera feedback. Added regression coverage for pack mount priority, traversal rejection, NPC map precedence, camera synchronization, and GR2 presentation facing.
-
Cached static building geometry and switched macOS packaging from Debug to an explicit RelWithDebInfo build. Same NPC scene measured about 240 ms/frame in Debug versus 25 ms/frame in the optimized build, approximately 4 to 40 FPS on this host.
-
Remaining visual/performance gaps: sustained 60 FPS, mounted NPC rendering, foliage and sky parity, and hardware depth-buffer rendering. Short live samples do not establish full Windows pixel parity or long-session stability.
-
Final validation: 8 relevant regression tests pass, live selection/NPC camera probes pass, and relogin probe remains connected after the second game entry. The broad Python suite retains unrelated missing-icon fixture / derived-status expectation failures, documented in GAME-RENDER-INVESTIGATION.md. Signed app and archive contain the optimized executable.
2026-10-11 Hardware depth, frame pacing and mounted NPCs
-
Added a native SDL_GPU scene pass with persistent vertex/index buffers, depth testing/writes, alpha testing, D3D-style culling and perspective-correct texture interpolation. Metal is verified on this host; the Vulkan SPIR-V shaders compile but Vulkan runtime is not verified. CPU model transforms, lighting and fog remain CPU work.
-
Upload decoded textures on the scene GPU queue before sampling. Borrowing SDL_Renderer textures produced a blank first frame because their queued uploads were not submitted until Present. Composite the scene with premultiplied alpha so the original selection background survives.
-
Cache tinted text masks (512 entries / 16 MiB) instead of creating/destroying textures for every label. Cull static objects by conservative world bounds before copying mesh commands. Keep collision geometry intact. Disable GPU validation in normal release builds; AVA2_GPU_DEBUG enables it for diagnostics.
-
Move the 60 Hz deadline wait immediately before presentation and use SDL_DelayPrecise. The frame CSV distinguishes active CPU work, geometry assembly, raster encoding and presentation intervals; loading and screenshots are excluded from steady-state statistics.
-
Port the reference sky's vertical cube gradients, environment cloud scale/height/alpha and lens-flare enable conditions. This removes the invented cloud/flare appearance in C1.
-
Render mount actors and attach riders through the animated saddle bone. Convert native Z-up bone matrices before world attachment. Register the reference horse wait/walk/run/dead motions for all eight PC races, and resolve the active motion mode at playback time: riders no longer stand on mounts, and an armor rebuild preserves the riding pose. A real GR2 leg-pose regression checks riding, armor rebuild and dismount restoration.
-
Validation: 10 targeted Debug CTests pass, including native Metal depth/alpha/culling/perspective/first-texture/background pixels, font renderer lifetime, conservative frustum rejection, sky configuration and mounted animation. Live selection, NPC/mount scene, movement/orbit and same-process re-login were exercised with the authorized account. No credentials are stored in source or documentation.
-
Remaining Windows parity gaps: SpeedTree still generates approximate foliage rather than decoding the original SPT geometry; outdoor rendering still lacks full adjacent-tile streaming; original specular/sphere-map shading is not complete. Performance evidence covers the measured local Metal scene, not every map or long-running session. Existing unrelated broad-Python-suite fixture/formula failures remain unchanged.
-
Final signed-bundle measurement: 2,400 game updates (~40 s), 2,359 steady-state samples after the first 40 updates; average 60.000 FPS, presentation interval P95 16.723 ms / P99 16.765 ms, active CPU work P95 10.424 ms / P99 11.313 ms. Two intervals exceeded 20 ms (maximum 23.478 ms); this is not a claim of zero dropped frames. Full camera orbit, short W movement and connection checks at updates 1,190 and 2,390 passed. Evidence:
build/verification/gpu-depth/final-stress.csv,final-stress-summary.json,final-stress.png,riding-tests.log. Signed app:dist/AVA2.app; release archive updated from that bundle. -
Final packaged re-login probe also passed after the riding fix: second GameWindow and skill page rendered, movement completed, and the connection remained live for the following 100 updates (
build/verification/gpu-depth/final-relogin.log).
2026-10-11 Follow-up performance audit (investigation only)
- Captured an 8-second main-thread sample and a separate 1,200-frame unprofiled control on the signed Metal build. Control averages 60.000 FPS / 7.117 ms active CPU; P99 presentation interval 17.698 ms with one interval above 20 ms. Sampling run had an unconfirmed 521 ms pause near sampler startup; do not use it as a proven client-code spike.
- Excluding cap-wait samples, rendering preparation and actor draw generation account for approximately 81% of main-thread samples. Prioritize actor culling/pose reuse, removal of redundant hardware-path work, immutable geometry references and resident GPU buffers. Animation switching currently reads/parses GR2 synchronously; caching needs movement/combat measurements. Terrain caching, instancing, resource budgets and UI/collision follow later.
- Detailed evidence and implementation priorities: docs/PERFORMANCE-AUDIT-2026-10-11.md. No client runtime behavior, asset bundle or server changed during this audit.
2026-10-11 Performance optimizations: parsed assets, poses and geometry
-
Added shared immutable parsed GR2 model/animation caching in ../sdk/gr2 (64 retained entries / 128 MiB source bytes, path/mtime/size invalidation), per-instance pose reuse and pre-bound track indices. Mutable playback/attachments remain independent. CPU pose equivalence and cache invalidation tests pass.
-
Cull non-main network actors/mounts before mesh generation using conservative bounds; keep all network/locomotion updates active. Static building commands reference immutable mesh streams; terrain patch/LOD geometry is cached and invalidated on map data/origin changes. Both software and native GPU raster paths consume geometry references.
-
Skip fallback-only screen coordinate calculations in the hardware path. Fixed a discovered exit-time minimap image reference lifetime by destroying UI/Python resources before SDL renderer/resources.
-
Same-scene stationary control: active CPU average 7.117 -> 5.423 ms (-23.8%), scene assembly 2.920 -> 1.838 ms (-37.1%); 60.000 FPS, interval P99 16.792 ms, no >20 ms interval in 1,159 steady-state frames. Eleven targeted Debug CTests pass, including original-vs-cached pose matrices, resource update invalidation, terrain reuse and hardware shared-geometry pixels/material overrides.
-
Further static resident GPU buffers, GPU transforms/skinning, instancing, memory budgets and lower-priority UI/collision changes remain follow-up work. Details and measured evidence: docs/PERFORMANCE-AUDIT-2026-10-11.md / build/verification/performance-audit/.
-
Final signed-bundle validation: 2,400-frame camera-orbit/short movement probe passed both connection checks; 2,359 steady-state samples averaged 60.000 FPS, interval P99 16.811 ms, active mean 5.669 ms, with two >20 ms intervals (max 22.489 ms). Same-process re-login rendered the second game/skill window, completed movement, remained connected for 100 further updates and exited cleanly. Evidence:
optimized-orbit-summary.json,optimized-orbit.log,optimized-relogin.logunder build/verification/performance-audit. Signeddist/AVA2.appand its archive updated.
2026-10-11 Resident meshes, GPU skinning and opaque instancing
- Move vertex transforms, fixed-function lighting/fog and skeletal weighted transforms into Metal/Vulkan shaders. SDK raw mesh templates preserve part inverse-bind remapping, rigid/zero-weight handling and attachments; CPU bone pose still drives saddle/effects. Palettes above 128 bones and software/F6 paths retain CPU skinning. GPU geometry conversion cache validates source ownership, not just an address.
- Resident vertex/index buffers cover immutable building, terrain and character streams, with an inactive-entry 256 MiB soft GPU retention budget. Dynamic water, tree wind and effects remain streamed. Deduplicate building mesh streams and instance compatible adjacent opaque commands through per-instance transforms/material data; transparent and skinned-palette commands remain independent.
- Same-location signed before/after comparison: active CPU 5.976 -> 3.491 ms (-41.6%), render preparation/submit 2.918 -> 0.807 ms (-72.3%). Both cap at ~60 FPS; interval P99 16.832 -> 17.038 ms, so do not claim improved pacing from reduced CPU work. 40-second orbit averages 60.000 FPS, P99 17.020 ms with one >20 ms sample; same-process relogin/skill window/movement/connection and clean exit pass.
- Eleven targeted Debug tests pass, including real mesh/normal skin equivalence, GPU weighted-rotation pixel comparison, resident upload reuse, instance material/matrix isolation, nonzero firstInstance and transparent exclusion. Metal verified; Vulkan shaders compile but runtime unverified. Signed app/archive updated. No original AVA2/server or credentials modified.
- Evidence and remaining lower-priority work: docs/PERFORMANCE-AUDIT-2026-10-11.md and build/verification/gpu-resident/.
2026-10-11 Texture budgets, compiled dispatch and collision broad phase
- Bound decoded 3D images (64 MiB / 256 retained entries) and native/SDL textures (256 MiB soft budgets), protect in-flight/current working sets, and reuse uploaded native textures without requiring decoded RGBA residency. GPU bytes are logical image payload, not measured driver VRAM; UI images and whole-process memory remain outside this budget. Skip eviction bookkeeping below GPU budget.
- Cache Python 2 compiled statements with bounded source retention and release before interpreter finalization. Eval still resolves current globals/callbacks; no UI throttling, frozen phase-window references or credentials written. Add frame-profile-only resource/compilation counters.
- Add collision spatial grid candidates while preserving original OBB/radius checks, insertion-order first-hit normals, oversized-query/object fallback and index invalidation on changes.
- Eleven targeted Debug regressions pass; add LRU/error/callback-rebind tests, texture eviction/reload/current-frame/software-transition pixel tests, and 500 exact collision hit/normal comparisons. Latest GPU hot-path tweak passes hardware_scene separately. Final signed re-login/skill-window/movement/connection/clean exit probes pass.
- Same-scene active CPU averages 3.758 ms before, 3.722 ms final: too small to claim a reliable speedup. Final ~60 FPS, P99 interval 17.225 ms with one >20 ms sample. Forty-second orbit ~60 FPS / P99 17.239 ms with no >20 ms sample; decode/upload/compile counts stabilize and decoded retention stays below 64 MiB. GM live collision workload was not representative; non-GM/dense/multimap and actual GPU timing remain follow-up validation.
- Signed app/archive updated; detailed limits/evidence in docs/PERFORMANCE-AUDIT-2026-10-11.md and build/verification/resource-ui-collision/.
Reproducible SDK dependency (2026-10-11)
- Publish the shared SDK independently and pin its revision through the
sdkGit submodule. Client builds default to this checkout;AVA2_SDK_ROOTsupports an explicit development override. Source snapshots, tests and SDK provenance remain in the SDK repository, rather than duplicated client source. - Build products, unpacked game assets, local resource links, runtime state and account credentials are excluded from both commits. Embedded SPIR-V C++ shader code accompanies its GLSL source and regeneration tool as required renderer source.
2026-10-11 Project directory cleanup
- Removed untracked root diagnostic screenshots, logs, six one-off Python probes, the hair inspection scratch source/binary, stray CTest output, Finder metadata and Python caches.
- Removed the obsolete build-root configuration/products and regenerable Android core build. Retained build/dev, build/release and build/verification, including recorded verification evidence.
- Removed the duplicate generated dist/AVA2-macOS-arm64.tar.gz archive; retained the current dist/AVA2.app. The packaging script can regenerate the archive.
- Removed approximately 3.3 GiB of file contents; root entries reduced from 129 to 60. Preserved tracked implementation/reference files, SDK, runtime resources and local configuration. Documented output locations in README and expanded root diagnostic ignore rules.
- Validation: ava2.pack_mount, ava2.python_view, ava2.select_render, ava2.game_entry, ava2.pack_assets and ava2.protocol all passed (6/6); git diff --check passed. verify_baseline.py reports four pre-existing baseline mismatches (interfacemodule.py, intrologin.py, serverinfo.py, ui.py); all four still match HEAD. Baseline manifest reconciliation remains outstanding.
2026-10-11 SpeedTreeRT static reverse engineering
- Analyzed the original PE32 x86 SpeedTreeRT.dll with Ghidra 12.1.4; exported 1,219 functions, with no export failures, including CRT/template helpers. All 137 exported functions have pseudocode; two other exports are static data.
- Retained the Ghidra project, combined/per-function pseudocode, call/export indexes, disassembly, hashes and validation under build/verification/speedtree-decompile. Added reusable headless export scripts under tools/reverse_speedtree and an entry/token map in docs/SPEEDTREE-REVERSE-ENGINEERING.md.
- 355 functions have decompiler warnings. These are analysis artifacts, not a compilable source recovery or a proven equivalent port. DLL execution/output comparison, detailed internal structure recovery and SDK integration remain outstanding. No original DLL, SDK implementation, client runtime or server changed.
2026-10-11 SpeedTree SDK metadata compatibility corrections
- Updated the independently maintained sibling sdk/speedtree using recovered SPT grammar. Corrected size/variance tokens (2006/2007), near/far LOD (2003/2001), the single-byte 2002 field, atlas groups (10002 leaf / 10003 billboard / 10004 frond) and preservation of raw UV quad corners. Added collision/wind metadata and clamped LOD evaluation; property size now overrides the authored SPT size.
- Replaced byte scanning/string guesses with a bounds-checked little-endian cursor and counted section traversal. Invalid SPT model loads return null; unsupported extensions are explicit partial metadata results. Removed developer-specific absolute path fallbacks from the SDK.
- SDK Debug and ASan/UBSan tests pass. All 606 original pack_maker SPT files parse base metadata without sanitizer reports: 323 complete, 283 stop explicitly at extension 21000. Client forest integration against the external SDK passes with deterministic valid SPT fixtures. Evidence: build/verification/speedtree-sdk-compat; SDK provenance and limits: ../sdk/speedtree/REVERSE-ENGINEERING.md.
- The SDK remains a procedural geometry/wind approximation: original spline generation, seed/variance effects, generated LOD meshes, billboard transitions and wind solver equivalence remain outstanding. No original assets, DLL or server changed; no Windows output-oracle/visual parity claim.
- Local build/dev is configured to AVA2_SDK_ROOT pointing at the sibling SDK for verification. The committed sdk submodule version and default CMake dependency configuration are unchanged.
- Final active build/dev verification: ava2_client rebuilt successfully against the sibling SDK; ava2.speedtree_forest, speedtree_test and spt_format_test passed (3/3). Logs: build/verification/speedtree-sdk-compat/active-build.log and active-tests.log.
2026-10-11 SpeedTree branch geometry and wind follow-up
- The external sibling SDK now retains Bezier branch curves/segment settings and builds bounded limb hierarchies driven by authored length/radius/profile/growth/declination and seed instead of filename-based tree species selection. Added per-model Park-Miller/128-entry shuffle state, seeded size variance, taper/curvature normals and coherent leaf pivots. Client forest/property adapters now forward tree_variance.
- CPU wind now uses indexed weighted affine matrices (recovered 10011e10), pivot rocking and inverse-transpose normals. Zero generated strength is neutral; world wind direction remains stable across instance yaw. Reference GLSL equations are aligned and descriptor conflicts removed; new matrix-index attribute/WindBlock interface is documented in ../sdk/speedtree/REVERSE-ENGINEERING.md.
- Final active Debug client build succeeds; ava2.speedtree_forest, speedtree_test, spt_format_test and branch_wind_test pass (4/4). SDK tests and geometry/deformation checks on all 606 original SPTs pass under ASan/UBSan. Both reference GLSL stages compile to SPIR-V. Evidence: build/verification/speedtree-branches-wind/.
- This is not full original runtime equivalence: branch scheduling/topology, exact sampled spline LUT/random call order, original wind controller/rocking tables, generated LOD and billboards remain unresolved. No GPU runtime or original DLL output/visual comparison was performed. Original AVA2 assets/DLL/server unchanged; current local build uses the sibling SDK, without changing the committed SDK submodule pin.
2026-10-11 Original SpeedTree runtime primitives
- Replaced direct curve inversion with the recovered 500-entry parameter/x-resampling LUT and 499-scaled query convention. Ported original AVA2 source-level four-matrix forest wind controller, including frequency pairs/compound rotations/strength phase rescaling and explicit Z-up to Y-up conversion. Integrated into SDK and AVA2 forests.
- Added legacy leaf rocking metadata and strength-change phase handling from 10025480/100254d0/10025510; CPU and reference GLSL support the recovered waveform. Original leaf orientation/group tables are not recovered. Retained branch scalar/flag and LOD metadata.
- Added original discrete LOD selection and dual alpha-test transition helpers from 1001d630/100207a0. These do not constitute recovered LOD meshes or an active client mesh/billboard transition.
- Active client build succeeds; five targeted tests pass. Four SDK tests and all 606 SPT metadata/generation/deformation checks pass under ASan/UBSan; GLSL stages compile. Evidence: build/verification/speedtree-original-runtime/.
- User chose continued static recovery without a Windows execution environment. Full original topology, leaf/frond geometry and orientation tables, generated LOD meshes, 360-degree/horizontal billboard behavior and DLL output parity remain unfinished. Original AVA2 files and server unchanged; SDK submodule pin unchanged.
2026-10-11 SpeedTree billboard generation and rendering
Shared ../sdk/speedtree now retains horizontal/360 billboard flags and their
supplementary overrides, preserves token 20005 raw UV values, and implements
360-degree atlas angle remapping/wrap and view/distance alpha-test composition
from functions 10020390/10020560. Vertical camera-facing quads and optional
horizontal bounds-midpoint quads retain raw four-corner atlas UVs. Model bounds
are cached during generation rather than scanned for every distant instance.
The client forest passes camera coordinates to draw construction. Near trees use generated geometry; the final leaf LOD transition fades to billboard quads with alpha-test thresholds. Camera direction respects instance yaw and scale; billboards do not receive wind or leaf rocking. Missing billboard UVs or valid LOD distances retain the existing geometry rendering path.
Verified: active ava2_client build, five targeted client/SDK tests, four standalone SDK tests under ASan/UBSan, and all 606 corpus generation/deformation checks. 462 corpus files produce finite indexed billboard meshes. Regressions cover near/transition/far draws, atlas wrap/thresholds, horizontal geometry, supplemental flags, instance transforms and billboard wind stability.
Outstanding: original recursive topology/random call order, leaf orientation and rocking-group tables, frond generation, independent branch/leaf LOD meshes, original billboard dimension computation/component fade scheduling, extension 21000 and gameplay collision integration. Vertical billboard size/centering use our generated bounds; trunks currently share the final silhouette fade. No Windows DLL runtime or rendered visual parity comparison is available; the user has requested continued static recovery. The original AVA2 files and server are unchanged; the pinned ava2-client/sdk submodule is unchanged.
2026-10-11 SpeedTree frond generation and additional SPT payload
Shared ../sdk/speedtree retains the full frond settings and texture list decoded from 100085b0/10008ac0. Enabled limbs at the authored start level now generate blade strips or symmetric spline-profile meshes. Width follows 10009040's centerline-length/aspect/size equation; atlas UV quads retain all corners. Fronds replace branch tubes on selected limbs and duplicate terminal leaves are suppressed. Authored fronds take precedence over grass/bush filename heuristics.
AVA2 submits double-sided alpha-tested frond draws with CPU branch wind weights; leaf rocking is disabled for these vertices. Fronds participate in cached model bounds, radius and billboard transitions. Original frond frame/edge smoothing, random call ordering and reduced LOD meshes remain incomplete.
All 283 corpus extension-21000 tails contain two token-tagged floats (21000 and 21001). These are now preserved without assigning unverified semantics. Parsing then reports unsupported token 22000; no unknown later blocks are skipped and metadata completeness remains 323 of 606. This part is inferred from resource bytes, because no corresponding handler was found in the current DLL decompile.
Verified: active application build and five targeted tests pass; four standalone SDK tests, all 606 metadata reads and generated/deformed models pass under ASan/UBSan. All 337 enabled-frond resources produce frond meshes; 462 resources produce billboard meshes. Evidence: build/verification/speedtree-fronds/.
Remaining: exact recursive tree topology/random order, leaf orientation/rocking groups, independent reduced branch/leaf/frond LOD meshes, exact frond smoothing, billboard dimensions/component fades, newer SPT extension semantics, gameplay collision integration and GPU wind rendering. No DLL runtime or rendered visual parity comparison was performed. Original AVA2 data and server remain unchanged.
2026-10-12 Per-frame CPU/GPU optimization pass
Implemented the prioritized per-frame findings, one commit per item (client 1eccdc87..121f1a63, shared sdk a1b3938..53115d9):
- Render3D mesh cache sweeps only on growth; one shared GPU skinning palette per instance (pushed once per change); cached part->parent bone maps.
- Text tails/labels: no per-frame codepoint vectors, show-state flag instead of list search, memoized widths, reused painter text instance.
- Off-screen actor shadows culled; draw lists reserve last frame's peak.
- Full mip chains for GPU scene textures (visible change: distant terrain/props no longer shimmer; sampler max_lod was zero before).
- GPU tri-groups share one resident mesh and draw index sub-ranges.
- Skins resolved once per skin change on the GPU draw cache; RenderSceneGPU resolves each texture once and sorts opaque draws by texture handle.
- HardwareVertex packed 88 -> 48 bytes (UBYTE4_NORM colour, SHORT4_NORM normal, UBYTE4 bones, USHORT4_NORM weights); shaders unchanged.
- Texture/mesh uploads staged and copied in the frame command buffer (one transfer buffer and copy pass per frame).
- Every draw reads its transform from the instance storage buffer (firstInstance = batch index); the 288-byte uniform is pushed once per frame. Texture eviction sorts candidates once.
- Bone lookup by a cached name index; attachments cache their bone index.
- Python member-function names interned for PyCallClassMemberFunc (cache dropped by Py_AtExit across Py_Finalize/Py_Initialize).
- Preview minimap radar redrawn only when its inputs change.
Verified: Debug macOS/Metal build, 50/50 CTests (including new regressions for resident index sub-ranges and GPU-cache skin changes). The current origin/main SpeedTree forest test needs SDK APIs not present in any pushed sdk revision, so verification used a local SDK shim; speedtree_forest_test was not built.
Not done, by decision: removing the offscreen colour target + blit (the 3D layer must composite premultiplied over SDL_Renderer 2D layers); baking text outlines (SDL already batches the five quads; colour would enter the cache key); partial palette pushes (risky on Vulkan/SPIR-V); sharing streams on the CPU-skinning tri-group path (would churn resident buffers); a per-frame light/fog uniform (light is per draw; fog is 32 bytes and nothing is pushed per draw any more).
Outstanding: no Vulkan/Android device run or frame-time capture for this pass;
frames*0.033f / frames/60 animation clocks are frame-based rather than real
time; translucent depth sorting uses each draw's first vertex. Original AVA2
data and the server are unchanged.
2026-10-12 FPS pass 2 (SpeedTree untouched)
SpeedTree (forest culling, SpeedTreeRT texture-path cache) is left alone while the SDK side is still being optimized. Client commits 46880be5..b2c7c6ce, one per item:
- Cached map-object and terrain-patch draws are submitted by pointer
(
Render3DDrawRef+FlattenDraws); no per-frame copies of cached commands. - Map objects beyond the AVA2 loading distance are skipped, 1:1 with
ENABLE_MAP_OBJECT_OPTIMIZATION(CArea::__UpdateLoadedObjectInstances): 2D distance from the main actor > max(OBJECT_DIST, 5000). The background update now receives the player position instead of the camera eye, asCPythonApplicationdoes. Fog-far culling was rejected (it changes silhouettes against the sky). - Render scale < 1 no longer copies the scene through an extra full-screen texture when the SDL_GPU pipeline is active; the scene target is composited with linear filtering.
- HardwareScene skips redundant vertex/index/pipeline/sampler binds; the opaque sort groups depth-writing opaque and alpha-tested draws by cull mode, texture and geometry (blended and non-depth-writing draws stay back to front).
- Distant actors animate at the original reduced FPS
(
CGrannyLODController::UpdateLODLevel+CGrannyModelInstance::Update): only models with a_lod_01.gr2sibling, more than 500 units from the camera target, 30-120 FPS by camera distance over 5000 (25000 for models of 500+ units). The_lod_meshes are now swapped in too; see the follow-up below.
GPU skinning limit reviewed, not changed: 36 of 3755 skinned models in pc*, monster*, npc*, npc_mount and npc_pet exceed 128 bones (bosses, metin stones, doors; max 314, no PC models) and fall back to CPU skinning. Raising the limit needs shader rebuilds, exceeds Vulkan's 16 KB minimum uniform range and the UBYTE4 bone index range.
Verified: Debug macOS/Metal build, 50/50 CTests (new regressions for
FlattenDraws, scaled-scene compositing and LOD animation rate). Not verified:
in-game frame-time capture and 3D screenshots (no server in this session), and
any Vulkan/Android device run.
2026-10-12 FPS pass 2 follow-up: real-time clocks and LOD meshes
- Animation clocks follow real frame time:
main.cppsums the frame delta into a game clock (still fixed at 0.033 s per frame under--frames) for water, network actors,FlyingManagerand weapon traces; the skybox,effect.Update/fly.Update(app.GetGameFrameDelta) andCRenderTargetpreviews (elapsedSDL_GetTicksNS, clamped to 0.25 s) use real deltas. The SpeedTreeUpdateSystem(0.033f)wind clock is unchanged (SDK work pending). - Actor bodies swap to
_lod_01.._03meshes (CGrannyLODController): queue{lod_03, lod_02, lod_01, main}, lazy loading, the original distance bands (including the BYTE wrap for a single LOD) and the building factor. Parts,.msmskins and the current motion follow the drawn instance. - 9 of 1739 shipped LODs drop an attaching bone (
lion2_lod_02/03losesaddle;shaman_miyeom_lod_*,mutant_1/2,gold_monkeyandassassin_easter_day_2016_lod_01loseequip_*). Such a level stays on PART_MAIN while that bone is in use, and bone queries fall back to PART_MAIN. - Not ported: weapon/item LOD models.
SetWeapon/AttachParthelper attachments (outside the part slots) are kept on the actor and re-attached to the drawn instance after the slots, so LOD and shape changes no longer drop them; a slot taking the same bone replaces the helper, andSetRace/SetModelclear them.- Blended, non-depth-writing, water and additive draws sort back to front by the bounds centre of their indexed vertices instead of the mesh's first vertex (cached per shared geometry index range). Depth-writing opaque draws keep the first-vertex tie-break.
- Build:
AVA2_SDK_ROOTdefaults to a sibling../sdkcheckout and falls back to the pinned submodule (now https://git.slcydia.fun/4v5u09Z5a4Yuc/metin2-SDK.git).
Verified: Debug macOS/Metal build, 50/50 CTests (render_3d covers the LOD
bands, the 30 FPS far pose rate on _lod_03 and the lion2 saddle fallback;
hardware_scene covers the blended centre sort).
Not verified: in-game or device visuals (no server in this session).
2026-10-12 Android step 1: APK packaging and game data
support/androidmoved to a top-levelandroid/and completed: Gradle 8.12 wrapper, AGP 8.7.3, compileSdk/targetSdk 35, minSdk 26, arm64-v8a, placeholder adaptive icon.android/build.shbuilds SDL3 3.4.16 and FreeType 2.13.3 once intobuild/android-deps(SDL Java sources copied from the same release), then the APK (C++ as RelWithDebInfo in debug), and installs/launches it when a phone is attached.libmain.so,libSDL3.soandlibc++_shared.soare 16 KB page aligned; FreeType is linked statically (AVA2_HAS_FREETYPE).- On Android the client enters
SDL_GetAndroidExternalStoragePath()(/sdcard/Android/data/com.metin2.ava2/files) at startup. Script-root discovery also accepts a flattened root (game.pybesideuiscript/). android/push_assets.pystagesassets/loose+upstream/python-root(scripts win) +python27.zipas hard links inbuild/android-data/root(55,761 files, 2.86 GiB) and sends them withadb push --sync. It remaps the threeassets/loosesymlinks that point into the old machine's pack_maker (bgm,sound/ui,icon/icon).- The on-screen keyboard follows edit focus (
ime.EnableCaptureInput/DisableCaptureInputfromui.py), the in-game chat and the dev login view where SDL reports screen-keyboard support; desktop keeps text input on. - Build workaround: this checkout calls SpeedTree SDK APIs that are not yet in
the SDK repository (
LegacyWindController,CreateFromSptvariance, LOD fields). Until that SDK work is pushed, the APK builds from a local mirror with shims:AVA2_SOURCE_DIR=<mirror> AVA2_SDK_ROOT=<shim> android/build.sh. (Obsolete since SDK 62a5f5a, 2026-10-13: plainAVA2_SDK_ROOT=../sdkbuilds.)
Verified: debug APK builds; the desktop client reaches the login screen inside
build/android-data/root (the phone layout) with no missing-effect errors.
Not verified: any run on a device (no phone attached), Vulkan rendering, touch,
lifecycle, frame rate.
2026-10-12 Mobile step 3: touch input router
src/app/input/touch_router.{h,cpp}(ava2_input): per-finger routing in this order: UI under the finger (or any finger outside the game phase) -> one UI pointer; attack circle; lower-left joystick area (floating base, dead zone 0.18); otherwise camera (one-finger drag rotates after a slop, two-finger pinch zooms, a short tap is a world click).CancelAllonSDL_EVENT_FINGER_CANCELED/ focus loss.- Touch mode is on by default on Android/iOS, or with
--touch/AVA2_TOUCH=1on desktop; it setsSDL_HINT_TOUCH_MOUSE_EVENTS=0and makesapp.ENABLE_MOBILE_HUDfollow it.main.cpphosts the sink: UI = a picked window that is not the player GameWindow; world tap = mouse move + left down for one frame (GameWindow keeps the move target after release); joystick ->SetPlayerJoystick(replaces the WASD axes while active, so movement uses the original camera-relative yaw path); attack ->SetPlayerAttackKey(same state and fishing check asplayer.SetAttackKeyState). - Python module
touch:IsEnabled,GetJoystick,IsAttackPressed,SetAttackButton,SetJoystickArea,GetLayout. The mobile HUD prototype's joystick and combat wheel are now display-only (not_pick); the old joystick sent raw move packets and the attack button was a one-pointerui.Button.
Verified: ava2.touch_router (routing unit test) and ava2.touch_game (the
original GameWindow with the mobile HUD in touch mode: open world, joystick
zone and attack button are not UI, the taskbar is; joystick right gives
movement yaw 90 at camera yaw 0; attack held while walking; taskbar tap reaches
the window manager, open-world tap becomes a world click); 51/51 desktop tests;
ava2_client --touch reaches the login screen.
Outstanding: no device run (real multi-touch, finger/pixel scale); the attack
key state is still not consumed on the real-server path (player_ComboAttack
stub), so touch attack does not swing yet; the prototype's attack/quickslot
.sub art is missing from the packs (attack drawn as a coloured block, skill
slots invisible).
2026-10-12 Mobile step 3b — attack and combo wiring
The attack key (keyboard or touch) now swings on the real-server path, ported
from GameLib ActorInstanceBattle / ActorInstanceCollisionDetection,
CPythonPlayerInput NEW_Attack, CPythonPlayerEventHandler OnAttack /
OnHit and CInstanceBase RefreshState / RunNormalAttack / RunComboAttack.
RaceData:RaceMotionData(ParseRaceMotionData, cachedGetRaceMotionData) reads ComboInputData and AttackingData in both the old single-hit layout (AttackingType) and theMotionType+HitDataCountlayout;.msmDEFENDING radius.LoadPlayerRacesregisters every player motion and combo table (LoadPlayerMotions, a port of PythonPlayerSettingsModule intro/general/weapon/combo/horse/fishing).chr.MOTION_MODE_BOW_SPECIALis 17 and there is noMOTION_MODE_CLAW(AVA2 builds withoutENABLE_WOLFMAN_CHARACTER, Locale_inc.h:131).ActorInstance: combo state machine (InputComboAttackCommand, pre-input and direct input windows,ComboProcess,__RunNextCombo, mounted wrap), normal attack, attack speed (m_dwAtkSpd / 100) applied to attack motions, per-hit-data victim maps with invisible time and the 16 / HitLimitCount limits,TestAttackHit(hit-position segments against the victim).ProcessPlayerAttack(called from the main loop):NEW_Attackchecks (bow needs a target and an arrow), stop packet when the attack interrupts a walk,CG_MOVEFUNC_COMBO per started motion, hit test against live monsters/stones,SetTarget+CG_ATTACKon a hit. Walking and click-move are suspended while attacking.player.ComboAttackuses the same path.- Remote actors:
RefreshStatepicks the motion mode from weapon / mount / polymorph / wedding dress / pickaxe / rod;CG_MOVEFUNC_ATTACK / FUNC_COMBO from the server play the attack motion facing the packet rotation.
Verified: ava2.attack_combo (both .msa layouts, warrior combo tables, real
combo timings: pre-input fires at DirectInputTime, direct input chains, input
after InputLimitTime is dropped, attack speed, remote motions not reported,
hit detection at yaw 0 / 90 incl. once-per-combo, range and far side);
ava2.touch_game; 52/52 desktop tests.
Outstanding gaps: not verified against the real server; attack speed is a
motion-clock ratio (no blend / speed-ratio curves); accumulation root motion is
not applied during attacks; victims are an upright cylinder of the race
DEFENDING radius (50 default) instead of the bone spheres; bow attacks have no
arrow flight / clickable-distance reserve; horse attack details, emotions and
skills are not wired; PvP IsAttackableInstance rules and the __CanAttack
checks (emotion, private shop, observer, new mount) are missing; remote
FUNC_ATTACK / FUNC_COMBO snap to the packet position instead of walking there
when 50+ away.
2026-10-12 Mobile step 2 — platform layer
src/app/platform/ (ava2_platform) takes the per-platform code out of
main.cpp:
EnterClientDataDirectory(macOS per-user data dir linking the bundle Resources; Android external files dir) andConfigDirectory(Android internal storage for metin2.cfg / interface.cfg) — moved unchanged.Lifecycle: an SDL event watch records background / foreground / low memory / terminating; the main loop applies them. Entering the background cancels movement and touch fingers, saves the config and interface status, and pauses the audio device (SoundManager::SetPaused); while in the background the loop skips game update and rendering but keeps receiving and dispatching network packets. Foreground resets the frame clock. Android runs withSDL_ANDROID_BLOCK_ON_PAUSE=0(SDL then waits up to 100 ms per poll while paused); SDL's Vulkan backend recreates the surface on resume.- Safe area:
SDL_GetWindowSafeAreamapped through the letterboxed logical presentation (MapSafeInsets) intoTouchLayout(safe_*;ForScreenkeeps the joystick area and attack button inside) and re-queried onSDL_EVENT_WINDOW_SAFE_AREA_CHANGED/ resize. Pythontouch.GetSafeArea(); the mobile HUD prototype insets the player panel, target bar, drawer, quick belt and combat wheel.
Verified: ava2.platform (lifecycle transitions incl. pause+resume between
frames, inset mapping with letterbox bars and scaling, safe touch layout),
ava2.touch_game (desktop insets 0; a HUD built with insets puts the attack
button inside them), 53/53 desktop tests, ava2_client --touch starts,
Android APK builds.
Outstanding: no device run (background/resume, surface recreation, audio
resume, server keepalive while paused); low memory only logs (no cache purge);
the HUD reads the insets only when it is built; iOS lifecycle needs the event
watch to do the save work synchronously.
2026-10-12 Mobile step 4 — mobile HUD layout
The touch HUD (upstream/python-root/ui_mobile_*.py, mobile mode only) now
follows the planned phone layout instead of the step-3 prototype:
- Native
UI::CDisc(wndMgr.RegisterDisc/SetDiscColors/SetDiscArc,WT_DISC): radial-gradient disc with a bevelled rim and an optional clockwise pie arc, drawn withSDL_RenderGeometry. All round frames are procedural; icons come only from AVA2's own taskbar / skill / item / face textures. ui_mobile_widgets.py:Disc,RoundButton(icon or label, fires on release inside),QuickSlotDisc(oneui.SlotWindowslot inside a disc; tap uses it, tap while dragging adds or moves into it — theuitaskbar.AddQuickSlotlogic; refresh is a one-slotTaskBar.RefreshQuickSlot).- Layout (inset by
touch.GetSafeArea()): top-left face disc (uiCharacter.FACE_IMAGE_DICT) + "Lv. name" + HP/SP/stamina gauges with the originalAffectShowerbelow; originaluiTarget.TargetBoardstays top centre; top-right row Messenger / Status / Inventory / Menu (menu panel: Skill, Quest, Guild, System) with the original minimap and event icon under it; left column Quest / Skill / Emote / Chat plus the originalGameButtonWindowhint buttons in a second column; bottom-right attack disc (r 60,touch.SetAttackButton) with 8 quickslots on two rings (current quickslot page, cycles pages 1-3) and page / ride (/ride, the Ctrl+G command) / pick-up buttons; bottom centre potion belt = quickslot page 4 (global 24-31); 3 px experience bar at the bottom edge. interfaceModule.ShowDefaultWindows/ShowAllWindowscallMobileHUD.AdoptDefaultWindows: hides the PC taskbar (and its TOP_MOST HP/SP/EXP tooltips, which only the taskbar's OnUpdate hides), expanded taskbars and energy bar, moves the minimap, chat and game hint buttons.game.GameWindowcallsAdoptGameWindowsafter the event icon opens.- New
player.RequestUseGlobalQuickSlot/RequestAddGlobalQuickSlot/RequestMoveGlobalQuickSlotToGlobalQuickSlot(global < 32, same CG_QUICKSLOT packets as the local variants) for the belt; switchingSetQuickPagewas not usable because it refreshes the inventory.
Verified: ava2.touch_game (taskbar hidden, belt = globals 24-31, minimap
under the top row, HUD buttons are UI while open world / joystick / attack are
not, attack disc pixels drawn, insets move the player panel),
ava2.python (global quickslot packets and range limits), 53/53 desktop
tests, desktop screenshot reviewed, Android APK builds.
Outstanding: no device run; minimap is still the original round one; labels
are English; chat input line can overlap the wheel's page button while typing;
no auto-hunt / target-lock buttons; Android keeps the 1024x768 letterboxed
logical size (step 5 scaling); the HUD reads the safe area only when built.
2026-10-12 Mobile step 5 — UI scaling and live safe area
- Logical UI size on phones / tablets (
platform::ChooseMobileLogicalSize): instead of letterboxing metin2.cfg's 1024x768, height = clamp(round(height in dp x 1.5), 600, 768) and width = height x screen aspect (landscape, even, at least 1024). A 2400x1080 phone at density 2.75 gets 1332x600, a 2400x1080 at 2.25 gets 1600x720, a 4:3 tablet 1024x768.--ui-height N/AVA2_UI_HEIGHToverride the height (600..1080).CPythonSystem::SetDisplaySizeOverridemakessystemSetting.GetWidth/Heightand the window manager report it without rewriting metin2.cfg. Android / iOS read the primary display (QueryDisplay); desktop simulates with--phone WxH[@density](implies--touch) and--safe-insets L,T,R,B. - Live safe area: on
SDL_EVENT_WINDOW_SAFE_AREA_CHANGED/ resize the host resets the touch layout for the new insets;MobileHUD.OnUpdateseestouch.GetSafeArea()change and rebuilds itself under a fresh root window (old root hidden), re-registers the attack button and re-runsAdoptDefaultWindows/AdoptGameWindows(minimap, chat, hint buttons, buffs, event icon). Covers rotating 180 degrees with a side notch. - HUD gauge backgrounds and frames are now kept referenced (they were destroyed right after creation).
- Fixed the step-4
touch_gamedisc pixel check (threshold too high; the earlier run used a stale test binary because the build stopped at the known speedtree_forest_test errors without-k).
Verified: ava2.platform (size choice for phones, portrait-reported
displays, tablets, override clamp, near-square foldable, --phone parsing),
ava2.touch_game (running HUD relayouts on new insets and back, minimap and
buffs follow, attack button re-registered), 53/53 desktop tests,
ava2_client --phone 2400x1080@2.75 --safe-insets 50,0,0,24 --phase game --preview-data renders 1332x600 full-bleed with the HUD inset.
Outstanding: not run on a device (display mode vs. immersive window size,
real cutout insets); a window size change at runtime (split screen,
foldable) keeps the logical size chosen at start; no in-game UI size option
yet (only --ui-height / env); original PC windows (inventory etc.) are
not rearranged for 600 px height.
2026-10-12 Mobile step 6 — auto hunt
Client-only feature (the original client has none; not taken from 40250). It only drives paths that manual play already uses: walk-to (move target), target packet, the normal attack, quickslot skills, item pick-up and quickslot potions. Nothing new goes on the wire.
src/game/auto_hunt.{h,cpp}: engine-free state machine (off / search / engage / loot / return / paused). Hunts the nearest living mob withinradiusof an anchor point (metin stones optional), loots own or unowned drops before the next mob, walks back to the anchor when the area is empty, and gives up on a target whose distance stops shrinking for 8 s (ignored for 30 s). Joystick / attack key / mouse movement pause it; it resumes 3 s after the last input and re-anchors where the player stopped. HP / SP potions (belt slots 1 / 2, quickslot 24 / 25) are checked in every state with a 1 s gap. Death turns it off.ProcessAutoHunt()(python_gameplay_modules.cpp, called from the game loop beforeProcessPlayerAttack) builds the input from NetworkActorManager (mobs bType 0/2),CPythonItem::GetGroundItems()(new read accessor) and the combat wheel's current skill page, skipping skills on cooldown, active toggles, 121-123 and guild skills.- Python:
player.SetAutoHunt / IsAutoHunt / GetAutoHuntState / SetAutoHuntOption / GetAutoHuntOption; options (radius, skills, pickup, stones, hp_percent, sp_percent, hp_slot, sp_slot) persist inautohunt.cfgnext to metin2.cfg. ui_mobile_autohunt.py: AUTO button on the combat wheel (tap toggles, green while on with the state under it; 0.6 s long press opens the settings board with range / skills / pick-up / stones / potion thresholds).
Verified: ava2.auto_hunt (targeting, range stop, skill gap, busy, loot
before next mob, area and stone filter, return, chase watchdog, pause /
resume / re-anchor, potions, death), ava2.touch_game (AUTO is UI under the
finger, tap on/off, engage + target VID + move target, stop in reach,
joystick pauses, long press opens settings, option persistence), 54/54
desktop tests, HUD screenshot shows AUTO above Ride.
Outstanding: not run on a device or against the server (ownership timing,
pick-up refusals, attack speed); straight-line walking only, the stuck
watchdog is the only obstacle handling; party loot rules ignored (only own /
unowned drops); no desktop hotkey (F9 is taken by the preview mode);
English labels, no locale strings; does not run in --preview-data.
2026-10-12 Mobile step 7a — app_loop split
src/app/main.cppmoved tosrc/app/app_loop.cpp(history kept). The formermain()body is nowRunClient, a C++20 coroutine that suspends at the top of every frame (co_yield), so start-up, frame body and teardown stay one function with all their locals in the coroutine frame.ava2::app::AppLoop(app_loop.h) drives it:Start(start-up up to the first frame),Iterate(one frame),QueueEvent,Finish(lets a running client leave the loop and tear down),Run(classic loop).- The new
src/app/main.cpponly picks the driver: SDL main callbacks (AVA2_MAIN_CALLBACKS, default ON except Android; iOS requires it because UIKit owns the main thread) or a classicmainloop (Android for now). With callbacks, SDL_AppEvent queues events and the frame's event pass reads the queue instead ofSDL_PollEvent. - iOS: no software FPS cap by default (SDL_AppIterate follows the display).
Verified: 54/54 desktop tests; ava2_client --phone 2400x1080@2.75 --safe-insets 50,0,0,24 --phase game --preview-data --frames 150 --screenshot gives a byte-identical BMP with the callbacks and with the
classic loop (-DAVA2_MAIN_CALLBACKS=OFF) compared to before the split;
bad arguments still exit 1.
Outstanding: Android stays on the classic loop until callbacks are tried on
a device; the frame body is still one function (state not yet split into
classes).
2026-10-13 Mobile step 7b — iOS packaging
ios/build.sh [sim|device] [deps] [--no-run]: builds static SDL3 3.4.16 and FreeType 2.13.3 once intobuild/ios-deps/prefix-<sdk>(tarballs shared withbuild/android-deps), then the client asbuild/ios-<sdk>/ava2_client.app(8.8 MB, code only, Python embedded, deployment target 15.0, arm64). The simulator build is signed ad hoc, booted, installed and launched. A device build is signed withAVA2_IOS_SIGN_IDENTITYand the entitlements ofAVA2_IOS_PROFILE, and is installed withxcrun devicectl.ios/Info.plist.insets landscape only, full screen, a hidden status bar, an empty launch screen (native resolution),UIFileSharingEnabledand a local-network usage string.- Simulator only: SDL_GPU rejects the simulator's Metal device because it
does not report MTLGPUFamilyApple3.
build.shpatches its private extracted copy ofSDL_gpu_metal.m(|| TARGET_OS_SIMULATOR). Device builds use stock SDL. - Data directory:
platform.cppuses the app's Documents folder (SDL_FOLDER_DOCUMENTS). The "game data not found" box namesios/push_assets.py. That script stages the tree withandroid/push_assets.py --stage-only --lowercaseand copies it into the simulator container as APFS clones (cp -Rc), or to a device withxcrun devicectl device copy to. - iOS file systems are case-sensitive as the app sees them, including the
simulator container. The client opens lower-cased paths
(ResourceManager::NormalizePath), but the data is mixed case
(
Dopador_manual/…). So the iOS tree is staged with every name ASCII-lowercased. Only A–Z is folded: legacy CP949 names stored as Latin-1 code points (oxà캥æ®.dds) must keep their bytes.EffectData's path normalisation now also folds A–Z (scripts spellempire_A.mse), like the effect cache key already did. - Staging fixes that also apply to Android:
android/push_assets.pynow usesbuild/dev/test-rundir(tools/make_test_rundir.py) as the base layer and adds the loosesvside/folder. Before,assets/loosealone lacked pack files that game.py needs (Dopador_manual/, the switcher art, svside/.jpg), and the game phase ended. The staged tree is now 98,349 files / 3.95 GiB.
Verified: iPhone 17 Pro simulator, --phase game --preview-data. The game
scene and the mobile HUD render; the safe area (118/0/118/38) keeps the HUD
clear of the notch on either landscape side. The console has 0 TraceError
or Traceback lines. Without data, the app shows the "game data not found"
box. Desktop 54/54.
Outstanding: the device build, signing and devicectl install/copy are
untested (no device or profile). The network keepalive does not run while
the app is in the background (iOS suspends SDL_AppIterate). Android still
uses the classic loop. Paths the client opens without lower-casing them
would fail on iOS; none showed up in the login screen or the game phase,
but character select and a real-server login have not been run on iOS yet.
2026-10-13 Mobile gestures — item and window interaction
- Before this step the port's
CSlotWindowhad no mouse handlers, so item pick-up, drop, equip, double-click use, right-click and hover tooltips did not work on desktop either. Ported from EterPythonLib, 1:1:PythonSlotWindow.cpphandlers: left down → OnSelectItemSlot/OnSelectEmptySlot, the drop on left up, right down, double click → OnUseSlot, over/over-out tooltips, RefreshSlot.PythonGridSlotWindow.cpp: the slot vector, GetPickedSlotList, OnRefreshSlot, CheckMoving, the grid GetPickedSlotPointer.CWindowManager: IsDragging (the 10 px rule), mouse over on every move, right button down/up with DeattachIcon.
app.SetMouseHandlernow stores the handler. app_loop calls its Update/Render after the phase window, so the attached icon follows the pointer.app.IsPressedreads the real keyboard state, so desktop Shift-split and Ctrl-quickslot work. Desktop double clicks (clicks >= 2) reach RunMouseLeftButtonDoubleClick. Keys are released on focus loss and when the app goes to the background.- Touch router UI gestures:
- A tap sends move, down and up at the touch-down point.
- A drag past tap_slop presses at the start point.
- A double tap (within 300 ms and 40 px) becomes a double click.
- A long press (450 ms) on an item slot calls
touch.SetLongPressEvent.
- The callback opens
ui_mobile_actions.ItemActionSheetwith Use, Split and Quick slot. Split and Quick slot run the original Shift/Ctrl branches viatouch.SetVirtualKey. - Mapping table: docs/MOBILE-ARCHITECTURE.md, "物品与窗口手势".
Verified: the new ava2.inventory_touch test drives the original
uiinventory.py through the router and the window manager. It covers the
hover tooltip, tap pick-up and tap drop (move packet 0→5), drag 0→6,
double-tap use, the long-press sheet (Use, Split opens dlgPickMoney,
Quick slot), tap-outside close, long press on an empty cell, and
app.IsPressed. touch_router_test covers the gesture timing. The phone
simulation (--phone --touch) draws no software cursor. Desktop 55/55.
Outstanding:
- Gestures have not been tried on an Android or iOS device yet.
- Drop and sell are drag-only; the sheet has no buttons for them.
- A button's zero-size TextLine sits at the button's exact centre pixel, and IsIn is inclusive, as in the original. Only that one pixel misses the button.
2026-10-13 Android device verification
Device: OnePlus PJZ110 (Android 17), 2376x1080 at density 3.00, giving a 1320x600 logical UI. Safe area insets: 117/67/50/53.
Changes:
Ava2Activity(extends SDLActivity) passes theargsintent extra as the command line, so a dev run can start in--phase game --preview-data.android/build.shforwardsAVA2_ARGS.- Startup crash: directories created by
adb pushwere owned byshellwith mode 2770, so the app uid could not statymir work/pc/...gr2. The uncaught std::filesystem exception ended main.push_assets.pynow chmods what shell owns after the push. It skips files the app wrote itself (channel.inf, the cfg files), which shell cannot chmod. - Forced landscape: the window is resizable and had no
SDL_HINT_ORIENTATIONS, so SDL requested FULL_USER. That overrode the manifest'ssensorLandscape, and the game rendered letterboxed in portrait. Fixes:- app_loop sets the hint to
LandscapeLeft LandscapeRighton Android and iOS. Ava2Activity.setOrientationBisalways requests SENSOR_LANDSCAPE.- Verified with the system rotation locked to portrait.
- app_loop sets the hint to
- The mobile window is
SDL_WINDOW_FULLSCREEN(immersive). Before this, the status bar drew over the HUD. Verified. - Wrong trees on the phone: about 1000 files exist in both
assets/looseand the pack-manifest test-rundir with different content. Examples are the zone/b tree atlases (at half size), monster2/npc_pet models and pc effects.assets/loosewas layered on top, which broke the SpeedTree UVs into flat green cards. The desktop client showed the same result inbuild/android-data/root. Fix:push_assets.pynow stagesassets/loosefirst and lets test-rundir (what the original client serves from its packs) win. - One
adb push --syncover all ~98k files aborts in file_sync_client ("failed to read stat response"). push_assets.py now pushes batches of at most 20,000 files.
Verified on the device:
- Game phase renders correctly on Vulkan.
- Joystick moves the player.
- The inventory opens from the HUD and closes with its X.
- Login phase shows the server list.
- 60 fps steady on the 60 Hz panel (SurfaceFlinger latency: 0 frames over 25 ms), with SoC sensors around 41 °C.
Environment notes:
- A root-owned adb server on :5037 claims the phone, and launchd respawns it. Use the SDK adb (34.0.4) against it: a different client version restarts that server mid-push.
Outstanding:
- Item gestures on the device: the preview inventory is empty, so pick/drag/double-tap/
long-press were checked only in
ava2.inventory_touch. - Real-server login: no isolated AVA2 server or account is available. The listed servers are not to be used.
- A missing or unreadable model should fail that load, not throw out of main.
- The
--preview-datacamera starts inside the tree canopy, so the player is hidden. - Thermals over a long session not yet measured.
2026-10-13 Real SpeedTree SDK
The SDK repository now carries the SpeedTree runtime this checkout calls (SDK 62a5f5a: "Implement cross-platform SpeedTree runtime and recovery tests" and "Fix terminal foliage dispatch on frond branches"). The local mirror and SDK shim are no longer needed; desktop and Android build against the plain SDK checkout.
Changes:
tests/attack_combo_test.cppandtests/ava2_render_3d_test.cppcall the code under test insideassert(). In RelWithDebInfo (NDEBUG) those calls compiled out and the tests segfaulted; they had been skipped only because the test rundir was not found. Both now undefine NDEBUG, likehardware_scene_test.cpp.android/build.shprefers the SDK's adb over the one on PATH (see the adb note above).
Verified:
- Desktop ctest 59/59 with
-DAVA2_TEST_RUNDIR=<checkout>/build/dev/test-rundir, includingava2.speedtree_forest(without that option the 9 asset tests are skipped). - Desktop phone layout and the device both render trees with real branches and fronds.
- Device game phase: 60.3 fps, max frame gap 16.6 ms, 0 frames over 25 ms.
2026-10-13 Mobile HUD: minimap frame and top inset
- Minimap outside its frame (preview): with
--preview-datano map loads, sominiMap.Renderreturns early and the green circle was app_loop's dev radar, drawn at the fixed PC spot(screen_width - 132, 5).CPythonMiniMap::Rendernow records the window position before the map check (GetScreenPosition), and the radar draws there. It opens the minimap once viaShowMiniMap()(normallyAtlasInfodoes that on map load), soCanShow()follows its close/open buttons. A real map was not affected. - Top HUD row too low: SDL folds system-gesture insets into the safe area. In landscape
fullscreen the status bar is hidden but its swipe zone still gave a 120 px (67 logical)
top inset.
Ava2Activity.Ava2Surfacere-sends the insets with the top taken only from the display cutout and visible system bars (device cutout is left-only). - The preview keyboard-hint header is not drawn in touch mode; it overlapped the HUD.
--game-scriptnow also runs with--preview-data(desktop probing of the mobile HUD).
Verified on the device: minimap inside its frame, portrait/status bars and the entry row at the top edge. Desktop ctest 59/59.
Outstanding: after a tap the cursor stays where the finger lifted, so hover tooltips (e.g. "[F6] Battle pass") remain until the next touch. (Addressed below: world taps and cancelled touches now park the pointer too.)
2026-10-13 Mobile touch: system edges, cancel, long-press sort
Interaction ideas from jhaizhou-ops/d2r-mobile (MIT); only the ideas were taken, no code. docs/MOBILE-ARCHITECTURE.md has the details ("系统边缘与取消").
TouchRouter:- world fingers that land in the bottom safe inset (the gesture bar) are
Owner::Ignored; - new
FingerCancel(id, ms):SDL_EVENT_FINGER_CANCELEDnow cancels only that finger instead ofCancelAll; - a cancelled joystick finger keeps the stick vector for
joy_reacquire_ms(300). A finger landing within 1.5 radii of the old base takes it over, keeping the same base; - an attack tap shorter than a frame releases on the next
Update; - new sink hook
UiPointerIdle: a cancelled pending UI touch parks the pointer.
- world fingers that land in the bottom safe inset (the gesture bar) are
- Host: a world tap's deferred button-up also parks the pointer (
TouchUiPointerIdle), so no hover tooltip or target stays under the tap point. - Long press on an empty inventory cell:
touch.SetLongPressEventcallbacks get a sixth argument,isEmpty.ItemActionSheetoffers Sort / Close. Sort fires the originalseparateButtonevent, which opens the question and then sends/click_sort_items. Cells covered by a larger item and empty cells in other windows still press normally. - Checked, no change needed: every quick-slot tap uses the slot once (select on button
down; the double click goes to
OnUseSlot, and quick-slot discs have no use event). Dropping an item on any shop slot, empty or occupied, already sells it (uishop). - Tests:
touch_router_testsystem_edges;inventory_touch_test: long-press empty cell → Sort → question →/click_sort_items;touch_game_testnow keeps its assert()s in release builds.- Desktop ctest 59/59.
- Verified on the device: long press on an empty bag cell → Sort / Close → the original sort question.
Outstanding:
- the system-edge strip and joystick re-acquire are covered by unit tests only, not yet exercised by hand on the phone;
- hold-to-repeat on quick slots (d2r's held potion) is not done.
2026-10-13 Mobile HUD: left column closer to the edge
- The left safe inset was 117 logical px on the OnePlus PJZ110 (landscape). Android adds the back-gesture zone (90 physical px) on top of the punch-hole cutout (120 physical px), so the portrait and the left button column sat about 130 logical px in from the edge.
Ava2Surface.onApplyWindowInsetsnow passescovering.left(cutout and visible system bars only) as the left inset, the same way it already handled the top. Taps in the gesture zone still reach the app. Right and bottom still use the combined insets.- Verified on the device: the portrait, the Quest/Emote column and the joystick moved about 50 logical px to the left and stay clear of the cutout.
2026-10-13 Mobile: tapping an edit line shows the keyboard again
- The frame loop only called
SDL_StartTextInputwhenime.EnableCaptureInputstate changed. Once the user hid the on-screen keyboard (Back or the keyboard's hide key), the login edit kept focus, so tapping the ID or password box changed nothing and the keyboard stayed hidden. HostTouchSink::UiMouseDownnow notes a finger landing on the focused window (or a child of it) while text is captured. The next frame callsSDL_StartTextInputagain if the keyboard is hidden; SDL shows it again without restarting text input.- Verified on the device (login board): Back hides the keyboard; tapping ID or Password brings it back; tapping the background does not. Desktop ctest 59/59.
2026-10-13 Render: intro pose, preview hair, tree LOD, terrain seams
All four issues reproduced on desktop too (--phone ... --phase select|game --preview-data).
- Select screen T-pose:
chrRenderdraws intro characters through the CPU scene renderer, which ignores GPU skinning palettes, so with hardware skinning on they stayed in bind pose. It now turns hardware skinning off while it collects those draws. The intro character playsintro/waitagain. - Missing head on the preview player: its hair path
(
plechito/summer2020_costume/hair/warrior_m.gr2) does not exist, and the body models carry no head. It now usesymir work/pc/warrior/hair/hair_1_1.gr2(warrior_m.msm HairData00). Network actors already went through the originalSetHairlogic. - Trees:
CSpeedTreeWrapper::AdvancecallsComputeLodLevel()and then alwaysSetLodLevel(1.0f), so the original draws full geometry at alpha ref 84 and never shows the billboards. Our integration compared the camera distance with the raw .spt lod_near/far (100/1100), so nearby trees dropped to their billboards (dark composite silhouettes, pine needle quads).SpeedTreeRT.cppnow always builds trunk, leaf and frond geometry. Texture names resolve likeLoadTree: GetPath(spt) + NoExtension(name) + ".dds" (CompositeMap,plant_grasshad no extension and stayed untextured). Leaf density and branch shape come from the SDK generator, which is still being worked on. - Terrain white seams/blocks: far patches (step 2) next to near ones (step 1) left T-junction cracks that showed the cleared background. Each patch now hangs a vertical skirt (2 cells deep) below its edges. Forcing step 1 everywhere removed the seam the same way.
- Desktop ctest 59/59. Device (OnePlus PJZ110): select screen shows the warrior and ninja in their intro idle with heads; the game preview shows full-geometry trees and no terrain seam. The preview player stands inside a pine, so its head was not visible in the game shot.
2026-10-13 Terrain: load the 3x3 blocks around the player
On the real server (Android, "AVA2 General" at 412,760) the terrain stopped at a block edge,
with empty sky beyond it. CPythonBackground::LoadMap loaded only the block under the warp
point and never loaded another one. The original CMapOutdoor::Update/LoadTerrain
(LOAD_SIZE_WIDTH 1) keeps the 3x3 terrains and areas around the player's terrain coordinate,
clamped to MapSize, and reloads them when that coordinate changes.
TerrainHeightmap::LoadBlockDirsstitches up to 3x3 blocks into one heightmap:- heights are (128n+3)², tiles (256n+2)², attr 256n²; neighbours share their border samples;
- the patch grid is 8 patches per block, and the quadtree is built over the patch ranges;
- patches of blocks with no
height.raware skipped. The active-terrain pointer stays the same, so height, attribute and actor queries work as before.
GetAttrAtWorldnow maps attr.atr the way the files are laid out: 256 cells of 100 per block, starting at the block origin (raw index 1). Before, the 256 cells were stretched over the 130-cell bordered height grid.CPythonBackground::Update(x, y, z)takes map x, map y and height (asapp_update_gamepasses them; the app_loop call had y and z swapped). When the terrain coordinate changes it reloads the set: terrain, every block'sareadata.txt, and one water surface per block. The object loading centre now uses map y instead of height.- Desktop ctest 59/59 (background_test checks a 2x2 stitch: heights, attributes, and Update with no block change).
2026-10-13 Audit: remaining differences from the Windows client
Compared module by module against upstream/ava2-client in three passes:
- Python module surfaces (functions and constants, nearest method table,
#ifdefchecked againstLocale_inc.h/ServiceDefs.h); - every packet handler per phase and every
net.Send*; - engine subsystems.
The Python surface has no real gaps. What remains:
- names commented out in the reference (CHAT_TYPE_UNK_10, ITEM_FLAG_RARE, RARITY_MAX_VALUE, MOB_RESIST_BLEEDING, chrmgr.RegisterMotion);
- names behind macros that are off (WJ_COMBAT_ZONE, ENABLE_WOLFMAN_CHARACTER, ENABLE_SOULBIND_SYSTEM, ELEMENT_SPELL_WORLDARD, WJ_CHANGELOOK_SYSTEM, ENABLE_PERMA_ITEM, ENABLE_OPTION_COLLECT_EQUIPMENT, NEW_PET_SYSTEM);
- modules python-root never imports (udp, guild_ranking, wndSlot, wndText).
Every GamePhase case exists. The 9 upstream-only cases are all macro-off: CSHIELD, ELEMENTS_SPELL, KEY_AGREEMENT*, COMBAT_ZONE*, SUPPORT_SKILL, TOURNAMENT_ADD, and TARGET_CREATE (commented out).
Outstanding, most severe first:
P0, the real-server flow stops:
-
RecvWarpPacketreads and drops GC_WARP. Windows sets DirectEnter for the selected slot and reconnects tolAddr:wPort. Map teleports and channel moves hang.- Fixed:
RecvWarpPacketstops processing the old socket andpump_python_netcallsLoginClient::warp. It reconnects like DirectEnter: same login key, the remembered selected slot, a new generation so the server clock is re-synced, andSetNewLoadingPhase(ENABLE_NEW_LOADING). A connect failure under DirectEnter is ClosePhase (SetLoginPhase). Covered inlogin_oracle_test.
- Fixed:
-
In-game
RecvPhasePacketonly stores the phase. Windows callsSetSelectPhase(plus__DownloadMark),SetLoginPhase,SetLoadingPhase,SetGamePhaseorClosePhase. Going back to character select and reloading after a warp do not work.- Fixed:
RecvPhasePacketfollows the Windows switch: CLOSE → SetLoginPhase; SELECT → leave the game phase and hand the unread bytes back toLoginSession::return_to_select, which shows the cached roster at once (SelectReady); a later LOGIN_SUCCESS raises SelectRefresh → select windowRefresh; LOADING → player clear; GAME → status refresh; DEAD → no-op (it used to makeIsGamePhase()false).__DownloadMarkwaits on item 8.
- Fixed:
-
LoginSession(select phase) only accepts headers 0/7/32/44/90/150-153/253-255 and drops the connection on anything else. The following are missing:- GC 6 LOGIN_SUCCESS3;
- GC 8/9 PLAYER_CREATE_SUCCESS/FAILURE;
- GC 10/11 PLAYER_DELETE_SUCCESS/WRONG_SOCIAL_ID;
- GC 17 POINT_CHANGE;
- GC 107 CHANGE_NAME.
On the real server,
net.SendCreateCharacterPacket/SendDestroyCharacterPacketraise NotImplementedError, andSendSelectEmpirePacket/SendChangeNamePacketsend nothing.- Fixed:
LoginSessionparses GC 6/8/9/10/11/17/107 in LoggingIn/Selecting/Entering (17 is dropped like Windows) and queuesSelectResults;pump_python_netturns them into OnCreateSuccess (create window), OnCreateFailure (create + select), OnDeleteSuccess/OnDeleteFailure/OnChangeName (select). The four senders build the original struct images (wire::create_character/destroy_character/select_empire/change_name, checked against Packet.h inlogin_oracle_test); a failed Send only logs, and the empire is stored after a successful Send.
P1, visible gameplay:
4. ParseRaceMotionData ignores motioneventdata in .msa files (effect, effect-to-target, fly, screen waving/flashing, special attack, character show/hide). Per-motion .mss sound scripts are not loaded either. On the real server, skills and attacks show no effects and play no swing, footstep, hit or death sounds.
- Fixed:
ParseRaceMotionDatareads LoopData and MotionEventData (effect / effect-to-target registered with EffectManager, fly with FlyingManager, special attacking with its collision spheres, sound, show/hide, warp; AttackType defaults to SPLASH = 0) and thesound/<path>.mssscript.ActorInstanceMotionEvent.cppruns the events per 1/60 s frame (loop motions finish their frames before wrapping): effects attach to bones or follow them, .mss sounds go throughPlayCharacterSound3D(5000 range and 0.3 s repeat check for non-PCs), motion loops followCurrentMotionLoopProcess, splash hits feedProcessPlayerAttack→ SendAttackPacket(skill), fly shots → FlyingManager + SendShootPacket, warp → FUNC_WAIT state. Player skill and guild-skill motions are registered (__LoadSkill/__LoadNinethSkill/__LoadGuildSkill);ClickSkillSlotplays NAME_SKILL + grade motion with the formula loop count, sets the fly target and sends the FUNC_SKILL state; remote FUNC_SKILL states play the skill motion; GC FLY_TARGETING (71) / ADD_FLY_TARGETING (69) set the shooter fly target by VID or position, CG fly-targeting sends global coordinates. Limitations: screen waving is a no-op, the fishing effect-to-target is skipped, flying instances aim at the target position at launch, fan/circle multi-target AddFlyTarget and moving skills are not ported, the fly-target centre approximates the bounding sphere, splash spheres are tested as cylinders. Covered inattack_combo_test(TestMotionEvents).
RecvDamageInfoPacketand fly-target hits always spawnwarrior/effect/gihyeol_spark.mseand playsound/ui/punch.wav. These are invented. Windows uses the race-registered hit effects (chrmgr EFFECT_HIT…) and the damage-number effects.- Terrain (MapOutdoorLoad/RenderHTP, TextureSet):
- textureset UScale/VScale/UOffset/VOffset/Begin/End are ignored (fixed world/500 UVs);
- splat alpha is per-vertex 3x3 instead of per-tile, and only for textures with tiles;
- the static
shadowmap.ddsand the dynamic character shadow texture are not applied; - fog bands are missing (no fog near, untextured fog-colour patches past fogFar+1600, splat limit, 3 LOD index sets);
- setting.txt HeightScale, ViewRadius and TerrainVisible are ignored; the environment path rule is unverified;
areaambiencedata.txtambient sounds andAreaProperty.txtare not used.
- Actor visuals:
- armour/weapon refine glow and shining are missing;
- weapon trace is missing;
- the horse actor is missing (rider only);
- emotions (
player.ActEmotion,IsActingEmotion) are missing; - dig and fishing motion queues are missing;
- movement dust is missing;
- the percent-weighted random motion pick and motion blend times are missing;
- race smoke and attached effects are missing.
- Guild marks:
net.UploadMark/UploadSymbol/SendGuildSymbol/RecvGuildSymbolandwndMgr.MarkBox_Loadare stubs; there is no__DownloadMarkand no guild-area terrain overlay. - Stubbed queries used by python-root:
player.IsPVPInstance(uitarget PvP menu) andplayer.IsOpenPrivateShop(uiprivateshopbuilder) always return 0, as doplayer.IsInSafeAreaandchr.PickAll;background.TextureChange(game options) does nothing, nor dochr.LookAtandchr.DismountHorse;player.SetMouseStateis unused on touch.
- Features that are on in the reference but stubbed here:
- 67-attr (
__BL_67_ATTR__: Send67AttrPacket/Close); - calendar (
ENABLE_CALENDAR_SYSTEM: CalendarOpen/Close/Send); - Catch-the-King (
ENABLE_MINI_GAME_CATCH_KING); net.SendMobileMessagePacket;- SafeBoxWrongPassword does not call
OnSafeBoxError; - background Create/DeleteTargetEffect (shop and location markers);
- server commands StoneDetect and Start/StopStaminaConsume.
- 67-attr (
2026-10-13 Module behavior parity: first repair batch
This is a targeted behavior repair after updating to client HEAD 31c5b3dd, not a claim of full Windows equivalence. See the per-module audit for all 46 modules, source paths, reviewed scope and remaining work. The audit scripts now inspect src/scripting and fail instead of reporting an empty source set. Method coverage is complete, but 71 constant-return candidates and unreviewed behavior remain.
Fixed SMS and enabled 67-attribute/calendar/CatchKing senders; warehouse row capacities and original open/error/money/batched refresh callbacks; stamina start/stop/frame accumulation and mobile callbacks; PvP/safe-area queries and shared attack eligibility; casting cooldown using point 21 instead of movement point 19; TextureChange and original per-texture scale/offset coordinates. Added windows_behavior_test with literal wire fixtures, state/callback and terrain checks. Corrected obsolete forest tests to the source's forced full LOD and full-bound frustum culling.
Desktop build and all 60 CTests pass. ASan/UBSan windows_behavior passes. Packet audit compares 395 constants with zero mismatch. No live-server or Android-device test, no Windows process output oracle. Five Python baseline hash differences predate this batch in the pulled HEAD; original reference C++ and the shared SDK were not changed. Pending: guild mark connection/cache; target/StoneDetect effects; motion queues and advanced skills; terrain splat/shadows/fog/environment; Windows NO_WIND/static-lighting vs current tree rendering (leaf rocking needs separate handling); adapt necessary collision/GPU changes from the preserved pre-pull stash to the new layout. Older backlog descriptions about damage-number queues, missing network horse actors, LookAt and MarkBox_Load are superseded by the linked audit.
2026-10-13 Windows behavior parity: target effects, StoneDetect, tree lighting
Restored the missing background calls in target-create/update/delete receive handlers. Background now owns target effect instances, follows actual actor positions, converts global coordinates using MapOutdoor BasePosition, defers zero-height locations, and cleans its instances/bindings on deletion and map changes. Preserves first-insert actor bindings and the original shared reservation resource rule. Removes stale special-effect ID associations so deleted/recreated targets can follow instead of leaking. StoneDetect now selects the four original assets and converts its compass angle; invalid input does not spawn. SpeedTree tree/frond/leaf commands now disable dynamic lighting as WRAPPER_USE_STATIC_LIGHTING requires, preserving vertex diffuse colors.
See second-batch details and verification logs in build/verification/windows-target-effects-2026-10-13. Expanded windows_behavior tests cover received packet fragments, nonzero map bases, draw positions, following and ownership lifecycle; forest tests cover static lighting. Full Windows/Android visual parity remains unverified. Still pending: guild mark transfer/cache, advanced motion and skills, terrain shading/fog/splat/environment, tree wind-method separation and prior collision/GPU integration adaptation. Target effects still depend on the replacement effect renderer and current terrain-only height query.
Validation: desktop full build and CTest 60/60 passed (52.67 s); final expanded behavior/forest tests 2/2 passed (1.75 s), ASan/UBSan 2/2 passed (3.17 s). git diff --check passed; no new upstream reference changes and the shared SDK is clean.
2026-10-13 Windows terrain parity: map settings, culling and water grid
Restored HeightScale through initial and streamed terrain loads and water vertices; TerrainVisible now independently gates terrain drawing. Reset per-map settings and texture/UV caches at map load. The compatibility fallback block entry now uses the same streaming loader instead of a stale-origin raw path. Valid camera culling no longer falls back to an uncullable whole-map draw. Water starts at its block origin, uses the map height scale without the invented -200 bias, draws every valid cell (including odd rows/columns) and skips -1 layers.
Third-batch source comparisons and regression cases document retained developer-map defaults and malformed-input boundaries. background_test covers 4×1 streaming, heights, pointers, per-map vs runtime visibility, reset, culling, sparse water and bad scale. ViewRadius patch allocation, true LOD, shadow/fog/splat, water depth alpha/material/animation and ambient sound remain outstanding; this is not visual equivalence. Other backlog: guild mark transfer/cache, advanced actors/skills, tree wind separation and collision/GPU adaptation. No reference/server/SDK changes or live-server/device proof.
Validation: full desktop build and 60/60 CTests passed (52.49 s). ASan/UBSan background + windows_behavior 2/2 passed (1.51 s); SDK/client C++ instrumented, Python C dependency not equally instrumented. git diff --check passed.
2026-10-13 Windows SpeedTree parity: WIND_NONE vs leaf rocking
Client forest/model now default to no branch/frond/leaf-center deformation using identity wind matrices, matching WRAPPER_USE_NO_WIND. Empty matrices cannot mean no wind because the SDK synthesizes it. Leaf pivot rocking and camera-facing placement remain active. Explicit SetCpuWindEnabled(true) / the final BuildDrawCommands cpuWind argument preserves optional CPU wind. The background forest now uses accepted game-frame dt instead of fixed 0.033; invalid/overflowing forest time steps retain prior state.
Fourth-batch source comparison and limits distinguish completed mode separation from still-approximate leaf amplitudes, normalized strength and original per-tree creation/environment propagation. Added actual draw/pivot checks under yaw/scale and adversarial custom matrices, mode toggling, stable fronds/trunks and background frame-clock comparisons. No SDK/reference/server modifications. Random generation, exact leaf/DLL values, collision/GPU adapter migration, guild marks, advanced actors/skills and remaining terrain shading continue in the backlog.
Validation: full desktop build and CTest 60/60 passed (49.73 s); ASan/UBSan forest/background/windows_behavior 3/3 passed (2.38 s). Method audit: 46 modules, no missing methods; packet audit: 395 constants, zero differences. No Windows or Android dynamic parity proof.
2026-10-13 Windows player motion parity: emotion request, fishing and digging
Restored player.ActEmotion's alive-target /kiss request and original NEED_TARGET callback, and IsActingEmotion's narrow KISS/FRENCH_KISS motion-index query (not all emotes). RecvFishing now drives the existing once/loop motion queue and fish emoticon, gates STOP/REACT on actual fishing WAIT/REACT, and preserves main-only failure callbacks. Removed the packet-flag stand-in: cancellation and fish messages query current motion data. RecvDigMotion faces an existing target and queues exactly the received count, while missing targets do not suppress digging.
Source comparisons and precise limits retain pending dual-emotion approach/TCP locking and fishing water target/blend timing. New asset-backed player_motion uses temporary MSA/race data with original read-only model/wait GR2 to verify transitions, eight kiss queries and fragmented/repeated DIG; it explicitly skips if resources are absent, but ran and passed here. Full build and CTest 61/61 passed (31.98 s); ASan/UBSan windows_behavior + player_motion 2/2 passed (1.53 s). Static method and packet audits remain zero-mismatch; git diff --check passed. No SDK/reference/server changes or Windows/Android visual equivalence proof. Guild marks, advanced skills/dual motions, terrain shading and exact tree generation/leaf values remain outstanding.
2026-10-13 Windows dual-emotion parity: scheduling, approach and roles
Replaced server-command local pair pushes with a VID-based dual scheduler: 500ms clock deadline, requested 100-unit endpoint, far approach then mutual facing and job-specific once motions. Preserved MAKELONG high/low assignment (slap sender HIT, receiver HURT). Pending main as either participant blocks manual movement/attack; native move target/direction entry points cannot bypass the lock. Kiss/slap local movement stays locked by current motion. TCP movement packets are deferred instead of discarded and resume after permission; deletion/clear releases state. Server clock callback and existing deterministic test clock cover uint32 rollover.
Sixth-batch details and remaining differences explicitly retain root motion/blend/collision and unified TCP scheduling gaps, plus conservative rejection of self/overlapping pairs and safe coincident coordinates. Extended player_motion exercises delay, approach, job/role mapping, input recovery, queued movement, both main roles and removal. No reference/SDK/server modifications or visual equivalence proof.
Validation: full desktop build and CTest 61/61 passed (50.91 s); ASan/UBSan windows_behavior/player_motion 2/2 passed (1.47 s). Active method audit 46 modules and mapped packet audit 395 constants remain zero-mismatch. git diff --check passed; no new reference changes or shared SDK edits.
2026-10-13 Windows motion parity: weighted variants and playback speed
Restored BYTE percentage selection for all motion modes, including the original first-entry fallback for underfilled weights. Selected GR2 and MSA metadata now stay together; queued motions select only at activation and LOD uses the selected file. Added explicit C++ speed overloads retained in queued nodes while preserving existing native attack-speed behavior. Network body and mount creation/updates now propagate movspd/100 to WALK/RUN; running speed changes restart the loop. Zero speed stays zero and >1100 clamps to zero, including main input movement.
See seventh-batch comparison and limits. Asset-backed player_motion tests enumerate all 100 selection values, malformed totals, metadata/clip identity, immediate/queued speeds and live network speed changes. Mount propagation is source-reviewed without a dedicated mount fixture. Platform RNG sequence, skeletal blending, blend-overlap timing, root motion, special NPC/polymorph speed rules and full TCP scheduling remain pending. No SDK/reference/server changes.
Validation: full desktop build succeeded; CTest 61/61 passed (49.58 s); ASan/UBSan player_motion/windows_behavior/attack_combo 3/3 passed (3.62 s). No Windows/Android dynamic or visual equivalence proof.
2026-10-13 Windows attack speed: zero, overflow and binding time
Network creation/RefreshState/updates and mount creation/updates now clamp raw attack speed >1100 to zero and normalize by 100, preserving zero instead of replacing it with normal speed. Actor speed storage accepts finite nonnegative values; bound attacks retain their current ratio until a new attack binds, matching the original setter and elapsed-time calculation. Regressions cover raw boundaries including UINT32_MAX, mount storage, zero-speed attack freeze, next-attack recovery and unchanged current-attack speed.
See eighth-batch comparison. The AVA2 reference disables ENABLE_FAST_MOB_MOVE_SPEED; its guarded NPC caps are not missing active features. Outstanding: overflow detection queue, polymorph type/mode and 1.1-second scaling, bone blending, root motion and full TCP scheduling. No reference/SDK/server changes or runtime visual parity claim.
The full suite exposed intermittent inventory_touch shutdown failure after its completion marker. macOS crash frames identify preview-manager static destruction releasing an image after the resource cache died. Added CRenderTargetManager::Destroy and call it during PythonRuntime teardown before image pools/resources, following Windows PythonApplication::Destroy. Added weak ownership/index lifecycle regression; retained initial failure logs.
Final full build succeeded; CTest 61/61 passed (42.78 s). Instrumented four-test regression passed (10.88 s), inventory_touch repeated three times passed (21.60 s), and the preview-image use-after-free disappeared. Recoverable UBSan diagnostics remain in unmodified Singleton offset calculation, unaligned reads and font color conversion; process success does not establish sanitizer-clean code. Detailed logs retain these findings for follow-up. Method/packet audits: 46 modules with no missing methods, 395 mapped constants with no mismatch. git diff --check passed; SDK/reference unchanged.
2026-10-13 Strict UBSan and polymorph motion parity
Removed invented-address singleton offset arithmetic; actual base-subobject registration plus compiler casts preserves multiple inheritance. Font RGB now retains valid Win32 truncation and uses explicit ARGB packing, with documented finite/clamped input boundaries. Packed sockets use memcpy in inventory/warehouse/switchbot paths; packed attribute values are materialized before pair reference forwarding. Regression tests cover nonzero singleton base offsets and exact font colors.
Restored TYPE_POLY or PC race>=8 classification, GENERAL mode, base-variant interception without RNG and duration/1.1 speed scaling; ordinary loops retain random selection and unscaled explicit speed. Network poly shape zero and PC-poly sash rejection follow Windows. Synthetic ordinary-PC motion fixtures now use playable race indices 1/2. See ninth-batch scope and remaining work.
Strict ASan/UBSan four-test regression with halt_on_error=1 passed (11.89 s), including inventory teardown; detailed output contains no sanitizer diagnostics on those paths. Python C dependency is not equally instrumented. Remaining modules and unreviewed paths are not declared complete; no SDK/reference/server edits or Windows/Android/live-server dynamic parity proof.
Full desktop build and CTest 61/61 passed (50.12 s). Subsequent test-only strengthening checks literal odd-aligned socket bytes and a negative attribute value: native targeted test passed (1.23 s), strict sanitizer targeted test passed (2.05 s). Active method inventory 46 modules/zero missing, packet audit 395 constants/zero mismatches; git diff --check passed.
2026-10-13 Windows skill permission and toggle requests
Restored pre-send actor/observer/poly/dress/pickaxe permissions, passive rejection, MSA LoopCancelEnable cancellation, active AVA2 riding slot 107 threshold and source mount-level cases. Added horse-skill mismatch and attack-skill safe-zone callbacks; blocked paths emit no packets or cooldown events. Ordinary active toggles send the skill-slot argument; active standing toggles retain the separate original zero-argument branch before generic permissions. Animal/dress weapon constraints and repeated-armor checks now use requested PART_MAIN instead of poly render shape zero.
See tenth-batch source comparisons and limitations. Literal AVA2 CG233 fixtures cover acceptance/refusal and both toggle paths; asset-backed actor tests cover cancel flags and stun priority. Static mount-case audit compares all 100 active cases with zero differences. Strict ASan/UBSan four-test regression with halt_on_error=1 passed (10.23 s). No SDK/reference/server modifications; remaining skill conditions, targets/movement, guild marks, terrain and tree work are not declared complete.
Final full desktop build succeeded and CTest 61/61 passed (49.71 s). Strict sanitizer detailed output has no diagnostics on executed paths. Method audit 46 modules/zero missing, packet audit 395 mapped constants/zero mismatch; git diff --check passed. Python C dependency not equally instrumented; no live-server or device proof.
2026-10-13 Windows skill costs, learned level and equipment conditions
Restored bottle scans, fishing-mode restriction, active/default learned-level gate, weapon masks and bow-arrow condition. HP/SP use source point indices 5/7 and Win32 formula truncation; equal resources pass, client does not deduct ahead of server. Preserve source zero-cost refusal/chat, -1 SP sentinel, partial-SP flag, summon exemption and DASH/CHARGE cooldown/resource exceptions. Skill failure/cooldown/arrow callbacks now go to the network game-phase window, verified with distinct player and phase windows.
See eleventh-batch evidence and limitations. Real SkillDesc/SkillTable inputs cover normal/exception boundaries and literal CG233 requests. Targets, multi-target/moving skills, right-button mode, bone blending/root motion, guild marks, terrain and tree work remain pending; no reference/SDK/server changes or live-server/device parity claim.
Final full build and CTest 61/61 passed (47.53 s); strict ASan/UBSan four-test regression passed (11.84 s) without diagnostics on executed paths. Method inventory 46 modules/zero missing; packet audit 395 mapped constants/zero mismatch; git diff --check passed. Earlier intermediate runs retained in the verification directory; final logs include the window-routing correction.
2026-10-13 Windows skill target resolution
Separated UI selection from local skill target: no-target skills send zero; alive/corpse lookup, picked fallback, alliance/self and enemy safe/attack checks now follow the reviewed source branches. Added front auto-search's distance-varying cone and capped-distance/VID ordering, actual fly target binding and horizontal facing. Failed animation binding cannot send packets/cooldown. Restored __UseSkill's second IsUsingSkill lock even when the lower actor predicate allows LoopCancelEnable; asset-backed regression proves that distinction.
See twelfth-batch scope and limitations. Static/fixture tests cover literal target/use packets, native picked state, target deletion/death and roles. Source range reservation/approach, 1000/2000ms selection throttling/UI targeting effects, fan/circle/random fly targets, moving skills and blending remain pending. No SDK/reference/server changes or Windows/Android/live-server visual proof.
Final full build and CTest 61/61 passed (48.43 s); strict four-test ASan/UBSan passed (11.96 s) with no diagnostics on executed paths. Subsequent test-only deletion, capped-sort ties and 2000/2001 distance boundaries passed native (1.29 s) and strict sanitizer (2.26 s). Method inventory 46 modules/zero missing; packet audit 395 mapped constants/zero mismatch; git diff --check passed.
2026-10-13 Windows skill range and reserved approach
Added targetRange + point34*100, source >= range reservation and strict arrival with the 10-unit margin, moving-target following and permission/resource rechecks. Restore source huge race2493 correction, enemy ATTR_BLOCK check, zero-range exemption and charge's first target-zero send/cooldown followed by DASH completion. Frame pipeline processes the reservation; locks pause owned movement, manual input/deletion/main changes cancel. Weak actor identity prevents VID reuse inheriting a cast. Auto hunt does not overwrite the reserved approach. Formal skill callback (-1) no longer invokes the app's preview cooldown/effects.
See thirteenth-batch source comparisons and limits. Tests cover 190/189 boundaries, follow/reselect/one-shot, stun/revive, input/lifecycle cancellation, friendly approach, range bonus, blockers and charge bytes. Root motion, exact movement/stop packet timing, full right-button/standing-toggle reservation interactions, target hold/UI lifecycle and multi-target remain pending. No SDK/reference/server changes or Windows/Android/live-server visual proof.
Final full build and CTest 61/61 passed (46.68 s); strict four-test ASan/UBSan passed (8.48 s) without diagnostics on executed paths. Method inventory 46 modules/zero missing; packet audit 395 mapped constants/zero mismatch; git diff --check passed. Python C dependency not equally instrumented. Preview callback guard is compiled/static-checked without app visual proof.
2026-10-13 第十四批:技能追加飞行目标
已接通 FAN/CIRCLE 候选选择、距离/VID 排序、MSM 防御球位置与严格 3D 范围、原版随机算法的 8000 锥形补足、CG53→动作绑定→CG233 顺序和现有 Actor 队列。新增报文回归与真实 GR2/MSA 队列消费/主目标恢复测试。异常数量上限保护为明确偏差;精确模型中心、骨骼矩阵/附件生命周期、持续追踪和移动技能仍未完成。详见 第十四批记录。
本批验证:桌面完整构建成功,61/61 CTest(33.73 秒);四项严格 ASan/UBSan(10.85 秒)通过,无执行路径诊断。方法与协议静态审计通过。未提交/推送本轮修改。
2026-10-13 第十五批:飞行物目标与生命周期
接通 FLY/服务器索引飞行物的对象追踪、对象消失转最后位置与安全实例身份、严格线段命中、实际飞行距离退出,删除五秒误报命中。恢复 MSF 初始旋转及速度/加速度积分、重力、homing 延迟/半角规则、主目标一次性穿透及受击动作。新增独立飞行回归和真实 GR2/MSA 回调链测试;背景/其他怪物碰撞、视觉附件、shake 和精确包围中心仍未完成。详见 第十五批记录。
同批继续恢复 SpreadingFlag 的三次原版随机调用和初始旋转顺序;固定种子验证独立计算轨迹、速度/加速度一致旋转及关闭时随机序列不变。
本批最终验证:完整构建成功,62/62 CTest(57.66 秒);五项严格 ASan/UBSan(14.25 秒)通过,无执行路径诊断。静态方法与协议审计通过。SDK/参考/服务器未修改,本轮尚未提交或推送。
2026-10-13 第十六批:飞行物场景碰撞
已接通 BODY/DEFENDING 分类、演员双轨迹检测、发射者身份排除、额外角色穿透去重、回调/碰撞优先级、严格地形高度和当前物体三维 OBB 代理;游戏入口借用当前场景,地图高度使用多区块查询。新增合成 MSM/移动演员回归及真实 GR2 物体代理测试。原版 culling 首候选顺序、静态完整碰撞图元、树木碰撞、骨骼/部件历史仍未完全对齐。详见 第十六批记录。
本批最终验证:完整构建成功,62/62 CTest(54.71 秒);五项严格 ASan/UBSan(12.49 秒)通过,无执行路径诊断。方法与协议审计通过。SDK/参考/服务器未修改,本轮尚未提交或推送。
2026-10-13 第十七批:飞行附件与受击震动
已接通多 AttachData、独立效果与尾迹、angular rotation、LINE/MULTI/SINE/EXP 偏移、全局矩阵与完整清理,以及 OnShootDamage 的 100ms 图形震动。主体/骨骼/飞行中心使用图形偏移,逻辑坐标和碰撞球不受影响。修正 CG51 图形 Y 符号并验证实际默认处理器报文字节。真实 GR2/MSA 与 MSE/尾迹绘制回归已加入;CRT 精确随机序列、第一帧/粒子时序、近战全部受击流程和 GPU 逐帧画面仍未对齐。详见 第十七批记录。
本批最终验证:完整构建成功,62/62 CTest(53.47 秒);五项严格 ASan/UBSan(13.20 秒)通过,无执行路径诊断。方法与协议审计通过。SDK/参考/服务器未修改,本轮尚未提交或推送。
2026-10-13 第十八批:飞行尾迹几何与衰减
恢复六顶点四三角形尖角尾迹、相机位置参与的方向基底、逐段深度排序、原色恒定 alpha、宽度衰减、原版 UV、alpha test、小尺寸参数及严格过期边界。扩展固定源公式绘制几何和前批多附件回归。逐段 frustum、继承 GPU 深度状态、首帧绝对时间和相机/浮点动态输出仍未完全对齐。详见 第十八批记录。
本批最终验证:完整构建成功,62/62 CTest(51.52 秒);五项严格 ASan/UBSan(12.55 秒)通过,无执行路径诊断。方法与协议审计通过。SDK/参考/服务器未修改,本轮尚未提交或推送。
2026-10-13 第十九批:尾迹逐段视锥裁剪
接通 view×projection 六平面、每段中点/最长轴半长球、外侧相切剔除及部分可见保留;标准透视粗球保留原版 FOV 度值直接传 tan 的历史行为。新增边界/相机/透视及历史单位回归,基础几何测试使用明确宽投影。原版全局 frustum 更新时序、非标准投影粗球、浮点逐位和 GPU 深度继承仍待对照。详见 第十九批记录。
本批最终验证:完整构建成功,62/62 CTest(50.78 秒);五项严格 ASan/UBSan(12.06 秒)通过,无执行路径诊断。Python C 代码未全部同等插桩。46 模块方法和 395 个映射协议常量审计通过,git diff --check 通过。SDK/参考/服务器未修改,本轮尚未提交或推送。
2026-10-13 第二十批:视锥更新缓存、非标准投影与 GPU 深度继承
UpdateGame 更新阶段建立缓存,渲染阶段尾迹读取该快照。相机/投影设置不自动刷新缓存,正交及自定义矩阵继续使用最近透视元数据计算原版粗球。接通 Python 正交投影;尾迹继承深度开关/写入并使用 LESS,硬件管线键及软件光栅器同步支持;加法混合不再强制关闭软件深度写入。新增快照/投影/软件回归和真实 GPU 像素回读。Windows 浮点逐位、全局相机切换、SDL 几何备用后端无深度缓冲等边界详见 第二十批记录。
本批最终验证:完整构建成功,62/62 CTest(62.48 秒);六项严格 ASan/UBSan(17.43 秒)通过,包含实际执行的 GPU 回读,无执行路径诊断。Python C 代码未全部同等插桩。方法/协议审计与 git diff --check 通过。SDK/参考/服务器未修改,本轮尚未提交或推送。
2026-10-13 移动交互:浮动摇杆、技能手势及场景点击
参考 d2r-mobile 的交互思路,移除闲置固定摇杆,真实落点与绘制中心分离,补齐技能独立多指归属、拖动方向提示、按住遵守冷却重试、最近敌人选择、完整快捷按钮热区及物品拖拽抬高。增加 NPC/入口和掉落物热区、接近交互、失焦取消与实例/物品 generation 防复用。保留原版双击/长按物品面板及报文,新增真实 HUD、库存和目标/技能/NPC 字节测试。详见 移动交互调整。真机多指、精确模型点击体、完整寻路和技能范围预览仍待验证/实现。
本批最终验证:完整构建成功,62/62 CTest(63.67 秒),移动专项 4/4,严格 ASan/UBSan 4/4(19.86 秒),无执行路径诊断。Python C 代码未全部同等插桩。方法/协议审计及 git diff --check 通过。SDK/参考/服务器未修改,尚未提交或推送。
2026-10-14 树木:包围裁剪、透明测试、静态网格与资源碰撞
改为实际 min/max 包围及整树冠距离裁剪;默认树干/frond 使用共享静态流和实例 world 矩阵,材质路径模板缓存,叶片仍按相机/摇摆更新。接通原版森林/实例/环境风强生命周期并移除 ×0.05;修复树干 alpha=84 GREATER、软件 alpha reference 0/调制时序/浮点边界。接通 authored 球/圆柱到角色 BODY 与飞行物查询,保留忽略 box 和平移规则,防高速完整跨越;生命周期删除和真实 SPT 加载失败不产生假树。485 个当前真实 SPT 两次全 LOD 快照一致且无截断。详见 树木修复记录。原 DLL 数值、GPU 叶片/风 shader、真机性能和完整球体响应仍待对齐。
验证:62/62 完整 CTest(48.61 秒)、专项 6/6、严格 ASan/UBSan 5/5(4.07 秒)通过,包含实际 GPU 回读;方法/协议与 diff 检查通过。资源审计额外确认 280 个文件在 token 22000 处停止扩展解析,不能将无截断视为元数据完整;客户端已记录诊断,未知扩展继续保留为明确待办。SDK/参考/服务器未修改,尚未提交/推送。
2026-10-14 — Game FPS display and movement altitude check
Added an always-visible, non-interactive FPS badge at the safe top centre of the game screen. It counts completed SDL presentations over half-second windows (including pacing/render cost), resets on phase transitions and foreground resume, and remains hidden outside the game. It does not use the existing app.GetRenderFPS stub, which currently returns the requested rate.
Corrected MapObjectManager movement collision to test actor BODY sphere altitude against the 3D mesh OBB instead of an infinitely tall 2D footprint. Added real-model regression checks for solid obstruction, passage above/below geometry and ActorInstance walking above an object. Added rate-limited device logs for attempted movement that produces no displacement, including map, position, next position and terrain block flag.
Verified: desktop and Android builds; 4/4 focused CTests (player_motion, touch_game, flying_target, speedtree_forest); capped desktop 10 FPS measured 10.0 and displayed 10; desktop 30 FPS cap under scene load measured 16.4 and displayed 17; physical PJZ110 Android preview displayed 10 at a 10 FPS cap. Updated APK installed with existing data retained, then restored normal login launch. Evidence: build/verification/fps-movement-2026-10-14/.
Remaining: the user's specific blocked region still needs a live retest after login; this change alone does not prove its cause. Static objects still use mesh OBB proxies rather than original authored .mdatr primitives, which can incorrectly cover openings. The original Python FPS getters and app.SetFPS host integration remain separate parity gaps.
2026-10-14 — Reported town gate falsely sealed by mesh OBB
Live device logs pinpointed the continuing movement obstruction to metin2_map_a1 near (66041.5, 71337.5), with terrainBlock=0. The corresponding a1-middledam-01.gr2 instance at (66907.429688, 19664.039063, 72199.484375), yaw 30 degrees, has six authored planes in its companion .mdatr. The former whole-mesh OBB incorrectly seals its doorway.
MapObjectManager now reads validated little-endian AttributeData plane sets, transforms quaternion axes and centres with the same (x,z,-y) basis and object transform as the rendered model, and uses source plane crossing/radius/rectangle tests for movement and flying collision. Movement permits escape from a plane overlap. Broad-phase candidates include authored plane extents. Valid empty attributes suppress dummy collision; missing, truncated or mixed/non-plane files retain the existing OBB fallback.
Verified with the reported real gate and coordinates: the old 2D footprint intersects the doorway; the authored-plane movement test clears it; ActorInstance moves 2000 units through the entire opening; all six wall planes still block approaching spheres and allow escape. Empty/truncated attribute and above/below-OBB regressions pass. Desktop/Android builds and 4/4 focused CTests passed. APK: build/verification/fps-movement-2026-10-14/ava2-gate-fix.apk.
Deployment pending: USB disconnected before this gate-fix APK could install. The phone currently has the earlier FPS/3D-altitude fix. Reconnect and install gate-fix APK, then verify the reported passage on the live device. Remaining parity gaps: authored non-plane .mdatr primitives and height meshes, mesh-proxy camera/2D collision queries, original Python FPS getter values.
2026-10-14 — Mac test package and gate-fix device installation
After USB reconnection, installed the gate-fix Android APK successfully with adb install --user 0 -r (application data retained). Live passage/movement retest remains separate; the user reports additional running issues and requested a Mac package first.
Built the current workspace as macOS arm64 RelWithDebInfo and packaged full game resources into dist/AVA2.app, with dist/AVA2-macOS-arm64.tar.gz for transfer. Bundled/relocated all non-system dylibs and applied ad-hoc signatures for local testing. Verified strict deep codesign, all 88,052 asset-manifest hashes, internal bundle links, and inclusion of the reported gate .mdatr. Isolated-data packaged executable checks exited successfully in normal login (45 frames) and game preview (35 frames); opened the normal application for manual login and gameplay testing. Evidence: build/verification/macos-package-2026-10-14/.
Packager now excludes saved-account lib/wa_ac.py and optional no.py auto-login overrides from both manifest and adapted-script layers, preventing host user state from entering the test package; packaging regression passed. This is a local Apple Silicon test build, not a notarized release. Live running/animation correctness is still under investigation.