Chipping the Bug.

There is an old saying in software development circles which goes something like this, “A bug can never be created nor destroyed. It can only be changed from one form to another.” While that is not to be taken too literally, bug fixes do often lead to regressions that are difficult to track down and fix. Especially the ones that occur at the end of release cycles, or the worst ones that occur at the end user’s or the customer’s machines. Well not if two researchers, Chad Sterling and Ron Olsson, from UC Davis have their way.

Their research has lead to the creation of a new technique in debugging software which reduces a large piece of software into smaller fragments called “variants” which are then used to track down the bugs (reference). The technique is called “chipping”. They have even developed a software (“chipper”) called ChipperJ in Java that they claim reduced a large program down to 20 to 35 % of it’s size. I have no idea how the program does this but apparently it uses the original software code to do it. While it is debatable if and how such a system would apply to industry level software that spans more than million lines of code, it is certainly something to be interested in if you are a developer. While the technique may not remove the human factor all together from the process of debugging, it certainly is a novel idea that could push automated testing to another level.

The authors of the ChipperJ program seem to suggest that their system could be applied to large and complex projects. Their research paper does provide interesting insights into the method. The authors are of the view that their paper is just a preliminary draft of what promises to be a new approach to debugging software. The method, they claim can be combined with other more traditional methods like “slicing” in the debugger to get even better results.

Leading a Second Life.

Ah again a long week with no updates to the blog. Actually this was something I was planning to write a couple of weeks back but never got the time. As it goes, a few of months back I had downloaded Second Life and decided to give it a try. I am still pretty new to this concept of Second Life so these are basically my initial reactions. Once again, the game is something new, something I certainly look out for thesedays. I haven’t really played any MMOs before this one, so I was a bit exited. Installation and setup of the software was a breeze. I did get a nice name for myself and decided to sign on.

The game features a in-depth tutorial but I found it a little bit difficult to understand. There were some poor unfortunate souls in there who couldn’t understand anything at all. I think the tutorial focuses more on how the program should be used, but fails to address what Second Life is all about. I would rather like a tutorial that explains to me the “possibilities” in the game. I would like the tutorial to explain to me the different experiences that can be had in the world of Second Life. Essentially how to go about having a very different life. Maybe some examples of how others, maybe senior players have gone about and created their own worlds. Yes, the tutorial does a good job at explaining stuff like which keys do what and what needs to be done to achieve something, but fails to address finer issues with the game. Like, for example, how to do macro level things like building your different life. You tend to pick things as you go along, but I would have loved a more in-depth tutorial.

The game is basically a 3D world or should I say a 3D chat room. You can log into a place and the content then gets pulled off the net into your PC and slowly you can see the world. The login interface looks deceptively similar to a chat or an IRC application. Maybe the developers intended it to be that way so players can pick things up rather easily. I tried to log into different places to see that it was all about. I must say, places with high number of users are particularly slow. Unfortunately these are the very places that are interesting and worth a visit. Catch 22 there. If you want to logon to Second Life you better have a high speed connection, else you can forget about it. Other places I visited were mundane and uninteresting. Some places were plain weired! Some were disturbing (, parents watch out there).

The game is great if you like to make friends on the internet or spend your time chatting on IRCs. The game allows you to push this further and adds a whole new dimension to your social networking experience. Second Life provides players with “Unlimited Freedom”. You can check out the FAQ for more details. You can even earn money off of Second Life, I haven’t explored that part however. The fact is I got bored rather quickly. I am not the kinda guy who you would expect to find on a chat channel, or one who spends a lot of time on a social networking site, so I quickly lost interest. I have too much things to do as it is in my First Life. I haven’t given up though. Maybe after a few days I might try again and see if I can really get the hang of a “Second Life”.

Silverlight looks promising.

Recently Microsoft released version 1.0 of it’s “cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web”, called Silverlight. Last week I had a sneak peek at the software and I was presently surprised to see that Microsoft is also developing a Linux version of the plug-in with the help of Novell, codenamed Moonlight.

As such Silverlight is just a plug-in that can deliver interactive .NET content on to your web-pages. It is particularly interesting to see where this leads to with regards to game development. Silverlight is almost certainly a challenger to Flash’s monopoly on web-based games. It offers a flexible programming model that supports javascript, .NET, and other languages, so it will particularly hit a cord with programmers that already know these languages.

Are we going to see more Silverlight based games? I am sure we will. .NET applications are very easy to build now that there are great environments like the Visual Studio, Visual Studio Express and #develop. It just means people are naturally going to build games that run on Silverlight. This software is clearly something to watch out for if you develop web-based games. I hope Microsoft offers graphics hardware acceleration in some form on the Silverlight platform. That will just be amazing.

Vista Woes.

Ah had my first Vista experience! I am been doing some heavy debugging for the past week and have had to keep myself awake drinking 6 cups of tea a day. For the record I am not a heavy tea drinker, but I had to do it because the work load is a bit heavy. One of the machines I was debugging on happened to be a Vista machine. This is my first taste of Vista and, boy is the OS corny! The UI in true Microsoft tradition has been revamped. I was kinda expecting that, but it was nothing out of the ordinary. I have seen Linux boxes that looked slicker, but not bad on the whole.

It is the whole attitude of the OS that ticked me off. For one it takes me for a freaking dumb ass. The warning boxes are pretty nagging. Now, some people told me that they can be turned off, but even so I felt that the engineers have gone overboard. I can understand that safety is concern these days, but come on guys a box to ask me if a want to run an exe or copy a file is just too much. Even if you do want to, where are the “OK” and “Cancel” buttons. Why are you making me read “Do want to Move and Overwrite”, “Do you want to Move and Keep”, “Do you want to Move to Latvia” … every time I want to copy a file, bull shit let me do my job. I would like to ask Mr Gates, “Just because we use your OS, do you take us for a bunch of f***ing retards!” The OS kept nagging me like I was a 2 year old kid.

