Commit Graph

2963 Commits

Author SHA1 Message Date
Aaron Kimbrell
4db019de91 doc: README: waypoint actions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 05:17:35 -06:00
Aaron Kimbrell
f5a4dfab9a test(movement): movement AI and pathfinding serialize nothing
The client's movement AI and pathfinding control components read no
replica data; NPC movement reaches it through the physics component.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 05:17:19 -06:00
Aaron Kimbrell
cc7a1b3640 feat(ai): shared Lua AI runs its waypoint actions
Objects on the Lua AI (unless Set.SuspendLuaMovementAI) get the
waypoint's actions in Arrived, in order with empty values nil, run them
in the WayPointEvent state and send ContinueWaypoints themselves; the
movement AI only waits for it. The actions the Lua hands on run through
the movement AI's handlers. isLastPoint is the path's last waypoint on
every path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 05:15:04 -06:00
Aaron Kimbrell
2473d3dccd feat(movement): waypoint actions run like the client's movement AI
A waypoint with any actions holds the object there until ContinueWaypoints;
one without never does. The actions run in order until one pauses (bounce,
stop, delay, emote, femote or an unknown name), the wait counts down, the
rest run, and then ContinueWaypoints sends it on (not at the end of a once
path). Any new GoTo, Stop or path ends the wait, so a later
ContinueWaypoints does nothing.

Handlers added or brought in line: bounce (two waypoints on, arc there,
5 s), stop (StopMoving), groupemote, emote/femote (wait for the animation,
PlayEmote of the number), teleport, pathspeed (below 0 is 0, 0 stands it),
removeNPC (KillOBJS proximity, 1 s), DeleteSelf/removeself (1 s), killself
(silent), spawnOBJ (pathset/SpawnedVar, then silent death), playSound.
Names match exactly, values are read like _wtoi/_wtof, lists split on ,;:

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 05:15:04 -06:00
Aaron Kimbrell
7256db7efa doc: README: shared Lua AI waypoints, Follow and custom state
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 23:54:19 -06:00
Aaron Kimbrell
09d686e98d feat(ai): shared Lua AI keeps facing its FaceTarget
FaceTarget with keepFacingTarget turned once. The binding now keeps
turning to the target each frame while it is more than 5 degrees off,
until the next GoTo, FollowTarget or StopPathing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 23:54:10 -06:00
Aaron Kimbrell
c96d645b94 feat(ai): shared Lua AI custom state
Port o_Main's customState: a script that defines
onTemplateCustomStateEnter or onTemplateCustomStateArrived gets the
state, and its enter and arrived hooks run as LuaAIScript virtuals.
Pets and helpers stay unported: no original script turns them on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 23:50:19 -06:00
Aaron Kimbrell
9df7deb468 feat(ai): shared Lua AI Follow state and name override
Port o_Movement's Follow state (Set.FollowActive): the Followers
proximity, the faction 7 line and its PointInLine / Imfollowing vars,
the flip emote and the follow at radius 3, speed 3. loadOnce now applies
Set.OverRideName; the binding only logs SetName, which DLU does not send
yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 23:46:28 -06:00
Aaron Kimbrell
06e9778076 feat(ai): shared Lua AI waypoint paths and template timers
Port o_WayPointEvents and the waypoint parts of o_mis, o_StateCreate and
o_onEvent: Set.WayPointSet / attached_path / groupID, the WayPointEvent
state and its actions, SavedWP and the last point detaching the path, the
startpath fire event and SetStoreTimmer / CancelTemplateTimers. The
binding reports MovementAIComponent waypoints as arrivals without
actions, since the movement AI already runs the waypoint commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 23:42:38 -06:00
Aaron Kimbrell
81795a0420 doc: README: shared Lua AI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:51:03 -06:00
Aaron Kimbrell
154f53004f test(ai): shared Lua AI transitions, radii, tether and wander timing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:50:50 -06:00
Aaron Kimbrell
cf940f13f9 feat(scripts): Medusa and snake parts run the shared Lua AI
The Medusa (LOT 6602) wanders 25 round its spawn, aggroes within 15,
chases to 8 at double speed, casts its skill every cooldown and tethers
home at 50; the parts are Passive guards. Their Set tables replace the
values put on the combat and movement AI before, which they have no rows
for. The parts' onTimerDone and onDie replace the shared ones as in the
original.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:50:50 -06:00
Aaron Kimbrell
8a7768ae37 feat(ai): LuaAIScript runs the shared Lua AI on an entity
A script base whose original requires the shared Lua AI: StartLuaAI from
OnStartup with the Set table; proximity, hits, timers, deaths and
notifications go to the machine, arrivals come from the movement AI
finishing a GoTo or follow, and the tether is checked every frame. Moves,
skills, immunity and health go through the movement AI, skill and
destroyable components.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:50:36 -06:00
Aaron Kimbrell
5334953fe6 feat(ai): shared Lua AI state machine ported from the original scripts
The State/o_StateCreate/o_Main/o_mis/o_onEvent/o_Movement AI that the
original server scripts run with loadOnce, getVarables, CreateStates and
oStart: Idle, Meander, aggro, tether, GoHome, combat, AiDisable, AiEnable
and Dead, fed by the scripts' Set table and driven through a Host
interface so it runs without an entity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:50:36 -06:00
Aaron Kimbrell
549e8821dd doc: README: Medusa port
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:23:08 -06:00
Aaron Kimbrell
34cdb67439 test(scripts): Medusa notify chain, part spawns, follow and AI settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:22:51 -06:00
Aaron Kimbrell
a75623b41d feat(scripts): Medusa and its five snake parts ported from the original
L_WILD_MEDUSA.lua (LOT 6602) loads the snake parts 6564-6568 at +-5
around it; each part (L_WILD_snake_01..05.lua) joins the group, follows
the part before it (radius 4.5, speed 1, keepFollowing) and on its
death tells the group, turning the next part to faction 4 with its
effect. Part 5 starts hostile and glows red; the chain ends with the
Medusa. The Set tables are put on the combat and movement AI the way
the Lua AI uses them. OverrideFriction is a client-side message only,
so it is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:22:51 -06:00
Aaron Kimbrell
cdd5b6b94f feat(ai): FollowTarget with radius, speed and keepFollowing; AI value setters
MovementAIComponent::FollowTarget(target, radius, speed, keepFollowing)
halts within the radius and walks after the target again once it is
out of it; without keepFollowing the follow ends on arrival. The old
overload is FollowTarget(target, 0, 1, true) and behaves as before.

Setters for the wander settings (radius, speed, chance, delay range)
and the combat ones (hard tether radius, attack radius, pursuit speed)
that the Lua AI's Set table overrides.

BaseCombatAIComponent's proximity entities start as null, so one
whose constructor returns before making them no longer frees garbage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 22:22:51 -06:00
Aaron Kimbrell
2be8488f2b doc: README: shooting gallery re-port
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:54:52 -06:00
Aaron Kimbrell
9914deb9ce test(scripts): shooting gallery scoring, streaks, waves and timers
Streak bonus and marks, the reward model percent, wave scores and the
summary string, the original's random path quirks, spawn times, GF's
data, activity timer names with '_' and restarts, the wave timers
(EndWave<n> to SpawnWave<n + 1>, the last wave to GameOver), misses and
super charged shots, and the super charge pausing between waves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:54:26 -06:00
Aaron Kimbrell
270593b6b5 refactor(scripts): SG_TARGET into the shared shooting gallery folder
The target script is the original's ai/ACT one, which every gallery's
cannon gives its targets; no change in what it does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:54:26 -06:00
Aaron Kimbrell
8d059ab1c8 feat(scripts): shooting gallery cannon and zone re-ported from the original
SG_CANNON.lua and L_GF_SG.lua line for line, as a shared cannon and
zone script (ShootingGallery folder) that a gallery fills with its
constants and targets; GF's (SGCannon, ZoneSGServer) is now that data.
The cannon gets the zone control's ActivityStateChangeRequest,
MessageBoxRespond and ObjectLoaded from the zone script, as the
original asked to be told of them.

