You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library looks really cool! I love the typescript support.
In order to use this library for my game, I'm currently missing these features:
benchmarks - how does this library perform compared to others
patch encode + decode: enable a game server to encode only a delta of the last changes per client and have the client apply it to its local game state.
produce events from applying patch changes
The text was updated successfully, but these errors were encountered:
Hi! Thank you for your interest in typed-binary. The library has gone through a few updates since your issue was posted, and the patch encode and decode functionality could really enhance this library's usefulness.
I am thinking of connecting this idea with something I have been thinking of recently: partial updates. I have been inspired by what immer.js is doing, and that would allow the code to look as if we were just mutating a POJO, but under the hood it would apply those mutations to the binary representation and record the changes that were made. In addition, there would be an alternative ISerialOutput implementation, maybe DiffRecorder that would record every change to the underlying buffer and represent that. This part of the solution is already possible, you'd have to create a class that implements ISerialOutput and wraps another ISerialOutput that actually does the writing.
//// defining the schemasexportconstVertex=object({x: i32,y: i32,z: i32,});exportconstPolygon=object({vertices: tupleOf(Vertex,3),});exportconstMesh=object({faces: arrayOf(Polygon),});//// creating a buffer to store the binary representation of the meshconstbuffer=newArrayBuffer(Mesh.measure(MaxValue).size);//// writing the initial valueMesh.write(newBufferWriter(buffer),{faces: [{vertices: [{x: 0,y: 0,z: 0},{x: 1,y: 1,z: 1},{x: 2,y: 2,z: 2}],},],});//// applying a partial updateconstbufferWriter=newBufferWriter(buffer);constdiffedWriter=newDiffRecorder(bufferWriter);Mesh.update(diffedWriter,(mesh)=>{mesh.faces[0].vertices[0].x=1;},);diffedWriter.mutations;// the list of recorded mutations that were done to the underlying binary.
This library looks really cool! I love the typescript support.
In order to use this library for my game, I'm currently missing these features:
The text was updated successfully, but these errors were encountered: