Wanted: More than a simple Add/Remove.

There are some flawed assumptions about Windows vs Linux debate and one of them is, “It’s easier to install applications on Windows than it is on a Linux distro”. A few weeks back I was attending a seminar on some rather uninteresting technical presentations. That’s besides the point, what really is the point is, in one presentations the speaker actually stresses on the fact that Linux is difficult for mass adoption because it is very awkward for a new user to install applications on Linux. That’s laughable, because it’s clear the speaker has not done his homework nor has he any experience with any modern Liunx distro. This archaic argument has it’s roots at the time when you had to compile almost everything under Linux to get it to work. Although *NIX veterans may still do the same, for most of us times have changed. On the contrary I have to argue otherwise. Installation on Linux is slowly becoming easier, in fact in some cases it’s almost trivial. Unfortunately the presentation did not offer a Q&A session (strange I know), else I had some “really good questions” for that particular speaker. Anyways, I have my blog to rant about them 😀 .

After using Ubuntu for about 9 months now, I have grown to be extremely fond of the Synaptic package manager. While there are other package managers under other distros, (and I don’t want to belittle any of those) what would really be interesting to see is something similar on other operating systems, maybe Windows too. For those who have little clue as to what Synaptic does, and for the windows (only) users; Synaptic is Add/Remove Windows feature on steroids. It takes a step further in installation features and combines some very crucial functionality that is not present in the normal Add/Remove. Contrary to what was said and is popularly believed, Synaptic is so much more than a simple add/remove. It manages download, setup  and a full install of an application including the automatic setting up of dependencies of an application or a library with a click of a button. It’s almost a no brainer. All available applications are listed and categorized on distro servers and you can use synaptic to query and search them as required.

Synaptic package manager.

One of the greatest strength of Synaptic is probably the categories and filters it allows on installed and installable packages. It allows the user to browse through all packages in a particular category, thus enabling him to see a variety of similar or related packages, before he decides to install or remove a particular application or library. To a veteran debian and/or Ubuntu user this may seem trivial, but it is not. When you consider other platforms like windows where such facility is unavailable, hunting down applications often means a trip to Google. Now there is nothing wrong with that. However very rarely does Google results throw up exactly what is required, unless of course you are an “absolute nerd” at search-engine queries or, you are extremely lucky. Often times it’s through a lot of query refinement do you get down to results you require. Queries like “comparison of paint applications”, “best photo editing software”, “list of  best mp3 players” are all to common. This however doesn’t always give you what you are looking for and may not provide you with the best possible alternative out there. For example, a query “best photo editing software” returns link to reviews, and it’s only after some refinement do you really get to software download. Under Synaptic, it’s just a matter of simple search. I did a “C++ IDE” search under synaptic and it returned me a list of IDEs available in a snap. Everything from Code::Blocks, Eclipse, Anjuta were listed. All I had to do was right-click install on the one I wanted and Synaptic took care of all the dependencies and every other headache.

Synaptic is interesting but like most problems with Linux, it is distro specific. You will find Synaptic on most Debian based distros. Ubuntu takes it a step further and also features an interactive separate Add/Remove feature where the user can browse entire categories of applications with a brief explanation on each of them. (I am not too sure if other distros support Synaptic or how far it will work with other packaging systems like yum and others). However there is an interesting project in the works called PackageKit. While it looks very much like Ubuntu’s Add/Remove feature it also works on other distros, and infact works towards “providing a common set of abstractions that can be used by standard GUI and text mode package managers”.

There are a lot of software applications out there. So many in fact that you would probably miss out on most of them. You would never know they existed because you never go out and look for them and even if you did, you would probably miss out on most. Which is exactly why applications like Synaptic and PakageKit go a long way in advertising these apps. I would say that such functionality is probably an feather in the cap of distros like Ubuntu and Debian. It actually expands the distros by giving them a reach beyond a normal CD/DVD install and frees the user from the shackles of “using only what the OS provides”.

Opera is impressive, but back to Firefox.

Ah for the last 4 days I have been using Opera, and that’s after a pretty long time. I must admit, for the past 5 years I have been been a loyal Firefox fan. There was a time when Opera used to be my browser of choice, but somehow Firefox managed to squeeze it for the number one position. However the recent hype of Opera 9.5 was just enough to pep my interest in the browser once again. I decided to give the browser a try and found Opera to be surprisingly good. The interface is more streamlined and the browser gives a lot of screen real-estate to work with. No doubt other people have also mentioned the very same points.

