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.
As usual when a project has advanced a lot, like Project “W” did, the steps you make get smaller and smaller. At first you implement the big features and see big changes within a few days of coding but that phase is over for some time now.
And therefore I’m currently working on a lot of the smaller things that make the game more playable/enjoyable, and that includes a lot of small facets of game design. The last days for example I concentrated almost alone on the small tidbits of the military feature for Project “W”. Although that feature was actually done, there were still a lot of things that need to be tested and then turned out that they needed to change at least to some extent to give this feature what it was lacking.
So together with a lot of other things I changed the building queue for units so that you now can construct four units at once (contrary to only one unit which was initially planned) and you’ll also be able to queue twelve additional units. This was necessary cause otherwise it would have taken too much time constructing enough of the later units (like heavy tanks which take some rounds to build). Though this sounds like a small change when first reading about it, it’s a huge change in gameplay if you think about it twice. And this is just one of the “small” decissions/changes I made over the last fews days. I’m not going into detail about the other ones, cause that would be pretty boring, so take this as a fine example of what I did over the last days.
Another thing that was badly needed (and already can be seen to some extend in the last screenshot) were icons for the buttons of the GUI. This also doesn’t sound like something important at first but believe me, there is a huge difference between a button that only has text written on it and the same button with an added icon. The icon will make the button much easier to recognize and even if you’re using those dialogues dozens of time each day, text-only buttons still make it hard to find the correct button that triggers the functionality you’re looking for. So a lot of time also goes into making awfully small icons (32×32 for the final release) to make it easier finding the correct buttons. And since those icons have to resemble a given functionality within a very limited space it can often take a lot of time for just making one small icon. And as an extra here is a small selection of some of the icons I made for Project “W”, with most ones being prerendered with an added 2D part :
Another long outstanding thing that I was “succesfully” getting around the last months was translation of Project “W”. But this is history, as I sat down the last few days and implemented translation features into the game. At first I wanted to use the ITE of BDS2006, but somehow actually didn’t like it. So I implemented the whole translation stuff myself, and you can directly translate strings in the game’s main editor “WeltEdit”, which then are referenced through unique identifiers within the game. A special function then returns the string that matches this identifier depending on what language the game is currently running at.
As with the other data files of the game the translation is also stored within an XML file and adding new languages can be done without having to change anything within the game code.
Though I didn’t spent too much time on Projekt “W” since the last posting I still got some stuff done.
Firstly I went for the technology tree, which was (very much like the list of buildings) something that I pushed back and back during the whole developement. But since the list of buildings is closely tied to the technologytree I actually had to do this, and many technologies are mainly there to unlock new buildings. Other technologies include modifiers for global factors and military stuff like new army units and so on. For the final release I plan on having somewhere in between 30 and 40 different technologies, including “endless-technologies” that’ll make research still important (or at last giving you advantages) when all ordinary technologies have been researched.
And the AI also got some some new feature, it can now finally create military units, make divisions and assign them to important regions. It’ll now even attack other regions to widen it’s territory. But as of now I halted developement of the AI because it actually won’t be a very good idea (and actually not possible) to create a full AI for the AI without having taken care of the next point, the balancing.
For this I started with the formulas that are used to calculate the values for a region, mostly population growth, pollution, etc. Although it may sound easy it’s actually not easy to balance them, cause they can be influenced by buildings in the region, technologies and so on. So I rewrote the whole part for recalculating those values and it should now be possible to have a region with all building places occupied that won’t die of high pollution after a few rounds. As mentioned above this is also important for the AI, cause it tries to construct buildings based of the regional factors. And if it would actually be impossible to e.g. have a productive region with low pollution, the AI would struggle to construct the right buildings.
That’s it for now. But with the research tree almost being done I also got most of the content done for the game, so it’s still coming along great!
You read right, earlier than I expected I started to implement computer controlled enemies (aka “AI”) that’ll control all non-player regions.
But before doing that step I did a lot on the code and made sure all features worked as expected and that there were no bugs left, so I can fully concentrate on the AI without having to fix problems or bugs at the same time. Luckily there wasn’t much to be done on that part, and except for one or two annoyances (e.g. one where you would always move the first created division, even if another one was selected) I didn’t encounter any problems or bugs. So I also used that time to create some icons for different buttons in the espionage window (buttons without icons are actually harder to recognize, so the final game will have icons for all buttons) and to make some minor adjustments to the GUI in terms of usability.
And then yesterday I finally started to get my hands dirty on code for the AI. At first (as mentioned in a comment for my last posting) I wanted to “implement” different behaviour via lists (for e.g. buildings and research) that would have been premade in the Editor and would include a certain building order for different personalities. But I dropped that idea very soon after I wrote a first implementation of the constructing part of the AI and found out that this actually works equally good (or mostly better) and is better to tweak (no more lists, just some parameter adjustemts).
That new approach to the construction AI selects the type of building by checking the demand for a certain value of the region, and it has a special “path” for creating military buildings if the region has a high risk factor (sourrounded by a lot of enemy regions). So basically it has a priority list that changes with it’s personalities and goes like this : “energy is the most important, max. population comes next, ressources production at third, and so on…”. Round after round it then goes through that lists and checks if that value is below a certain configurable threshold (e.g. current energy is below 0.2) and then constructs a building that produces energy. If that value is above the threshold it’ll check the next demand value in it’s list and so on.
So for different personalities I’ll now won’t have to create different building-order-lists in the editor, but just create a list of the order in which it’ll check values with their thresholds.
And though this isn’t the most interesting and/or advanced type of constructing AI I think it’ll get it’s job done and for the first release of the demo it should be more than enough.
And to help me seeing what that AI actually does, and mostly if it does what I want it to do, I added a new debug window for the AI controllers (one for each nation, the personality of each AI controller can be changed on the fly) which includes some debug options (like advancing a certain number of rounds) and mostly the debug log, where the AI writes down what it’s doing. This way I can always see where problems arise and so on.
So much for now, sorry for no new screenshots but AI is mostly code and nothing visual. Next step now is to tell the AI which armie units to build, how to manage them and where to move the divisions for defending it’s endangered regions.
Over the past days I implemented the last missing sub-feature of the military feature : attacking enemy regions.
This was something I pushed back and forth all the time, cause before implementing it I had to be sure that the values and properties of military units would be final, and recently I made a third draft of what properties those units should have and how they would affect combat. The first draft (back in 2003) was too detailed with a lot of different units, which would have been to hard to balance. The second (and most recent) draft was very simplified and after thinking about it again too simplified, so I also scraped that one and made a final draft for military units that isn’t to complicated but still distinguishes the different units from each other. After writing down that new draft I directly started to implement the automatic battle calculation, which will be one of the two methods to fight for regions in the final game. The other method (that I’ll put into the game at some later point, as it isn’t crucial) will be the hexagonal round-based one I showed you in my last posting.
You can see the window where all this happens on the screenshot above, so the feature is in and working! And with a strong army under your command you can now finally take over enemy regions. And though the screenshot isn’t looking too spectacular, the most important additons were made within the code itself and that window is only a basic way (and also not finished, I’ll add some graphical extras to it later on) of showing what happens when you attack a nation. So all the calculations for units fighting against each other are implemented, and when your army crushes the defending units it’ll move into that region and claim it for you.
Now this all doesn’t sound too earth-shaking, but with the addition of the possibility to take over enemy regions I finally have implemented all the features needed to actually play the game like it was supposed.
And this means I’ll soon start to implement computer-controlled enemies (aka “AI”)! I already wrote down my ideas on the AI in my game design document and I plan on using different personalities that are assigned random to your enemies when starting a new game. This way each game should play different as you never know how your enemies will react.
This will be a very interesting part of Project “W”s developement, and you can bet that I’ll let you know about on my blog!