Only send/store attributes that have been changed from their defaults

Registered by Erik Ogenvik

With better support in TypeInfo for accessing the default attributes we can alter the way entity attributes are transmitted to the client (and also stored locally on the server) to only send/store those attributes that have changed from their default values. For most entities this would result in major decrease of traffic and storage needed.
Any such effort would require a coordinated update on both the server and client (or rather eris) side.

Blueprint information

Status:
Complete
Approver:
Al Riddoch
Priority:
Low
Drafter:
None
Direction:
Approved
Assignee:
Erik Ogenvik
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Erik Ogenvik
Completed by
Erik Ogenvik

Related branches

Sprints

Whiteboard

The server work for this change is effectively done. All that is left is to flip a couple of switches to stop sending the defaults. Now that defaults are being stored in a sane way on the client side, we are well on the way to it being implemented on the client side, though inheritance is far from sorted yet. /al

Would this change be optional, or would the changes needed in cyphesis require that all clients connecting used the new Eris release? If the latter, how would this be negotiated between the client and server? I know Atlas has a protocol resolution step in it's handshake; could that be used for marking whether the client could handle this? /erik

It will break to some extent all clients with earlier versions, but I really don't see this as a problem at the current point in our development. Atlas has a codec negotiation step, but currently nothing is done with protocol versions. In a sense this is not even really a change in protocol at the layer that Atlas-C++ implements, but is rather a change in a higher layer. Older clients are still going to see the types, locations and velocities of everything, though bounding boxes for most things will disappear. /al

Regarding the Eris part, a simple solution would be to alter the Eris::Entity::init method to copy all attributes from its types. The alternative approach would be to instead alter the Eris::Entity attribute accessing methods to perform lookup into the TypeInfo whenever an attribute is requested. The former is perhaps more straight forward and easier to implement, while the latter would save on some memory (though I don't think that the memory usage is too great since only a limited number of entities are ever shown to the client at any time) but would require some refactoring of the attribute accessing code (for example getAttributes()).
/erik

The latter seems the right way, but the former would be simple. Inheritance is going to be vital though, and is going to require TypeInfo to store the attribute defaults specific to that class separately, then compile and override the inheritted attributes which will change and propagate down the tree whenever a TypeInfo node is updated. /al

Moving this discussion to the specification URL on the wiki. /al

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.