Firefox 3 was also released about 2 days back so one can’t help but compare the two. Actually I have been using Firefox 3 betas for the past couple of months so the final release did very little to add to what I was already using. True to it’s tradition Firefox 3 has been an excellent release, at least for me. Firefox 3 also boasted of considerable features that were added in this release, and I must say it does deliver on them. Oh yes, and if not less, there was an equally amount of hype surrounding Firefox 3 release.

So what’s the truth? Which browser is better? There are things both browsers have and don’t have. I would have loved to have a seed dial for Firefox by default. I know there is a plug-in for that, but it’s such a nice feature to have. On it’s part, Opera should have something like NoScript (by default). That thing has saved me countless times before. Then again Opera’s Dragon Fly is equally impressive. Firefox also has a lot more plug-ins and using Opera just makes me miss all of them.  I am not too big on themes, so it doesn’t bother me one way or the other. Apart for these and other small things, most of the hype created around the release of both browsers is largely unwarranted. None of the two browsers bring in revolutionary changes, and none of the browsers are deficient in any particular area.

For me the most important point for adopting any application and particularly applications that I tend to use on a daily basis, is “productivity”. It’s “how fast can I adapt” or “how fast I can get things done”. It’s more about “how much do they nag” and “how annoying things are while using them”. That’s why I generally take a considerable amount of time in deciding whether an application is worth the effort to switch to and/or adapt to. Browsers absolutely fall in that category.

I guess most of the people who surf the net, of-course myself including, are similarly fanatical about the choice of browsers. While Opera is going to stay on my box for some more time, Firefox retains the numero uno position as far as I am concerned. Not because it is revolutionary or because it is the best. It’s because, well, I am simply used to it!

A long silence.

OK I have been silent on the blog for some time know. I know I know, but there were some pressing issues that needed 200% involvement both on the game and on some other issues as well. So it has been an unusually quite two weeks. Actually I have a list of posts that I am through half-way and haven’t been able to finish them and/or polish them up for final release. I hope the next few weeks won’t be this quite since I see an easing up of the work from now on. Also the game is mostly there. Even though beta testing continues, no breaking bugs have been reported thus far.

Beyond C++

It’s a fact that C++ has been the most successful and probably the most widely used programming language till date in the gaming industry. Even if you were to look at the software industry as a whole, a near countless software projects owe their existence to the language and probably many more will eventually be made using C++. Universities around the world still churn out thousands of CS grads with C++ knowledge and there will be no shortage of programmers who know C++, at least for some time to come. So why is C++ so popular? The reasons may be many (, I am sure there are other near infinite blogs which touch on this,) but at the end of the day it just boils down to the simple fact, “it gets the job done”! While it made good business sense to employ C++ (some years ago), it doesn’t make all that much sense when we consider scalability looking into the future. C++ in it’s current form is — well, simply inadequate. Most people will agree with me that C++ has probably outlived it’s time, and it was time the programming community as a whole moved away from the language. Easier said than done though, but the question to ask is, what real options do we have which provide radical new changes to the way C++ operates? Very few approaches I would say. Before you raise your hand and give out the name of <insert your favourite language here>, let’s look at some of the challenges facing future game development and/or rather future software development as a whole.

Lets first look at the C++ language itself. It’s well known that C++ has it’s faults. It’s not an easy language to learn and an even more difficult language to master (, compared to other languages). It takes a substantial amount of time and experience to understand the intricacies of the language and takes even more time and effort to fully grasp the quirks and subtleties involved in software creation using C++. Typically it takes quite a lot of time before an average programmer can become truly productive with C++. The learning curve for the language is high and not for the faint hearted. Besides this the language has increasing come under flak for allowing seemingly undefined behavior without complaining too much. The language does very little to deter flawed assumptions regarding some (very) basic constructs that contradict how things actually work. Even with proper planning, strict development cycles and stringent coding practises, software development using C++ is difficult. Memory management is a bane and can cause unexpected and unwarranted catastrophes which are known all too well in the industry.

