Der Post ist nur auf Englisch verfügbar
Too Clever
I’ve did some work again on my snow game project. On the one hand, sorry for the long delay, on the other hand, who is reading this anyway?
This is by far not the first game project I’ve started, but if I ever finish this, it will be the first 3D game I finish. There are some reasons for this, for example that I had some strange bug that I could not find at all or that the code base was so crippled that adding anything would have been painful. But a lot of times, I’ve fallen in a trap which is quite old for me. Considering that I’m younger than the original Macintosh, this has to mean something. My first and most important problem is that I try to write too good code.
I’ve nearly fallen in this trap again with this project, and I want to give a short outline what this means. In this situation here, its all about the rendering. My current code is a mess, making additions of stencil-shadows or new file formats other than .obj difficult. Information, e.g. about the geometry, is stored everywhere, but nowhere central. There’s no chance at all that I can ever create a DirectX-renderer with this code (apart from the fact that there is no such thing as DirectX for the Mac). So I went and wanted to rewrite all my rendering code, storing everything centrally, having shadows, new camera code, better culling and so on.
Big mistake. I coded some outline structures and then was too intimidated to continue writing the actual functionality. I’ve thrown all of this away and now continue to improve the current code base. It isn’t perfect, not even near, but it gets the job done. I will have to write lots of new code for new features, no matter whether I use my old code or rewrite everything from scratch. So what I learned can be summarized as “If it ain’t broke, ain’t fix it”.
Now back to work. I’m currently working on implementing static objects on the map and created a file format to store all map-related data in a central location, so that I can just edit an XML file instead of rewriting my app for all that stuff. So far I’m at the “getting everything to work like it did before” stage. Normally, I wouldn’t make a new post now, but I just wanted to have something related to programming on this site again. So here two nice screenshots:
My .obj-loading code got changed in the process and now has problems with file names. As you can see with the smoke, the rest of the game works. Oh, and the texture won’t load as it should.
This image shows the Newton Debug Display, which renders all collision meshes at their current location. Obviously, the collision and physics system is working fine.
Geschrieben am 17. Oktober 2005 um 12:21