As the original: waves end through their own EndWave<n> timer and the
last one through GameOver; targets spawn 1 s or more after their timer
starts; scores are counted at the shot's end and can go below 0; the
super charge is the shot of its cannon ball; one activity reward roll,
rated by the score; the wave, fire and preload animations and effects;
GF's spawn table as the original's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:54:26 -06:00
Aaron Kimbrell
145fbced64 feat(scripts): shared shooting gallery types and arithmetic
A common ShootingGallery folder for the gallery scripts: the zone's
constants, the cannon's spawn table and spawn data as the original
script lays them out, and its arithmetic (streak bonus and marks, reward
model percent, wave scores, random path, spawn times, the summary
string) apart from its messages, so other galleries can reuse it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:54:26 -06:00
Aaron Kimbrell
904c761cb1 feat(messages): PreloadAnimation
Server to client: load an animation ahead of playing it, as the
client reads it (animation name, handled, the object told when it is
loaded, name / value text). The shooting gallery preloads its wave
animation with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:54:26 -06:00
Aaron Kimbrell
6f014d0972 fix(skills): shot_done names the projectile LOT, not the skill
The shooting gallery script compares shot_done with its super charge
cannon ball's LOT (6297 for GF; skill 249 launches it, skill 228 the
normal ball 1822). Also give the count of projectiles still in the air,
the script's cannonball group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:25:24 -06:00
Aaron Kimbrell
c1b9e1aec9 fix(activity): timer names with '_' and restarting a running timer
ActivityManager split the timer name on '_', so a name such as the
shooting gallery's Super_Charge_Timer never reached the script. Strip
the prefix instead. Starting a timer under a running name now starts it
over (ActivityTimerSet) instead of running two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 21:25:15 -06:00
Aaron Kimbrell
d0a8f6f950 doc: README: moving platforms round 7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:56:15 -06:00
Aaron Kimbrell
b16f2daff0 Merge exp/platforms-7: platform riders, 1/15 s platform steps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:56:15 -06:00
Aaron Kimbrell
a39b410b56 feat(moving platform): move in live's fixed 1/15 s physics steps
The live captures show platform movement in whole 1/15 s steps in every
zone (departure drift past a waypoint is always a whole number of them,
exact to 0.1 ms on about 260 departures), whatever the server loop ran
at, while the waypoint waits count the loop's time. Platforms now move
their object by the whole steps that fall in a frame; timers keep the
frame's time. The world server's frame rate is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:55:23 -06:00
Aaron Kimbrell
15c61676d6 feat(physics): riders keep their place on moving platforms
The client sends the object it stands on in its position updates (local
space: the offset from that object's position and velocity, not turned
with it); live's servers wrote it back in the controllable physics
serialization and the other clients place the rider on their own view of
the object. DLU read the block and dropped it, and wrote 0 for it.

- ControllablePhysicsComponent keeps the block (SetLocalSpace) and writes
  it as the client does (velocity only over float epsilon).
- While it is set, the server position is the platform's position plus
  the offset, on each update and every frame between them, so proximity,
  phantom volumes and ghosting follow the platform.
- A move by anything else (a teleport) takes the rider off; a platform
  the server does not have keeps the client's world position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:55:23 -06:00
Aaron Kimbrell
b8e383d953 doc: README: shooting gallery target leftovers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:10:30 -06:00
Aaron Kimbrell
4da0b5a220 Merge exp/sg-leftovers: SG_TARGET time score, PlayAim, ChangeSpeed timer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:10:22 -06:00
Aaron Kimbrell
b5ead35a79 test: waypoint actions through a whole zone file; include order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 20:10:09 -06:00
Aaron Kimbrell
ce4f557c81 feat(scripts): SG_TARGET time score write, PlayAim and ChangeSpeed timer
Ports the parts of SG_TARGET.lua shipped data never reaches: the
SetActivityUserData typeIndex 5 write, the PlayAim waypoint action and the
ChangeSpeed timer branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 19:09:53 -06:00
Aaron Kimbrell
22e115414f feat(activity): GetActivityUser, the first player with activity data
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 19:09:53 -06:00
Aaron Kimbrell
7a6a1124f3 feat(zone): waypoints keep every name / value pair as the file has it
The Arrived message's actions are the waypoint's raw pairs in order; DLU
dropped the ones that are no waypoint command (PlayAim).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 19:09:53 -06:00
Aaron Kimbrell
ce38147563 doc: README: custom server script wins over the row's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
75273591ee Merge exp/script-precedence: custom server script wins as the client's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
1d2490a226 doc: README: moving platforms round 6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
35fc5b16b2 test(scripts): which server script an object runs
Custom script over a ported row script, over the empty script and with
no row script; empty custom script keeps the row's; an unported custom
script still wins (no script); once-per-LOT reporting; IsPorted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
3ea1a93986 Merge exp/platforms-6: moving platforms round 6
Mover turns with a stopped rotator, Departed script hook, arrivals at
waypoints in one place as the client, GF shooting gallery target script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
6e02fafbc6 feat(scripts): custom server script always wins over the row's
As the client picks its script component's script: a non-empty
custom_script_server in the level config always replaces the
ScriptComponent row's script_name, not only a missing one or
scripts\empty.lua. An empty or missing custom script keeps the row's.

