aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


docs/team-resources.md (7831B)


Native team health and nano

Team resources use the original 14.9.1 actor and TeamView paths. The roster retains names across zoning, but the GUI deliberately empties both bars when the member's actor is absent. Resource delivery does not create actors, send inventory, or extend world interest.

Original packet and GUI contract

KKR 10084650 reads TeamMemberInfo, key 28784248. Its body is exactly 40 bytes, all big-endian 32-bit fields:

Field Meaning
member type, member ID Actor identity, normally type 50000
stat 343, stat 342 HealDelta and HealInterval
stat 364, stat 363 NanoDelta and NanoInterval
stat 214, stat 221 Current and maximum nano
stat 1, stat 27 Maximum and current health

Activation 10084740 resolves the body's identity, ignores the local actor, and drops unresolved actors. It does not establish membership or enforce team privacy. The server must select authorized recipients. After assigning the fields, it clears additive maximum-health/nano modifiers through 100762f0(stat, 0), so those two transmitted maxima include equipment effects.

DDR TeamView 1004a620 polls existing actors for health 27/1 and nano 214/221, then passes their ratios to the native PowerBars. Missing actors explicitly produce zero bars while their rows remain. Current HP comes from actor +0x1b0, the same mirror used by delayed weapon impacts. TeamMemberInfo's ordinary stat 27 setter also overwrites that mirror; it is not an independent GUI cache.

Remote actors perform native regeneration prediction. The packet's deltas are components, not total recovery: the native loop separately adds effective BodyDevelopment divided by Rest. It also halves the health interval while sitting and masks the nano interval to an even value. The current server sends the native breed delta bases and computed, unhalved Stamina/Psychic intervals. It does not disable prediction or transmit total gains as delta components.

Independent original-source audits, DLL identities, import checks and a read-only TeamView row probe are retained under local/team-resources-research/. They reuse the original artifact identities recorded in teams. These are static source findings unless explicitly identified as browser observations below.

Delivery and combat ordering

Accepted formation sends resources after each recipient's roster, leader and side. Ready/reconnect sends the returning actor's public resources to loaded teammates after its equipment replay. The returning client receives its peers' initial snapshots before it can receive their subsequent combat updates. Repeated ready messages do not replay either snapshot sequence.

Subsequent updates use the existing two-second regeneration cadence and current in-memory state. Only ready, loaded members of the same accepted team and playfield receive them. Loading, disconnected and departed members do not receive team resource fields. No resource replication writes to the database.

Outside combat, TeamMemberInfo corrects all eight fields. During outgoing or incoming combat, ordinary stat packets correct the seven non-HP fields and leave current HP on the native impact timeline. Each connection records the direct equipment and nano health bonuses absorbed by its last full snapshot. Later stat corrections use that observer's basis, including after departure from the team: the native actor retains its folded maxima until it is replaced. Equipment changes between snapshots can otherwise double or lose bonuses. Actor spawn and removal reset this basis. Skill training and equipment-derived foundation changes use the same accounting. Ordinary hit, death, resurrection and quiet health packets retain their established paths.

Player inspection also folds the health bonus into the remote actor's raw maximum through InfoPacket. It updates the health part of this basis without changing the separately absorbed nano bonus.

The original server's resource publication frequency and remote prediction phase were not recovered. Two seconds is the current server's existing cadence, not an asserted historical constant. Remote actors do not necessarily hold all of the owning player's private skills, so exact intermediate prediction parity still needs original producer/capture evidence. Authoritative snapshots correct the displayed resources; this does not establish every historical timing rule.

Ordinary maximum-health nanos use the same observer accounting. Their Modify1 contribution stays separate in normal spawn/replay foundations, and is included in the absorbed total after a complete snapshot.

Verification

Go regressions cover initial wire order/values, current and equipped maxima, two-second scheduling without duplicate publication, incoming/outgoing combat without absolute HP, initial ready during a peer's fight, returning-member replay, death, departure and loading/offline/other-playfield/unrelated recipients. Equipped cases use a durably worn Dust Collector and check combat both before and after a full snapshot. Further regressions cover skill training while teamed and after leaving, changing to a Pioneer Backpack with ability trickle, durable item identities/placements, and replacing an actor on reconnect.

Before implementation, two WASM clients reproduced the missing replication: Visitor22's own nano maximum was 511 while its teammate used 10 and retained stale current nano. The captured native caches and PowerBar fractions are in local/team-resources-research/red-peer.json and red-leader.json.

The complete Go server suite passed in 277 seconds. Team, regeneration, skill-training and backpack regressions passed twice under the race detector in 163 seconds. No client or adapter change was needed for resource delivery.

Two WASM clients rendered through the GPU verified control-panel resource edits, changed maxima, sitting regeneration, combat, shop zoning/return and a qualified resource backpack. Across two 18-sample fights, both actors' HP mirrors followed the same damage sequence; equipped maximum HP stayed 2836. TeamView's scheduled GUI cache briefly lagged at two samples, then converged. The owning row also retained the preceding maximum in the immediate training capture while the actor and later peer capture already held the new value. These observations distinguish native polling from authoritative resource state.

Native skill training verified successive HP maxima 1201, 1207, 1213 and 1219: initially equipped, trained while teamed, trained after departure, and trained again after reconnect. The former observer retained its absorbed bonus after departure, then rebuilt the normal equipment modifier on actor replacement. local/team-resources-research/verification.json checks 21 native snapshots, both combat sequences, native packet coverage and conservation of all 192 original item records and placements. Temporary items were deleted through the native inventory, the team dissolved and both edited profiles restored. All owned browser contexts were closed without page/adapter errors. The single shared LAN preview remains available on HTTPS 8443.

The equipped fixture also isolates armor effectiveness: assigning a Dust Collector below its requirements leaves native HP and AC bonuses at zero; nano retains its bonus. This occurs in a fresh solo client too, and qualifying the wearer restores HP/AC. The paired equipped-fresh-solo.json and qualified-solo.json captures preserve that discriminator. Armor/backpack overequipping now applies the recovered penalties on the server. Raw authored bonuses remain the basis for remote OnWear and observer absorption accounting, while the owning actor's foundation excludes its effective bonus.