There are a growing number of languages that address the shortcomings of C++. Be it Java, C#, Python or most new(er) languages, all try to fill in the gaps left out in C++. As a matter of fact most languages do a good job at it. However with all it’s faults, C++ still stands out as a viable game development choice. That’s because of 2 primary reasons; a) it has vastly more libraries, code dumps (, I am talking about game development only), engines, examples and everything really, that it simply wins over the argument right there. True many libraries have bindings to other languages, but most of them seem rather inadequate or poorly maintained. Besides there are a lot more examples on cutting edge technologies (,especially graphics) written in C++ than there are in all other languages put together. and b) It’s easier to get programmers for C++ than any other programming language, Java being the exception. Things are changing though and there are some concerted efforts being made to promote other languages and platforms (XNA, PyGame) as viable game development alternatives. However all those remain some distance away from challenging C++ for the number one position.

The above mentioned points in support of C++ are non trivial. They go a long way in weighing out the demerits of building a game using the language. So the question really is, do we really have any viable options beyond C++? The answer is somewhere in between a complete YES and a total NO. As we stand today the best scenario is probably building the core engine using C++ and then having a scripting system on top of it. Be it Lua, Squirrel, Python, or whatever. That way you can always find a middle ground between having to reuse existing code and at the same time allow rapid development and prototyping capabilities. Many engines/games take this route and there is little doubt that such a process proves to be advantageous in the game building process. There are already a lot of games out there that use scripting language for rapid prototyping and in some cases building large sections of the game. Having a scripting language on top of the engine core is clearly a step in the right direction.

Scripting languages solve but some of the problems. They do a part of the job and they do it pretty well. However, there are issues related to game development which require newer and more radical approaches. The challenge facing game development in the future is building an engine which can effectively and efficiently use parallel programming/computing techniques (Invasion of the multi-core machines). Current generation programming techniques fall short of addressing the issue effectively. More importantly most newer approaches to effectively address multi-core problem are just way too complicated to be implemented effectively in C++. Efforts are on to find radical new solutions (C++ STM), but thus far they look good only on paper and still seem too cryptic to be put in production use. The issue of effectively using multiple cores of a CPU will  probably be the biggest challenge for the next generation engine designer. The more natural choice for addressing the multi-core and parallel programming issue is the the use of functional programming languages. Since functional programming approaches are typically side effects free, parallelizing functional programming code is easier than imperative programming. However mixing functional and imperative styles can be an equally daunting task. As my argument in the above paragraphs suggest, there will still be a lot of code in C++ that will need, someway, of interacting with any functional language that may be used.

It’s debatable if going “strictly functional” will solve all the challenges the future will throw at us. A more plausible scenario would be to have specific portions of the engine/game parallelized either by using a functional language or by having a subsystem level parallelism. This obviously would allow existing (C/C++) code to be reused, however there are still challenges to overcome even with such approaches. Sub-system parallelism means having each subsystem (physics, renderer, logic, AI, sound, network…) run in a separate thread/s. This however is a very optimistic approach since sub-systems tend to overlap and in some cases critically depend on each other. Such a system could be achived with existing code also, however I remain very skeptical whether such an approach will actually work on the ground. Another approach is to have job based parallelism. Divide your most CPU intensive tasks into jobs and then have a kernel system to marshal them based on priority. This is something similar to what an OS does and seems the best way to shoot for parallelism with existing mechanisms. This approach however requires you to split your design into a job based approach and that could prove challenging. Having a functional language as a script system (on top of a C/C++ based engine) is another idea to think about. I am not really sure how helpful this would be and can’t really comment on this (, since I myself haven’t tried such a radical approach, maybe I ought to give it a shot). But it seems very much possible to have a functional language as a scripting system, and could in theory be used to parallelize sections of the game/engine.

So it would seem C++ might just survive in the game engine of tomorrow, although in a less prominent form compared to it’s position today. It may happen that over the years C++ may eventually fade out, however it’s part can’t be total ruled out. Transition from C++ to any other language will be slow and may be tumultuous, with teams opting for a hybrid approach than just downright building existing functionality from scratch. As new technologies progress and CPUs with 100s of cores start being commonplace, we sould see the popularity of C++ waning and been replaced by some other (maybe functional) language. As time progresses C++ might well become increasingly irrelevant as more and more libraries get promoted to newer and more modern languages or newer more efficient ones take their place.

New screens of the Doofus 3D Game.

Update: Doofus Longears – Get ’em Gems has been released and can be found on www.doofuslongears.com

