From 710a98bc8d2b95c3f016a8529667ac5581c174cf Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 05:08:39 +0100 Subject: [PATCH] Use typed hull facets in entity state --- .voidbot/state/aetheria.cc | Bin 65417 -> 65980 bytes Aetheria.State.Import/Program.cs | 5 + .../AetheriaRuntimeCatalogSnapshotMapper.cs | 5 + Aetheria.State.Verify/Program.cs | 22 ++++- .../Documents/AetheriaItemDefinition.cs | 15 +++ .../AetheriaRuntimeItemCatalog.cs | 5 + Assets/Scripts/ServerShared/Entity.cs | 90 +++++++++++------- GameData/aetheria-world.cc | Bin 30723 -> 31616 bytes ...fa831c114bded61755656ce143acff8498.msgpack | 2 +- ...6bcb5217c5fee889541667442528a98491.msgpack | 4 +- ...a275af9147897cd1f60b23a18cc48b7fee.msgpack | 4 +- ...3921217d7ba077f48246e0b33fc1493431.msgpack | 4 +- ...3fbff428c15ab389a42d0d2aa0e75980fd.msgpack | 2 +- ...6b93b4259541f580967a52464d9686f3aa.msgpack | 4 +- ...fdee0c7ff471c8bb4b4e0b2067eb36da09.msgpack | 4 +- ...cc1c87e1e40afcab2bb8dd8f889fe0918b.msgpack | 2 +- ...1ac1edd3dffac04996b12d9f9d0e8304f1.msgpack | 2 +- ...1368ec2948a11425e377fa92a71d575637.msgpack | 4 +- ...8858c36442af01034165db67b886e94ce3.msgpack | 4 +- ...2cd5bdbf86136a558044079cba7a029ac8.msgpack | 4 +- ...6ba52bd445978bb0cb399047cf64aa722f.msgpack | 4 +- ...3e8ff05893f872c2437a5621f2a2eec71b.msgpack | 4 +- ...9bb06b3f45a746ac5f7739b1cbd896443f.msgpack | 4 +- ...07d0fb3e1d5d58fbc176520a100614f404.msgpack | 2 +- ...48df04cfa2250b7101fc00f9c6f2c1317c.msgpack | 4 +- ...06e97680a29efe7d1436947e3a8eba4c95.msgpack | 4 +- ...2ccd793983d2af31967b7d70a977fd2e02.msgpack | 4 +- ...f91cb8ca685ea96318a795771ae6d911eb.msgpack | 4 +- ...db27aa2b805705e823bed4877c4623cf88.msgpack | 4 +- ...5eead201bac20496fa5a2649e4b1522a37.msgpack | 4 +- ...fa0290206edd7b2e0dc08b0f9842dea0f2.msgpack | 4 +- ...dd6eeb3d8311f3753af60c2b5596719b15.msgpack | 4 +- ...d7e3a5d8fa1509efb8a9249d0e48891299.msgpack | 2 +- ...c76a739617023ffa2c2aeb091cf5580b7d.msgpack | 2 +- ...f5bd89832b6e55959ea4902bfa15bc8117.msgpack | 4 +- ...d52fa612f479ccbad76307db432c0b6147.msgpack | 2 +- ...268eff507c40681c6b1955fa786f99066c.msgpack | 2 +- ...ad0cb1b8ec9229ee0525bb8571edb6ea32.msgpack | 4 +- ...1b5d1ba2d39f2014715b235086b087f9b7.msgpack | 2 +- ...616a532f076ae0a66f2257f9c7899100a9.msgpack | 4 +- ...ae26acc72f64a9ca536b895d59a8675c66.msgpack | 4 +- ...44c85439d1f3caa1caaf24beb34e7d8d50.msgpack | 2 +- ...9500e6c9192f76c38393eb84bee3345ee0.msgpack | 4 +- ...dd6ef83562c3b82a0e03c21a37c241f5b8.msgpack | 4 +- ...5cdcddbcded4980427149dc10ba9eb08a1.msgpack | 2 +- ...baf1c52a76a0e7adce5acb06a2d7f5bd79.msgpack | 4 +- ...79872da971faf89ceef4c395a64f1b5e88.msgpack | 4 +- ...60257125aef40381db5877aa16c02b39e4.msgpack | 4 +- ...ea1ff3e3f204925bb28ccb1d45d2b3d732.msgpack | 4 +- ...786b7af0cd4f808a703d5f242c9b0fd372.msgpack | 2 +- ...05ae7658005ee7019c3810650baf8e6c4f.msgpack | 4 +- ...d65f26dcd9e6b2bc9ef89cb16dd16e4b07.msgpack | 4 +- ...4187f90237d4386c76e3b847376b466dd3.msgpack | 4 +- ...042b3f00710055061bb4b6d9b2306d14c3.msgpack | 2 +- ...36ce1066ae558fc09801457a30674f515b.msgpack | 4 +- ...e298fc6ceb8352b047986733e405d6006b.msgpack | 4 +- ...7cb628668b9e3842a59c0e2dd106a820bb.msgpack | 4 +- ...b30b7614eb776ee14b16bed525675b67b8.msgpack | 4 +- ...6321b14e59b2b62a7e914e74771273097a.msgpack | 4 +- ...d39c7f7412772d7ad9adc1f1db3f39cc10.msgpack | 4 +- ...e152a6e77f714229898548c45b02cc72d6.msgpack | 4 +- ...0ecea7ff27435bd9e9d534bcb0c1b892ef.msgpack | 4 +- ...daf7ada6d75ceaa0a07f1e0dc46d65003f.msgpack | 4 +- ...25c2c88303bdbc1a54a178c895086e6c55.msgpack | 4 +- ...320b70986559345e184297437f13bcae7d.msgpack | 4 +- ...1f7c425775d76ba34c55a9ae879e27b3d8.msgpack | 2 +- ...8181b2c9794fa3a70f803c67de8d0dcff0.msgpack | 4 +- ...918704bf6ad447ce7a4733664d3888359d.msgpack | 4 +- ...9358f522e1794e5a675f77b06e99ee061e.msgpack | 2 +- ...fd4bd127dae7ce9a1cc25669b23daffd1b.msgpack | 2 +- ...72d6a82431bf8c842bc57b1c7f3bae4876.msgpack | 4 +- ...78de0d154287774728c30a461ed0d9e334.msgpack | 4 +- ...5a77b77ba285ba04fa6e1c678d86988867.msgpack | 4 +- ...cb33184e1aade105b24afaba265b148ce4.msgpack | 4 +- ...92a3874ff91d1e08024120231bb836c2bb.msgpack | 4 +- ...30a284a5876d9f55597d457cebba6a2226.msgpack | 4 +- ...04c4d886f2bf72ae35b733603966e28d61.msgpack | 4 +- ...a65e76836067e0661b91eb2fa4cc5c2b3f.msgpack | 4 +- ...6550ff7ce20b046a653debb4e7bc10e047.msgpack | 2 +- ...2888041296cc8e256b3774e29b1b969c4b.msgpack | 4 +- ...d247ef4aa34cfbe648b0b1587836dc48cb.msgpack | 2 +- ...eb069ff9e1ed707a2590cedcffc835ac23.msgpack | 4 +- ...199f861a6986234742cd7d603c9d8cbe86.msgpack | 4 +- ...699d5fc930104242470efeddc8f9500222.msgpack | 4 +- ...ef7f34c156794d697606252db56928e23b.msgpack | 4 +- ...d30298201bd0eced6bfa9c3b7e01d9448c.msgpack | 4 +- ...946ba31ec32b37bfe4b0829825c4e85029.msgpack | 2 +- ...cb793e7bcf5f7afa2c328d12d6561d0f1e.msgpack | 4 +- ...56919b8dd915d9fef8f2361b77d9bf6b99.msgpack | 4 +- ...386b0b8e8f80cfe0ad311061b682ecff95.msgpack | 4 +- ...1c82be1f818ee634833d6e3e637e694344.msgpack | 4 +- ...4f2a1a72a54f72c42a4e4c1d0f231586ba.msgpack | 4 +- ...34144722b989cf3cf2f03431cabc1f3929.msgpack | 4 +- ...a34a37e5fcb7892a29eb02cf5da1c338de.msgpack | 4 +- ...c97b1604f21df8132d6305f350e80ba5b7.msgpack | 4 +- ...98c89c7c57fff60a2c357887e8dc400dc3.msgpack | 2 +- ...c595e7f3aea98935f9e9a6aafdf8b4d9d2.msgpack | 4 +- ...1539aa45529f4c740066eb5301ed36edfd.msgpack | 4 +- ...2e4971d71ab5b8b38ac0c89c3f9a764764.msgpack | 2 +- ...cc7b2c41fe7e5fcc138566aa65f6a2b10b.msgpack | 2 +- ...79e8b3e7a51e9d5145e08f639a88de38be.msgpack | 4 +- ...cb2be74c711de0d5b22f9160aba0ee7ee9.msgpack | 2 +- ...65d32cdc881f54a82297e048ac6adff8ff.msgpack | 4 +- ...0336d40c18572d3f6ed6318a4008af5a89.msgpack | 4 +- ...fcd8fa1e9858c270d58ccf5d2170a3842c.msgpack | 4 +- ...d2064953cbde740647c3a820bacf9c27c3.msgpack | 4 +- ...33d98be75491a3b1b3af0d080505b31b21.msgpack | 4 +- ...76f8e8486ae0dd84c256d8c672c54837ec.msgpack | 4 +- ...7dd3b2bd29116afbf8857d8b5afdc85c8f.msgpack | 4 +- ...26af1122625e375d29d192aacad668e2a7.msgpack | 4 +- ...0d87791a49bb911b2e7ab294e1303e180c.msgpack | 4 +- ...85198b8b38c36fc5417df965fe098c7523.msgpack | 4 +- ...fdf046f5a7951655cf83dc22938e7563b2.msgpack | 4 +- ...f4651415e50cce4eb13240370a1394b928.msgpack | 4 +- ...52a044e5c42314b43945ded225f3009bf9.msgpack | 4 +- ...b76604f01f891d11f6bc9c079621d2b45c.msgpack | 4 +- ...dd6056bad45424aaadc0ed86534053fd43.msgpack | 2 +- ...6a84bb1ad648c6e3f72452f8ee47f98cb5.msgpack | 4 +- ...28230b2636da2c91d4e12ec6c804c8a04a.msgpack | 4 +- ...480afdb5047dee177edeac207ce337e083.msgpack | 4 +- ...7f81911af70edf42cb5275ce8f96dee707.msgpack | 2 +- ...07128f325b6f8981e61bf216400dd09f8e.msgpack | 4 +- ...f4dc349da455027ef5db10f14d88553894.msgpack | 4 +- ...1ade7f7e67031a1f69bec307690212bb53.msgpack | 4 +- ...3ff4da3985d54c314bcaf6ceca29a0d80e.msgpack | 4 +- ...1b1a624f836079caf3f9c892cbc94d0aae.msgpack | 4 +- ...01600dd1985f3e1ddeeb16b10593afc5ab.msgpack | 2 +- ...08e1a83f1dc14096339f67d56c0e0869ff.msgpack | 4 +- ...06d60f0e24b919fdf36a025cfddee87011.msgpack | 4 +- ...0f1c261fbbb7f1961d8acd057a3b287e38.msgpack | 4 +- ...5b07b6b9ec7bba75debf9915460dbe3e1a.msgpack | 4 +- ...2762b088b45c2b873b2816cc7dd4e7672c.msgpack | 4 +- ...e79aecf53d9558fd48290599da73065788.msgpack | 4 +- ...3dd2a11f08fa54e6ffc699ee7ff032399d.msgpack | 2 +- ...36c731b877c242d1dd966801858145a431.msgpack | 4 +- ...8668f9d2c05806983d89a8e9227a63871e.msgpack | 4 +- ...e2540502e68596a3603f76389e57028805.msgpack | 4 +- ...9ab8ab7bd5c5792eaffa4226a6c04eb105.msgpack | 4 +- ...b464103bd76e410747a9c9b7ff24e3c4e1.msgpack | 4 +- ...5ee0f0a8c3001293f5702aa2424e24427e.msgpack | 2 +- ...731eadcb421407c89d781610905a20f024.msgpack | 2 +- ...4a3699e1985d69a91cf8dcb7f4c66bddf5.msgpack | 4 +- ...25da6d94408d6a3d1d9118f6ee39b59f6b.msgpack | 4 +- ...27c780283d518bb03ec1796d41885bd88a.msgpack | 4 +- ...0f473896745b146e5990046afe53ac54b8.msgpack | 2 +- ...e9c2093d642b67286400600a6215e90683.msgpack | 4 +- ...08270dbd928b514d6de583f46201acc8e6.msgpack | 2 +- ...8f723d3a0a7f48de7e52fe545a530c2559.msgpack | 4 +- ...3f7d34327c64a8a33c3dfb1809131717a1.msgpack | 4 +- ...42f2cef8f92eb11513d698d60a8ad234c4.msgpack | 4 +- ...d4f7d77f094191b2e9d7590b6795950780.msgpack | 4 +- ...c4bd13b358f1ffb0937b14289d35ab2d53.msgpack | 4 +- ...6b87f1ba0566a44f3d381b757edb40d25d.msgpack | 4 +- ...e4f0b2d619dceb69ec354fe56f99488b42.msgpack | 2 +- ...beb23a1fa47461adda98ef10295021480f.msgpack | 4 +- ...d3f4d154424deaf2f21dd15d213684d46f.msgpack | 4 +- ...8da4a63ef12a1dc5126b11ebba43840395.msgpack | 2 +- .../Runtime/AetheriaRuntimeCatalogSnapshot.cs | 15 +++ .../Runtime/AetheriaRuntimeCatalogStore.cs | 12 ++- docs/aetheria-perfect-machine-map.md | 22 +++-- 160 files changed, 412 insertions(+), 307 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 9fec9d0998fc5827f01749fe14a6555d044cce40..720e061b33456f58a9c8f3cd85108e056db56beb 100644 GIT binary patch delta 1737 zcma)7O=w(I6n2tWjp?EVo0MYZEJ{V0%$THUlCBzTNunl5Cfx*ExVi7VdDpym@AKaK zl8l?778i9Dxl0iXR{Sd>&PuR~3l|lHx)2(1(Lk{(xDYM4({taO&LqZ#t9kRy-20vH zJKs6)^54CmU+VkhYR~=?r=C7}YHXr1H9oogM(L3Iy618iJ2{$Ts&``tHlAY-_Z{u| z{bK8hzVB}~Upp(UunmZ^IEEFaEYwjYXmz6unN*x-slZ^^q>Lk^8V$zCtx&QIbuEHn z6@~^aq%r-TptNORGJpt~g+PR1X6UaV)jDWo0oX>00qBf46ZD)1V$f>cRNmz=6Uh&y z_uXk6a@F$wS*~P|5!0HlE{!u&l;}yJASEiDC|!m?vwFeHnOq{SkczRU0!tBsW8Vxm zi34yWRR#^%h&~_`7zd_I-w=3&e3e8B2@DC)f(@@L9S0T8VVxPOy^az!vltXSg=v*} zmKINCXd~x3messtZTzW5rVuh+N9#Vjb*xFY5wY>|@+e43 z36V+`cP=3-q{$K_ohIWEP#pFs=$7s)|CgHo787`DrpcR*FMe*GFXYV>X``;~(OLPB zNggS^h@tuMfrIX=S0~-=+JTnb`gq^@^F<2tIo>28QOAxPbJyQG?rz+6ql?p;N5WF4eQpz$f@DcPT)6Wb*`CLSc--dpP=Ciux0x=L zo^d0yhlYueY2EO&-GR@Sh+j!*)G&fmiN#F2zYeFRIX~0W#GaV;RR6!jm20>r0+bxR zdvCV3x8HuSbirM`d-Qa5WMsU12|{tXuVSn^R&1VP5O>!@N7iU~>*%)b-g)TKI~v0+ z;jVnU@CeM1AAa~=bXQgf-A{0Eeqph@M%pGBOWB2WVI%MbkdJ;p=Hz7<8TF$5uBAQY zOCi9!OuH*a_ri07?z^9lKiYW-j7=?HwX9C5c&s(>OReRp>J3VYflEt(h zl>C6$Fkk+y3%?HZ5A3+e-RvFezBML_x68FZu6MD?k@nkVpWFO1*@2(P@yG8qcVH79 PYkhI=%lbH^7JjvqeKoI7@C?OJWR_~TK%_;KROSp8_I>&f1zHh*X_)Lxw0Kk@MF z;Ek!DZeO@`N-B(jE@m=KNI7Ur*MKxeL1AeLjp#PY10Z6wR<@-;C$(w-stB|YS&B;J zt%NrrqS&DYrMDonRKQC!#m%)H{m=PVncS&;cv3m(^5(LmRgyr;w zCcH&m+~iImbYEF#GT~JNLkUV{A*K$B9M(x7D^<~<$ddu97V8n?mgT5!jZDv|4yxO2GdgJs*hA3NGCCtm&iibldOQY&?JlxjltZ8 zY4Qd)Cd*a`Gal2cV`Nm`Jk+>ZBtOset4rEMj5XF6>CBZqVut4#2e_l3mMekZrZ~1t zs;v#N?Ys^BNFqQXD0OTpYQj<__B!Tp279YaA>bTp0o3S`$i{>n>S|?@#U+PIDTY$q zs!#Wyo~51xX2?c7XqhJgcd+aNoy8F(dXxCBp@cy%sVV_0>acoz1yoRoHb z^(CvupDWb1*Ng8jA1&^#zBcIn`gQ$)s2owIiBsNU$)i@eOwo01$m^@0?c3*5eS*A2 zB(9X+J3UNI@yXpk`=Wn{yD*CLu;R(h z&TiY<7O(tsuUL6!Px0Ho2lkAf)y2iN8xA}6_ZRjKrth!T2G<_!+PQ0NySP0$v;DHp p4qxGK$7=J{3tTULc$|#YkA(XBPx{-nx$ytszbD`A94pSR{SPGoFE#)G diff --git a/Aetheria.State.Import/Program.cs b/Aetheria.State.Import/Program.cs index 76babecf3..91dc2a874 100644 --- a/Aetheria.State.Import/Program.cs +++ b/Aetheria.State.Import/Program.cs @@ -388,6 +388,7 @@ internal static class LegacyCatalogReader Description = description, Mass = GetDouble(payload, 4), SpecificHeat = GetPositiveDoubleOrDefault(payload, 6, 1), + Conductivity = GetPositiveDoubleOrDefault(payload, 7, 1), Volume = shape.OccupiedCells, ManufacturerLegacyId = GetOptionalGuid(payload, 3), Price = GetInt(payload, 8), @@ -413,6 +414,10 @@ internal static class LegacyCatalogReader MaximumTemperature = unionKey is 2 or 3 or 29 or 30 or 31 ? GetDouble(payload, 14) : 0, ThermalPerformanceCurveKeys = unionKey is 2 or 3 or 29 or 30 or 31 ? ReadCurveKeys(payload, 17) : [], HullPrefab = unionKey == 3 ? GetString(payload, 24) : "", + HullGridOffset = unionKey == 3 ? GetDouble(payload, 26) : 0, + HullArmor = unionKey == 3 ? GetDouble(payload, 27) : 0, + HullDrag = unionKey == 3 ? GetDouble(payload, 28) : 0, + HullCanTow = unionKey == 3 && GetBool(payload, 29), SimpleCommodityCategory = unionKey == 0 ? GetEnumName(payload, 10, SimpleCommodityCategories) : "", CompoundCommodityCategory = unionKey == 1 ? GetEnumName(payload, 11, CompoundCommodityCategories) : "", WeaponRange = unionKey == 31 ? GetEnumName(payload, 24, WeaponRanges) : "", diff --git a/Aetheria.State.Unity/AetheriaRuntimeCatalogSnapshotMapper.cs b/Aetheria.State.Unity/AetheriaRuntimeCatalogSnapshotMapper.cs index 6c02ed7d9..70427df0f 100644 --- a/Aetheria.State.Unity/AetheriaRuntimeCatalogSnapshotMapper.cs +++ b/Aetheria.State.Unity/AetheriaRuntimeCatalogSnapshotMapper.cs @@ -24,6 +24,7 @@ internal static class AetheriaRuntimeCatalogSnapshotMapper item.Price, item.Mass, item.SpecificHeat, + item.Conductivity, item.Volume, item.ShapeWidth, item.ShapeHeight, @@ -49,6 +50,10 @@ internal static class AetheriaRuntimeCatalogSnapshotMapper item.MaximumTemperature, item.ThermalPerformanceCurveKeys.Select(FromState).ToArray(), item.HullPrefab, + item.HullGridOffset, + item.HullArmor, + item.HullDrag, + item.HullCanTow, item.SimpleCommodityCategory, item.CompoundCommodityCategory); } diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 08cd8bebc..7bf8d5c70 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -48,6 +48,7 @@ if (nameFiles.Any(nameFile => nameFile.Names.Length == 0 || nameFile.Names.Lengt var pricedItems = items.Count(item => item.Price > 0); var manufacturedItems = items.Count(item => !string.IsNullOrWhiteSpace(item.ManufacturerLegacyId)); var specificHeatItems = items.Count(item => item.SpecificHeat > 0); +var conductiveItems = items.Count(item => item.Conductivity > 0); var shapedItems = items.Count(item => item.ShapeWidth > 0 && item.ShapeHeight > 0 && item.OccupiedCells > 0); var shapedMaskItems = items.Count(item => item.ShapeCells.Length > 0); var interiorShapeItems = items.Count(item => item.InteriorShapeCells.Length > 0); @@ -64,6 +65,12 @@ var behaviorLegacyRefCount = items var hardpointItems = items.Count(item => !string.IsNullOrWhiteSpace(item.HardpointType)); var hullItems = items.Count(item => !string.IsNullOrWhiteSpace(item.HullType)); var hullPrefabItems = items.Count(item => !string.IsNullOrWhiteSpace(item.HullPrefab)); +var hullArmorItems = items.Count(item => !string.IsNullOrWhiteSpace(item.HullType) && item.HullArmor > 0); +var hullPhysicalFacetItems = items.Count(item => + !string.IsNullOrWhiteSpace(item.HullType) && + item.HullArmor > 0 && + item.HullDrag >= 0 && + !double.IsNaN(item.HullGridOffset)); var simpleCommodityCategoryItems = items.Count(item => !string.IsNullOrWhiteSpace(item.SimpleCommodityCategory)); var compoundCommodityCategoryItems = items.Count(item => !string.IsNullOrWhiteSpace(item.CompoundCommodityCategory)); var weaponItems = items.Count(item => @@ -96,6 +103,12 @@ if (specificHeatItems != items.Length) $"Typed item definitions did not import positive specific heat for every item: {specificHeatItems}/{items.Length}."); } +if (conductiveItems != items.Length) +{ + throw new InvalidOperationException( + $"Typed item definitions did not import positive conductivity for every item: {conductiveItems}/{items.Length}."); +} + if (shapedItems == 0) { throw new InvalidOperationException("Typed item definitions did not import any shape dimensions."); @@ -243,6 +256,12 @@ if (hullPrefabItems != hullItems) throw new InvalidOperationException($"Typed hull prefab import mismatch: hulls={hullItems}, prefabs={hullPrefabItems}."); } +if (hullArmorItems != hullItems || hullPhysicalFacetItems != hullItems) +{ + throw new InvalidOperationException( + $"Typed hull physical facet import mismatch: hulls={hullItems}, armor={hullArmorItems}, physical={hullPhysicalFacetItems}."); +} + if (simpleCommodityCategoryItems == 0) { throw new InvalidOperationException("Typed simple commodity category import produced no categories."); @@ -353,12 +372,13 @@ if (string.IsNullOrWhiteSpace(quarantine.CatalogFingerprint)) Console.WriteLine($"Aetheria typed state verify passed: {statePath}"); Console.WriteLine($"Catalog fingerprint: {quarantine.CatalogFingerprint}"); Console.WriteLine($"Item definitions: {items.Length}"); -Console.WriteLine($"Priced/manufactured/specific-heat/shaped items: {pricedItems}/{manufacturedItems}/{specificHeatItems}/{shapedItems}"); +Console.WriteLine($"Priced/manufactured/specific-heat/conductive/shaped items: {pricedItems}/{manufacturedItems}/{specificHeatItems}/{conductiveItems}/{shapedItems}"); Console.WriteLine($"Shape masks: {shapedMaskItems}"); Console.WriteLine($"Interior masks/hardpoint hosts/hardpoints: {interiorShapeItems}/{hardpointHostItems}/{hardpointCount}"); Console.WriteLine($"Behavior payload items/payloads/fields/legacy refs: {behaviorPayloadItems}/{behaviorPayloadCount}/{behaviorFieldCount}/{behaviorLegacyRefCount}"); Console.WriteLine($"Behavior/hardpoint/hull/weapon items: {behaviorItems}/{hardpointItems}/{hullItems}/{weaponItems}"); Console.WriteLine($"Hull prefab items: {hullPrefabItems}"); +Console.WriteLine($"Hull armor/physical facet items: {hullArmorItems}/{hullPhysicalFacetItems}"); Console.WriteLine($"Simple/compound commodity category items: {simpleCommodityCategoryItems}/{compoundCommodityCategoryItems}"); Console.WriteLine($"Durable hull/weapon items: {durableMaxDurabilityItems}/{maxDurabilityItems.Length}"); Console.WriteLine($"Thermal range/curve items: {importedThermalRangeItems}/{importedThermalCurveItems}"); diff --git a/Aetheria.State/Documents/AetheriaItemDefinition.cs b/Aetheria.State/Documents/AetheriaItemDefinition.cs index 4c19a4283..b6a889e96 100644 --- a/Aetheria.State/Documents/AetheriaItemDefinition.cs +++ b/Aetheria.State/Documents/AetheriaItemDefinition.cs @@ -129,6 +129,21 @@ public sealed class AetheriaItemDefinition [Key(38)] public double SpecificHeat { get; set; } = 1; + + [Key(39)] + public double Conductivity { get; set; } = 1; + + [Key(40)] + public double HullGridOffset { get; set; } + + [Key(41)] + public double HullArmor { get; set; } + + [Key(42)] + public double HullDrag { get; set; } + + [Key(43)] + public bool HullCanTow { get; set; } } [MessagePackObject] diff --git a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs index c9cef0f3f..c9ff9f175 100644 --- a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs +++ b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs @@ -103,6 +103,7 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemProjectionReader projected.Manufacturer = ParseGuid(item.ManufacturerLegacyId); projected.Mass = (float)item.Mass; projected.SpecificHeat = (float)item.SpecificHeat; + projected.Conductivity = (float)item.Conductivity; projected.Shape = ProjectShape(item.ShapeWidth, item.ShapeHeight, item.ShapeCells); projected.Price = item.Price; @@ -143,6 +144,10 @@ public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemProjectionReader { hull.HullType = ParseEnum(item.HullType, HullType.Ship); hull.Hardpoints = item.Hardpoints.Select(ProjectHardpoint).ToList(); + hull.GridOffset = (float)item.HullGridOffset; + hull.Armor = (float)item.HullArmor; + hull.Drag = (float)item.HullDrag; + hull.CanTow = item.HullCanTow; } return projected; diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index 8459e9bcc..5100aa882 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -339,39 +339,44 @@ public abstract class Entity private void MapEntity() { - var hullData = ItemManager.GetData(Hull) as HullData; + var typedHull = ItemManager.GetRuntimeItem(Hull); + if (typedHull == null) + throw new InvalidOperationException($"Unable to map entity {Name}: missing typed hull row for {Hull?.Data?.ItemId}"); + + var hullShape = GetHullShape(typedHull); EquippedHull = new EquippedItem(ItemManager, Hull, int2.zero, this); Equipment.Add(EquippedHull); - Mass = hullData.Mass; - Temperature = new float[hullData.Shape.Width, hullData.Shape.Height]; - NewTemperature = new float[hullData.Shape.Width, hullData.Shape.Height]; - HullConductivity = new bool2[hullData.Shape.Width,hullData.Shape.Height]; - ThermalMass = new float[hullData.Shape.Width, hullData.Shape.Height]; - Armor = new float[hullData.Shape.Width, hullData.Shape.Height]; - MaxArmor = new float[hullData.Shape.Width, hullData.Shape.Height]; - Hardpoints = new HardpointData[hullData.Shape.Width, hullData.Shape.Height]; - foreach (var hardpoint in hullData.Hardpoints) + Mass = ItemManager.GetMass(Hull); + Temperature = new float[hullShape.Width, hullShape.Height]; + NewTemperature = new float[hullShape.Width, hullShape.Height]; + HullConductivity = new bool2[hullShape.Width, hullShape.Height]; + ThermalMass = new float[hullShape.Width, hullShape.Height]; + Armor = new float[hullShape.Width, hullShape.Height]; + MaxArmor = new float[hullShape.Width, hullShape.Height]; + Hardpoints = new HardpointData[hullShape.Width, hullShape.Height]; + foreach (var typedHardpoint in typedHull.Hardpoints) { + var hardpoint = ProjectHardpoint(typedHardpoint); foreach (var hardpointCoord in hardpoint.Shape.Coordinates) { var hullCoord = hardpoint.Position + hardpointCoord; Hardpoints[hullCoord.x, hullCoord.y] = hardpoint; } } - var cellCount = hullData.Shape.Coordinates.Length; - foreach (var v in hullData.Shape.Coordinates) + var cellCount = Math.Max(hullShape.Coordinates.Length, 1); + foreach (var v in hullShape.Coordinates) { - Armor[v.x, v.y] = hullData.Armor; - MaxArmor[v.x, v.y] = hullData.Armor; + Armor[v.x, v.y] = (float)typedHull.HullArmor; + MaxArmor[v.x, v.y] = (float)typedHull.HullArmor; if (Hardpoints[v.x, v.y] != null) { Armor[v.x, v.y] += Hardpoints[v.x, v.y].Armor; MaxArmor[v.x, v.y] += Hardpoints[v.x, v.y].Armor; } Temperature[v.x, v.y] = 280; - ThermalMass[v.x, v.y] = hullData.Mass * hullData.SpecificHeat / cellCount; + ThermalMass[v.x, v.y] = (float)(typedHull.Mass * typedHull.SpecificHeat / cellCount); } - GearOccupancy = new EquippedItem[hullData.Shape.Width, hullData.Shape.Height]; + GearOccupancy = new EquippedItem[hullShape.Width, hullShape.Height]; } public void GenerateWeaponGroups() @@ -417,10 +422,13 @@ public abstract class Entity { get { - var emptyShape = new Shape(HullData.Shape.Width, HullData.Shape.Height); - foreach (var v in HullData.Shape.Coordinates) + var typedHull = ItemManager.GetRuntimeItem(Hull); + var hullShape = GetHullShape(typedHull); + var hullInterior = GetHullInteriorShape(typedHull); + var emptyShape = new Shape(hullShape.Width, hullShape.Height); + foreach (var v in hullShape.Coordinates) { - if (HullData.InteriorCells[v] && GearOccupancy[v.x, v.y] == null && Hardpoints[v.x,v.y] == null) + if (hullInterior[v] && GearOccupancy[v.x, v.y] == null && Hardpoints[v.x, v.y] == null) emptyShape[v] = true; } @@ -580,6 +588,19 @@ public abstract class Entity : ItemRotation.None; } + private static HardpointData ProjectHardpoint(AetheriaRuntimeHardpoint hardpoint) + { + return new HardpointData + { + Type = GetHardpointType(hardpoint, HardpointType.Hull), + Position = new int2(hardpoint.PositionX, hardpoint.PositionY), + Shape = ToShape(hardpoint.ShapeWidth, hardpoint.ShapeHeight, hardpoint.ShapeCells), + Transform = hardpoint.Transform, + Rotation = GetRotation(hardpoint), + Armor = (float)hardpoint.Armor + }; + } + private static bool IsCargoBay(AetheriaRuntimeCatalogItem typedItem) { return typedItem != null && @@ -986,8 +1007,6 @@ public abstract class Entity public virtual void Update(float delta) { - var hullData = ItemManager.GetData(Hull) as HullData; - TargetRange = Target.Value == null ? -1 : length(Position - Target.Value.Position); var localSecurityLevel = Zone.GetSecurityLevel(Position.xz); @@ -1084,61 +1103,64 @@ public abstract class Entity Position = Parent.Position; Velocity = Parent.Velocity; } - else Position.y = Zone.GetHeight(Position.xz) + hullData.GridOffset; + else Position.y = Zone.GetHeight(Position.xz) + (float)(ItemManager.GetRuntimeItem(Hull)?.HullGridOffset ?? 0); } private void UpdateTemperature(float delta) { - var hullData = ItemManager.GetData(Hull) as HullData; + var typedHull = ItemManager.GetRuntimeItem(Hull); + var hullShape = GetHullShape(typedHull); + var hullInterior = GetHullInteriorShape(typedHull); + var hullConductivity = (float)(typedHull?.Conductivity ?? 1); MaxTemp = Single.MinValue; MinTemp = Single.MaxValue; - //float[,] newTemp = new float[hullData.Shape.Width,hullData.Shape.Height]; + //float[,] newTemp = new float[hullShape.Width,hullShape.Height]; var radiation = 0f; - foreach (var v in hullData.Shape.Coordinates) + foreach (var v in hullShape.Coordinates) { var temp = Temperature[v.x, v.y]; var totalTemp = temp / ItemManager.GameplaySettings.HeatConductionMultiplier; var totalConductivity = 1f / ItemManager.GameplaySettings.HeatConductionMultiplier; - if (hullData.Shape[int2(v.x - 1, v.y)]) + if (hullShape[int2(v.x - 1, v.y)]) { var conductivity = (GearOccupancy[v.x, v.y]?.Conductivity ?? 1) * (GearOccupancy[v.x - 1, v.y]?.Conductivity ?? 1) * - (HullConductivity[v.x - 1, v.y].x ? hullData.Conductivity : 1 / hullData.Conductivity) * + (HullConductivity[v.x - 1, v.y].x ? hullConductivity : 1 / hullConductivity) * (ThermalMass[v.x - 1, v.y] / ThermalMass[v.x, v.y]); totalConductivity += conductivity; totalTemp += Temperature[v.x - 1, v.y] * conductivity; } - if (hullData.Shape[int2(v.x + 1, v.y)]) + if (hullShape[int2(v.x + 1, v.y)]) { var conductivity = (GearOccupancy[v.x, v.y]?.Conductivity ?? 1) * (GearOccupancy[v.x + 1, v.y]?.Conductivity ?? 1) * - (HullConductivity[v.x, v.y].x ? hullData.Conductivity : 1 / hullData.Conductivity) * + (HullConductivity[v.x, v.y].x ? hullConductivity : 1 / hullConductivity) * (ThermalMass[v.x + 1, v.y] / ThermalMass[v.x, v.y]); totalConductivity += conductivity; totalTemp += Temperature[v.x + 1, v.y] * conductivity; } - if (hullData.Shape[int2(v.x, v.y - 1)]) + if (hullShape[int2(v.x, v.y - 1)]) { var conductivity = (GearOccupancy[v.x, v.y]?.Conductivity ?? 1) * (GearOccupancy[v.x, v.y - 1]?.Conductivity ?? 1) * - (HullConductivity[v.x, v.y - 1].y ? hullData.Conductivity : 1 / hullData.Conductivity) * + (HullConductivity[v.x, v.y - 1].y ? hullConductivity : 1 / hullConductivity) * (ThermalMass[v.x, v.y - 1] / ThermalMass[v.x, v.y]); totalConductivity += conductivity; totalTemp += Temperature[v.x, v.y - 1] * conductivity; } - if (hullData.Shape[int2(v.x, v.y + 1)]) + if (hullShape[int2(v.x, v.y + 1)]) { var conductivity = (GearOccupancy[v.x, v.y]?.Conductivity ?? 1) * (GearOccupancy[v.x, v.y + 1]?.Conductivity ?? 1) * - (HullConductivity[v.x, v.y].y ? hullData.Conductivity : 1 / hullData.Conductivity) * + (HullConductivity[v.x, v.y].y ? hullConductivity : 1 / hullConductivity) * (ThermalMass[v.x, v.y + 1] / ThermalMass[v.x, v.y]); totalConductivity += conductivity; totalTemp += Temperature[v.x, v.y + 1] * conductivity; @@ -1148,7 +1170,7 @@ public abstract class Entity var r = 0f; // For all cells on the border of the entity, radiate some heat into space, increasing the visibility of the ship - if (Parent==null && !hullData.InteriorCells[v]) + if (Parent==null && !hullInterior[v]) { var rad = pow(NewTemperature[v.x, v.y], ItemManager.GameplaySettings.HeatRadiationExponent) * ItemManager.GameplaySettings.HeatRadiationMultiplier; diff --git a/GameData/aetheria-world.cc b/GameData/aetheria-world.cc index 811ab8661bae08ec2ac9b6535a5e8551f0a1985a..cb1bb42d6481fe142fd50e3bebc8a77f151af7b4 100644 GIT binary patch delta 491 zcmbu5KTE?v7>6y0NE9ksO{s{|#edb_U6Q+;gSJM|L2%GrE|)tgw27ptrHd5&2HxUF zP?0M1+laesH^-V-DrENEp7-H}-|xL2WV+v(_Z_`LY|c$Wv6K)4K>#NPqJl~mkBz8D zxWQcraSRsZHm9bYo`HpHL*N0^axGzV2_nxi&Sahk^M~=&FO`ylU&&{$l=4e<)~6v{dw2LlpOlPT+ej9@TDZQAe$n zn`%(ebnvH7TlM-$So6-MYznnnjuO8BQ@$EDf^d90k5cX^WY=SrGg8W7{$W51l6sq7=?}}=RQ7TGHC5~enW^L;!;osCTE^ogi XI7-^P=rkkI*gXt_x?p~P5)Z3C`9z-V delta 237 zcmbu(J4%B=5CCA)SOoj6Ql|>+%sytPiAqkg^VllhK@hyae}-Ty{1-_Xf@hF)0V{Kd zT;St-zb-y5i| thermalPerformanceCurveKeys, string hullPrefab, + double hullGridOffset, + double hullArmor, + double hullDrag, + bool hullCanTow, string simpleCommodityCategory, string compoundCommodityCategory) { @@ -136,6 +141,7 @@ namespace GameCult.Aetheria.State.Unity Price = price; Mass = mass; SpecificHeat = specificHeat; + Conductivity = conductivity; Volume = volume; ShapeWidth = shapeWidth; ShapeHeight = shapeHeight; @@ -161,6 +167,10 @@ namespace GameCult.Aetheria.State.Unity MaximumTemperature = maximumTemperature; ThermalPerformanceCurveKeys = thermalPerformanceCurveKeys; HullPrefab = hullPrefab; + HullGridOffset = hullGridOffset; + HullArmor = hullArmor; + HullDrag = hullDrag; + HullCanTow = hullCanTow; SimpleCommodityCategory = simpleCommodityCategory; CompoundCommodityCategory = compoundCommodityCategory; } @@ -173,6 +183,7 @@ namespace GameCult.Aetheria.State.Unity public int Price { get; } public double Mass { get; } public double SpecificHeat { get; } + public double Conductivity { get; } public double Volume { get; } public int ShapeWidth { get; } public int ShapeHeight { get; } @@ -198,6 +209,10 @@ namespace GameCult.Aetheria.State.Unity public double MaximumTemperature { get; } public IReadOnlyList ThermalPerformanceCurveKeys { get; } public string HullPrefab { get; } + public double HullGridOffset { get; } + public double HullArmor { get; } + public double HullDrag { get; } + public bool HullCanTow { get; } public string SimpleCommodityCategory { get; } public string CompoundCommodityCategory { get; } } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs index ff595bf1d..61cb7f66c 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCatalogStore.cs @@ -202,7 +202,12 @@ namespace GameCult.Aetheria.State.Unity var simpleCommodityCategory = ReadFieldString(ref reader, fields, 36); var compoundCommodityCategory = ReadFieldString(ref reader, fields, 37); var specificHeat = ReadFieldDouble(ref reader, fields, 38, 1); - SkipRemaining(ref reader, fields, 39); + var conductivity = ReadFieldDouble(ref reader, fields, 39, 1); + var hullGridOffset = ReadFieldDouble(ref reader, fields, 40); + var hullArmor = ReadFieldDouble(ref reader, fields, 41); + var hullDrag = ReadFieldDouble(ref reader, fields, 42); + var hullCanTow = ReadFieldBool(ref reader, fields, 43); + SkipRemaining(ref reader, fields, 44); return new AetheriaRuntimeCatalogItem( legacyId, @@ -213,6 +218,7 @@ namespace GameCult.Aetheria.State.Unity price, mass, specificHeat, + conductivity, volume, shapeWidth, shapeHeight, @@ -238,6 +244,10 @@ namespace GameCult.Aetheria.State.Unity maximumTemperature, thermalPerformanceCurveKeys, hullPrefab, + hullGridOffset, + hullArmor, + hullDrag, + hullCanTow, simpleCommodityCategory, compoundCommodityCategory); } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 91c3bcb1b..45299a58f 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -182,10 +182,13 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `InventoryPanel` lowers cargo-grid display from that typed `InteriorShape`. Final equipment fit/equip acceptance also reads typed item shape, hardpoint type, hull shape, hull interior, hardpoint masks, cargo/docking categories, - and mass/thermal mass from runtime catalog rows. Hull initialization, - `Entity.UnoccupiedSpace` loadout preselection, shield/thermal simulation, - docking bay max-size, and behavior construction still belong to legacy - simulation projections until those owners are rebuilt. + and mass/thermal mass from runtime catalog rows. `Entity.MapEntity`, + `Entity.UnoccupiedSpace`, grid-offset placement, and `Entity.UpdateTemperature` + also read typed hull shape/interior, hardpoints, base armor, mass, specific + heat, and conductivity from runtime catalog rows. `EquippedItem` inset-shape + and behavior construction, docking bay max-size, ship drag, combat/turret + prediction, thruster behavior, and loadout generator helper predicates still + belong to legacy simulation projections until those owners are rebuilt. The item properties panel also reads typed catalog title names, descriptions, manufacturer, base mass, max durability, thermal bounds, and thermal performance curve keys for basic item presentation without hydrating legacy @@ -228,7 +231,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. dimensions, occupied cell counts, full typed shape-cell masks, hardpoint type, hull type, interior shape masks for hull/cargo equipment, hull hardpoint definitions, behavior kind fingerprints, typed recursive behavior - payloads, stack size, specific heat, durability, and weapon + payloads, stack size, specific heat, conductivity, hull grid offset, hull + armor, hull drag, hull towing flag, durability, and weapon range/caliber/type/fire/modifier classifications. Corporation documents now carry the legacy short name, true description from key 3, name-file and boss-hull legacy IDs, influence distance, allegiance count, full allegiance edges, and music bank IDs. Empty @@ -700,8 +704,12 @@ First Aetheria surfaces to publish: `TryUnequip` gear occupancy/mass deltas onto typed catalog rows for item shape, hull shape/interior, hardpoint masks, cargo/docking category, and mass/thermal mass. - - Done: delete the console `give` command instead of preserving a debug - operator path that hydrated typed item rows back into legacy item DTOs. + - Done: import typed conductivity and hull physical facets, regenerate the + checked-in `.cc` catalog, and move `Entity.MapEntity`, + `Entity.UnoccupiedSpace`, grid-offset placement, and + `Entity.UpdateTemperature` onto typed runtime hull rows. + - Done: delete the console `give` command instead of preserving a debug + operator path that hydrated typed item rows back into legacy item DTOs. - Done: delete `ItemManager.GetCatalogEntries` after all live callers moved to typed catalog selection. - Done: delete `ILegacyItemCatalogReader.GetAll` and the type/global indexes