Sorry for the long absence.

First, apologies for being off the blog radar for a few days. I don’t think I have been this silent on the blog for so long. I guess people must be wondering what I was up to. I was very busy with a lot of stuff on the game and business front. Well, a lot has happened in the past two weeks. That’s really an understatement considering I live in Mumbai and I think the world knows what the city has  seen in the past 2-3 weeks.

The city is still coming to terms with the attacks on 26/11 and is still on edge, but as with everything else life goes on. Maybe for nothing else, but for mere necessity; because it has to. I only hope and pray that the authorities and the people in charge take due and adequate measures to prevent such dastardly acts from happening again. Condolences to the families who lost their loved ones.

Supercomputer@Home

The past few weeks has seen a spat of newswires from leading GPU manufacturers showcasing GPUs with potential supercomputing capabilities. Some even going as far as saying that a powerful GPU could be used to achieve the power of a supercomputing cluster. Building a supercomputer at home might sound like an impossible task, but the fact is, very soon you could well have one sitting on your desk. No, this is not one of those machines that is just a bit faster than the previous or current generation PC you already have. This machine could well have a mother load of computing power and it might not feel all that fast while running your GNOME, KDE or Vista UI; or for that matter your Office applications. In fact it might not feel any different at all to the average user. However, hidden beneath the UI exterior will be a system that could be a power monster, at least for applications that have been designed to take advantage of what has become the latest buzzword in programming; parallel computing.

There has been a lot of talk about how a supercomputer could be built using top line GPUs, but up until very recently GPGPU was a difficult thing to achieve. This was due to the fact that most GPGPU solutions in the past involved tweaking already existing graphics APIs (OpenGL and Direct3D) for GPGPU tasks. This method was fraught with problems, mainly due to the fact that graphics APIs were never designed with general purpose computing in mind. That’s why GPGPU technologies like CUDA were developed and with the advent of those and an almost exponential increase in GPU power, the Supercomputer@Home has become a reality.

No, this is not another entry that praises GPGPU, well it is, but not entirely. Let’s be fair, GPGPU is only a part of the solution. As I have repeatedly said in my earlier entries, GPGPU has tremendous potential when applied to the correct problem. If you were to believe GPU manufacturers, it would seem that the GPU is the answer to all the problems out there. The fact however remains that the GPU is only a part of the solution. GPUs are designed to address data parallelism very efficiently. The roots of this obviously lie in how graphics is processed. Graphics, or should I say modern game graphics generally require a lot of parallel data processing and GPUs have evolved to address precisely that.

The current generation GPUs have immense computing power, and most of us already know that. However, GPUs are not all that great when dealing with task based parallelism. Simply put, GPUs are not designed to run several different tasks concurrently. So for problems involving a lot of separate tasks that can benefit from simultaneous execution, GPUs are of little help. However, if you have a large set of data comprising of a lot of smaller data units, and want to perform same operations on those data units, then using the GPU could give you a huge performance enhancement. The solution would involve streaming the entire data on to the GPU, and executing the operation on all the units simultaneously. GPUs excel in such situations.

Which, brings us to  data streaming. Streaming data on to the GPU can be a costly operation and is best done for large data chunks. Streaming data too often and in smaller data chunks can usually offset the performance benefit the GPU has to offer. While this is not a limitation of the GPU per say and more of a limitation of the bus, data transfers to and from the GPU should be kept as little as possible to achieve maximum performance throughput. Graphics programmers are already aware of this. OpenGL and Direct3D both encourage programmers to send maximum data across to the GPU all at one time in what is called as “batching”. Both APIs advise the programmer to stall the GPU as little as possible, and in many instances even go as far as adding a memory/resource overhead to achieve a better throughput.

After reading the above paragraphs, one must invariably ask the question, “Can all problems be efficiently data parallelized?” The answer is no. Not every problem is solved by efficient data parallelism. A lot of problems can be, but many computing problems can’t effectively take advantage of data parallelism and therefore can’t take advantage of the GPU in general. Also if you have a small set of data and want to perform a lot of different operations on that same set, the GPU is of little help. Actually it is you good old CPU that is designed for task parallelism. While a lot of hype has been going on about the latest generation GPUs as potential replacement for supercomputing clusters, the CPU has been left on the sidelines. Or has it?

The next question to ask is, “What role will the CPU play in your Supercomputer@Home?” Well make no mistake about it, a very significant role indeed. In the time the GPU has been growing from strength to strength, the CPU has been having a transition of it’s own. While things have moved on from the days when clock speeds were treated as marketing tools, the CPU has itself seen some significant development. Although nothing to get exited about, the CPU cannot be ignored especially if you have to work on problems which involve multi tasking or multi-threading. Most non trivial programing problems require a mix of programming solutions. Some parts may require data parallel solutions, others may require task parallel. Then there are problems that can’t be solved by either. Therefore the CPU will still continue to play a critical role in any supercomputing system you may build.

