Doofus runs on Wine!

Doofus on Wine.
Doofus 3D running on Wine!

Just before logging off of the Gutsy, I tried running the 0.0.5 beta version of Doofus 3D via Wine and “Voilà”, it actually ran! On Linux, with no tweaks of any kind, no nothing! Obviously only with the OpenGL driver, Wine has near absent DirectX support so it was only OpenGL, but still I was like blown away. I didn’t even expect it to work and I must say I could see no performance issues. Almost the same speed as Windows. I ran most of the unit tests and managed to finish the first 7 levels without any problems (, didn’t try any more but I am sure they will work just as well). To be frank I didn’t expect the game to run, and I mean run at all, let alone with the same speed as Windows.

I had no idea Wine had no DirectX support. I guess it must be very difficult to port the DirectX APIs (, but who’s complaining when the engine can run on OpenGL just as well) . The engine logs show Wine hooks in the native OpenGL driver on Linux, so I guess there is no visible performance loss while running the game using OpenGL renderer via Wine.

Update (Dec 17th, 2007): After reading Dan’s comments and some experimentation I could in fact run Doofus 3D via the DirectX renderer. However, the DirectX renderer will not run out of the box and there might be other legal issues associated with it, which are as yet unclear. You can read the entire comments here. I like to thank Dan for pointing out the error in the above post, Wine does have DirectX 9 support.

An Open-Source marketplace.

In an interesting development Sourceforge.net has released a service for the open-source community whereby open-source projects can now commercialize their services via Sourceforge (read here). This is interesting because it will allow small open source projects listed on Sourceforge to sell services which was previously not possible. As one blogger points out, such initiative will allow smaller open-source projects to build businesses around their projects.

“It’s one thing for a venture-backed open-source startup to develop new channels. It’s quite another for a one or two-person open-source project to do so. Suddenly, however, these small projects have an outlet to the market. A global market.” – (read the entire post here.)

I have been contributer to an open source project once and I can tell you from experience, managing or contributing to a project online is no trivial matter. It takes lot of time and effort to do so. I have great appreciation for these guys who work for free, open-source projects and who get almost nothing in return. Sourceforge’s direction in this regard is a welcome initiative indeed.

Some additions to yesterday’s update.

  • I was browsing through Visual Studio express page when my interest was drawn towards a toolkit called Game Creators GDK. The interesting thing is, it integrates with the express edition of Visual C++ and thats a little bit surprising. Or maybe not; many indie and aspiring game developers do tend to use express a lot. Just out of curiosity I did download it and the package seems to be a solid beginner level package especially since it is free. If you are a budding game developer you have to check this out. It also comes with a bunch of tutorials and extensive documentation. Yes, it’s a C++ SDK but, I didn’t delve in too deep so can’t say too much about it really.
  • I missed this one yesterday; but XNA Game Studio Beta 2.0 has been released. I tried a hand at XNA a long time back, when it was first released but never really got fully into it. It still remains a mystery why MDX was discontinued in favor of XNA. Maybe XNA is more of a complete game creation toolkit rather than a wrapper over DirectX.

Some recent news updates.

I generally have such an entry every 2-3 months so here goes.

  • Visual Studio 2008 is here!
    Microsoft recently released Visual Studio 2008 along with the Express editions. If you are like me then head on down there and start downloading the express editions, like now!
  • Delayed but good news from AMD/ATI:
    AMD (and ATI) has/have announced the availability of the HD 3870 and 3850 range of graphics cards, widely believed to be an answer to NVIDIA’s 8800 GT and GTS range of GPUs. They are based on ATI’s new RV670 graphics chip. Just how much of a challenge will they be to the 8800 has yet too be seen, but I am guessing we could be seeing stiff competition here. Read details of the spec here and here.

    In other news, very recently AMD also released the Phenom Quad core processor, X4 and the 7940FX chipset. Again to early to say how things pan out. More details here and here.

  • Updates from NVIDIA:
    As you know NVIDIA released Cg 2.0 Beta recently. Along with that two other releases from NVIDIA just rencently; 1) PerfHUD 5.1 and, 2) though I am not working on Cuda, I know some of you are, you can grab the Cuda 1.1 beta.
  • Disappointment in the OpenGL camp.
    As announced recently OpenGL 3.0 specification is delayed due to…. oh well, lets start that again; It seems OpenGL 3.0 has had some last minute changes and the specification release was put on hold. Let me not say anything further, I don’t like getting hate mails.

Cg 2.0 Beta.

