cohadar wrote:When a serialization library does not deserialize exactly same data as on input it is NOT a small problem.
The whole point of serialization is to save data and get the same data back later.
The fact that number differences are small like 0.000000001 does NOT mean that this is a small problem.
And this is especially not a small problem in networked games where any difference between client and server means that a desync has happened and that game state is invalid for some player.
In FPS games desync is often non fatal, just introduces more lag to the player.
In RTS games desync is fatal and player gets disconnected.
Floats are approximations themselves. So adding accuracy in the serialization generally is just that: only adding accuracy. If one needs perfect precision of floats they shouldn't be using the built in lua number type (ie. use infinite precision libraries that are available in c/c++). If might seem confusing why I am stating this because it seems obvious that one would want to replicate the float exactly. Except you seem to have forgotten that floats are platform specific. Any variation from the server's implementation of float (specifically the precision) while cause a mis-match. It is REALLY bad practice to force your game to be locked like that. Thus, it is not a good idea in the first place to expect that the floats will be exactly the same on the other end. The server should be built so that error is expected in the first place.
On the other hand. A int definitely should be replicated perfectly.
If you REALLY care still and you think I am wrong about this (and I might be) fork the repo. You are using the libraries as evidence to show that lua tables are bad. The libraries are not lua tables. That is like me saying that because a table to json library loses precision json shouldn't be used. That is just really logically incorrect.
cohadar wrote:I have submitted this issue on github to several libraries.
Great! Then stop using this as something to show that these entire libraries are bad!
cohadar wrote:And no, seriously, noone needs self-referencing tables in netcode.
99.999999% of games in the world have netcode written in languages that don't have self-referencing data.
Self-referencing is a non-essential feature of a particular language, like for example how Java uses checked exceptions, but almost no other language does.
Why do you think that java has that? I think you can answer this for yourself.
cohadar wrote:Regardless of all our pro and con arguments so far, having JSON support in love would be a good thing, talking to web API-s is becoming an essential feature in modern gaming. Stats-tracking, achievements, etc..
Love is a minimalistic engine. Things don't just get added because they are nice to have. They get added because they are a must. Json support is definitely not a must because there is the lua equivalent and also json parsers written in lua.
Why are you defending this like your it is your own life? You haven't even addressed the problem that it might not even be faster because of the JIT compiling. (Calling C functions repeatedly is expensive and the api exposed to C is not going to be able to make lua tables as fast.) Json is missing features. Json is easy converted to lua tables. There isn't any reason for json.
There is no reason to put more baggage into love when it already can do it just as fast.