Reverse-engineering an MMO Aion 2's network protocol to build a real-time DPS meter (Rust + Tauri)
Disclosure: this is a write-up about my own side project — a combat analytics tool for AION 2. No affiliation with the game's publisher. Links at the end. Architecture A Windows desktop app: Rust backend + Tauri v2 webview UI . It passively captures the game's TCP traffic (npcap), reassembles streams, parses the game's undocumented binary protocol, feeds a combat model (damage, heals, buffs, deaths, boss detection), and pushes aggregates to a small JS frontend. Nothing touches the game client — no injection, no memory reading. If the packet didn't say it, we don't know it. Pain #1: the protocol is a moving target Nobody hands you a spec. The protocol is varint-heavy, partially compressed, and changes with game patches. You end up doing packet archaeology: capture a fight, stare at hex dumps, correlate "I pressed this skill at 19:32:04" with byte patterns, build a parser, and then — the fun part — keep it alive after every patch , usually reverse-engineering the diff within hours because your users' raids are tonight, not next week. One hard-won lesson: log everything behind toggleable trace categories. Our tracing setup keeps hot-path log callsites at literally zero cost when disabled (Rust tracing with Interest::never() + atomic per-category flags), so a user can flip a "Trace: Packets" checkbox, reproduce a bug, and send a log that actually contains the bytes we need. Pain #2: entity identity is a lie The single hardest correctness problem wasn't parsing — it was identity . A player is not one ID: your character has a stable "owner" entity that carries your buff bar, your damage lands under a transient combat entity whose ID changes between pulls, leave the dungeon and the game re-binds you to a brand-new ID, names arrive from different packets than damage, sometimes seconds later, sometimes never (mid-fight app start). Get any of this wrong and a healer's healing lands on a ghost row, or a player's buffs vanish from the saved fight because their ID was recycled 7