Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
120 stars 2 forks source link

Redesign & rework type serialization & negotiation #2264

Open Frooxius opened 3 weeks ago

Frooxius commented 3 weeks ago

Is your feature request related to a problem? Please describe.

Currently the type serialization in FrooxEngine, both for realtime synchronization and persistence is built on top of .NET's own typesystem. However this presents a number of problems:

Describe the solution you'd like

Implement more custom system for handling datatype encoding & add explicit type negotiation & validation to session communication.

This system will recursively handle any generic types - validating and processing each type within with the custom system.

Primitive datatypes will be encoded much more efficiently with custom handling, to ensure that they are compatible between different runtimes and don't change over time.

Other datatypes will be processed & validated in a similar manner, with full support for compatibility attributes to adjust any types that were moved or renamed.

Describe alternatives you've considered

N/A

Additional Context

This is a pre-requisite for moving to .NET runtime. With the initial step being switching the headless: https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2265

Additionally this will heavily improve support for plugins and mods, as it will lay part of groundwork for ensuring that clients with mods and plugins can remain compatible with ones without them - they will simply be forbidden bringing datatypes that aren't supported by all clients within the session.

Requesters

No response

Banane9 commented 3 weeks ago

Additionally this will heavily improve support for plugins and mods, as it will lay part of groundwork for ensuring that clients with mods and plugins can remain compatible with ones without them - they will simply be forbidden bringing datatypes that aren't supported by all clients within the session.

Sounds great! Fully approve :>

gameboycjp commented 2 weeks ago

For clarification, will this implicitly improve plugin compatibility on its own, or will type negotiation still have to be worked on further before that improves?