It’s completely possible to build a supercomputer at home today. But, building a supercomputer is the easy part. Taking advantage of all this power is whole another story. It would involve an approach where the programmer will have to split his/her design so that data parallel parts could be executed on the GPU; at the same time multiple parallel tasks are executed on the CPU. Yes, it would imply a design that is similar to modern game engines, where data is sorted, batched and the entire data is sent across to the GPU to be processed by the rendering system. While this happens parts, or rather tasks of the application can be executed in parallel by conventional multi-threading or using parallel programming (OpenMP) to achieve maximum performance.

A machine with say a Tesla GPU or 2 HD 4870 GPUs connected via crossfire with a new and upcoming Core 7i CPU from Intel and oodles of memory could very well be a machine with supercomputing capability. But, where would one use so much power? Obviously computer games is one area. For a game developer like me, you just can’t have too much power. I always manage to stress out everything I have on my machines, however high end it maybe. But seriously, where else could you use all this power? Maybe for someone who wants to do heavy duty scientific calculations, could indeed benefit from such a machine. Another use could be compression algorithms, especially video and audio compression. People in video/audio editing business could also benefit from such setups. However, for the joe user so much power is all but useless.

Gamepads, Joysticks! How do you play with those?

I integrated Joystick support into the game engine a long time ago but I never actually played the Doofus game using a Joystick or a gamepad up until now. One of the testers logged an issue last week saying that the game’s camera movement was a bit slow for game controllers in general. So I decided to play the game out myself with a joystick. For the record I never play any game with any accessory other than the keyboard and mouse and after my recent experience with the gamepad, I must say I missed the mouse quite a bit. Maybe it’s just me or I have taken a strong disdain towards any kind of game controllers ever since my days with God Of War, and though I am a total fan of the GOW series, the experience with game controllers while playing that game has been more than a little unpleasant. I think I have been playing games with the mouse for too long. Maybe so much so that I have grown too accustomed to the Keyboard and Mouse. I truly don’t know. However, and this could very well just be me, I find controlling the camera using the mouse far simpler and more intuitive than a Gamepad or a Joystick axis.

I tried a lot of different games this week with a gamepad, which  for the better part of this year, has sat inside the cupboard. I told myself, “It’s just a matter of time before I get the hang of this thing.” No chance! With every game I try it’s the same story. I just give up after struggling with the controller for about 10 mins. It’s been like 3 days and I still can’t control the Doofus game’s third person camera, which by the way is not at fault 🙂 . For me, controlling Doofus’ third person camera just seems a lot more natural with the mouse than with the Keyboard. Not that I can’t do it, it just feels a lot more comfortable with the mouse. Fortunately for people that dislike the mouse, Doofus does run perfectly well on any game controller.

Some people say game controllers are great for flight simulators and maneuvering vehicles. Sorry, I haven’t had time to play those. I can tell you, FPS games are almost impossible to play. You can’t aim with these things and get fragged pretty easily. Maybe combat games fare better, but again I haven’t had time to play those either. I ran Tomb Raider demo I have on my system and even there I found my gamepad to be more than a challenge.

So, after this bout of testing, the gamepad goes right back in the desk from where it came. Ok maybe I have ranted enough for one post!

A bit under the weather.

Maybe I am pushing a bit too hard here, but for the past week I have been a bit down and out. Maybe not the entire time, but for most of the time last week. I had a nasty bite from the cold bug last week and the tough guy that I am, or so I thought, I totally ignored any RNR until things became a bit too much. Usually I am not the one to fall sick in the family and most of the time I have a tendency to ignore such niggling health issues (like maybe a cold) until things turn really ugly.

So there, now I have a leaky nose and a sore back. I initially thought my back problem was due to the chair, apparently not. The doc says it’s due to the flu (a bit relieved there), that means it will go away in a few days. The only good news is Doofus game is all but done. Both the main versions and the demo versions have been packaged and the only thing remaining is the beta tester’s stamp of approval! I wanted to finish the website and all of the e-commerce stuff this week but I guess that will have to wait for a few more days. Hold on there… maybe I gave too much away 😀 .

Stay tuned!

The HD 4850 and the story with AMD/ATI.

First the HD 4850. I was testing the game on the new HD 4850 (Palit 512MB) today and some interesting things I observed with the graphics card. For one it gives a serious bang for the buck. Doofus 3D clocked at about 140 FPS at a resolution of 1024×768, AF 16x with graphics quality set to high. Even with AA 2x Doofus 3D clocks more than 120 FPS and I have a strong suspicion the game was going CPU bound at those frame-rate, since the machine had a 3 year old CPU. I can tell you for a fact, the card is a serious performance monster, but then again Doofus 3D ain’t a top line game. However, for me, this is the first time I have seen Doofus 3D under 4x AA and 16x AF running at a playable FPS since up until now I have had only GeForce 6200, 6600 (and to some extent the 8600) cards. There is no denying that the HD 4850 is more than worth it’s price for someone who is looking for a budget card and expects to run most of the top-line games today. The card runs a little bit hot but that’s to be expected given the amount of triangles it can push and effects it can deliver. Hats off to AMD/ATI in that regards. If you are someone who is looking for a mid-range card right now, the HD 4850 is excellent value for money.

That was the overview from non-programming point of view. Now the programmer in me has something to say. The card maybe excellent, however it’s not all that cozy with ATI drivers. OpenGL drivers are a mess, with the bundled driver not even having extensions like EXT_stencil_two_side support. Even basic functionality like (for example glDrawRangeElements() ) seems to be broken at times, even showing messed up graphics when using Vertex Arrays on older cards. Now this exact same functionality is available under DirectX. Lets say it’s safe to assume that GL drivers haven’t been updated in a while and\or AMD/ATI just isn’t interested. The only issues that were reported in this round of testing were on ATI cards, so I had to literally debug the application on ATI hardware to ascertain that these were indeed driver problems. Some of the issues I have mentioned occur on guess what, the HD 4850 also. The only workaround seems to be, vendor specific hacks! That doesn’t make me a happy programmer at all!

The story with Direct3D is a lot better and no issues were observed under DirectX renderer of the game. That just tells you something doesn’t it!

It’s a cracker!

It’s probably well known that GPUs are powerful beasts, and I have repeatedly pointed out on this blog that the awesome power of the GPU can be used for more than just graphics. For tasks and computations that can be executed in parallel, GPUs are a lot faster than CPUs and also more powerful. So it won’t come as a big surprise to learn that people have put GPUs to good use to do all kinds of stuff. GPGPU has been more than a buzzword off late and with technologies like CUDA and Larrabee, it has become even easier to get at all this power. However like every other piece of technology, GPGPU also has it’s downsides. This article I read recently briefly outlines the fact the GPU could be put to work as a generic brute force cracker. I am no expert in cracking, but I am a person who has played around with GPGPU long enough to understand how serious this could be. I read the article and the first thought that crossed my mind is, “Hey, you know, this is the kind of thing the GPU excels in actually!”

GPUs today can deliver computational power in teraflops. Very soon we could have hardware that can do 100s of times that. There is also another interesting thing that GPUs allow you to do. You can stack a series of these buggers together and achieve a phenomenal boost to this already awesome power. You could increase the computational power of a machine by several orders of the magnitude by stacking GPUs in parallel. It’s a disturbing fact that such power, until a few years ago, was only available on top-of-the line mainframes. Today your could build a machine that has the power of a supercomputer with components probably available at your nearest computer hardware store. That just doesn’t bode will with the fact that anyone with a brain and time to kill can hack-up a brute force cracker and put it to work — and with enough “horsepower”, might even succeed.

As more and more powerful GPUs hit the market and as GPGPU technologies progress, we will see newer machines with unheard of computing power on our desks and laps. While this means more interesting games and faster number crunching for most of us, there are those who will put such tech to vile use. What we probably also need are better security systems and stronger encryption systems along with better games and faster number crunchers.

Tweaking the game to run on a wide range of hardware.

For the last week I have been involved in rather uninteresting activity. Well, I have been literally throwing the game on all possible hardware configs hoping it will run. All of this (yes, again) to find out how the game fares when exposed to different hardware configurations. Well it may seem like this activity is rather mundane, then let me assure you — it is. Well, not entirely 😀 . It takes some effort to get a game to scale seamlessly to all kinds of hardware and currently I am enduring all the pain of crappy drivers and broken functionality, which,  should I say, underscores some of the major headaches in real-time graphics development. It’s not like you can throw the game with it’s peak setting ON and expect it to run on a crappy Intel on-board graphic cards. Such a thing will just end in a disaster. The game must scale to different kinds of hardware and in our case especially so; that too seamlessly and effectively.

