@vworlds/vecs 1.0.41 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +1 -1
- package/docs/design-guide.md +6 -3
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/docs/design-guide.md
CHANGED
|
@@ -181,9 +181,12 @@ world.query("ByCell").with(Networked, Position).groupBy(InCell); // index by tar
|
|
|
181
181
|
- **`Relationship.target` is an `Entity` — not directly serialisable, but
|
|
182
182
|
relationships can be networked** when listed in `networkComponents`.
|
|
183
183
|
`vecs-protocol` registers `Relationship.prototype.target` as an `"entity"`
|
|
184
|
-
wire field (u32 eid), so subclasses
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
wire field (u32 eid), so subclasses serialise their target as a raw entity
|
|
185
|
+
id. The client resolves the id to a live entity (creating a ghost
|
|
186
|
+
placeholder if the parent hasn't arrived yet). Use a dedicated relationship
|
|
187
|
+
class per concern — e.g. `ChildOf` for server-local ownership/lifecycle,
|
|
188
|
+
`DrawIn` (in vecs-phaser) for networked display hierarchy — so the two
|
|
189
|
+
concerns don't overload a single relationship.
|
|
187
190
|
- **Retargeting is a plain data change** (no archetype churn). Prefer retargeting a relationship
|
|
188
191
|
over swapping marker components to express "which bucket this entity is in."
|
|
189
192
|
|