Monday 24 August 2015

C++ string formatting, etc.


The lack of articles recently is because I became a professional game developer. Since January I work as a senior programmer at a major indie developer studio, and for a while I didn't have much energy to work on private projects besides work. The new job also meant moving to yet another country, and it took some time to settle down.

Although it's fun to code AI for bosses, improve the engine, gameplay, etc. as a fulltime job, after a while I felt like working on my own stuff, and recently started to experiment with an idea I had. I was wondering if a database would be suitable for storing all the data of a game, and to check it, I started to implement an engine with SQLite in it's core. I'm not sure how it will turn out in the end, so far I like it. It's convenient to have access to textures, sound files, configuration values, etc., or writing log messages with simple SQL queries, not having to handle files.

As a side effect I've also developed the core of a simple and easy to use string formatting solution which uses C++11 features. I searched for good solutions to support formatted logging, but didn't really like any of them, so I wrote my own string formatter classes, and decided to turn them into a full library and release it as open source, since it might be useful for others too. It's available at https://gitlab.com/almonsin/fmt11

I plan to continue extending the new engine and try to make an actual game with it.