June 14, 2006

[Personal] Coding (into a) Corner

I've been working on my side project (a VB.NET 3D game engine) for quite some time now, and I'm finally getting to the point where there is noticable progress. What's funny is that I'm seeing progress because I decided to start over.

I'm a decent coder, but I'll often find that even though I plan out how I'm going to handle a piece of code, I'll still often code myself into a corner. I'll go extremely far down a path, run into a fairly serious issue, and then just try to code around it. Most of the time, I can...but the side effects of the workaround can often have a cascade effect throughout the codebase.

When I start seeing one of these cascade effects, I stop coding and examine the codebase, trying to figure out where I went wrong, what I needed to do, and what I can do to prevent making a mistake like that in the future. Most of the time, I can figure out a way to refactor my way to where I need to be.

For my engine, though, I had made enough incorrect assumptions early on that it essentially forced me to Alt-F, N my way to progress.

On the upside, progress is definitely visible. I've got my UI working in-engine with all of the controls properly abstracted out. I've got the event system properly broadcasting user events. I've got the game state manager properly handling state setup and teardown. I've got the pathfinding system set up so that it can work over multiple timeslices. I've got the render state manager set up in such a way that I get a major performance boost during rendering at the cost of the first frame rendered after losing the Direct3D device being rendered incorrectly (second frame on works fine.)

The only major "hiccup" I can foresee is integrating my object picking system into my GUI system, and so I'm going to pause work for a bit to try to design it out a bit more. After all, I have no desire to Alt-F, N myself again...

No comments: