… And i should have known better, but i somehow got tricked from all this new shiny modern C++ stuff and lost sight of the good old ways.
Turn out JSON is a good idea, but only at validation and file interface level. After some benchmarking it looks like serializing to JSON then messagepack a single star system cost some 40ms, which is… Embarrassing. And probably also expected, damn me.
I choose to keep the messagepack format, which is actually quite effective, but leave out the json middleman.
Mind you, JSON is still used to load game rules and to save to disk the game, as this is perfect for human readability and validation, but direct message pack conversion is now used to exchange live data between server and client over the network interface.
This should be much more effective, using arrays instead of maps to avoid also sending strings around. Dataitem indexes and category indexes will be used instead, so both byte count and transmission speed will be greatly optimized.
Another advantage is that, by using message pack, on the client you can actually convert to native Godot structures as before.