Another dumb message box for installation. The OS sounds a big alarm bell when you try to run any installation. Almost like an anti-virus program would when it detects a virus or a worm attack. Seeing the message box even scared me, and it was in-fact my very own installation package. For a moment I thought the installer was corrupted or infected by a virus. The next bad experience was when we tried to install VNC. No! Doesn’t work. Set a rule in the firewall, no, doesn’t work. Turn off the firewall, no, doesn’t work! Oh its our new Defender Service! Put a rule in the defender service, no, doesn’t work! Oh yes security, sorry we don’t allow programs like these to run. Please use our 1000$ Remote Desktop. Oh sorry, it’s not available for Home edition, buy our 10000$ Professional Vista Edition. Oh God getting VNC up and running was a nightmare. The OS is also a big resource hog. It was slow while pushing a lot of windows and applications on a AMD Turion 2.0 64bit, dual core CPU, which can run XP at comfortable speeds.

Eventually we did get everything working and the game ran with but the whole experience just left me with a very bad taste for Vista. There are many more things that got to me, but this rant has gone on long enough. Maybe I need some serious straight 8 hours of sleep. Looking objectively however, there is nothing special that Vista offers and I can’t think of 2 reasons to upgrade to it. The ONE reason I will have to upgrade to this naïve OS is DirectX 10. I know it will be punishing, but unless Microsoft comes up with DirectX 10 for XP, which I know will not happen, I will have to move to this OS ultimately. I hope sanity prevails and the service packs for Vista turn off the kindergarten nanny in the OS.

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.

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

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.

Games and game development on Linux.

This week I found some time to dabble with development on Linux. The O2 engine and the Doofus game both have been written to be cross-platform with full ANSI C++ compatibility. It was one of the stated objectives when we first began on the development of the engine that it would be portable across platforms. I must admit I have done all the development of the engine under Windows and with Visual Studio Express. However, I do intend to port the engine and the game to Linux and Mac OS’. So last week I fired up the Fedora Core 6 installation just to have a feel of what changes Linux has had over the years.

Its been about 4 years since I did any serious development on Linux and I was kinda surprised that things haven’t changed much. FC6 comes bundled with KDevelop and Eclipse. I tried both and found both to be wanting. I mean I use the free VC Express edition under windows and both these IDEs were nowhere near to even the free version of VC. I had expected more, unfortunately I was disappointed. Then I downloaded Code::Blocks, one of the IDEs that I have a keen interest in because of its close relationship with wxWidgets. The IDE is kinda neat. I am impressed, because I am completely at home on it. It also has a great feature where you can just import VC project files in it, cool! Though it is nowhere near as good as the Pro versions of VC, I found it much better than KDevelop and Eclipse. In my college days I use to program using emacs, but I have gotten lazy over the years, especially after joining the dark side ;)) . I like IDEs and I always hated the Automake system, it seems like too much work.

My next adventure was trying to run a sample OpenGL application. I wrote an application that renders a simple cube on the screen using OpenGL. Hmm.. setting up OpenGL under X is almost as painful as setting it up in Windows. But, after about an hour’s work I was there, only to find that the application’s was running at a measly 50 FPS! I mean, I run my game on this m/c under Windows and it runs at about 40 FPS with everything from stencil-shadows to environment bloom turned on. A simple cube application like this should run at about 1000 FPS. After much searching on the internet, I found that I, in fact, needed to update the display drivers. The application was using default Mesa drivers, which fall back on software under OpenGL. I did download and install NVIDIA drivers and I would like to say its not as trivial as setting the drivers up under Windows, and finally the application ran at about 1000 FPS as expected.

I did dabble more with Linux. Also installed and tried the famous Ubuntu distribution. Did some python programming also and I must say that it was easier to work with than I had expected. As a development platform Linux seems to be a good, I had expected more but it’s not quite there yet. Eclipse seems promising, though it needs some more work. Code::Blocks is good and I am sure the team will do a good job with their upcoming release. On the whole, Gnome and KDE have also grown up, so its kinda nice to see good and fast GUI under Linux. Administration has also become a breeze with so many applications around. There is almost no need to go to the console to get things done, well almost.

As a platform for gaming, it seems to whole another issue. I can see there are a lot of problems that have to be addressed. Why are there no accelerated display drivers on Linux? Even if I did manage to port my game to Linux, for my game to run on a Linux system, the player must download my game first. Then he must download and install NVIDIA/ATI drivers. Then install the game and then finally play it. How on earth do you expect a non techie to do that? I mean I know people who do not even understand what a driver is. Do you expect them to download and install a Linux driver just to play a game! To my surprise, none of the Linux distributions I saw have NVIDIA or ATI drivers, they all have Mesa drivers! Holy cow! I mean Linux is such a great platform for games, but the setup of even the most noted Linux distributions fail to address simple issues. The gaming market is huge and I am very very surprised that the Linux community and distributors have no interest or are simply ignoring vital issues. Yes there have been game that are natively released under Linux. Some major development houses do release games for Linux regularly. But what is Linux’s market share in the gaming business? After Loki went bust, gaming on Linux has been on a decline. Why? According to me there is no reason. The platform is solid and has gotten better. There is nothing fundamentally wrong with Linux. There is a lot of potential to grow if some simple issues are addressed.