Closed evorios closed 2 years ago
related with #22
Thanks for the overview.
I would argue against using a serialization library that uses explicit schemas (such as FlatBuffer) since this is more like to cause additional work with game updates. We should stick to a schemaless approach.
Additionally, i think it's important we pick a library that generates the serializer code once and is then able to reuse the generated code. We can easily spare the initialization time when booting up the game.
From just a quick glance Apex, Bois and GroBuf all fit those criteria. We could put the serializer code for #22 behind an interface and benchmark the performance for a few of those libraries with actual game objects. @garrettluskey already did some serializer work, maybe he's got some input as well.
I have only done work with creating serializable classes. How we package them is still up for debate.
Only now, after more intensive work with the transfer of objects between the server and the client, I see that my research is not relevant, because the RailBitBuffer
and RailRoom
is the most convenient mechanism for translating objects.
I disagree. Although railgun may provide some serialization libraries, it may not be optimal for large object transfer. Railgun, from my understanding, is used to synchronize the server and clients. The object we would have to initially transfer such as a character created when joining needs to be transferred separately.
Adding on-hold as this is a lower priority than synchronization.
Because we work with network in short time we need effectiveness utilities for serialization/deserialization and compression/decompression. I done some research for it.
Binary and json serialization/deserialization
Good overview
Binary
For simple types we have NetPacketProcessor from LiteNetLib
For arbitrary objects looks good follow libs:
Json
Utf8Json without a rival
Compression
LZ4 without a rival