Doofus 3D is uniquely placed. It doesn’t aim to be a top-line, hardware intensive, hard-core gamer only, triple A (AAA) title. Neither is it a 2D game capable of running flawlessly under software rasterized graphics on your grandma’s old school PC. It is geared more towards intermediate level hardware. Hardware that most people have on their work laptops and home desktops. This effectively means an extremely wide range of hardware to cater to, and that in turn means scaling the game’s software paths (internally) based on a *lot* of underlying factors. Assuming a player to have a specific functionality available on his hardware setup can be catastrophic and disastrous. Such assumptions could mean a total failure of the game on a machine and could mean a potential loss of a buyer in the end.

While drawing up specs of Doofus 3D we were especially careful not to go overboard with graphics galore. Even with careful planning, there was significant feature creep, and with each new feature that was added, new countermeasures had to be put in place so that the game would scale to lower-end hardware. Not everything was straight forward, but we still did manage to push it through. If you have been following my blog for some time now, you would know that this is not the first time I am into such activity. I (personally) run such tests after each beta (feature addition/ feature freeze) of the game. That is probably why we haven’t faced too many problems this time around.

Under Doofus 3D we followed a process that is a bit different from traditional software development. Every beta under this game project was actually a feature complete runnable version of the game. Before or between any beta, every release was an internal alpha version. A beta meant, “A set of features is complete enough to be tested”. After each beta, each feature was tested on various hardware setups. Something like an iterative method of software development, but not quite. I would say, a process tailored specifically for our project and more specifically for our situation given our limitations.

Doofus 3D runs on most middle rung hardware without too much problems. It will run on on-board graphics cards too, but I find Intel on-board graphics to be an abomination. Hopeless hardware support for 3D graphics and equally crappy driver support! Enough reason for the engine to scale the game to run on a low setting when it detects an Intel graphics card. The situation with NVIDIA and ATI cards is a lot better with ATI’s low end cards (,assuming the price point, ) to be consistently outperforming NVIDIA cards. That said, NVIDA has the most stable hardware and drivers and most settings work uniformly across cards and driver setups, though there can be problems there as well. ATI’s drivers can be buggy at times and in case of OpenGL can be totally broken. Fortunately the O2 Engine and the Doofus Game can use either Direct3D or OpenGL as rendering APIs. For any high end or for that matter even for most mid-range graphics cards, Doofus 3D is not a problem at all.

The world survives!

I had a dream last night where I wake up and peer out of my bedroom window to look at what usually is a huge tree, only this time in the dream I look out and see nothing! Yeah pitch blackness, and I wonder, “Oh so the LHC must have produced one after all.” The next though that enters my deranged nightmarish mind is “Have I crossed the event-horizon yet? Then maybe I still have a chance to run away, maybe someone has a spaceship and I might just get a lift to alpha centauri“, and that’s when I wake up to find the sun shining down my face. I guess the trip to alpha centauri will have to wait. So the world hasn’t ended yet albeit fears of earth gobbling black holes, strangelets, vaccum bubbles, magnetic monopoles or as someone on gamedev said, “We haven’t yet been invaded by head-crab hordes from Zen.” So I guess it’s time to congratulate the scientists working on the LHC, but I guess they took every bit of precaution and as someone said, “Even inviting Gordon Freeman just in case!” 

Gordon Freeman spotted at cern.

Hmm… where’s the hazmat suit dude?

It’s New, it’s Chrome, it’s Fast.

I know I have written too much about browsers on this blog, but I could not resist writing about the newest member of the Google family, aka the new browser Chrome. OK, so the browser is pretty fast, no kidding, I know how deceptive this can all be but you can benchmark the Javascript speed here and see that Chrome leaves the competition biting the dust. The above test will freeze IE, and for me it froze IE 7.0 for well over a minute with a dismal score of 26. Safari clocked 93 on the test, FireFox 116, Opera 161, but Chrome clocked an amazing 1183. Just shows you how much speed the Javascript engine of Chrome delivers. You can feel it when you browse other sites as well. The rendering engine is at par with FireFox and I couldn’t notice much difference between the two browsers when Javascript was not around.

The other thing I love about this browser, is the amount of real-estate it gives you. Gone is the menu-bar and the status-bar has shrunk down to a small strip which appears when needed. These are the kinds of GUI innovations that I really appreciate. Logical; since most of us rarely use browser menus when we surf, at least I don’t. An rare trip to the “Preferences” section to clear browsing history is all I need to do with the menus anyways, so I am not too bothered with the fact that the menus in Chrome have been shrunk down to two little corner drop-down buttons. As a matter of fact I have customized FF (FireFox) to do the same using an extension. As expected the navigation bar has a tight integration with the search engine and you will find suggestions being popped up as and when you write directly from Google search. There is still some work to be done on this front though, it would be wonderful to see something along the lines of what Yahoo has on it’s search.

