More content and a VFS

Once again the past days have been very productive when it comes to Project “W” (although I’ve been a bit distracted by the recent Dawn of War Addon) both in terms of content for the game and in terms of coding.

As for the content, I modeled some new buildings so that I currently have 26 of the ~32 buildings finished. I’ve put my priority on creating models for the buildings you can construct right after the start of the game, so the remaining models I have to do will be for some of the more futuristic buildings that you can only build after researching certain technologies. Since making those “normal” buildings already was much fun I can imagine that creating the remaining ones will be even more fun, as I already have some nice ideas swarming around in my head. I also redid all military units (right now only 2 infantry units and 3 different tanks, but more to come) and finally made a nice looking and easy to recognize logo for the game, which is now also used as the icon for the game’s .exe and as a new background for the loading screen. It’s nothing spectacular but it has something that makes it both unique and easy to assign to the game’s theme.

In terms of coding I fully implemented a virtual filesystem from scratch. Implementing a basic VFS is nothing to spectacular, but as usual I opted for something that fits seamingless into Project “W” so it’s not your basic VFS anymore. The one that I made encapsulates loading of all kind of ressources used in the game (XML, 3D models, textures, etc.) so that within the game code I don’t have to check wether to load a file from disk or from the VFS. So if I need a texture I load it via the VFS and the VFS will then first check if it’s existing on the disk, and if not it’ll load it from the data archive assigned to the VFS. This way I don’t need to update the game’s data archive (the final release will contain all game data in one single file) as the VFS will always prefer a file if it’s existing on the disk drive. Implementing it was no real big deal, but “thanks” to an error on Borland’s side (in the TStreamAdapter) implementing PNG-loading via GDI+ using a stream gave me real headaches, so after a lot of searching I found this link that shows how to fix Borland’s mistake. So if you also want to load a PNG from a stream using GDI+ and get runtime-errors which even the debugger won’t give you a clue about remember to take a look at that link!

So much for now, I initially also wanted to rant about how bad and buggy the new version of Delphi is, but actually that already costed me so much time that I won’t invest in writing something about it. But my advice : if you’re still using Delphi 7, stay with it, otherwise you may regret it.