Cut 5c-1: Multi-human authoritative sim, SimSnapshot/SimEvent boundary, RustToDust.Net & RustToDust.Server

This commit is contained in:
Meta Vens 2026-12-05 08:35:07 +01:00
commit d8f5c49b8d
34 changed files with 5785 additions and 700 deletions

View file

@ -520,7 +520,7 @@ public partial class ArenaRenderer : Node3D
vis.Visual.Root.QueueFree();
}
var role = c.IsPlayer ? VehicleVisualRole.Player : VehicleVisualRole.Rival;
var role = c.Id == 0 ? VehicleVisualRole.Player : VehicleVisualRole.Rival;
var instance = VehicleVisualInstance.Create(_assetCache, c.Grid.Spec.Id, role);
instance.SyncMountedGear(c.Grid);
_actorsGroup.AddChild(instance.Root);
@ -537,15 +537,15 @@ public partial class ArenaRenderer : Node3D
vis.Visual.Root.Transform = new Transform3D(new Basis(q), pos);
float distSq = hasCam ? pos.DistanceSquaredTo(camPos) : 0f;
bool castShadows = !hasCam || c.IsPlayer || distSq <= 75f * 75f;
bool useStaticLod = hasCam && !c.IsPlayer && !vis.Visual.HasAnyStrippedCell &&
bool castShadows = !hasCam || c.Id == 0 || distSq <= 75f * 75f;
bool useStaticLod = hasCam && c.Id != 0 && !vis.Visual.HasAnyStrippedCell &&
(vis.Visual.IsStaticLod ? distSq > 64f * 64f : distSq > 68f * 68f);
vis.Visual.SetLodState(useStaticLod, castShadows);
vis.Visual.SyncMountedGear(c.Grid);
if (!useStaticLod)
{
if (!hasCam || c.IsPlayer || distSq <= 55f * 55f)
if (!hasCam || c.Id == 0 || distSq <= 55f * 55f)
{
vis.RigDtAccum = 0f;
vis.RigSkipFrames = 0;