3 ms·
> Serialisation Compared to serialisation in almost any modern language, serialising state in C (or C++) is excruciating. There are no reflection capabilities i
by lelanthran 2y ago
> Serialisation Compared to serialisation in almost any modern language, serialising state in C (or C++) is excruciating. There are no reflection capabilities in C, and minimal capabilities in C++, so you need to manually specify each and every field when serialising or deserialising the game state
I got tired of that years agao, and have used this approach with success in a few projects: https://www.lelanthran.com/chap2/content.html https://www.lelanthran.com/chap2/content.html
- steeleduncan 2y agoThat looks really interesting, I'll experiment with swapping to it!
- zvr 2y agoSerialization in C has a very long history. Back in the '80s we were defining the struct's and then used rpcgen to automatically generate code that reads/writes them, for RPC calls. I think the most widely deployed mechanism nowadays is protobuf.