NVIDIA has released Cg 2.0 beta a few days back. I downloaded the new version including the docs and was browsing through them. What particularly interested me was the sentence “New OpenGL profiles (gp4vp, gp4gp, and gp4fp) for GeForce 8 extensions” in the features list. It’s a little bit confusing though, because the docs don’t go into how exactly to do that, or is it just some extensions. One another thing that seems a miss is how exactly to access new DirectX 10 features from Cg, or am I missing something? I don’t have a DirectX 10 compatible card so can’t test anything really, but I checked out the examples provided with the SDK and there seems to be no examples for DirectX 10.

The docs mention 2.0 is compatible with 1.5 so  I tried out some of my older test shaders written with previous versions (1.5) and they worked OK. But then again those weren’t pretty extensive.

A vest that lets you FEEL the Game!

A US surgeon has devised a vest that when worn and plugged to your computer allows you to feel the blows from virtual game characters (read here). Now that is really interesting! It will allow the player to experience another dimension of gameplay never before possible, a consequence of his action in the virtual game world occurring on himself in the physical world. The vest allows you to feel the shocks, stabs and hits occurring inside the game. Players wearing the vest will now have to deal with implications for their actions. Ah! Responsibility! No mad shooting in an FPS game from now on. That’s refreshing for a change. It’s no secret, I am a fan of games where the player has to deal with consequences for his actions. FPS games today just lack any variety, and this vest, it seems, may just provide the right impetus to what has become a rather monotonous game genre.

New website… Finally!

Things have been very hectic lately, in the midst of which I have been franticly trying to get the blog up and running on a new website. I have finally finished migrating the database, and the blog, and the comments, without loss of anything really (Yeah!). Migrating the bugs database which involves full bug tracking for the game and the engine was a real pain and I must admit I had some anxious moments, but that too is now fully migrated.

So now my official website is www.susheelspace.com (, which by the way is still being worked on) and the blog is now at (blog.susheelspace.com). However I doubt if I will be able to move the original site very soon since there are other pressing issues at hand, but I hope to get to it in a couple of weeks.

Migrating any site that runs off a database can be painful. The only way is to have some way to export the database to a file and then reload the same at another place. That can be a pain in the neck especially if the exporter-importer (in my case phpMyadmin) are of different versions. If you thought that was painful, In my case however I had to split my original database into 3 separate ones. I ended up doing some heavy SQL work to get the old data in the new databases. Well I must admit, my SQL knife is not as sharp as it once used to be and this exercise turned out to be a nice refresher course in the end. Using raw SQL is probably the easiest and the most fool-proof way of migrating a site. Programs like phpMyAdmin will export to SQL, but be prepared for some tweaks to that. I tried other methods like using a migrator script but that just doesn’t work. My only recommendation is, “Don’t be afraid to get your hands dirty with SQL”.

Migrating the wordpress database ended up being an anticlimax. I tried messing around with the database, but there are some incompatibilities between the older version and the newer version. I tried a couple of different things, but in the end the easiest way to migrate a wordpress blog to a new site is by using the “Export” option (“Manage >> Export”) which saves the blog contents to an XML file, and then “Import” it to the new site. A word of caution, you may have to hand edit the XML file to replace the web links of your old site, example, “www.myoldsite.com/?p=64” to “www.mynewsite.com/?p=64”. Just make sure you check the entire XML file. I know it can be a pain, but at the very least check the weblinks. Also you will have to migrate the blog/wp-content/uploads directory of your old site to the new one.

What’s going on with the game?

Doofus game.
Doofus Game

I have had a lot of questions from people on the status and progress of the game. The favorite question is “When is the game going to get released?” I have a separate blog open for this but since I don’t put any technical stuff on that blog, I decided to throw in some more details on the things that are happening with the game. First, the game is on track and we are doing great thus far. Most of the team is contributing little to nothing at the moment. Except the beta testers, who are busy at work. So for the time I am pretty much pulling the programming side of things alone. There isn’t much left anyways but there are just too many small small things to take care of.

First the AI. It is not yet up to my satisfaction. Enemies sometimes get stuck into walls, fall off cliffs or behave weird. I don’t think this is going to be too much of an issue. Such issues are generally solved by clever heuristics and eliminating obvious redundant conditions. All entities in the O2 Engine’s AI module are handled by individual state-machines and are fully modeled on state transition logic. These redundant conditions are in fact eliminated quite nicely with the state logic, i.e. having a specific state to handle a specific condition. Also some tweaks here and there are due. I had initially feared that the AI would take significant CPU cycles, and since I am doing all shadow silhouette calculations on the CPU, the game would become significantly CPU bound. That is clearly not the case. The game does not go CPU bound except for some low end single core machines and you generally do not have any problems with CPUs 1.8 GHz and above. With shadows turned OFF, the game can run on a P III 1 GHz easy.