An object whose custom script has no C++ port now runs no script even
when its row script was ported; that is logged once per LOT at debug
level ("custom server script ... (not ported) replaces its row script").
No level object or spawner in the shipped zones has both a row script
and a different custom server script, so nothing there changes.

CppScripts::IsPorted: a name in the loader map or the excluded list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
5a863659ee feat(scripts): GF shooting gallery target script (SG_TARGET)
The cannon gives its targets scripts/ai/ACT/SG_TARGET.lua as their
custom_script_server, but their own script row is the empty script, which
won. A custom server script now replaces the empty script too, and the
target script is ported:

- explode factor 2.5 at startup;
- its score is its spawn data's (the cannon scores a hit with it);
- at the last waypoint of its path it tells the cannon (FinishedPath, the
  cannon spawns the next one, as after a hit) and, when its spawn data
  says so, dies silently 1 s later (2 s on a moving platform), which is
  no hit;
- at the other waypoints it may change speed (spawn data chance, whole
  numbers between its least and most speed; only an object following
  waypoints takes it).

The cannon's own end-of-path handling is gone; it now answers the
target's FinishedPath. The waypoint PlayAim action is not ported: no
path in the game has one. The spawn data has no time score.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
b63f65ee5d feat(moving platform): mover turns with a stopped rotator, Departed, arrivals in one place
Three changes to the platform logic, each as the client's platform does it:

- Mover and rotator on one object: the object now turns at an angular
  velocity. A mover setting off (or going on between waypoints of
  different speeds) puts the object in the rotation for where it is and
  gives it the angular velocity that brings it to the next waypoint's
  rotation as it gets there. A rotator that has not stopped puts its own
  angular velocity back every frame, so the mover only turns the object
  while the rotator is stopped. Objects without a rotator still turn
  between the two waypoints' rotations as before.
- Departed: a new script hook, OnDeparted, called when a platform leaves
  a waypoint it waited at, before it sets off.
- Two waypoints in one place: a platform that has not stopped looks for
  its arrival every frame, also while it waits, and with no special case
  for a next waypoint in the same place. It is there at once, and on a
  path that keeps it at one waypoint it arrives every frame (without
  resending an unchanged state).

ScriptComponent::SetScript can now take a script itself (used by the
tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:49:46 -06:00
Aaron Kimbrell
53dfa66cf7 doc: README: 3D views turn model parts as the game does
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 21:03:06 -06:00
Aaron Kimbrell
1fd13234fa Merge exp/nif-rotations: node rotations are read row by row, scenery models converted again
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 21:03:06 -06:00
Aaron Kimbrell
d5a962a1d4 fix(dashboard): convert scenery models again now node rotations are read row by row
Converted models are kept on disk and in browsers by conversion format, so without a new format the 3D views would keep drawing the old conversions with turned nodes the wrong way round. Format 7.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 16:41:39 -06:00
Aaron Kimbrell
1c5d2e49c4 fix(nif): read node rotations row by row, as the client does
Gamebryo stores a node's rotation in the order it keeps it in memory, row by row for column vectors, and the client reads the nine floats as they are. Reading them column by column turned every rotated node the wrong way: parts of Nimbus Station's buildings stood in the wrong places and the minifig skeleton stood on its head.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 16:41:39 -06:00
Aaron Kimbrell
8ce02a7b65 doc: README: moving platforms round 5
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 16:35:41 -06:00
Aaron Kimbrell
b8ca082054 Merge exp/platforms-5: simple movers and rotators run as platforms, resync answers, pathless movers
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 16:35:27 -06:00