registry.c banner

registry.c

1 devlog
5h 30m 42s

A 2-file C-23 library that implements a simple registry (a.k.a. hashmap). It is designed for moddable or data-driven games where the entries could be items, monsters, etc.

This project uses AI

Used ChatGPT for help with CMake

Demo Repository

Loading README...

Kolin63

For those of you who are wondering, NO I did NOT forget about devlogs. In fact, I initially did not plan to put this on Flavortown but then I polished it up a lot and decided I may as well.

Anyways, it is such a small project that more than 1 devlog would be extraneous.

I started making this as part of my other project, Endian Online, which I needed a flexible registry for. Endian is a game with data driven components, so the purpose of a registry is to load items, NPC’s, functions, etc, from JSON files or dll’s / shared objects into the engine at runtime.

For that reason, this registry is designed to have a super fast reading time, but I did not put a lot of effort into making writing fast. Furthermore, there isn’t even a way to remove an entry from a registry because it would be entirely useless for what it is designed to do.

I am proud to say that even though it is written in C, I spent a very small amount of time debugging. My development was made much easier because I wrote unit tests, so testing became very easy. It is entirely memory safe (or at least as close as possible) and it is well optimized. I am using this in my own projects, so I want it to be good.

Attachment
0