The things that I really miss in Chrome is AdBlock and Noscript. I hope Google will allow some way of having extensions to Chrome so people can come-up with all those amazing things that FF currently has. In fact I miss the extensions thing that is so popular under FF. I also could not find an RSS reader or any method of importing RSS/ATOM links into the browser. I also felt that the status bar was a bit short and could not display longer web-links. Chorme crashed on me once and ironically it was Google’s very own site, google books and yes I was browsing Chrome’s very own book Google Chrome when that happened. It somewhat flies in the face of the claim about application not crashing if one instance crashed. While Google has touted memory management of Chrome as great, the browser does take up a significant chunk of memory with even a modest number of tabs open. It’s certainly a lot more than FF, about 20 – 40% or so more for the same number of tabs.

For some reason the browser continuously uses about 60 to 70% of both CPU cores on my machine and that happens even when the machine is sitting idle and there is no interactions with the browser. Interestingly I also found a lot of memory swapping taking place after the browser ran for 2 hours or more and the memory usage keeps increasing steadily. That would somewhat contradict what was written in the Chrome book about low memory usage. The thing worth mentioning here is the fact that each tab of the browser is a separate process, meaning every tab is actually a separate instance of a browser running.

In the end, Chrome is still a beta product and I would expect significant improvements in the coming versions. I would also hope that Google will at the very least release a Linux version of the browser. The speed of the browser is truly impressive, however it still rough around the edges. The interface is good, but that’s just my taste. I always prefer a minimalistic approach when it comes to GUI. I am however not sure how others may view this. I would conclude by saying, Chrome is a browser worth trying and certainly a browser to keep your eye on.

In-game advertising.

I was recently asked as to what I thought about in-game advertisements. Given the fact that I am a game developer, the whole concept of in-game advertisements does seem like an intriguing subject. There are two ways to really look at the whole idea of in-game advertisements.The first and the most obvious one is of course as a potential money spinning tool for developers/publishers and is quite an interesting idea to explore. But there is a also a view that such ads inside games will end up polluting and degrading the overall game experience and could attract an ire from the players or the community as a whole, and in the worst case have an adverse effect on games sales. The last thing you want is a commercial break or a cutscene marketing something inside a fast paced game. Such a thing will be a disaster and I am sure players will frown on games that take this road.

My feeling is, game designs don’t need to this drastic to have the whole in-game advertising thing working for them. It would be a horrendous mistake to have advertisements inside the game that degrade gameplay. However having interactive ads that are properly integrated into the game may not necessarily be a bad prospect. That is exactly why ads in games need to be more than just inert props and simple banners. To a player such things make little impact and might or might not get noticed. The impact from any 2D inert items will be limited, especially if the game features a 3D world (2D games could still make use of banners more effectively than 3D ones, but even they could do better if the ads were interactive). Games typically differ from other traditional forms of digital entertainment in the fact that they are an interactive medium and therefore like every other gameplay element, ads within games will also be most effective when the player interacts with them.

Gamers (, especially hard-core gamers) might frown on the idea of having in-game ads but it may not be all bad. Not all games are ideal for in-game ads, I will touch on that point a little later. I personally haven’t seen any ads in most of the games that I have played. But I have seen it in some games, the example I can sight is Second Life. Second Life is a great example of how ads can make into games without being immediately frowned upon. The player is given a choice of whether he/she wants to interact and view the content (of the ad) instead of something being forced on him/her. A player will appreciate this, and the ad campaign will thus be successful. In the brief time I played Second Life (here), I visited a couple of interesting places where the in-game advertisements looked really great. Music seems to be the best appreciated followed by fashion when it came to ads there, but I am sure people must be advertising all sorts of stuff over there. As I said, my stint with Second Life was pretty brief.

As a game developer I look at the whole scenario of in-game advertisements positively. I am sure using proper game design advertisements can be made sufficiently interactive so that they could “fit into” a game without actually nagging the player. I would even go further and say that if used effectively a game could actually be enhanced (case in point Second Life) so that marketing inside games could be something that player can look forward to and actually find an interest in the whole idea of having an online try-before-you-buy opportunity. Can all games be effective as in-game advertising mediums? No, some might do a better job at it while others might not be as effective. MMOGs like Second Life will probably be far better at it than say a FPS with it’s setting on an alien planet. Some games like shoot-them-up tournaments might not be effective at all. Having said that, we can never be too sure about marketing ideas and how “genius minds” work. So, someone might just find some way to insert a “Matrimony Online” banner inside the Strogg Nexus on Stroggos, you never can tell.