Whew, finally found some time to update the blog. I have been frantically working on putting final polish to the game, business related activities, tweaking graphics, ironing out small glitches in gameplay, play-testing levels, and the list goes on!

My major headache was the background. There were a lot of people who had complained about the background not being up to the mark. So I decided to paint a brand new background from scratch. It was a hell of a lot difficult though. Doofus 3D being a cartoon game, I wanted to have a flamboyant background (, rich and colorful with a distinct cartoon touch). However it’s not quite that simple, it’s not as easy as firing up good ol’ GIMP and just having a go at painting any ordinary scene. Since you are painting for a sky-box you really have to be a lot more careful and lot more sensitive about how to handle depth in your scene, plus you have to paint for a full panoramic view. A lot of experimentation went into this one, believe me! Lot’s of hits and misses later, and after studing some other skyboxes this is what I ended up with.

As you can see the background is a whole lot better than the muddy dingy background from the screenshots of the previous beta. Plus there is something more. Yes, the first pictures of new characters. More later 😉 .

Insanely busy.

I know the blog has been silent for some time now, but I have been insanely busy for the past couple of weeks and it’s not looking to ease up any time soon. There are just too many small things that need to be done, I still have a sh**t load of work to catch up too, I am in up to my neck in work. Things haven’t been this hectic for quite a few years now, probably never ever since I started on my own. Reminds me of the days when I used to put in 90+ hours a week. Yeah, those were indeed stressful times, used to work on a full-time job and then somehow manage to find time to come back and work on the engine and the game (*shiver*). Thankfully even though I am busy, it’s not that stressful at all. You may think the game is the culprit, on the contrary the game is the least of my worries, it’s just small things that keep adding up. It’s the other things that you have to get going to start-up a business that are just plain insane, and yes, things I hate to do 😀 . I guess you have to do all those things at least it once to get things rolling.

Fable, Oblivion and the sandbox gameplay.

Fable is a game developed by Lion head studios and to be honest I missed out on it a couple of years back when it first came out. Interestingly it was my bout with Oblivion that actually first piqued my interest in this game; since the game seems very similar to Oblivion, and yes Oblivion is pretty high on my list of all time favorite games. Fable is interesting because it just seems so much like what I have in my head as to something I might be working on. A very cartoonish backdrop, a very serious and in-depth gameplay with, what can be called as, dark humor. I have only very briefly played the game and it seems like a well designed game overall. I like it, and like it a lot. While not exactly same as Oblivion, some similarities do exist between the two and, well, it’s hard not to compared the two.

For one, although Fable is open-ended, Oblivion allows you more freedom, definitely more than Fable does. (Those of you who don’t know what an open-ended or sandbox style game is read this.) You can play Oblivion at your own pace and the game can play differently depending on the choices you make quests you complete and how you interact with world (and NPCs). Fable does allow you something similar and does have a sandbox style play, but unlike Oblivion it has a more linear gameplay, or should I say, more linear than Oblivion. Fable is actually an older game as compared to Oblivion, so it wouldn’t be fair to compare them outright, since of course the game predates Oblivion by almost 2 years. Then again 2 years isn’t such a long time after all.

The one thing I didn’t like about Fable, or should I say, didn’t appreciate too much, is that fact that you can’t deviate from your play area, meaning you can’t go anywhere and everywhere in the game world. Exploration is kept to a confined area and the player is not allowed to go beyond that. In Oblivion you are free to explore every corner of Cyrodiil which, I must say, can take quite a while. I played the game for 8 months now and I still haven’t had time to go to every place on the map. The world along with every cave and dungeon is just simply huge. I can understand the technical limitations for such an approach, but Oblivion addresses this very subtly and elegantly. Coming back to my point about exploration; I think exploration is a critical component of any sandbox style game. It gives you so much freedom or should I say gives you an illusion of total freedom and that is something I have come to appreciate a lot after playing the Elder Scrolls series (Morrowind and Oblivion).

