From 77de740b635f31d8a2a1485609acefb1b5121a20 Mon Sep 17 00:00:00 2001 From: Luis Gonzalez Date: Wed, 15 Jul 2026 15:51:48 -0700 Subject: [PATCH] LANTERN purge B7: rename CharacterId -> FrameKind (frame terminology) Enum renamed in StatIds.cs (byte values unchanged - serialized definitions/saves never re-mean); all call sites + doc mentions swept (ClassTraits, PlayerAuthoring, CharacterStatsDefinition field type, menu/UI, tests). CharacterStatsDefinition SO CLASS name kept (asset-binding risk; deferred per plan). 390 green. Co-Authored-By: Claude Fable 5 --- .../Authoring/Combat/AbilityDatabaseAuthoring.cs | 2 +- .../Authoring/Combat/CharacterStatsDefinition.cs | 2 +- .../Scripts/Authoring/Player/PlayerAuthoring.cs | 2 +- .../Scripts/Client/Debug/DebugCommandSendSystem.cs | 2 +- Assets/_Project/Scripts/Client/UI/HowToPlayPanel.cs | 2 +- .../_Project/Scripts/Client/UI/MainMenuController.cs | 6 +++--- Assets/_Project/Scripts/Client/UI/WorldLauncher.cs | 4 ++-- .../Scripts/Server/Connection/GoInGameServerSystem.cs | 2 +- .../Scripts/Simulation/Combat/AbilityDatabaseBlob.cs | 2 +- .../Scripts/Simulation/Combat/ClassSelection.cs | 2 +- .../_Project/Scripts/Simulation/Combat/ClassTraits.cs | 8 ++++---- .../Scripts/Simulation/Combat/SocketComponents.cs | 2 +- Assets/_Project/Scripts/Simulation/Combat/StatIds.cs | 10 ++++++---- .../Scripts/Simulation/Connection/GoInGameRequest.cs | 2 +- .../Scripts/Simulation/Debug/DebugCommandRequest.cs | 2 +- Assets/_Project/Scripts/Simulation/Meta/MetaCatalog.cs | 2 +- .../_Project/Scripts/Simulation/Meta/MetaComponents.cs | 2 +- .../Scripts/Simulation/Persistence/SaveData.cs | 2 +- .../Scripts/Simulation/Player/CharacterStatsRef.cs | 2 +- .../Tests/EditMode/AbilityDatabaseBlobTests.cs | 4 ++-- Assets/_Project/Tests/EditMode/MetaSeedingTests.cs | 2 +- .../Tests/EditMode/StatRecomputeSystemTests.cs | 2 +- 22 files changed, 34 insertions(+), 32 deletions(-) diff --git a/Assets/_Project/Scripts/Authoring/Combat/AbilityDatabaseAuthoring.cs b/Assets/_Project/Scripts/Authoring/Combat/AbilityDatabaseAuthoring.cs index 7ec39bee0..74301edba 100644 --- a/Assets/_Project/Scripts/Authoring/Combat/AbilityDatabaseAuthoring.cs +++ b/Assets/_Project/Scripts/Authoring/Combat/AbilityDatabaseAuthoring.cs @@ -19,7 +19,7 @@ namespace ProjectM.Authoring [Tooltip("All ability definitions available in the game. Indexed at runtime by AbilityId.")] public List Abilities = new List(); - [Tooltip("All character-stats definitions. Indexed at runtime by CharacterId.")] + [Tooltip("All character-stats definitions. Indexed at runtime by FrameKind.")] public List Characters = new List(); private class DatabaseBaker : Baker diff --git a/Assets/_Project/Scripts/Authoring/Combat/CharacterStatsDefinition.cs b/Assets/_Project/Scripts/Authoring/Combat/CharacterStatsDefinition.cs index e591c13f2..40a1209d5 100644 --- a/Assets/_Project/Scripts/Authoring/Combat/CharacterStatsDefinition.cs +++ b/Assets/_Project/Scripts/Authoring/Combat/CharacterStatsDefinition.cs @@ -11,7 +11,7 @@ namespace ProjectM.Authoring [CreateAssetMenu(menuName = "Project M/Character Stats Definition", fileName = "Character_")] public class CharacterStatsDefinition : ScriptableObject { - public CharacterId Id = CharacterId.Default; + public FrameKind Id = FrameKind.Default; public string DisplayName = "Character"; [Min(0f)] public float MoveSpeed = 6f; diff --git a/Assets/_Project/Scripts/Authoring/Player/PlayerAuthoring.cs b/Assets/_Project/Scripts/Authoring/Player/PlayerAuthoring.cs index e5c079aa9..cbaaf7f10 100644 --- a/Assets/_Project/Scripts/Authoring/Player/PlayerAuthoring.cs +++ b/Assets/_Project/Scripts/Authoring/Player/PlayerAuthoring.cs @@ -43,7 +43,7 @@ namespace ProjectM.Authoring if (authoring.Character != null) DependsOn(authoring.Character); byte characterId = authoring.Character != null - ? (byte)authoring.Character.Id : (byte)CharacterId.Default; + ? (byte)authoring.Character.Id : (byte)FrameKind.Default; float maxHealth = authoring.Character != null ? authoring.Character.MaxHealth : authoring.FallbackMaxHealth; diff --git a/Assets/_Project/Scripts/Client/Debug/DebugCommandSendSystem.cs b/Assets/_Project/Scripts/Client/Debug/DebugCommandSendSystem.cs index 81c84ce1f..a1c78d432 100644 --- a/Assets/_Project/Scripts/Client/Debug/DebugCommandSendSystem.cs +++ b/Assets/_Project/Scripts/Client/Debug/DebugCommandSendSystem.cs @@ -37,7 +37,7 @@ namespace ProjectM.Client public static void Kill() => Send(DebugOp.KillPlayer); /// Set the knob to value (server-applied, x1000 fixed-point; MC-0). public static void SetTuning(byte knob, float value) => Send(DebugOp.SetTuning, knob, Mathf.RoundToInt(value * 1000f)); - /// Swap the sender's class to (a byte); server-authoritative (class-switch dev tool). + /// Swap the sender's class to (a byte); server-authoritative (class-switch dev tool). public static void SetClass(byte classId) => Send(DebugOp.SetClass, classId); public static void SetWarrior() => SetClass(ClassTraits.WarriorClass); public static void SetRanger() => SetClass(ClassTraits.RangerClass); diff --git a/Assets/_Project/Scripts/Client/UI/HowToPlayPanel.cs b/Assets/_Project/Scripts/Client/UI/HowToPlayPanel.cs index 222b9f5fa..33e29832d 100644 --- a/Assets/_Project/Scripts/Client/UI/HowToPlayPanel.cs +++ b/Assets/_Project/Scripts/Client/UI/HowToPlayPanel.cs @@ -68,7 +68,7 @@ namespace ProjectM.Client switch (idx) { case 0: // Controls (chosen class) - bool ranger = WorldLauncher.SelectedClass == (byte)CharacterId.Ranger; + bool ranger = WorldLauncher.SelectedClass == (byte)FrameKind.Ranger; Head(c, ranger ? "CLASS: Ranger (ranged anchor)" : "CLASS: Warrior (melee anchor)"); Body(c, "Move — WASD / Left Stick"); Body(c, "Aim — Mouse cursor / Right Stick"); diff --git a/Assets/_Project/Scripts/Client/UI/MainMenuController.cs b/Assets/_Project/Scripts/Client/UI/MainMenuController.cs index d5b34ecb0..0870df5d4 100644 --- a/Assets/_Project/Scripts/Client/UI/MainMenuController.cs +++ b/Assets/_Project/Scripts/Client/UI/MainMenuController.cs @@ -99,8 +99,8 @@ namespace ProjectM.Client var classRow = new VisualElement(); classRow.style.flexDirection = FlexDirection.Row; classRow.style.justifyContent = Justify.Center; - classRow.Add(MenuUi.Button("Warrior", () => SelectClass((byte)CharacterId.Warrior))); - classRow.Add(MenuUi.Button("Ranger", () => SelectClass((byte)CharacterId.Ranger))); + classRow.Add(MenuUi.Button("Warrior", () => SelectClass((byte)FrameKind.Warrior))); + classRow.Add(MenuUi.Button("Ranger", () => SelectClass((byte)FrameKind.Ranger))); card.Add(classRow); card.Add(MenuUi.Button("Single Player", () => Launch(SessionMode.Single, false))); @@ -149,7 +149,7 @@ namespace ProjectM.Client if (_classLabel != null) _classLabel.text = ClassName(classId); } - static string ClassName(byte classId) => classId == (byte)CharacterId.Ranger ? "CLASS: Ranger (ranged)" : "CLASS: Warrior (melee)"; + static string ClassName(byte classId) => classId == (byte)FrameKind.Ranger ? "CLASS: Ranger (ranged)" : "CLASS: Warrior (melee)"; void ShowSettings() { diff --git a/Assets/_Project/Scripts/Client/UI/WorldLauncher.cs b/Assets/_Project/Scripts/Client/UI/WorldLauncher.cs index 8703867b5..0d3cf8013 100644 --- a/Assets/_Project/Scripts/Client/UI/WorldLauncher.cs +++ b/Assets/_Project/Scripts/Client/UI/WorldLauncher.cs @@ -28,8 +28,8 @@ namespace ProjectM.Client public static bool Busy { get; private set; } - /// Slice 2: the class chosen in the menu (a CharacterId byte), seeded into the client world at session start. - public static byte SelectedClass = (byte)CharacterId.Warrior; + /// Slice 2: the frame chosen in the menu (a FrameKind byte), seeded into the client world at session start. + public static byte SelectedClass = (byte)FrameKind.Warrior; /// The mode of the most recently started session — the HUD's outcome banner branches on it /// (single: PLAY AGAIN restarts; co-op: the honest exit is a clean teardown for everyone). diff --git a/Assets/_Project/Scripts/Server/Connection/GoInGameServerSystem.cs b/Assets/_Project/Scripts/Server/Connection/GoInGameServerSystem.cs index 79c159318..2bdcfaa70 100644 --- a/Assets/_Project/Scripts/Server/Connection/GoInGameServerSystem.cs +++ b/Assets/_Project/Scripts/Server/Connection/GoInGameServerSystem.cs @@ -101,7 +101,7 @@ namespace ProjectM.Server // meta-band StatModifiers on the just-instantiated player (same ECB as Instantiate, the // ClassTraits idiom). Skip tier 0 / unknown ids (preserve-don't-crash); CLAMP a saved tier above a // rebalanced MaxTier (D-F5). Class gate via BoonMath.MaskFor (ClassId is the normalized - // CharacterId 2/3 — a raw 1<One authored character-stats definition, baked immutable into the AbilityDatabase blob. public struct CharacterStatsBlob { - public byte Id; // CharacterId + public byte Id; // FrameKind public float MoveSpeed; public float TurnRateRadiansPerSec; public float MaxHealth; diff --git a/Assets/_Project/Scripts/Simulation/Combat/ClassSelection.cs b/Assets/_Project/Scripts/Simulation/Combat/ClassSelection.cs index 0ba544e84..9970aa5c1 100644 --- a/Assets/_Project/Scripts/Simulation/Combat/ClassSelection.cs +++ b/Assets/_Project/Scripts/Simulation/Combat/ClassSelection.cs @@ -3,7 +3,7 @@ using Unity.Entities; namespace ProjectM.Simulation { /// - /// Slice 2: the local player's chosen class (a byte), staged in the CLIENT world as a + /// Slice 2: the local player's chosen class (a byte), staged in the CLIENT world as a /// singleton by the menu / WorldLauncher before going in-game. picks it up /// (GoInGameClientSystem) so the server seeds the right class at spawn. NOT replicated — it is client-local /// intent; the class travels to the server via the RPC, then back to all clients via the seeded StatModifiers + diff --git a/Assets/_Project/Scripts/Simulation/Combat/ClassTraits.cs b/Assets/_Project/Scripts/Simulation/Combat/ClassTraits.cs index 0682be8c9..0f3e51224 100644 --- a/Assets/_Project/Scripts/Simulation/Combat/ClassTraits.cs +++ b/Assets/_Project/Scripts/Simulation/Combat/ClassTraits.cs @@ -4,12 +4,12 @@ using Unity.Entities; namespace ProjectM.Simulation { /// - /// Slice 2 — pure mapping from a chosen class (a byte) to its spawn-time setup: the + /// Slice 2 — pure mapping from a chosen frame (a byte) to its spawn-time setup: the /// Fire-slot ability id + the permanent trait s (tagged with the reserved /// range, NEVER stripped by the generic modifier systems). Applied by /// GoInGameServerSystem on the just-spawned player and unit-tested. Burst-safe (byte/uint only, no managed types). /// - /// Trait deltas seed onto the character (no per-class blob row needed — the + /// Trait deltas seed onto the character (no per-class blob row needed — the /// deltas ride the replicated StatModifier buffer, OwnerSendType.All, so the owning client folds the correct /// EffectiveCharacterStats). The DRG-asymmetry (operator-locked): Warrior = melee bruiser (tankier, /// slower, harder + longer-reach melee via MeleeDamage/MeleeRange); Ranger = ranged anchor (faster, @@ -26,8 +26,8 @@ namespace ProjectM.Simulation /// public static class ClassTraits { - public const byte WarriorClass = (byte)CharacterId.Warrior; - public const byte RangerClass = (byte)CharacterId.Ranger; + public const byte WarriorClass = (byte)FrameKind.Warrior; + public const byte RangerClass = (byte)FrameKind.Ranger; /// How many trait modifiers a class seeds (each on a distinct SourceId at ClassSourceId + i). public const int ClassSeedCount = 4; diff --git a/Assets/_Project/Scripts/Simulation/Combat/SocketComponents.cs b/Assets/_Project/Scripts/Simulation/Combat/SocketComponents.cs index 14ec8e434..a4eea7a6c 100644 --- a/Assets/_Project/Scripts/Simulation/Combat/SocketComponents.cs +++ b/Assets/_Project/Scripts/Simulation/Combat/SocketComponents.cs @@ -79,7 +79,7 @@ namespace ProjectM.Simulation [GhostComponent(OwnerSendType = SendToOwnerType.SendToOwner)] public struct FrameId : IComponentData { - /// The frame/class id (see the CharacterId / ClassId convention). + /// The frame/class id (see the FrameKind / ClassId convention). [GhostField] public byte Value; } } diff --git a/Assets/_Project/Scripts/Simulation/Combat/StatIds.cs b/Assets/_Project/Scripts/Simulation/Combat/StatIds.cs index 42f5bff5b..0d9356f80 100644 --- a/Assets/_Project/Scripts/Simulation/Combat/StatIds.cs +++ b/Assets/_Project/Scripts/Simulation/Combat/StatIds.cs @@ -16,13 +16,15 @@ namespace ProjectM.Simulation LightZone = 9, // Aoe/zone: a persistent light/damage zone } - /// Stable key for an authored character-stats definition in the AbilityDatabase blob. - public enum CharacterId : byte + /// Stable key for an authored character-stats definition in the AbilityDatabase blob — the + /// frame/class id (a LANTERN suit-frame IS the class; renamed from the pre-LANTERN CharacterId, + /// byte values unchanged so serialized definitions/saves never re-mean). + public enum FrameKind : byte { None = 0, Default = 1, - Warrior = 2, // Slice 2: melee-anchor bruiser (tankier, slower, longer/harder melee) - Ranger = 3, // Slice 2: ranged-anchor (squishier, faster, longer projectile range; weaker melee) + Warrior = 2, // Bathynaut-lineage melee-anchor bruiser (tankier, slower, longer/harder melee) + Ranger = 3, // Harpooner-lineage ranged-anchor (squishier, faster, longer projectile range; weaker melee) } /// diff --git a/Assets/_Project/Scripts/Simulation/Connection/GoInGameRequest.cs b/Assets/_Project/Scripts/Simulation/Connection/GoInGameRequest.cs index 16bd627de..d8b8a03c7 100644 --- a/Assets/_Project/Scripts/Simulation/Connection/GoInGameRequest.cs +++ b/Assets/_Project/Scripts/Simulation/Connection/GoInGameRequest.cs @@ -7,5 +7,5 @@ namespace ProjectM.Simulation /// NetworkStreamInGame to the connection (enabling snapshot/command flow) and spawns the /// client's player ghost. Lives in Simulation so both worlds see the type for RPC source-gen. /// - public struct GoInGameRequest : IRpcCommand { public byte ClassId; } // Slice 2: per-player class (CharacterId byte; 0 -> server defaults to Warrior) + public struct GoInGameRequest : IRpcCommand { public byte ClassId; } // Slice 2: per-player class (FrameKind byte; 0 -> server defaults to Warrior) } diff --git a/Assets/_Project/Scripts/Simulation/Debug/DebugCommandRequest.cs b/Assets/_Project/Scripts/Simulation/Debug/DebugCommandRequest.cs index 636e5ac3d..0a5d8ade6 100644 --- a/Assets/_Project/Scripts/Simulation/Debug/DebugCommandRequest.cs +++ b/Assets/_Project/Scripts/Simulation/Debug/DebugCommandRequest.cs @@ -59,7 +59,7 @@ namespace ProjectM.Simulation /// Set the ArgA to ArgB/1000f (live dash/Charger feel-tuning; MC-0). public const byte SetTuning = 12; - /// Swap the sender's class to ArgA (a byte: Warrior=2 / Ranger=3). + /// Swap the sender's class to ArgA (a byte: Warrior=2 / Ranger=3). /// Strips the old class trait seeds, re-seeds the new ones, swaps the Fire ability, and heals a living /// player to the new class's max. Editor-only dev tool (class-switch); 0 / unknown -> Warrior. public const byte SetClass = 13; diff --git a/Assets/_Project/Scripts/Simulation/Meta/MetaCatalog.cs b/Assets/_Project/Scripts/Simulation/Meta/MetaCatalog.cs index 157c4db3d..e436cddc3 100644 --- a/Assets/_Project/Scripts/Simulation/Meta/MetaCatalog.cs +++ b/Assets/_Project/Scripts/Simulation/Meta/MetaCatalog.cs @@ -7,7 +7,7 @@ namespace ProjectM.Simulation /// One authored PERMANENT meta upgrade: tiered (buy tier owned+1 up to ), priced in Aether /// with a linear ramp (cost(owned) = BaseCost + owned*CostGrowth), class-gated by /// (bit0 = Warrior, bit1 = Ranger — resolve via , NEVER a raw 1<<ClassId: - /// the stored ClassId is the normalized CharacterId 2/3). is the stable APPEND-ONLY key + /// the stored ClassId is the normalized FrameKind 2/3). is the stable APPEND-ONLY key /// persisted in SaveData v6 and keyed into the live StatModifier as Tuning.MetaSourceIdBase + Id. /// DISTINCT from — boons are run-scoped single-shots; overloading one catalog would /// blur the two channels (DR-037). = 0xFF means no prerequisite (v1 ships a FLAT catalog diff --git a/Assets/_Project/Scripts/Simulation/Meta/MetaComponents.cs b/Assets/_Project/Scripts/Simulation/Meta/MetaComponents.cs index aa26d302f..4b14f49f9 100644 --- a/Assets/_Project/Scripts/Simulation/Meta/MetaComponents.cs +++ b/Assets/_Project/Scripts/Simulation/Meta/MetaComponents.cs @@ -14,7 +14,7 @@ namespace ProjectM.Simulation [InternalBufferCapacity(24)] public struct MetaTierState : IBufferElementData { - /// Owning class id (Warrior/Ranger — the CharacterId anchor). + /// Owning class id (Warrior/Ranger — the FrameKind anchor). [GhostField] public byte ClassId; /// Upgrade id (append-only key into the meta catalog). [GhostField] public byte UpgradeId; diff --git a/Assets/_Project/Scripts/Simulation/Persistence/SaveData.cs b/Assets/_Project/Scripts/Simulation/Persistence/SaveData.cs index 51fd88bfc..3a5f203cc 100644 --- a/Assets/_Project/Scripts/Simulation/Persistence/SaveData.cs +++ b/Assets/_Project/Scripts/Simulation/Persistence/SaveData.cs @@ -10,7 +10,7 @@ namespace ProjectM.Simulation public int Count; } - /// One persisted per-class PERMANENT meta-upgrade tier (v6). ClassId = the normalized CharacterId + /// One persisted per-class PERMANENT meta-upgrade tier (v6). ClassId = the normalized FrameKind /// (Warrior=2/Ranger=3); UpgradeId = the append-only meta-catalog key (unknown ids round-trip preserved and are /// skipped live); Tier clamps to the catalog's MaxTier at seed/shop/spend, never at rest. [Serializable] diff --git a/Assets/_Project/Scripts/Simulation/Player/CharacterStatsRef.cs b/Assets/_Project/Scripts/Simulation/Player/CharacterStatsRef.cs index 2a1c86e4d..be24b3967 100644 --- a/Assets/_Project/Scripts/Simulation/Player/CharacterStatsRef.cs +++ b/Assets/_Project/Scripts/Simulation/Player/CharacterStatsRef.cs @@ -7,7 +7,7 @@ namespace ProjectM.Simulation /// Which authored character-stats definition this entity uses - a light key into the CharacterStats /// blob, replacing M2's inlined PlayerMoveStats values. NOW a [GhostField] (Slice 2 classes) so the /// server-written per-player class id replicates -> the owning client folds correct stats. Id stores a - /// . + /// . /// public struct CharacterStatsRef : IComponentData { diff --git a/Assets/_Project/Tests/EditMode/AbilityDatabaseBlobTests.cs b/Assets/_Project/Tests/EditMode/AbilityDatabaseBlobTests.cs index b7d22786e..d88cbef25 100644 --- a/Assets/_Project/Tests/EditMode/AbilityDatabaseBlobTests.cs +++ b/Assets/_Project/Tests/EditMode/AbilityDatabaseBlobTests.cs @@ -32,7 +32,7 @@ namespace ProjectM.Tests var chars = builder.Allocate(ref root.Characters, 1); chars[0] = new CharacterStatsBlob { - Id = (byte)CharacterId.Default, MoveSpeed = 6f, TurnRateRadiansPerSec = 12.5f, + Id = (byte)FrameKind.Default, MoveSpeed = 6f, TurnRateRadiansPerSec = 12.5f, MaxHealth = 100f, Name = "Default" }; @@ -71,7 +71,7 @@ namespace ProjectM.Tests var blob = Build(); try { - Assert.IsTrue(blob.Value.TryGetCharacter((byte)CharacterId.Default, out var def)); + Assert.IsTrue(blob.Value.TryGetCharacter((byte)FrameKind.Default, out var def)); Assert.AreEqual(6f, def.MoveSpeed, 1e-4f); Assert.AreEqual(100f, def.MaxHealth, 1e-4f); Assert.AreEqual("Default", def.Name.ToString()); diff --git a/Assets/_Project/Tests/EditMode/MetaSeedingTests.cs b/Assets/_Project/Tests/EditMode/MetaSeedingTests.cs index a9926cede..c6a13fdf9 100644 --- a/Assets/_Project/Tests/EditMode/MetaSeedingTests.cs +++ b/Assets/_Project/Tests/EditMode/MetaSeedingTests.cs @@ -78,7 +78,7 @@ namespace ProjectM.Tests var catalogE = em.CreateEntity(typeof(MetaUpgradeCatalog)); em.SetComponentData(catalogE, new MetaUpgradeCatalog { Value = MetaCatalogData.BuildDefault() }); var record = em.AddBuffer(catalogE); // the tier record rides any singleton entity in tests - byte warrior = ClassTraits.WarriorClass; // normalized CharacterId (2) + byte warrior = ClassTraits.WarriorClass; // normalized FrameKind (2) record.Add(new MetaTierState { ClassId = warrior, UpgradeId = 1, Tier = 2 }); // Reinforced Frame t2 -> +30 record.Add(new MetaTierState { ClassId = warrior, UpgradeId = 5, Tier = 9 }); // Warrior's Might, saved OVER MaxTier(4) -> clamp record.Add(new MetaTierState { ClassId = warrior, UpgradeId = 200, Tier = 1 }); // unknown id -> skipped diff --git a/Assets/_Project/Tests/EditMode/StatRecomputeSystemTests.cs b/Assets/_Project/Tests/EditMode/StatRecomputeSystemTests.cs index 433832dd3..395b7e4e9 100644 --- a/Assets/_Project/Tests/EditMode/StatRecomputeSystemTests.cs +++ b/Assets/_Project/Tests/EditMode/StatRecomputeSystemTests.cs @@ -15,7 +15,7 @@ namespace ProjectM.Tests public class StatRecomputeSystemTests { const byte AbilityPrimary = (byte)AbilityId.Primary; - const byte CharDefault = (byte)CharacterId.Default; + const byte CharDefault = (byte)FrameKind.Default; static BlobAssetReference BuildDb() {