In fact I am finding things are quite the opposite. The game has difficulty pushing geometry on lower end graphics cards and is probably more fill rate intensive than I would have liked. Of course this is when running with shadow volumes ON. That was expected since stenciling, especially for stencil shadows, is the most time consuming activity for the GPU. The engine does aggressively cull out shadows when it can, and just yesterday I finished a new optimization technique that decimates shadow volumes for static geometry at the cost of some CPU overhead. Even so, stenciling can be suicidal on lower end cards with limited fill rate, especially when occlusion geometry has high polygon count. Having said that, I am getting an FPS of about 30-34 on a card like the old Geforce 6200 TC with everything from glow effects to full screen bloom turned on. For any higher level card and for that matter even a mid-range card, pushing Doofus 3D level geometry along with volume shadows is a walk in the park.

However, we are marketing the game as a casual game and as with most casual games, it must run with bare minimum hardware. Most casual gamers don’t have a clue what a graphics card is, or what an update of a driver means. They have nothing more than an on-board card. True, these days mother-boards do ship with ATI and NVIDIA chipsets, bit unfortunately not all. My main concern is the game running on on-board Intel cards. Intel cards are lousy, and that is putting it mildly. These cards can sometimes exhibit ridiculous behavior and are giving me maximum headaches as of now. A few days back I was running the game on a machine with an on-board Intel card and the game used to run at 10 FPS at a resolution of 640×480, and at a nice 34 FPS at a resolution of 800×600, then used to drop again for higher resolutions. Explain that! No it wasn’t some program running in the background. I stopped all programs and some services and disconnected from the internet. Still this wired behaviour.

The fact is the game needs to scale to hardware so that it can run even on crappy GPUs. This is easier said than done and my current task is to see that the game detects and adjusts itself to even the most basic graphics hardware. There are also issues which are too specific to cover here like driver issues, render-to-texture issues and things like that. I also need to work on further optimizations to juice out higher FPS values. In the meantime the beta testing is also throwing up new bugs. Fortunately there have been no major bugs like GPFs or crashes reported by any of the beta testers. The game ran on most of the systems tested thus far. Sometimes a little slower than expected, sometimes with a lot of z-fighting of shadows, but the main thing is it ran.

That’s about it. The march continues, and I hope I can wind things down slowly and come out of this almost infinite beta.

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.

A couple of interesting events.

  • FX composer RC1

    NVIDIA released the release candidate of the FX composer not too long ago. I downloaded and gave it a “breezy” try, but I don’t see GLSL support! Maybe I missed it. Why is there no GLSL support? Nothing is mentioned on the site as well. This is what the site says about API Support, “HLSL, COLLADA FX Cg, CgFX shading languages”.

    I don’t have a latest card to test all profiles, but the product seems good, though it crashed on me once on an older gen card! Some dll problem. Ran ok with 6200 and 6600 cards. I am eagerly awaiting the gold release. Comes at an opportune time too since I will be finishing up with the current project and moving on to the next. Maybe I can seriously think of including this in the pipeline for the next version of the O2 Engine.

  • Silverlight

    Apparently Microsoft’s answer to Adoble system’s Flash player. Or so they say. A significant development if you are a Flash game developer. I don’t see myself developing Flash games in the near future, but you never can tell.

    Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications. Silverlight supports fast, cost-effective delivery of high-quality video to all major browsers running on the Mac OS or Windows.

    Hmm, cross-platform, cross-browser! So are we going to see Microsoft officially support Linux and other *NIX platforms, and browsers like FireFox? Usually in Microsoft’s dictionary cross-platform means platforms including Windows ME, Windows XP, Windows 2000, NT, Vista and cross-browser means Internet Explorer 5, 6 and 7 .

  • Intel® Threading Building Blocks 2.0 (TBB)

    Intel released a library designed to get the most out of multi-core processors under a modified GPLv2. This could be an interesting development. Parallel processing and parallelism is another contentious issue. Especially when it comes to implementing it. Many people have said that true parallelism is only possible while programming with a Functional approach. While that remains debatable, it is aptly clear that the next gen games will have to leverage most out of multi-core processors.

    I am just a little bit worried about the licensing policy. They have released it under GPLv2 with a “runtime exception“. I am no legal eagle, but it sounds like Intel intends to make make some money with the library after all. I am also not sure how things will work out with AMD processors. In any case, it is one of the “must look into” things.

  • Nintendo “for” the garage developers

    Surprise surprise! Nintendo announced the availability of its platforms for small and independent developers. It’s some kind of service named WiiWare which will allow developers to sell their games and players to download them off this service. WiiWare titles are supposed to be launched next year.

    Read more about this here and here.