From 95c0fa621b4b8fa1a921635254c409a32468a259 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 3 Oct 2026 14:39:09 +0200 Subject: [PATCH] Ship mounts: a thruster's mesh is an unrendered emission surface Ruling thrusters-radiators-are-meshes: thruster and radiator mounts are meshes; the thruster's is not drawn and is the surface its exhaust emits from, the radiator's is drawn. The assembler already required a mesh for both; it now turns rendering off on the thruster emitter, and the preview smoke checks it. The authoring doc states the mount rules and the mesh rule. Co-Authored-By: Claude Opus 5.5 --- Assets/Scripts/Editor/ShipModPreview.cs | 3 ++- Assets/Scripts/Gameplay/ShipModShips.cs | 2 ++ docs/moddable-ship-authoring.md | 21 ++++++++++++++------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/Editor/ShipModPreview.cs b/Assets/Scripts/Editor/ShipModPreview.cs index 44d419d92..090917d9e 100644 --- a/Assets/Scripts/Editor/ShipModPreview.cs +++ b/Assets/Scripts/Editor/ShipModPreview.cs @@ -65,7 +65,8 @@ public static class ShipModPreview ship.HullColliders[0].GetComponent() != null, "one hull collider with a MeshCollider"); Require(Inside(ship.MapIcon) && Inside(ship.Shield) && Inside(ship.TractorBeam), "map icon, shield and tractor inside the ship"); Require(ship.ThrusterHardpoints.Select(node => node.name).SequenceEqual(plan.Thrusters) && - ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter)), "thruster hardpoints with emitters"); + ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter) && node.Emitter.forceRenderingOff), + "thruster hardpoints with unrendered emitter meshes"); Require(ship.RadiatorHardpoints.Select(node => node.name).SequenceEqual(plan.Radiators) && ship.RadiatorHardpoints.All(node => Inside(node) && Inside(node.Mesh)), "radiator hardpoints with meshes"); Require(ship.WeaponHardpoints.Select(node => node.name).SequenceEqual(plan.Weapons.Select(weapon => weapon.Mount)) && diff --git a/Assets/Scripts/Gameplay/ShipModShips.cs b/Assets/Scripts/Gameplay/ShipModShips.cs index 9e06099c9..d60dc2a8c 100644 --- a/Assets/Scripts/Gameplay/ShipModShips.cs +++ b/Assets/Scripts/Gameplay/ShipModShips.cs @@ -122,8 +122,10 @@ public static class ShipModShips var thrusters = plan.Thrusters.Select(id => { + // The thruster's mesh is its exhaust's emission surface, never drawn (ruling thrusters-radiators-are-meshes). var hardpoint = AddOrGet(Node(id).gameObject); hardpoint.Emitter = Renderer(id); + hardpoint.Emitter.forceRenderingOff = true; return hardpoint; }).ToArray(); var radiators = plan.Radiators.Select(id => diff --git a/docs/moddable-ship-authoring.md b/docs/moddable-ship-authoring.md index 5a69f06de..6072e1afb 100644 --- a/docs/moddable-ship-authoring.md +++ b/docs/moddable-ship-authoring.md @@ -161,13 +161,20 @@ import](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/blob/main/ to read the package GLB asynchronously and map its stable node IDs to Unity transforms. It keeps a partially loaded object inactive and destroys it on failure. `ShipModShips` preloads one assembled, inactive prototype per hull -that names a `Visual`, at boot and before the game scene loads. `ShipModPlan` -decides which anchor fills which `ShipInstance` slot: the hull's hardpoint type -says what a mount is, and its anchor (id equal to the mount id) supplies the -node; a thruster mount needs a `thruster-emitter` anchor, a radiator mount a -`radiator-mesh` anchor, a weapon mount muzzle anchors parented to it. An -`articulation` anchor is an ordinary mount node until pivots move onto -`HullData`. The shared effects (shield, tractor beam, ping, explosion, map +that names a `Visual`, at boot and before the game scene loads. +`ShipAuthoringStore.Validate` owns which hardpoints carry anchors and which role +each anchor plays. Mount anchors exist only for hardpoints that show on the +model: weapons, radiators and thrusters. Each such hardpoint needs an anchor +whose id is its mount id: `thruster-emitter` for a thruster, `radiator-mesh` for +a radiator, `weapon-mount` for an energy, ballistic or launcher hardpoint. An +internal hardpoint (reactor, sensors, shield and the rest) has no anchor, and +an anchor taking its id is refused. A thruster's or radiator's anchor node is a +mesh: the thruster's is not rendered and is the surface its exhaust emits from, +the radiator's is rendered. A weapon mount is a point, and each one needs at +least one `weapon-muzzle` anchor whose `ParentId` is the weapon's mount id. +`articulation` is reserved for pivots and is never a mount; no pivot is +planned until pivots move onto `HullData`. `ShipModPlan` then maps the +validated pair to `ShipInstance` slots and refuses nothing itself. The shared effects (shield, tractor beam, ping, explosion, map and invisible materials) come from the Addressable `ShipModTemplate` prefab. `ZoneRenderer.LoadEntity` clones the prototype when the hull names a `Visual`. Gameplay reads a mod ship's records from the derived catalog; the package