Skip to content

Comment on I wrote a commercial game in C in 2025

Comments

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

Serialization 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.

That looks really interesting, I'll experiment with swapping to it!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.