Extending the code documentation generator.

When it comes to documenting code, there is nothing better than a documentation generator, and when you talk about document generators, none is perhaps more widely adopted than Doxygen. I am using Doxygen in my current project and I have been using it in on the last 3 projects. Doxygen is pretty good when it comes to generating documentation and I must add, does the job pretty well too. But besides it’s conventional use, I decided to try and experiment with it a little bit more for this project. I have always believed that unnecessary and excessive documentation is counterproductive to a project life-cycle. Mindlessly making Word documents and adding it to a folder often has no value addition what-so-ever to a project. This is simply because this documentation never gets properly referenced by the developer, designer or the team-leader especially during the time of intense project pressures.

Before you brand me as a development process heretic, or deem me as a free willed do-what-you-like vagabond, let me make things clear. I am neither of those. I am very much in favor of proper and detailed documentation and I myself follow strict processes (, too much sometimes,) in every cycle of the development process. Regarding documentation, the thing I find inconvenient is that fact that, documentation gets fragmented into different files and often into different locations. Some teams are careful never to let this happen and often do control this by using very specialized software (Rational products do ofter such software). But products like these can leave a hole in the pocket of large corporations, and for budget teams like ours this is simply not a viable solution.

From the very beginning I had this gut feeling that documentation should be at one single place and accessible via one single interface. I will go a step further and say that I, as a developer, would like to see design plus the documentation plus the code at a single place at any given time. This is immensely helpful when you are into heavy development. You can link back to the design at a click of a button and if you are intuitive enough to use the right tool, quite literally link to the exact spot you want to go. This to-and-fro movement from documentation to design to code and vice versa can serve as a powerful counter check mechanism. So the docs, the code and the design have to be in perfect sync for it to work. When one changes, everything needs to be updated. I found this very helpful in managing the current project. Kept me and the team always focused on macro and micro level design from the very beginning.

We started off with this idea in our project and decided to implement it via Doxygen. Since Doxygen builds docs in HTML, extending it to incorporate such functionality was, well, trivial. Believe it! I haven’t spent more than about 1 day (total) on this stuff. We have made no code changes to Doxygen program. All our changes are superficial needing only to use already built-in functionality of Doxygen and some minor (but intuitive) HTML tweaks. During this release we went a bit further and decided to link our bug-base to the design-documentation-code nexus. It has proved to be even better than expected. Not all things have been ironed out yet, infact a lot remain, but it already seems like a nice way to handle things.

Design documentation.

Design documentation

Documentation.

Class Documentation

Class Diagram.

Class Diagrams

I am not at a liberty to show more diagrams for the design but rest assured they are there.

Bah! My Flatron finally went dead!

