feat(vfx): decode retail hooks and typed tables

Replace the incomplete package path with one DatCollection-backed compatibility seam for PhysicsScripts and Animations. Preserve CreateBlockingParticle's inherited payload and following cursor, route every production and audit consumer through the corrected loaders, and apply retail's post-UnPack StartTime ordering.

Add exact stored-order PhysicsScriptTable upper-threshold resolution, high-byte DID and embedded-ID validation, plus live effect profiles with Setup-to-PhysicsDesc precedence across top-level and attached entity lifetimes. Keep blocking execution deferred and narrow TS-11 accordingly.

Pin synthetic malformed/cursor/order fixtures, installed-DAT blocking and recall audits, high-index IDs, IEEE boundaries, profile teardown, and ordinary decoder parity; synchronize architecture, inventory, milestones, roadmap, research, and memory.

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
Erik 2026-07-14 08:17:44 +02:00
parent 8dd996053d
commit 363e046112
31 changed files with 1102 additions and 73 deletions

View file

@ -1,6 +1,7 @@
using DatReaderWriter;
using DatReaderWriter.DBObjs;
using DatReaderWriter.Types;
using AcDream.Core.Physics;
namespace AcDream.Core.Meshing;
@ -42,7 +43,11 @@ public static class MotionResolver
/// to <c>Setup.PlacementFrames</c>.
/// </summary>
/// <param name="setup">The entity's base Setup dat.</param>
/// <param name="dats">Dat collection used to load the linked MotionTable + Animation.</param>
/// <param name="dats">Dat collection used to load the linked MotionTable.</param>
/// <param name="animationLoader">
/// Central animation loader. Production uses the retail compatibility
/// reader so blocking-particle hooks retain their inherited payload.
/// </param>
/// <param name="motionTableIdOverride">
/// Optional override for the motion table id. Defaults to
/// <c>Setup.DefaultMotionTable</c>. The server's CreateObject can
@ -71,11 +76,14 @@ public static class MotionResolver
public static IdleCycle? GetIdleCycle(
Setup setup,
DatCollection dats,
IAnimationLoader animationLoader,
uint? motionTableIdOverride = null,
ushort? stanceOverride = null,
ushort? commandOverride = null)
{
var resolved = ResolveIdleCycleInternal(setup, dats, motionTableIdOverride, stanceOverride, commandOverride);
var resolved = ResolveIdleCycleInternal(
setup, dats, animationLoader,
motionTableIdOverride, stanceOverride, commandOverride);
if (resolved is null) return null;
var (anim, ad) = resolved.Value;
@ -116,11 +124,14 @@ public static class MotionResolver
public static AnimationFrame? GetIdleFrame(
Setup setup,
DatCollection dats,
IAnimationLoader animationLoader,
uint? motionTableIdOverride = null,
ushort? stanceOverride = null,
ushort? commandOverride = null)
{
var resolved = ResolveIdleCycleInternal(setup, dats, motionTableIdOverride, stanceOverride, commandOverride);
var resolved = ResolveIdleCycleInternal(
setup, dats, animationLoader,
motionTableIdOverride, stanceOverride, commandOverride);
if (resolved is null) return null;
var (animation, animData) = resolved.Value;
int frameIdx = animData.LowFrame;
@ -138,12 +149,14 @@ public static class MotionResolver
private static (Animation, AnimData)? ResolveIdleCycleInternal(
Setup setup,
DatCollection dats,
IAnimationLoader animationLoader,
uint? motionTableIdOverride,
ushort? stanceOverride,
ushort? commandOverride)
{
ArgumentNullException.ThrowIfNull(setup);
ArgumentNullException.ThrowIfNull(dats);
ArgumentNullException.ThrowIfNull(animationLoader);
uint mtableId = motionTableIdOverride ?? (uint)setup.DefaultMotionTable;
if (mtableId == 0) return null;
@ -238,7 +251,7 @@ public static class MotionResolver
uint animId = (uint)animData.AnimId;
if (animId == 0) return null;
var animation = dats.Get<Animation>(animId);
var animation = animationLoader.LoadAnimation(animId);
if (animation is null) return null;
if (animation.PartFrames.Count == 0) return null;