Tuesday, March 4, 2008

This devblog isnt dead!

Its just being rarely updated when there arent much visual features to show. Im currently developing animated sprites support for my framework. It includes easy to use sprite interface, binary and/or text sprite file format, and a sprite editing tool. Im working on a sprite compilation tool right now. Since this is a first version, a draft if you like, it is console app which only goal is to compile sprite descriptor file which includes info about each frame of each animation, and produce single texture which contains all image data for frames from a sequence of separate images. Currenty there is only binary sprite descriptor, but I think it might be useful to add XML based one later. In future I will probably make visual sprite editor, or just a GUI wrapper for the console app, anyway the GUI part most probably will be programmed using my framework's GUI simple classes (which are yet to be developed), since I detest every part of WinAPI code and I dont intend to waste my time on learning MFC or whatever, its much easier and faster for me to write some basic GUI classes (I did this before). Maybe only in a far future I will introduce myself to WinAPI stuff, I cant say for sure now. Im hoping to finish basic sprite's features this week and post here a simple demo, maybe even with some source code, so you can tell me if you think I can improve the framework design in some way. Even though not much ppl read me, every opinion which isnt mine is worthless in terms of development. It is important, since I plan the framework to be used not only by myself - thats why Im trying to make it easy to use and flexible for average user.
Yea, I wanted to start porting DaTetris about 2 weeks ago, but I decided to wait until all core features of the framework will have somewhat constant design. I redesigned the sprite class about 5 times for instance, and Im not sure if I wont redesign it again soon. So, no DaTetris port until sprites, simple GUI and fonts are finished. The good part is that sprites are almost finished - I have a stable core right now, all I have to do is finish the compile tool and polish that core. For fonts and GUI I will be using my old code as a base, as I did with the Direct3D part of my current framework. IMO its almost always better to take old code that works, and refactor it to the new level than writing everything from scratch. It speeds up the development and improves the overall quality, since refactoring only improves the code, while writing the code from scratch you can, for instance, repeat your old errors. Also you spend much more time to write everything from scratch and make it work, while when you refactor you already have your working code. And the result code is often indistinguishable from the old one, like in case of the Direct3D part of my framework. If I was writing it from scratch, it would take at least twice as much time to achieve the current state. So, refactoring is one of the most useful techniques in programmer's arsenal IMO.