From a639569f722e0b20105d6e34fddac25b45f0120c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 17:23:27 +0100 Subject: [PATCH] Move behavior identity onto runtime instances --- .voidbot/state/aetheria.cc | Bin 86094 -> 85568 bytes Aetheria.State/README.md | 4 +++- Assets/Scripts/Gameplay/ActionGameManager.cs | 6 +++--- .../ServerShared/Behaviors/Behaviors.cs | 3 +++ .../ServerShared/Behaviors/StatModifier.cs | 4 ++-- docs/aetheria-perfect-machine-map.md | 6 ++++++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 6714b531d07866ef6be01ffb69dbcd2f4c9cd029..d627d6c652c2aab7536be7ba530d717bbe79d82c 100644 GIT binary patch delta 1385 zcmZuxJ8u&~5Z2|P5DF>+f&xaO0%8X{i5wCU@o*3lkMKr9LSl0_wio+$kKMhP&_pOD zqJS%|p@0IA5JFHv2PvqK5R@qp1rja)05N;MJ&Q+o_wDS?eBaDBpB@dre>nW=>A>b{ zb#}U1uGOZl-uK3m4+D1{GIJn9rC2X-} zE>(#OZJ6+})aD|UTfA$lbEo(+!qGecT!024yMVVMsS(UdgaNomfCnfHH!I~QeuwdJ zLkpd@;HdgZ zLT3CH7tO2=g)As)ET7~e$O^TnYyh41LQPA_xY;Tq>&&n$y8O(b&{W9Ax?^h3=;oD> z5oKT+hyoZ4BdM5L0bi0*D)x<36P8Vhs_O(6Ztx~7DIPR&4jOT%15vC<4C2h`N8!zw z6T|fEK5yGBM-5Wt`q^iI`99H?%I2eAA)zBhlZXo>iSy^{7Z=m(hrC^@8+Az`bSnrb zpj+tcIsgIs-14%|^|-q(l?(E7z#G8&%98Y1HeEDw9AfISQ>LdcBaNGF#HheC#k4Q& zEEw5Wh|*8wg=ZpZuv5^<1Z^;@;7TqSa7`6=&|px0PGi`T>O3~|gJfTKp1;nAr^I4I z2PEk;9fu(`W8;h~4SW`vnB>hR%_f0lEV@OtKtsv!-){EXmV6$mq|v;$^Tff^Otp1E zFely{g^sm_o99Ar9V?=Q2=>u@Vw&#CwPu71`(|bp~ zt(Pxf61|zWKGvaZqt)1O5z`%}H7fchAGo!Vy_}Wp=CHRjGA*n@gC*v-6Yt~L$kfG3 zZMHg+fx`Hq{ZOxqoo-mH7?3g}=4EiQPm cgR0pkOusL9cM7Oxqu#6?_tr-pHd(p)8+}Ih&Hw-a delta 1778 zcmZuyOK%)S5Y{+e<8T2a0tyPyfP@s09cPm`HnzaotSuA;f@On14tca^YIhpK({`9{aeCyzC-!--lJ?#4#6{9DjD~)MM8UkKa2y z?#<2|dXa*OKrz~62I3|Ny3QeNYC{bSug-h#4NjfG15zFkcR+;PBoWobWC?_XOB%}5 zOo1@WWJC*^=tvsUWxzx2e;07d;_a{7WhRn<(o7pomae2MNo>ad$zdWT(_S>#orGAL zB#?2;j6OmFDx_cm<)b7*8Kf~1!aHvZ%POJ42JHb+K*M$Xe}qsG5*^D8K)60AJoK*{ z5SmG`{pDLIN=*4wI7k&;XWT+a!I=Q}9SscYTd5{2<5^37`8qH$6YN;D)?VSfuyBYQoLq$p-dXl9!^PogYzH+FZ( zUn<6! z^~Sk#GzL9F6o-rMNYJ#Upu4@2)64Dr)|H9N zi{)_of&O-biSVxTQL~t8{K1}Ll{Mv7<(!qG#jh8BJA+Q>I3u79lwzo1*`NHTc`pCt zugQFC_2~;g)*dNb-PA#ZV_T!YQlamFb){DEC1-1!ZPkiwb7gg=L+aJRt&+H%Wd^E7 zURwqc+S#r~bC;S44hJY4x{`Dud`-4$u%l9L7Wcg!HNQ~w?6Ng=em*!mxLx|YS^2wW z@#bFtkd_w)fKh>iKEqzwJ9%Jv7tP_MsUDr@i}isCtbihOc!zS%pu!XKVOJ$GcjG SX6(oJ(nas5{Z(wHwe~L?Rg)P2 diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 3c8102e49..3071b78a7 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -126,7 +126,9 @@ persist hull simulation grids into `AetheriaEntitySnapshot`, so `RuntimeEntityBlueprint` is no longer the only surface carrying those live values. Broader runtime object graphs, typed behavior factory construction, and behavior-private simulation state remain legacy until dedicated typed runtime -documents exist. +documents exist. Live behavior instances expose typed behavior kind through +`Behavior.Kind`; the remaining `BehaviorData` objects are construction configs, +not runtime identity owners. Typed name-file documents are `aetheria.name_file.v2` records. They carry the legacy ID, display name, count, compact sample names for surfaces, and the full name array needed to move `Galaxy`/Markov name generation off legacy diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 183a6d7a1..7fa8e52bd 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -1041,7 +1041,7 @@ public class ActionGameManager : MonoBehaviour state.OwnerKind = ownerKind; state.OwnerIndex = ownerIndex; state.BehaviorIndex = behaviorIndex; - state.BehaviorKind = behavior.Data?.Kind ?? ""; + state.BehaviorKind = behavior.Kind; yield return state; } } @@ -1079,7 +1079,7 @@ public class ActionGameManager : MonoBehaviour OwnerKind = ownerKind, OwnerIndex = ownerIndex, BehaviorIndex = behaviorIndex, - BehaviorKind = weapon.Data?.Kind ?? "", + BehaviorKind = weapon.Kind, Firing = weapon.Firing, Ammo = weapon.Ammo }; @@ -1149,7 +1149,7 @@ public class ActionGameManager : MonoBehaviour OwnerKind = ownerKind, OwnerIndex = ownerIndex, BehaviorIndex = behaviorIndex, - BehaviorKind = behaviors[behaviorIndex].Data?.Kind ?? "", + BehaviorKind = behaviors[behaviorIndex].Kind, Progress = progressBehavior.Progress }; } diff --git a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs index 9e72b19b3..fd0424373 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs @@ -13,6 +13,7 @@ using static Unity.Mathematics.noise; public abstract class Behavior { public BehaviorData Data { get; } + public string Kind { get; } public EquippedItem Item { get; } private ConsumableItemEffect Consumable { get; } protected ItemManager ItemManager { get; } @@ -45,6 +46,7 @@ public abstract class Behavior protected Behavior(BehaviorData data, EquippedItem item) { Data = data; + Kind = data?.Kind ?? ""; Item = item; ItemManager = Item.ItemManager; } @@ -52,6 +54,7 @@ public abstract class Behavior protected Behavior(BehaviorData data, ConsumableItemEffect consumable) { Data = data; + Kind = data?.Kind ?? ""; Consumable = consumable; ItemManager = consumable.Entity.ItemManager; } diff --git a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs index af3904052..9b0a66a4d 100644 --- a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs +++ b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs @@ -61,7 +61,7 @@ public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwa _stats = Entity.Equipment .Where(HasRequiredBehavior) .SelectMany(gear => gear.Behaviors ?? Array.Empty()) - .Where(behavior => BehaviorKindMatches(behavior.Data.Kind, _data.Stat.Target)) + .Where(behavior => BehaviorKindMatches(behavior.Kind, _data.Stat.Target)) .Select(FindTargetStat) .Where(stat => stat != null) .ToArray(); @@ -103,7 +103,7 @@ public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwa { return string.IsNullOrWhiteSpace(_data.RequireBehavior) || (gear?.Behaviors ?? Array.Empty()) - .Any(behavior => BehaviorKindMatches(behavior.Data.Kind, _data.RequireBehavior)); + .Any(behavior => BehaviorKindMatches(behavior.Kind, _data.RequireBehavior)); } private void ApplyModifier() diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 0032d88f6..297d7705d 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -618,6 +618,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. type selection now uses an explicit runtime catalog map instead of `UnionAttribute` reflection, and the temporary behavior config constructor map is keyed by typed behavior payload kind rather than legacy union key. + Live `Behavior` instances expose their typed payload kind directly, so runtime + state projection and stat-modifier matching no longer reach back through + `BehaviorData.Kind` for behavior identity. Runtime item category classification uses package-owned `AetheriaRuntimeItemCategories` tokens; gameplay code should not ask C# legacy DTO class names to classify typed catalog rows. The typed state @@ -987,6 +990,9 @@ First Aetheria surfaces to publish: - Done: move `StatModifier` behavior kind/family matching onto `AetheriaRuntimeBehaviorMetadataCatalog`; the behavior only normalizes migrated `*Data` tokens before asking the package-owned metadata owner. + - Done: move live behavior identity reads from the temporary `BehaviorData` + config bridge onto `Behavior.Kind`, so state snapshots, weapon snapshots, + progress rows, and stat-modifier matching use runtime instance identity. - Done: delete the legacy `Behaviors` lists from `ConsumableItemData` and `EquippableItemData`; item DTOs can no longer carry behavior config state. - Done: move runtime blueprint price aggregation and conductivity restore