Archive for March, 2007

While we are on the topic…

Wednesday, March 14th, 2007

While we are on the topic of things that suck, I thought I’d chime in. I am writing some math code for Protocce now. That will be nice to have (some math helper functions and a Vector class are some of the things that I really should have added to the old Crown and Cutlass code), but floating-point math sucks! I think I have a function working now to see if a floating-point number is “close-enough” to be considered equal to another number. I’m sure it’ll change over time, but if you want to take a look at it and give me some advice feel free.

I have had a lot of issues in the past with Eclipse and the CDT plugin for C++ development. I would say it sucks as it stands now. Collin has a fancy dual-core machine and it seems to almost be usable on his machine. I only have a lowly single-core processor, though. The C++ indexer tends to go nuts at almost every keystroke (especially in header files) and take up 100% of the CPU for absurd amounts of time. Maybe Collin doesn’t notice since it’s only chewing up one of his cores… Anyway, today I installed a milestone build of the upcoming Eclipse (3.3M5eh) and CDT (4.0.0M5) releases. I have to say, I am pretty impressed! I haven’t really used it much yet, but for about the first time ever it seems to actually be usable. The parser took awhile to finish the first time it ran, but since then it hasn’t gone crazy on me (so far). I’m sure that as I use it I’ll find things that still need work (it is a prerelease version after all), but so far it seems like a major step forward.

C++ Serialization Sucks

Tuesday, March 6th, 2007

If you’ve read this blog at all, you probably have gotten the hint that we’re doing an engine rewrite. It’s great and we’re really excited about it and all, but there are lots of tedious parts that you don’t think about when embarking on this kind of project. For instance, implementing a standard serialization interface.

There are some options other than writing your own in the C++world, but looking around at other languages that are popular now, it’s clear that serialization is a missing feature in C++.

As a project, we’ve looked at a number of solutions to this problem. We’ve read bunches of articles written on the topic, and everyone seems to come to exactly the same conclusion: Serialization in C++ sucks! There is no good way to remove the responsibility from the user of the engine to write Save and Load functions to each class she wants to serialize. She also needs to remember to call all of those save functions at the right time. The serialization system will be smart enough to rebuilt the objects from a file at runtime, but only if the engine user registers load functions at runtime.

It all adds up to a big hassle for everyone involved. We’ll try to make it as painless as possible, but we promise nothing.