Replies: 1 comment
-
Hm if the entire hierarchy is spawned on the server we would add a lot of entities that would be synchronized to the client for all models, so I don’t think that’s the solution. It would also make lag compensation trickier; instead of just syncing the position of for instance a unit we’d have to lay compensate an entire trees positions and rotations. Although I do think there should be an option to spawn the tree on the server; there may be cases where lag isn’t an issue and where it’s easier to work with the hierarchy on the server. On prefab vs model; the difference right now is that the prefab is the collider and model, where collider lives on the server, whereas model lives only on client. So I think it would be hard to merge them for that reason. |
Beta Was this translation helpful? Give feedback.
-
This is somewhat of an open-ended issue. Currently,
model_from_url
(i.e. the system that handles it) only runs on the client; this has been fine as historically the models have only been relevant to the client.However, if you export a scene from Blender as a
glb
, the resulting prefab is one object where all of its children are in themodel
; this means that the scene does not spawn on the server:This could probably be addressed by adjusting the
glb
/mesh import to use prefabs for everything except the actual meshes, so that the hierarchy is spawned in. However, that may not be trivial (how do you distinguish between a mesh-child and a hierarchy-child?), and it still leads to confusion.I think this is emblematic of a larger issue:
prefab_from_url
andmodel_from_url
are conceptually quite similar, but behave differently, and interact in non-obvious ways, especially across the network boundary.I suspect that they should be merged into
prefab_from_url
, which always runs on the server 1, and the existing behaviour ofmodel_from_url
should be pushed into separate components that only load in on the client. That way, the entire hierarchy is available on the server, but all aspects related to rendering (including the actual meshes) are only fetched by the client.Footnotes
Not sure how this should be handled on the client.
client_prefab_from_url
? That's a bit ugly... ↩Beta Was this translation helpful? Give feedback.
All reactions