Commit Graph

214 Commits

Author SHA1 Message Date
Aaron Kimbrell
5f77dca7e7 feat(entity): the client's vehicle physics component (46)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 09:01:25 -05:00
Aaron Kimbrell
589a91a1f0 feat(entity): the client's projectile physics component (18)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 09:01:25 -05:00
Aaron Kimbrell
029e601e07 refactor(component): the destroyable loads itself in the client's phases
The DestructibleComponent row moves from Entity::Initialize into
LoadDataFromTemplate and the level keys into LoadConfigData; a character's
save loads after both. Like the client (LWODestroyableComponent::LoadConfigData
reads them for every destroyable), the destroyables added for models and
quickbuilds now also read set_faction, is_smashable and the level loot matrix;
their live defaults become their template. Nothing changes for objects without
those keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 08:52:10 -05:00
Aaron Kimbrell
7a0dba22a5 refactor(component): use is a RequestUse message handler
Components no longer have a virtual OnUse; each component that reacts to a
use registers a RequestUse handler, like the client's components. The entity
runs the INTERACT trigger and the script, then delivers a RequestUseEvent
(carrying the user) to the handlers. The mission choice of a multi-interact
use goes only to the mission offer, as before. Switches keep a direct
EnterIfResponding for touches and pets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:55:55 -05:00
Aaron Kimbrell
50bfa623ca refactor(component): the client's component lifecycle
Components get the client's per-component functions: LoadDataFromTemplate,
PrepareConfigData, LoadConfigData, LoadFromSaveData, Startup, Run,
OnEnterScope, OnLeaveScope, Preshutdown and Shutdown, called by the entity in
the client's order. Update is renamed Run, LoadFromXml LoadFromSaveData and
UpdateXml WriteSaveData. Nothing sent changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:45:16 -05:00
Aaron Kimbrell
e8406cc829 feat(entity): the client's property plaque component (113)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:23:03 -05:00
Aaron Kimbrell
0cdf3afe3d feat(entity): the client's roller component (105)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:21:13 -05:00
Aaron Kimbrell
e585a035e0 feat(entity): the client's gate rush component (103)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:19:31 -05:00
Aaron Kimbrell
d1a778a140 feat(entity): the client's faction trigger component (72)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:17:47 -05:00
Aaron Kimbrell
a6381be720 feat(entity): the client's rocket landing component (68)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:15:54 -05:00
Aaron Kimbrell
8c5e7ee0e1 feat(entity): the client's generic activator component (64)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:14:12 -05:00
Aaron Kimbrell
a286bea854 feat(entity): the client's showcase model handler component (62)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:12:31 -05:00
Aaron Kimbrell
4dba9c2aeb feat(entity): the client's custom build assembly component (59)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:10:50 -05:00
Aaron Kimbrell
6628aa2d45 feat(entity): the client's package component (53)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:09:10 -05:00
Aaron Kimbrell
464dd759fa feat(entity): the client's choice build component (52)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:06:54 -05:00
Aaron Kimbrell
bd6e419290 feat(entity): the client's changeling component (51)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:05:18 -05:00
Aaron Kimbrell
912f5998ae feat(entity): the client's spring pad component (41)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:03:00 -05:00
Aaron Kimbrell
b4c25a2512 feat(entity): the client's model builder component (38)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 07:01:24 -05:00
Aaron Kimbrell
6d185b6e2f feat(entity): the client's arcade component (29)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:59:38 -05:00
Aaron Kimbrell
0e37994d6c feat(entity): the client's module (a car or rocket part) component (28)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:57:54 -05:00
Aaron Kimbrell
62c770aa56 feat(entity): the client's blueprint component (24)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:56:19 -05:00
Aaron Kimbrell
e2b2c4c48d feat(entity): the client's chest component (22)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:54:42 -05:00
Aaron Kimbrell
939e30e6a8 feat(entity): the client's rebuild activator component (14)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:53:03 -05:00
Aaron Kimbrell
d4cd459747 feat(entity): the client's build controller component (13)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:51:13 -05:00
Aaron Kimbrell
60aaa9ec3f feat(entity): the client's modular build (rocket and car building) component (12)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:49:28 -05:00
Aaron Kimbrell
b9ad46a52e feat(entity): the client's platform boundary component (27)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:46:20 -05:00
Aaron Kimbrell
a9c4a2fe26 feat(entity): the client's culling plane component (116)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:43:53 -05:00
Aaron Kimbrell
e37f919700 feat(entity): the client's 3D ambient sound component (56)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:41:32 -05:00
Aaron Kimbrell
ba748d17d2 feat(entity): the client's 2D ambient sound component (55)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:39:41 -05:00
Aaron Kimbrell
b971d91a25 feat(entity): the client's sound repeater component (54)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:38:00 -05:00
Aaron Kimbrell
ee86102e97 feat(entity): NPC minifigures have the client's minifig component
The client makes LWOMiniFigComponent (35) from the registry; DLU had nothing for it. It sends nothing (the client reads the MinifigComponent row itself), so constructions are unchanged; 488 LOTs gain it (LoaderSnapshotTest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:35:45 -05:00
Aaron Kimbrell
822aba4194 fix(entity): a model's destroyable has armor 1, as live sent it
Live constructions of models on a Raven Bluff property (LOT 14, LOT 8069) carry the destroyable with health 1 / 1.0, armor 1 / 0, faction -1, smashable; DLU's had armor 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:33:25 -05:00
Aaron Kimbrell
3bd299d682 fix(entity): a quick build without a destroyable gets one, as the client makes it
DoObjectComponentLoad adds a destroyable (componentID -1) to a quick build that has none and marks it smashable. DLU's quick build wrote three empty flags instead. The construction's destroyable now matches live field for field (AG LOT 7804: health 1 / 1.0, armor 1 / 0, faction -1, smashable). 117 LOTs gain it; nothing else changes (LoaderSnapshotTest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:31:19 -05:00
Aaron Kimbrell
cc337a298d fix(entity): models get their item component, as the client makes it
The client makes the registry's item component for models too (only a pet takes it away); DLU skipped it and the model component wrote the item block itself, for the 30 model LOTs without an item row as well, and with the object id as ug_id. Live (Raven Bluff property capture): the item block carries the userModelID for brick built models (LOT 14) and 0 for reward models (LOT 8069). 1,455 LOTs gain the item component; nothing else changes (LoaderSnapshotTest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:27:36 -05:00
Aaron Kimbrell
b2192e158c refactor(entity): components are made in the client's load order
Entity::Initialize walks ComponentOrderVector::Initialize's list (0x0101f8e0) as ObjectLoader2::DoObjectComponentLoad does; ids a component needs from a later one come from the registry; the trigger is added after the walk. All 15,962 LOTs get the same components as before (LoaderSnapshotTest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:17:06 -05:00
Aaron Kimbrell
c11fd81154 fix(entity): a proximity monitor row with one radius no longer crashes the world (LOT 9833)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:13:18 -05:00
Aaron Kimbrell
c6f6aa5d2b fix(scripts): AG elevator, bus door and property platform drive their movers as their live scripts did
StopPathing, StartPathing and GoToWaypoint instead of hand-made resyncs; a built platform starts before the scripts hear of it so a script can stop it; the FV tree platform's resync hack is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 23:36:00 -05:00
Aaron Kimbrell
72efae54eb feat(moving platform): simple movers and rotaters, chosen as the client chooses
The subcomponent comes from the platformIsMover, platformIsSimpleMover and
platformIsRotater settings; with none set, a platform without a registry
component is a mover and one with a registry component a simple mover (also
when it has an attached path, so the registry ID is passed then too). All
flags set false means no subcomponent.

A simple mover reads its MovingPlatforms row and the platformMove* settings,
is always constructed with its starting point and state as live did, and
travels between its start and start + platformMove in platformMoveTime.
A rotater is written as type 6 with a mover's data.

On arrival platforms fire OnWaypointReached, then OnArrivedAtDesiredWaypoint
at the waypoint they were sent to and OnPlatformAtLastWaypoint at an end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 09:59:55 -05:00
Aaron Kimbrell
898ae024f0 feat(loot): a picked up item says which object it dropped from
Live's AddItemToInventoryClientSync for a picked up drop had
_Metric_Souce_LOT_Int in its extra info on all 2,344 live pickups: the LOT
of the DropClientLoot's source object, 1 when a player was the source
(activity rewards and chests, which drop from the player). DLU sent none.

The drop remembers its source object's LOT when it is registered for the
player, and the pickup sends it. A source object already gone when it drops sends
no key. Package contents keep sending none, as live's did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 07:45:59 -05:00
Aaron Kimbrell
d4e9423264 feat(servers): time the main loops' phases and the known heavy spots
Frames and phase scopes in the world, auth, chat and UGC loops (packets per type, entities, physics, ghosting, replica, spawners, log flush, saves, web requests by route). Scopes at LoadPlayer, CreateEntity, each component's construction, InventoryComponent::LoadXml, script timers and a world's zone load; game database queries in the query helpers; CDClient statements timed through sqlite3_trace_v2 as CDClient <table> (CppSQLite3DB gets a handle accessor). Task 96.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 22:26:17 -05:00
Aaron Kimbrell
e017c11aa2 feat(combat): destroyables keep their attack priority
DestructibleComponent.attack_priority is loaded onto the DestroyableComponent as a signed value. The client's
LWODestroyableComponent (LoadDataFromTemplate, 0x00c9f900) starts it at 1 and keeps 1 when the column is empty, and
answers GetAttackPriority with it; the server now does the same so TacArcs can order their targets by it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:44:48 -05:00
Aaron Kimbrell
e74a7ea701 docs(quickbuild): why the level's activityID wins over the template's
The client reads RebuildComponent.activityID over a level's activityID
unless the level sets actIDovrd, but live followed the level's: the AM
Center draw bridge (LOT 12047) has activityID 12047 without actIDovrd and
dropped no loot in 4 of 4 live completions, where the template's activity 6
would have dropped quickbuild rewards. DLU already does what live did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 13:06:37 -05:00
Aaron Kimbrell
bdc9170754 fix(replica): write the item component's UGC info, after skill and combat AI
Live wrote the item component's UGC info on every construction of an
object with an item component (99 of 99 constructions of LOT 14535, a
possessable with item, skill and controllable physics and no Objects row:
ug_id 0, moderation status NoStatus, no description). DLU wrote a 0 bit.

The item component is read after the skill and base-combat-AI components
(ComponentOrderVector::Initialize 0x0101f8e0; live constructions of LOT 14535
have Skill then Item). DLU wrote it before the inventory, which did not show while
it was a single 0 bit next to the skill's 0 bit, but would misalign every
component after it now that it writes more. It now comes after
BASE_COMBAT_AI. The ReplicaComponentOrderTests oracle moves the item the same
way (intended change).

Test: ReplicaConstructionTest.ItemConstructionWritesEmptyUgcInfo,
ReplicaComponentOrderTest.EveryListedComponent (oracle updated).

Check in game: with a second player watching, use a possessable / mount /
vehicle item (e.g. a racing car in the race lobby); it appears, moves and
is left normally for both. Rocket launches and property models look as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 05:39:56 -05:00
Aaron Kimbrell
545db47a40 fix(destroyable): take template factions from factionList, keeping -1
The client reads an object's factions only from the DestructibleComponent
factionList (LWODestroyableComponent::LoadDataFromTemplate 0x00c9f900: one
atol per comma-separated token, -1 kept; the faction column is not read),
and live replicated that list: [-1] on 12,829 constructions (vendors,
quickbuilds, bouncers). DLU added the faction column and dropped -1,
so those objects were sent with no factions, and the four rows with faction 6
but factionList "-1" were sent as [6].

-1 has no Factions row, so it adds no friends or enemies.

Test: ReplicaConstructionTest.TemplateFactionMinusOneIsReplicated.

Check in game: vendors, quickbuilds, bouncers and NPCs still can't be
attacked; enemies still fight players and pets; smashables still smash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 05:39:56 -05:00
Aaron Kimbrell
b035f60e72 fix(replica): send each object's real age as time_since_created_on_server
Live sent the milliseconds since the object was created on the server in
every construction header (nonzero in 142,258 of 145,677 captured
constructions; the same object constructed again later carries a larger
value by the time elapsed; the local player's own construction on load is
0). DLU always wrote 0. The client stores it in the object's config
(LWOGameObject::time_since_created_on_server).

Entities now remember when they were created (steady clock) and write
their age.

Test: ReplicaConstructionTest.TimeSinceCreatedOnServerIsTheObjectsAge.

Check in game: zone in and walk around several worlds; objects, NPCs,
enemies and other players appear and animate as before (no objects
popping, stuck or misplaced animations on platforms/spinners).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 05:39:56 -05:00
Aaron Kimbrell
d7833bd4c6 fix(skills): EchoStartSkill carries the cast, not the caster's input
Live sends used_mouse false, no caster latency, no clicked position and
a zero originator rotation (present, all four components 0) in every
echo: 78,841 of 78,841 in the live captures, player and server casts
alike. DLU forwarded the casting client's values and wrote the caster's
facing for server casts. The client copies the rotation into its local
StartSkill (LWOSkillComponent::msgEchoStartSkill), which is why a real
rotation made power-up pickups jitter; the per-call override that
worked around that is no longer needed and is removed.

Check: with two players, attack, use a thrown or ranged item and pick
up power-ups; the other player sees the same animations and the
caster no longer snaps or jitters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:49:29 -05:00
Aaron Kimbrell
fd2be18161 feat(skills): save running skill cooldown groups (charxml <skil sc>)
The client reads the cooldowns still running from the charxml on load
(LWOSkillComponent::LoadFromSaveData 0x00c2a9c0): <skil sc="..."> split
on ';' and ':' (the delimiter string at 0x015b1714 is L";:") into a
cooldown group and the seconds left, each put in its cooldown map under
{hasCooldownGroup = 1, group}, the key it checks when the player casts a
skill of that group (0x00c11400). Live wrote <skil/> with nothing running
and e.g. <skil sc="17:15.6958;"/> otherwise (226 live charxmls; groups
8, 17 and 78 seen, the times below the groups' SkillBehavior cooldowns).
The claude-client-re-docs page described sc as "id;time" pairs; the
live saves and the delimiters show "group:time;".

DLU wrote no <skil>, so relogging or changing zones cleared every
cooldown (e.g. the 90 s imagination and faction skills).

- A player's successful cast (CastPlayerSkill) starts its
  SkillBehavior.cooldowngroup's cooldown (groups 0 and up, cooldown > 0),
  counted down in Update.
- Saved as live wrote it; loaded back when the player's SkillComponent
  is created, so a cooldown survives several zone changes. Old saves
  without <skil> load with none running.

Check in game: use a skill with a long cooldown (e.g. a faction kit's
special skill, a consumable with a cooldown), change zones or log out and
back in right away: its cooldown is still shown and counts down from
where it was (minus the loading time on the server).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 03:44:07 -05:00
Aaron Kimbrell
1f29e9604a feat(stats): coins, bricks and smashes counted by the server as live did
The passport totals for coins, bricks and enemies came from the client's
ModifyPlayerZoneStatistic, which live's client sent for its per-zone counts;
live's server counted the totals itself and told the client
(UpdatePlayerStatistic). Now:

- CurrencyCollected (the amount gained) right after every SetCurrency that
  raised the coins (pickups, missions, achievements, selling, activities);
  none for losses. Captures: 15,815 pickups + mission/achievement/vendor/
  activity gains, all with the stat; no loss had one.
- BricksCollected (the count) after every add to the bricks inventory the
  client is told about (captures: 999 of 1,010, pickups and relocations).
- The kill counts go to the killer right after Die, before the loot:
  EnemiesSmashed when the DestructibleComponent's isnpc is set, else
  SmashablesSmashed for a smashable (captures: 2,766 NPC kills and 538
  smashables; faction or AI don't decide it, e.g. the Banana Cluster has AI
  and counted as a smashable). Neither while racing. Before, every kill was
  a SmashablesSmashed.
- ModifyPlayerZoneStatistic from the client only updates the zone counts,
  so nothing is counted twice.

Check in game: pick up coins, sell an item, finish a mission, pick up
bricks, smash a stromling and a crate; each passport number goes up by the
right amount at once and stays the same after relogging (no double counts).
The per-zone statistics still go up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 02:42:02 -05:00
Aaron Kimbrell
54cd9abd7a feat(loot): smashables use the level's smashable_loot_matrix
A level object's smashable_loot_matrix replaces the DestructibleComponent
LootMatrixIndex when smashable_loot_matrix_set is true or absent and the
matrix is not -1, as the client resolves it
(LWODestroyableComponent::LoadConfigData 0x00c44cb0). DLU only read the
key in BaseInteractDropLootServer, so tagged smashables dropped their
template's loot. Resolution in DestroyableComponent::GetLevelLootMatrix,
with tests. No wire change.

In game: smash level smashables that carry smashable_loot_matrix_set=1
(11 level objects in the 1.10.64 levels) and ones with a matrix but no _set key; they drop the
level's loot instead of the template's. Ordinary smashables
(smashable_loot_matrix_set=0) drop what they did before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 23:34:35 -05:00
Aaron Kimbrell
721925add0 fix(factions): override_faction 0 keeps the template's factions
The client (LWODestroyableComponent::LoadConfigData 0x00c44cb0) uses a
level object's set_faction only when override_faction is absent or true;
with override_faction=0 LoadDataFromTemplate (0x00c9f900) puts the
DestructibleComponent factionList back. 2948 level objects have
override_faction=0, and DLU applied their set_faction anyway. The
resolution is now DestroyableComponent::GetLevelFactions, with tests.
No wire change.

In game: enemies and smashables placed in levels with a set_faction but
override_faction=0 (most smashables, many enemies) are targeted and
aggro as before for the common case; check a few enemies in AG/GF/FV
still fight you and friendly objects are not attacked, and that
smashables still smash and give credit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 23:34:22 -05:00