Yes, I’m still alive
As you can tell, I’m really bad at this writing thing.
I’m currently working on a couple of .NET projects. The first is to instantiate a rendition of a galaxy by using the rules for creating a planetary system using the rules found in Universe, a RPG originally created by SPI.
I pretty much have the code written to create a galaxy and I just need a way to display it to ensure that all those numbers actually turn out to create nice systems and to have some visual feedback on how they look.
In order to do that, I’m working on the next (and parallel) project. I have a book that creates a 3D engine based on OpenGL. I am, in essence, translating that in to C#. It’s interesting to see what sort of things people who code in C/C++ do and assume.
I know, I used to be one of them :)
The most difficult thing to “translate” is the assumption that anything can be a stream of bytes. For example, reading the header of an archive file in the author’s code is just, essentially,
struct header {char sig[5]; int major; int minor;} h;
fread(&h, sizeof(h), fp);
This causes a problem in C# - mainly because pointers aren’t safe code. So I end up reading the header an entity at a time. *And* I have to account for padding.
There’s an extra 3 bytes after the sig because ints have to be on a 4 byte boundary.
Thus I’ve created version 2 of the archive file that will treat it a bit differently. I can still read the old format, but if any changes are made it will write a new format file.
At any rate, once I have a display system for the galaxy then I can worry about how to evolve this into a game.
Next time (which should be a few months sooner that the lag between these last two posts) I’ll post up what tools I’m using to build this stuff. It’s just that it’s at home now and I’m stealing time from work to post this up.
Explore posts in the same categories: Coding