After almost 5 years of continuous service, my trusty old LG Flatron CRT monitor finally bid farewell yesterday. I have been having problems with it for the past 3 months or so and only recently I got the thing fixed. But I had this wired feeling that it was on it’s final lap. The display had gone visibly blurry and I was using the monitor on my test PC for the past 9 months. Too bad, I had played some really cool games on it and most of the development of the current engine and game was done using the same monitor. (A little bit emotional, I know :'( ).

So now I am running the PC with an old 15 inch monitor which is a decade older. I know I have to get a new one soon, but which one is the question? Should I go for a CRT or for an LCD? After seeing the new LCD 19 inch monitors you can’t help but drool. They do leave a hole in the pocket but they do give bang for the buck.

wxWidgets + Code::Blocks, are we there yet?

wxWidgets wxWidgets is a mature and very powerful cross-platform GUI framework with a very liberal non-restrictive license. It has a very big community behind it and a also has a huge support base. There are tons of tutorials, excellent examples and many companies large and small have successfully used wxWidgets to develop their applications. When it comes to GUI frameworks, wxWidgets is among the best out there.

Code::BlocksCode::Blocks is more of a “new kid on the block” Integrated Development Environment when it comes to IDEs in general. If you see the design and layout of the IDE, you can unmistakably see traces of Microsoft Developer Studio and KDE Development environment in it. It reminds me more of the old Visual Studio 6.0 IDE. Programmers who have worked on the VC IDE v6.0 and Code::Blocks will know what I mean. Code::Blocks is written using wxWidgets and shares a very close relationship with wxWidgets framework.

wxWidgets is very similar in design to MFC (Microsoft Foundation Classes), so developers who have worked on MFC tend to gravitate towards wxWidgets more than any other GUI when they have to develop a cross-platform solution. I don’t blame them the least. Learning a brand new framework from scratch can be intimidating even for experienced developers. Being a long time MFC programmer myself, I personally like wxWidgets more than any other GUI out there.

So where does Code::Blocks fit into all of this? Code::Blocks has an integrated GUI editor and code manager (just like the famous “ClassWizard” of VC++ 6.0) for wxWidgets called wxSmith and its is very good for rapid GUI development. Code::Blocks is licensed under GNU GPL so it is the perfect solution for budget development solutions and for programmers that have to pay a bang and a buck for an IDE. The combination of wxWidgets + Code::Blocks takes rapid cross-platform GUI development to the realm of possibility.

A GUI that is very similar to MFC and an IDE that is custom made for it, and not mention all this for ziltch/nada/nothing, seems too good to be true. But wait a minute before you go and make your brand new mega budget office suite, there are some things that are not up to the the mark just yet. As I said earlier Code::Blocks is pretty new and it has some way to go. The IDE has had more than a jagged development path. It’s official 1.0RC release is doggy to say the least, not to mention it was released more than a year ago. The IDE has had a major re-design since then, why, your guess is as good as mine. New projects don’t need redesign this early in their life cycle. Maybe the dev team thought that the IDE could not stand up to others like eclipse, or maybe it was the plug-in system that they added or some other feature, I don’t know.

There hasn’t been a major release of the IDE in a long time and that’s a fact. What the dev team does release, are nightly snapshots and I must say these days the builds of Code::Blocks have been pretty impressive. The product has been in beta for way too long and I wouldn’t put my production projects on it just yet. There are also some issues with stability that the dev team is working on. The last time I checked the IDE was great while using GCC but MS compilers need some work. Though the IDE claims to work with many more compilers, I haven’t checked them all out yet. For Linux development I would recommend this IDE hands down, but for Windows I think I will stick with Visual Studio Express a while longer.

I suspect there is going to a major release of the IDE soon, I hope there is. I am eagerly looking forward to that. But one thing is clear, wxWidgets + Code::Blocks is a win-win combination. I think that wxWidgets will also greatly benefit from a stable Code::Blocks IDE. More people will use it, I am sure. More companies will adopt wxWidgets as a development environment of choice. In any case what Code::Blocks team has achieved is commendable, especially since most other similar project have long gone cold.

References

wxWidgets
Code::Blocks

Fear factor.

Fear factor.Just yesterday I was rummaging through my article archives when I had a run in with my Doom 3 DVD. It’s been a while since I played Doom 3, actually it’s been almost a year and a half since I abandoned the game half way. Interesting, since I hate leaving games mid-way. I generally have two particular reactions to games, a. I don’t like the game in the first few levels and never look at it again. This can be due to several reasons like bad controls, bad graphics, crashes and generally things like that will put off any normal person, or, b. I take an interest in the game and play it till the very end. However Doom 3 is an exception and that got me thinking as to what it was about the game that made me turn away from it.

I got my hands on the game a while back, about 6 months from its release. I was excited about the graphics and wanted to see what all the talk about stencil shadows and Carmack’s new and then controversial algorithm was. Unfortunately a series of accidents (with hardware failures) and incidents (job) kept me busy. When I did finally fire up the game, it was mind blowing. Most of id’s games are, nothing new about that. (For the record I have played every one of their games excepting Commander Keen series.) However after playing a couple of levels, I was already turning away from the game. For one, the game is set in a very dark backdrop and the whole gameplay revolves around getting the player shit scared. Dark alleys, claustrophobic environments and very little to no light. Everything is designed to play on basic human fear. It’s like the whole game is designed keeping only one intension in mind, FEAR.

Along with the environment there are some subtle tweaks done to the FPS style of play that aliments to the overall fear factor. Small things that you may or may not have noticed. For example, notice when you hold a torch, you can’t hold your gun at the same time. This is just an immensely powerful physiological disadvantage that has been designed in. It leaves you virtually helpless against an attacking enemy. Take away the light and hold the gun, and you can’t see what is approaching. The game tries to lead you into a dark void of the unknown! This “unknown” and the “fear of the unknown” is the gameplay of Doom 3. The best way to generate fear is having a set of unknowns. The game is very smartly designed to have you believe, of course, subconsciously that the environment is fearful. You start off on a Mars base where everyone is jumpy and fearful. Again no one knows anything (an unknown there). The base is flush with rumors and information is intentionally kept vague. The PDA you like so much, ah huh, again just used to play on your fears. The PDA messages are intentionally vague and misleading all done deliberately to keep the unknowns pilling up.

The overall game progress is slow and sometimes very slow. You might not have noticed this, but try adding up the amount of time you spend reading your PDA, listening to conversations, switching between the torch and the gun, and loading up saved levels and you will see what I mean. This is very contrary to most FPS style games where the action is fast paced and certainly for id’s games which are known for their shoot and frag style games. All well and good, so what had me dump the game. For one, I got tired of getting scared. Yes I did. I mean after playing the game for like 6-7 hours (total) that fear factor kinda gets boring. All due respect to the game designers, but th game has very little and too few “cool off” periods. A cool off period is an interval just after a intense fight sequence where the player is given time to cool off. This is an integral part of gameplay design especially for action oriented games. There are small and large cool off periods and their placement in the overall game flow is critical. While there are a number of small cool off periods, the game misses out on larger periods which generally occur after a level is completed. Yes, they are there, but they are short.

Another thing that bugged me a lot is the spawning of the enemies. In later stages of the game, enemies get spawned when you pick up a health pack or an ammo kit. This is somewhat controversial. Ammos, health packs, and other goodies are there to give a the player a reward, and often a well deserved one. To have a monster spawn up when you pick up a health pack makes me feel cheated! Period! In the end I just feel that the game lacked variety. Doom 3 is an old run of the mill fire and forget FPS style game, but then again we have played such games too many times already. I was coming over from playing Half-Life 2 and so the comparison couldn’t have been starker. I switched over to Quake 4, completed it and loved it. That’s because the game has a well balanced gameplay, great variety and never got me bored once. Maybe I had expected too much from Doom 3 since I am such a great fan of the old legacy Doom and Doom 2 series of games. They were like the ultimate technology adrenaline boosters when I played them. Maybe my expectation from Doom 3 was a bit too much. Maybe it’s just me getting older or maybe my tastes have changed over the years. I don’t know.

Busy busy week.

It’s been a very busy week. Not only on the coding side of things, but had to finalize some major business related issues. The progress on the game has been a tad bit slow on the coding side, but nothing that can’t be picked up in the coming week. I also had a run-in with a couple of senior colleagues/friends and had some interesting discussions on the future of the engine in general. (Things like an Editor/Scene-Builder for the Engine, future projects and things like that. Maybe in my coming posts I will elaborate further on that.) I generally take the Sunday off, but I am working today on some long remaining issues with the game.

Are we falling into the “Uncanny valley”?

We are currently working out gameplay issues in the Doofus game and I am working on some serious tweaks to the A* algorithm used in the game. One of the feedback from beta testers was the movement of the enemies was somewhat robotic with very sharp turns. Fortunately all the enemies in the game are robots (smart move there), so the robotic nature of movement is kinda OK, still A* algorithm gives very sharp turns. I am working on some way to smoothen out these turns. (I hope it works out.)

Anyways, what the beta tester said, really got to me. He is right, you do get an uncanny feeling. So I decided to do some googling around to find out how other games were solving the same problem and why we got this sort of “uncanny feeling“. Before long I landed in the “Uncanny Valley”. The Uncanny valley is a hypothesis that was suggested by a Japanese roboticist Masahiro Mori [1]. The hypothesis states; As robots became more and more humanlike, people were attracted to them, but up to a certain point. As soon as a robot or an android passed a certain threshold and became too realistic, people were repelled or disgusted. So what does this have to do with game characters? As it turns out the very same thing can affect game characters too.

Another article on the Slate gives more details on the effects of the Uncanny valley on game characters. I had noticed this effect before, where game characters don’t seem lifelike and their faces seem a bit odd. I couldn’t quite nail what it was that seemed strange, but reading the article makes things more clear. I was playing Elder Scrolls IV: Oblivion a few weeks back and there too the characters speaking to you looked odd. Their mouths, speech and gestures did not coordinate correctly. I remember in Quake 4 the character of Voss seems to be very robot like when he spoke to you.

I nearly shrieked out loud at one point. And whenever other characters speak to you—particularly during cut-scenes, those supposedly “cinematic” narrative moments—they’re even more ghastly. Mouths and eyes don’t move in synch. It’s as if all the characters have been shot up with some ungodly amount of Botox and are no longer able to make Earthlike expressions. — Slate

According to me, the Slate article is a bit too harsh and a little bit old. Yes, it may be true that games do suffer from uncanny valley effects, but I am not so sure they are here to stay. In fact after reading the article I fired up Half-Life 2 to re look at the animation effects from the cut scenes and guess what, the Source engine designers have nailed it! I mean the characters may not be totally lifelike but I found the animation system to have, lets say, less of the valley effect. Besides, if you look at the recent animation technologies like the ones in Shrek, Happy Feet, Chicken Little you see no visible signs of the Valley effect, at least I couldn’t. The gaming industry has some of the most intelligent and talented people in the world. With hardware evolving at law defying speeds and demands for realism going up all the time, I am sure these technologies will find their way into games sooner rather than later. To make claims like “though, gaming’s Uncanny Valley could be here to stay”, doesn’t do justice to the industry which is well known for its innovations and breakthroughs.

Something good for your eyes.

Do you feel your eyes getting stressed out after staring at the computer screen for too long? If you answered “Yes” to the question, then this is for you.
No, it is not another eye exercise, it is a nifty tweak for your Windows XP system that I happened to run across. It will take about 2 minutes of your time. Linux users need not worry, your systems probably already has this technology. Just in case it doesn’t, you can install it. It’s called FreeType. This is for Windows XP, Vista already has the new ClearType engine installed.

Recently I read an article about the new ClearType and OpenType technologies. The article caught my attention because it said that it made “reading enjoyable and less stressful for the eyes”. Being a computer programmer, I stare at the computer screen all day so any help to the eyes is a big plus. Microsoft has made the technology available for Vista by default, but what about the older Windows versions? After googling around a bit I found out that you could do the same for your XP systems.

First download the ClearType engine itself. It can be found at http://www.microsoft.com/typography/ClearTypePowerToy.mspx

The instructions on how to install and run the application are on that very same page.

After running and enabling the ClearType engine you will notice your fonts look a little bit different. Watch closely, they seem to have increased in contrast and look more pleasing.

There, you have successfully installed the engine. Now comes the time to take full advantage of it. Well as it goes, Microsoft has released 6 new fonts specifically designed to better the viewing experience with the ClearType engine. They are Constantia, Corbel, Calibri, Cambria, Candara and Consolas. Each is designed for a specific purpose and usage. Refer to the above mentioned article for details.

So where do you get these fonts? Well if you have a friend who has Vista, ask him to copy them for you. Each font is a set of .ttf files in the fonts directory. Or, I found a place you can download them. Its here. Scroll down and click on the “download” link [1]. Unzip the zip file and copy all the font files .ttf to your WINDOWS/Fonts directory. That”s it.

I am using Consolas with my Visual Studio IDE for the past 4 months and I love it. I have also set the same font for my Notepad and other apps that use Monospaced fonts. One thing I would like to mention tough, the above mentioned Vista fonts look hopelessly bad if the ClearType engine is not installed.

References
ClearType information on Microsoft’s site.
ClearType PowerToy.
The FreeType Project.
Adobe”s OpenType Fonts.
Bitstream Vera Fonts.
Information on each of the new Vista Fonts.

The new fonts are a big hit with me, hope you find this information equally helpful.

Blender Bender.

BlenderFor our entire game project the 3D modeling and animation package we have used is Blender. It was pretty much used to make the main character and all the mesh assets in the game excepting the world. We are using another software package for world creation and scene composition, but more on that later. I selected blender for variety of reasons. The most important is of course, it is free, but that was not the only reason for its selection. Don’t let the free thing fool you, blender is a mature piece software with features that can rival even the best 3D modelers out there. In fact some of the features like multires mesh modeling, UV unwrapping, multi UV unwrap and powerful animation system are are cutting edge and the very best.

The second most important reason why I selected blender is its amazing flexibility! OK, so if you have used blender then you might disagree with me. I said might, a veteran blender user might actually agree with me, but for some reason blender has got this nasty reputation of not having a very user friendly GUI. I tend to disagree with that view because it is biased. Yes blender has an unconventional interface that takes a little getting used to, but to say outright that it is bad just because of that, is judging a book by it’s cover. Anyways, that is an argument for other day.

As I said, I selected blender for its flexibility. Blender offers an amazing plug-in support. It supports a full Python plug-in system which is very easy to use. The plug-in system allows blender to be extended very very easily. In fact blender is fully written in Python and is open-source. That is an added bonus, it allows you to have a peek at the source if you want to or if you are stuck somewhere. I personally found blender to be very easy to extend via plug-ins. Python is one of my favorite languages because of its simplicity. No doubt my previous experience with Python also helped.

Since programming plug-ins for blender is easy, you can easily export blender assets into your custom formats. Blender already comes bundled with a lot of exporters and you can open the python code for one and have a look at it and maybe, modify one to suite your needs. However, to dabble with the code, you must have solid 3D graphics and 3D programming concepts. Blender offers very little help or documentation on its design, so you have to understand why certain things are the way they are.

The other thing that helps a lot is the huge blender community support. Help is always at hand, people are willing to help out. That is not to say that blender documentation is bad, it is really good, though I must say the plug-in system docs are a little bit cryptic. But on the whole using blender to create game assets has been a win-win situation for me thus far. I have included some screens of art assets created in blender and then used in the game.

blender1.jpg

Gem asset in Blender

Blender screenshot

Power-up asset in Blender

Game using the same assets.

Assets in the game

For any blender noob (, that is not to say I consider myself a pro,) the best way to get started is the blender video tutorials. They guide you through properly and allow you get you hands set on the blender interface. After doing that it’s just a matter of following the blender documentation. That is all you actually need to get started with the software. Yes, it will take a great deal more to master it, but this should be enough to get any newbie started.

A taste of Oblivion!

Oblivion!A few months back I ran into a friend on mine who was on and on about Oblivion. For those who are blissfully ignorant, The Elder Scrolls IV: Oblivion is an action oriented role playing game by Bethesda Softworks. He was so persuasive, that I finally got hold of the game and decided to have a go at it first thing when I was a little free. So about three months after first getting it, I finally had some time yesterday evening and decided to install and see what the game was all about.

The first thing you notice (or should I say hear) when you start the game, in this amazing title soundtrack. The only thing I can say is, Wow! Awesome music, it captivates you instantly. The story and cut-scenes following the initial game introduction are equally breathtaking. The next thing you do is choose your character. You can actually design your character the way you want him(/her, not sure if a female character is allowed) to look. Nice piece of technology, but kinda unimpressive. OK so you can change the look and feel of the character, big deal!

When the game begins, you immediately have a couple of characters talk to you. One thing I noticed is the facial animation system. Oblivion uses the famous Gamebryo engine, so I was more than eager to see what the guys had put in on top of that. The facial morph animation system looks good, but still not as good as the Source Engine’s facial animation system in Half-Life 2. I must say, not bad.

As the game progress, you are taken through tunnels and dungeons. The pace of the game is good, but I am not too impressed with hand to hand combat. Another thing that ticked me off is an extremely difficult weapon selection window/dashboard. The designers have crammed an insane amount of things in that small dashboard including spells and what not. You have to be pretty quick on the keyboard while selecting a weapon or spell, else you can get mutilated really quickly. This can get real annoying at times when there are too many enemies around. Playing the game, you end up spending nearly 40% of your time on the dashboard selecting and sifting through things. I mean, come on, selection via dashboard, didn’t the designers find any better way to do that?

Another thing that impressed me are the terrain and the atmospheric effects. I must say they are good and add good cohesion to the game play. The game features some interesting effects like moving-grass, thunderstorm, rain and fog. It is commendable that the game manages to keep a playable FPS with all these effects ON, but the results of level of detail calculations are painfully obvious on my dirt cheap 6200 card. I also liked the effects for the Oblivion gate, ooh! you have got to see that.

The gameplay is designed to allow the player to explore and lure him into a sense of a limitless world. This can get confusing at times resulting in the player losing focus of his goal. Sometimes the goal is not clear, sometimes you tend to wander off, or take a wrong turn and get lost, sometimes you can go around in circles. The game, I think, allows you to explore more than what is needed. You can enter any inn, house, castle and anything else and explore. Apparently, you tend to gain very little by exploring and in fact get yourself in trouble if you talk to a wrong person. You can directly approach your goal without exploring anything and it makes little difference to the game, maybe it does, but nothing is made clear.

The game features impressive enemies, but their role is not immediately apparent. Some enemies can pop-up in strangest of places, some just wander the terrain. Some just hit you for no reason and others don’t even seem like enemies till they throw a lightening bot at you. Why? Maybe things will get clearer as I progress. There seems to be one more thing, enemies get harder to kill as you progress. I am currently inside the Oblivion gate and I can tell you killing anything here is pretty damm hard! Thus far the game seems OK, not the best I have played, but good enough to continue playing, which could be a while since I am like extremely busy on the game release.

Updated the website.

websiteAh! Finally found some time to update the web-site. The main index page was rather drab and unattractive with very little on it except some techie nerdy stuff. Well it still does, what did you expect from a techi nerd, but added some spice by installing a random image display component. Looks kinda neat, if I can say so myself.

Along with that the major thing that was added were two articles from my previous blog to the article section on the site. The article on python called “Python: A maiden in a serpent’s disguise” is renamed to Python: Taming the serpent. I also added the game genres article named What are game Genres? Both these articles are from the previous blog on fastnet that went down. There are a lot more things to be added but I could not find time to salvage the entire blog. Maybe in coming week or, whenever; I am bad at deadlines!