Open crazyyi opened 6 years ago
I'm working on a similar approach to schemapack
called @colyseus/schema
. It supports optional fields!
I had the same issue so I made a small API on top of schemapack which lets you give entities any combination of “fields.”
Sometimes you can send your entity as {x, y, r} sometimes as just {x, y} and it still works.
Check out patchpack. It supports optional fields and dynamic fields (maps/arrays).
I had the same issue so I made a small API on top of schemapack which lets you give entities any combination of “fields.”
Sometimes you can send your entity as {x, y, r} sometimes as just {x, y} and it still works.
404 error :/
When using this in realtime games, sometimes delta compression is needed but current implementation doesn't support optional fields. So I always have to send everything defined in the schema. Possible to add support for optional field?