External Publication
Visit Post

Networked zay-es optimization

jMonkeyEngine Hub March 28, 2026
Source
rickard: > If there are updates, I check entityData for some additional components, that may or may not be there I think this will be slow, too. On the client, whenever I have to do a raw getComponent call, I try to always put it in a worker thread to avoid constant frame stalls. I don’t know why you get the error, though. EntitySet will be more efficient at keeping the client up to date and then the components will already be there. So it’s best to use it when you can. …and yeah, I have some client-side systems that have to keep multiple entity sets sometimes. For example, my ModelViewState has to keep an entity set for static objects versus dynamic objects… the only difference being that the dynamic objects have an extra component. Whether such a thing is easy or hard in a particular use-case is dependent on the use-case. I think in a classic inverted ECS (where the ECS code always calls your systems and your systems have a formal interface, etc.) you wouldn’t even be able to request a particular component directly. So at least we have the option. Sometimes it can be a sign that there might be a better component design, too. I’ve had a few cases where I started with “entity with optional component” and ended up switching to “separate entity with targeted component” because it turned out more flexible that way. A bit of a contrived example but in Mythruna there is a morph component that controls how open/closed some animated object is (door, chest, etc.). Instead of being an optional component right on the door, chest, etc. this becomes a separate entity with Morph including the entity ID upon which it operates. In my case, this made the morph system simpler to implement and has the added benefit that I can control the life-cycle of that entity separately. (Give it its own decay, attach names, types, whatever to it as needed) I had to do it because I wanted more than one per object using different morph types (open/close, expand/contract, whatever). But it turned out to be cleaner than an optional component in the end. So it just depends on the situation.

Discussion in the ATmosphere

Loading comments...