In support of Fable, it has a fantastic combat system. I would place it better than Oblivion and I can safely say Fable allows you to have a more balanced combat game. I can give you an example; both Oblivion and Fable allow the use of MĂȘlĂ©e and Ranged weapons, but for some reason I didn’t find the use of ranged weapons in Oblivion all that intuitive. I can’t really explain why, can’t really put a finger on one particular reason, but while playing the game I used to get clobbered if I used a bow & arrow. In Fable I use both to an equal degree. Both games are sandbox games and both games build the player character by the choices the player makes. In Oblivion I ended up being a beefy guy with little resistance to ranged attacks from other NPCs. In Fable my character seems to be a great balance of both. Now I can take down NPCs with proper planning and lure them into traps by using a combination of mĂȘlĂ©e, ranged and magic. On the whole Fable does allow you to build a more all-round character.

Fable’s graphics are top notch. Spells and magic, combat system, weapon augmentations and teleportations are all done wonderfully. Even the cartoonish world is built beautifully and so are all the NPCs, of course considering the triangle budget and the fact that the game runs flawlessly on a Geforce 6200 with an impressive frame-rate I must add. The camera navigation and the cut-scenes are also pretty good. Graphics complement the gameplay very nicely and that’s what is important. Graphics are not over done and that’s good. You will find games that are galore with graphics that do nothing more than slowdown the game for no apparent reason and have no particular function other than to please graphics “fanbois”. Fable does none of that. The only thing I really hate about Fable is it’s game-save system. You can’t save your game in the middle of a quest. All you can do is save the skills you have learned. I can’t understand the reason for this, just defies logic. I generally play games only for 20 to 30 mins and quests take significantly longer to complete. So this “feature” is a real PITA. This is probably the only real complaint I have with the game.

I am a fan of sandbox style gameplay but my interest in Fable was 2 fold; it’s true I like playing games, however this time around my interest in the game was more of an academic nature; as a student of game design. I wanted to see how the game was designed overall. Yeah! I have this crazy idea of actually making a sandbox style game some day (long time in the future… or maybe not so long) and Fable seemed too hard to resist. Mind you I haven’t fully played the game yet but I am already pretty impressed; and the same goes of Oblivion too. Baring little quirks, I think both games are equally good in presenting the player with a out-of-the-box experience. Both games allow you to build the player character in unique ways (, sometimes not so unique) but non-monotonous none the less. Both game are “different” and it would be unfair to say that one is better than the other. True they each have their good and bad points, but both games are equally enjoyable.

Two great books from NVIDIA

NVIDIA released 2 great books (free) very recently which are a must for anyone who tinkers with graphics and specifically with shaders. First one is the GPU Gems book, which I happen to have as a h/c (, long before it was released). It’s such an invaluable resource of tricks that are still very much valid to this day. I would recommend this to anyone and everyone who wants to get their hands dirty with graphics. Then yesterday  The Cg tutorial was released. I haven’t got a h/c version of the book as I pretty much have a good hand at HLSL and both (HLSL and Cg) are essentially the same. I read thorugh the book and was equally impressed with it. So if you haven’t already read them, I would strongly recommend taking a good hard look at both.

EDIT [13th May, 2008]: Another one released today. GPU Gems 2.

I want this!

I was over at geek.com and the website was carrying a story about a cool little gizmo called Neocube. Apparently it’s a “puzzle with a billion solutions”. Something to keep your mind occupied when you are bored or feeling a bit “gray”. What I like is the way you could manipulate all those little spheres into something cool, and so quickly. Looks like an amazing gadget to let your creativity do the talking. OK I need this one!

Posted in Fun.

STL is not slow.

Recently I was having a conversation with some former colleagues of mine and I got a feeling that most of them were of the opinion that STL was slow and/or inefficient . If you think there is truth to this then let me assure you it’s not the case, not at all. STL is used by so many people and so many libraries that it, in fact, is probably the most optimized piece of code there is. This misconception is actually a result of inappropriate use of STL library and not because STL is inefficient. It maybe true that different versions of STL may have different speeds and I have heard that MS STL is a little slower than others like STLport, but I have no data to either prove or disprove this. I never use MS STL even while programming under Visual Studio (find out why), so I can’t really say.

As I said earlier, the perception that STL is somehow slow and/or inefficient stems from the fact that programmers generally tend to abuse STL containers by not using correct ones. STL has different containers and each is specifically designed to address a particular problem. I don’t want to get into which container to select when, I think Scott Myeres has done a far better job that I ever can. If you haven’t read his book then you better get down to it right now. It clearly outlines how one should go about using STL and addresses several subtitles involved in correct container selection.