Saturday, April 22, 2006

We can own movies on tape, here we are in the 90s.

Recently I've been fiddling with wordpress on my local machine and I've finally managed to approach exactly what I want, so I'm quite happy about that. If only blogger was as configurable - I wish they had code tags for formatting code ...

Also I finally got emacs working with ruby - it seems I'm stupid and downloaded a old version. I've also got predictive text working now too, well buffer searching predictive text anyway. So I've downloaded Ruby SDL but I haven't touched it yet.

Anyway how about EINFALL. Well cities require at least two texture sets - the city textures and the underlying plains, mountains whatever land texture set. I've always known this but when I was designing the map - getting it to work was foremost on my mind. So I only have one slot for a texture set and a helpful note saying this should be an array or similar.

Fine so that needs some modification. Also my skills have improved or my programming humbleness has increased. I can see the tile class kind of sucks and there's too much crap it in. So I want to make a much lighter one, that has the added benefit of allowing me to optimize rendering even more if I so wish (ordering tiles in texture sets and pipeline voodoo that I'm not really familiar with).

My map class it's the worse class I've got, apart from maybe the stupid singleton engine class I made. It's a messy class and it's hard to change because it has a messy interface.

Why does it have a messy interface? Well my game stream maps from the harddisk and while the maps being streamed - there needs to be a placeholder. So the placeholder and the actual tile map inherit for a stupidly complicated interface. I intended to refactor this by have the placeholder inherit from the real tile map and then overwrite any critical methods.

On the tilemap also had a poorly thought our basemap parent. I've refactored those to into each other as tilemap was the only thing that used the basemap and I have since written a well thought out generic map class. So I'm spending some time cleaning up these old classes and then I'm going to add more than one texture set per map. Finally for my last magic trick - I'll change it so that the map is serialized rather than use my current crazy system which I wrote to avoid threading. But it's far too hard to maintain. The threading will be extremely simple and isolated so I won't ever get race conditions or two threads trying to save or load from the same file.

Anyway that's what I'm currently up to.

Also I wrote out the knowledge chain in a generic way - that I mentioned in my last post. I'd throw down the source code here but my CopyAsHtml visual studio plugin has stopped working and refuses to start again. It's quite simple anyway it just an extension to C#'s generic dictionary class.


Excellent I've managed to kill off the horrid ILocalMap interface. Thankyou virtual and override.

No comments: