Structured Files
Posted in MUD Development
First watch, 4 bells (10:19 pm)

I've reached the point with my MUD project that plain old text files make saving and restoring information prohibitively difficult. I need to add some structure to them. On the other hand, I'd like them to remain easy to read and modify by hand as well as by computer.

Enter JSON doesn't (excluding the hack of using Unicode newlines to separate your lines—DO NOT WANT!).

Anyway, I decided on writing a proof of concept for using YAML, and started it this evening. I haven't gotten terribly far, but far enough to run in to some issues reading files with yaml-cpp. Even reading the YAML 1.2 spec sample files. I'm not sure what's wrong. In any case, I hope to resolve this soon and that YAML works out. I'd really like to use it for the MUD!

I can parse the "complete example" code, though. Right down to each individual scalar. I used recursion to read the nodes until I hit a scalar value instead of their fancy operator>> overloading.

Leave a Comment »