Excuse me, but where’s the menu?

It’s interesting, but our good old menu-bar, yes, the one having “File  Edit  View …” on it, is slowly disappearing from some of the most popular software apps. Today I happened to wander across to the Firefox proposed UI design page and the thing I immediately noticed was the absence of the menubar in the new designs. Good riddance! No seriously, how often do you use the browser menu-bar? For me the browser is the second most frequently used application and 99% of the time I never bother about the menu-bar. I, however, would love every millimetre of screen space while browsing and am more than happy to see the menu-bar go.

There have been some subtle changes in UIs over the past couple of years. No I am not talking about glass effects and pretty pictures and icons, I am talking about design. Though not the first, it was MS Office that got the world’s attention by replacing the menu-bar with the “Ribbon Control”. A bold step, but the idea was to combine the tool-bar and menu into a single tabbed interface. To be honest, yes the ribbon idea is cool, maybe not innovative, but definitely cool. The interface had mixed reactions initially, but as people got more and more familiar with it, things started to get comfortable and soon other applications followed suite. At a first glance having no menu-bar is disorientating for a long time computer user. I did find it a bit “unusual” to navigate my way around  Office 2007 (the one and only time I used it). On the other hand, I never missed the menu-bar (even once) while using the Chrome browser. I guess the whole idea needs a bit getting used to, but apart from that, I really did like the whole concept of replacing the menus and tools into one single compact unit. Makes sense. Tool-bars, after all, only do complement the menus. It is therefore logical that both be combined into one.

I personally feel this use of the tab interface is a step in the right direction when it comes to exposing complex UI. The resurgence of the tab control and it’s innovative use in hiding complexity whist combining two separate controls (the menu-bar and the tool-bar) into a single entity to service both options is intuitive and resourceful. A similar usage of the tab control has also found it’s way into the mobile device world where it is going to be the main stay of the Moblin Linux platform. That is interesting indeed. So will we see our “Desktop Application Panels” and “Start Menus”, which are basically menus too, being replaced by tabs soon?

A new game with a new engine.

Holy cr*p! It’s been like 40 days since I have posted anything! That’s probably the longest the blog has gone silent. Well, that’s partly because I have been working on a new game and yes a new game engine. The new game will not be a 3D game but a 2D game. No, I haven’t abandoned the O2 game engine, to the contrary the O2 Game engine has had quite a few updates to it. So why another game engine?

Long long ago (, maybe not far far away) when I was designing/prototyping the O2 engine, I had plans for it to be a 2D and a 3D game engine. Overambitious? Yeah, maybe. But tell me who hasn’t had overambitious design plans?  Anyway, during that time a lot of design went into the 2D part. I even went ahead and created a mock prototype of 2D game builder UI. In any case, that was soon put on the back burner since we started in earnest on the 3D game. The design however, lingered in the archives, until I had the time to revisit it after the Doofus game was completed. Instead of letting the design rot, I decided to peruse and finish the 2D part.

A couple of problems immediately arose when I had a re-looked. The O2 engine is designed to be a 3D engine and a lot of abstraction has been made to ensure that the engine does 3D properly and efficiently. That’s not really required for 2D. 2D is a lot less complicated than 3D and most of the sections of the 3D game engine felt over-engineered when considered in the context of 2D. Most of the book-keeping required for 3D is down right unnecessary for 2D. In the end the two designs were a significant overlap, so I decided to rehash the 2D concept using similar design but start over from the engine core. Basically meaning, a rewrite of a significant section of the game engine code.  To my surprise the process was completed far sooner than anticipated, and that too without significant regressions. Yes the new engine uses a lot of same code-base as the O2 engine, but the engine itself is very different from the 3D engine.

Next came the game. There was an old prototyped 2D game (more details soon) that was lying with me for ages. Most of the game was polished up and ported to the new engine (lesson: Never throw away your old experimental code; ever. 😀 ),  and that’s about it. I am pretty happy with the results of my 2D experiment thus far. Completing a game is a complicated process. It requires a lot of things to come together and work correctly. True, 2D is lot easier than 3D, but there is still work to be done finishing the game and I hate to give out a release date just yet (, because of the fear of being proved abjectly wrong yet again 😀 ) .

A richer faster web.

fflogoFirefox 3.5 was released a few days ago and it’s not surprising that the browser adds a host of features to the new release, some innovative and some maybe not so much. Yes, we do see some ideas from Chrome and other browsers carried over (as we expected they would), and yes we also see a faster browser, mostly due to a faster Javascript engine (Tracemonkey) being deployed. (Though I have to say that Chrome still beats Firefox on  my machine on both the SunSpider and the V8 benchmarking suite.)  Firefox is something that I always use, mainly because I don’t run Win32 on my Internet machine and there is no real replacement for Firefox on other platforms when it comes to a good professional browser (except maybe the Mac, which I don’t happen to have) . So predictably, I am glad to see the new version up to speed with Chorme.

Recently there has been some sort of a competition between browsers; each trying to outperform the the other. Whatever you may call it, the browser wars  show one clear trend — the increase of Javascript speed to allow client side code to run at par, if not at the speed of desktop applications. The wars started with the launch of Chrome. Through Firefox started early, it was beaten to the soap-box, probably because Firefox runs across so many platforms, and it took more time to get everything running at par on everything supported. In any case, V8 outperformed it’s rivals by JIT compiling Javascript code (, which is similar  to what’s been done in SquirrelFish Extreme and now by Tracemonkey). But why this sudden obsession with Javascript speed? What’s so special about Javascript? As you probably already know, Javascript is the defacto client side language that is embedded in web content (HTML). It is used by almost all websites that display dynamic content and thus by analogy, faster Javascript means faster and consequently more powerful web applications. So as websites like Google push for more Javascript in their online services, the plan is to offset the use of conventional desktops applications, replacing them with mobile/online services. Take the example of gmail, Google’s email service. There was a time when I couldn’t live without Pop3 (Outlook express/Outlook/Thunderbird). I even got pissed when Yahoo stopped Pop3 support for their free service.  Now, since Gmail and the advent of fast Javascript browsers, I don’t even bother. Gmail was the first to push the bar and soon everybody followed. There was a time however when everything was not as speedy. Gmail used to take a long time to load and one did question the sanity behind having a Javascript heavy email service. However, what is more subtle is the fact that because of Chrome and the subsequent across the board Javascript enhancements that followed, gmail is now comparable to any desktop mail client you can find. Oh yes remember, gmail mails occupy zero space on the hard-drive, are accessible from any place that has a Internet connection and you don’t have to upgrade the application when a new version comes out. Log-in and you are there! With Chrome and now all others following suit, we could see even more enhancements to existing Google services and might even see some new applications as well. Whether this progression was evolutionary or revolutionary is up to you to speculate, but it does come across as a clever strategy from Google.

Coming back to Firefox. Interestingly Firefox also brings in some other changes. Apart from the obvious Javascript engine enhancement it includes support of HTML 5.0. Though HTML 5.0 isn’t formally ratified by the W3C, it is as they say it “a game-changer for web application development”. The support for the ogg container and patent free multimedia formats like Theora and Vorbis means an end to propitiatory technologies like Flash and Silverlight. Or does it? Well, at least that was the general idea with HTML 5.0. We will still have to see how that is actually implemented. Predictably not every browser vendor is happy about adopting open formats, but with HTML 5 the road is pretty much set. The push is on for a more dynamic and richer web. But, wasn’t it happening all the time. Well, not entirely. Most of the sound and video on the web today is played via third-party plug-ins like Flash. They are not natively supported by HTML and there in lies the problem. Come to think of it, it’s ridiculous that a multimedia container like a browser which allows rich content like pictures (.gif, .png, .jpg …) to be displayed doesn’t, even in this day and age, support video and sound. Today videos are pretty standard way of displaying content on the web, and mostly every site/portal what wants to demo it’s content has and does show a video clip somewhere. Then the question is; when are we going to see browsers ending their dependence on proprietary technologies like Flash and Silverlight and implement a standard for video and audio as well. Interestingly, Firefox 3.5 does allow the use of audio and video tags. Kudos to Firefox for incorporating the new changes, though it maybe a while before websites support them. I hope they do sooner rather than later, it’s almost trivial.

Mostly the changes in Firefox 3.5 were on expected lines. Nevertheless it does bring in some new enhancements and is a noticeably faster browser. I think the (earlier) release of Chrome did take some shine off the speed increase but still on the whole it’s a welcome development. Lets see when others like Opera catch up, I am sure they will soon, it’s just a matter of time.

Interestingly, PHP 5.3.0 has been released with additions like namespaces, late static binding, lambda functions and closures to the language. I say these features should have been a long time coming to such an immensely popular language like PHP. These are a welcome enhancements to the language indeed. While this may not have any direct bearing on the client side speed of web applications, it does fill in some gap with other popular server side web languages.

Is online gaming technology the future of social networking?

Yes we are all hooked on to Facebook and Twitter, maybe some of us more than others, but what does the future hold for social networking? It’s interesting, but if you were to look at it, online virtual worlds are becoming a lot like social networking sites. I was reading Shawn Fanning’s remarks on online games and it got me thinking about social networking in a virtual world. His technology Rupture attempts to connect gamers together via a common API/Interface. Your typical online game will probably feature quest and sub-quests; not your typical social networking activities. That said, the idea of having “social networking” in a virtual word is not something new. Second Life is probably the best example of how future social networking could be. To me a future 3D social networking virtual world would be something that I can log on to and create applications for. Something like a 3D Facebook, something having it’s own API that can be coded to. While Second Life does offer some capability to create your own content, what is needed is probably much more. How about allowing me to create my own little game in a 3D world? Maybe a full online game inside the service itself, something along the lines of a Facebook app/game. Ah! That would be amazing indeed!

Not all social networking users are actual gamers — but in a way they are. Most people will often end up playing those small little games or interact with others apps which give you an often ridiculous score that users like to brag about to other users/friends/community members. “Ooh lookey here, I have an IQ equal to Einstein” or “Joe Facebooker got 2,000,000 points on SomeApp” are all too common. People like to compete — and at the same time also like to interact, join communities. What current SN sites do is allow people to build communities and groups easily and rapidly — the two most important aspects for a success of an online game! With the advent of sites like Facebook, literally 100s of online games and apps have found easy adoption without needing to worry about things like server programming, latency, hosting, hardware, and you name it. The list goes on. However the most important thing they have cashed in on is an easier way to build communities for their products. Creating an online game/app today is not an easy task, besides the obvious engineering difficulties it is equally difficult to build successful community around an online game/app. Some future service that abstracts all these aspects and allows people to easily and rapidly build apps and games would probably be the social networking virtual world of tomorrow.

Nostalgia

Last night I was clearing the hard-dive to free up much needed space and I happen to run across an old zip file and in it was my older experimental engine — something I was working on long before I began work on the O2 Game engine. Well you can’t really call it an engine — it’s what you call; a bunch of experimental code hacked, stretched, hammered and stitched together to produce something that can be displayed on the screen 😀 . A more appropriate name would be a prototype or a demo. I was looking at the code and couldn’t help but wonder how I could comprehend anything inside those bunch of lines back then. To my surprise, the code still complied pretty easily on the new VC 8.0 Express. The app runs at 500+ FPS on the HD 4850 at 1280×1024, back then (, if I remember correctly) it ran at 40-50 FPS on a Riva TnT at 640×480.

experiment 1
Quake 3 Level – missing textures and shaders appear white.

Experiment 2

Another Quake 3 Level in the prototype engine.

Cool ain’t it. Well sorta, but lets take that with a pinch of salt. First, those levels that you see are some really cool Quake 3 Levels that I had downloaded off the internet. They are not created by me. I had written up a Quake 3 Level loader for the demo and albeit incomplete, was pretty good at loading most Quake levels. The lighting was obviously Quake 3’s internal Lightmaps. The collision system was rudimentary and navigation (running around in the level) was a huge problem. There were times when the collision system would completely fail and one would fall through the floor into the dark abyss below. MD3 animation was crap, so there were no players in the level, though I remember I was working on a skeletal animation library later on, but I guess I never integrated it with this piece of code. Oh well!

Baby steps I would say. Obviously I learnt a lot from hacking around that piece of code. But could I have created a game with that? The answer is — No I would not have. With all that was achieved, you wouldn’t be able to pull together anthing more than a short cool looking demo — period! The code is too haphazardly written and has no structure and I would only term it as research and learning material. Even then it’s a bit nostalgic to see some of your old code run 🙂 , and man it still does look cool at higher resolutions!

The world of 2D.

Well as I have said in my earlier  post I am currently working on some tech related to 2D gaming. Actually, working against the clock to finish the current project, which on all accounts is somewhat of a diversion from my main goal. However it has also given me time to retrospect and understand how things are in the world of 2D gaming (when compared to 3D). No, it doesn’t mean I am giving up on 3D, actually most of the tech I am using is from the O2 Game Engine, custom fitted to the 2D technology I am working on. Basically 2D is 3D with a fixed Z. People generally move from 2D to 3D but I seemed to have moved the other way around. The whole experience is kinda funny, because I can now truly appreciate how things with 2D really are.

Building quality 2D games is a lot easier than building quality 3D games. Actually creating 2D games is an order of  magnitude easier than 3D, or so I have heard 😀 . Having said that, the foundations of both technologies are extremely similar. Most of the tech I have designed for 2D is almost a reflection of the O2 Engine. True, it is not as complicated as the 3D engine, but majority of  the higher level design is similar to what was already put into the main 3D engine. I had initially decided to use the 3D engine as is, but the O2 engine is just far too complex for 2D. There were too many things that didn’t feel right for simple 2D. So it made sense to use an already existing third party 2D engine and parts of the O2 game engine to build the higher level framework that was missing. Simplicity was the deciding factor, since the primary focus of the tech is quick 2D game development and prototyping.

The second and most compelling reason was time. The project has be finished quickly in a matter of weeks so majority of the focus has been on using and integrating already existing tools and libraries. The project on the whole is simple, but it has a complex UI and involves integration of a lot of  libraries with a lot of functionality exposed via the UI, making the game builder UI the major challenge (more than the engine and the tech).

The project is still very much under development. I will post some screens and more details as soon as we hit alpha stages.

New Project.

I was a bit hush hush about my current activities, but I guess it’s OK to talk about it now that the project has been put on track. I am not revealing too many details as yet, but I can tell you what it is going to be. Well it’s actually a smaller project considering the my previous one (Doofus Longears – The game), lot easier in complexity and pretty small in size. Yes, it is related to games and gaming and involves a game, but it’s not a 3D project — it is 2D. Well it is 3D under the hood since it is based on Direct3D but it rarely uses the third dimension so it’s not 3D per say. The entire project involves creation of a game, which I must say is pretty trivial, but more than that it involves the creation of a generic game builder software, the work for which is already under way. The name of the entire thing is still under wraps, but you should see it come out in later entries.

The engine is an already written, accomplished 2D engine — no I am not writing the engine this time. The major job is to create an elaborate game builder (GUI), a designer, a scripting engine (Lua in this case) on top of the engine and integration of the engine and the scripting system into the game builder and designer. The game will be built on top of the scripting engine and should be pretty simple to make once the game builder and the scripting systems are in place and properly integrated. The game builder is designed to be generic enough to make any kind of 2D game (arcade, adventure, platformer, puzzle,…)

So — Yes, I am taking a holiday from our engine for a while, I hope only for a little while. I have been up to some interesting R&D which I hope I can integrated into the O2 Engine soon. It’s been a long time since I worked on a 2D game, almost 7 years now since I wrote a 2D pacman clone. The game had 3 levels and crappy graphics, makes me laugh looking at it now. But hey — that’s how you learn.

As it stands today, a fair amount of  progress has been made on the GUI side of things. A lot still remains to be done with integration, but 2D games are lot simpler than 3D ones so I hope and can tide over this project pretty soon. More details about the project and the game builder will be out in due course. I will post some screens of game builder when the game engine is integrated and there is at least a semblance of a game running inside it.

Going data-driven.

As you probably already know, the first Doofus game was released a few weeks back, and though I haven’t fully shaken off the lethargic hangover that accompanied the game release; I am slowly coercing myself  to get back to daily chores. After every project one must look back and take a note of hits and misses of the project development cycle (Causal Analysis). That’s what I have been doing for the past few days, and though there have been lots of those (hits and misses), one of the important lesson I have learned from the whole experience of making the game is the importance of data-driven programming.

Most of the tedious and time consuming activities during development turned out to be simple manipulation and ordering of code. Placing scene-nodes, structuring the scene-graph, ordering render batches, grouping shadowing objects, and the list could go on. Things like these took up ridiculous amounts of time. In the game  all this is done through code — when this could easily have been solved by a more data driven approach. I must admit there were times during development of the project when I yearned (almost cried) for a more flexible system. The problem was a lack of script driven programming, or should I say, a lack of a more data-driven system on top of the engine. Everything with the engine is currently done in C++, except maybe the configuration files. I hate it when you have to recompile 20-30 files just because you had to move a local variable to a class member. This does happen, especially for classes that have a long list of data variables and/or the ones that operate and integrate game data. We had initially planned on integrating a script and data-driven system into the engine, but that was later push down the priority of things to be done — and ultimately pushed out from the release due to lack of time and resources. Through not verbatim, that’s probably the story with every dev project out there that has to keep up with at least some sort of deadline.

In data-driven programming, data controls the flow of the program. Data is not just used to define an object state but also used to control the program flow, sometimes externally. Data-driven programming means writing generic code that consumes data and modifies it’s behavior depending on the structure of  that data. The concept of data driven programming is not new. UNIX utilities  have traditionally been data-driven and many applications use data driven designs. A web browser is a good example of a data driven application. It consumes a web page and modifies it’s behavior based on the structure of the web-page code, in this case HTML. Markups are again an excellent examples of data that encodes structure within itself (XML).

Well, there is a lot to take away from the current project. The engine will be made more data driven in the future, that’s for sure. The game also allowed me to pinpoint exact areas where a data-driven approach is needed. Many of those places wern’t immediately obvious during design.

Netbeans for C++?

I am a sucker for IDEs and I have been meaning to take Netbeans out for a test ride for sometime now. I have been hearing a lot of good things about Netbeans every since version 6.0 came out and more so ever since the version 6.5 arrived. OK before I proceed further, let me point out the fact that I have been using Netbeans for C++ development and have never used the IDE for anything other than C++. So my comments may be somewhat inaccurate for other languages.

For one the IDE seems to be solidly built and you can find your way around the place easily. Everything is where it should be and there is no second guessing as to what functionality a particular window, menu item or an option provides. Clean and sweet. Netbeans has probably the cleanest interface among IDEs. This is probably the strongest points about the IDE and given the fact that it is available on multiple platforms, means it could be used by people who do cross platform development.

I ran the IDE on Windows using the MinGW and MSYS systems, and it wasn’t very difficult to setup given that I already had MinGW and MSYS setup. The build system for the IDE is via your native Makefiles (*shiver*). I severely dislike the taste of Makefiles; especially maintaining them for large, cross-platform projects that have multiple dependencies. But the IDE manages Makefile issues nicely and I can live with that.

For those who don’t already know, Netbeans is actually a framework and a platform to build applications. The IDE is an application built on top of this platform. The strength of the Netbeans platform is it’s ability to have modules. Platform modules are basically Java classes that interface with Netbeans open API. The IDE also, can be extended via modules to add and enhance functionality. An open API like that also means Netbeans can be turned into almost any type of IDE by simply programming in functionality for a language.

The IDE has an excellent code completion feature, and I have to say it is surprisingly fast. The intellisense of the IDE  is top notch, probably better than most free IDEs out there, including my current hot favorite, Code::Blocks. I would even go as far as saying that in some situations it is better than even Visual Studio Express. The Navigator and the class display windows are pretty snappy. Any addition or change made to the code is updated very very quickly. On the intellisense front, it deserves a 7 on 10. The real-time syntax checker also deserves a praise. Oh how I miss these things in VS Express 🙁 !! Small things go a long way in enhancing productivity and Netbeans is by far the best among the free IDEs in that regard.

Netbeans has a lot of modules using which you can extend the functionality of the IDE and the community support is equally good. I would seriously recommend this IDE to all those who want a free IDE for C++. Netbeans by default supports only the GNU toolset, meaning you won’t be able to use compilers from Microsoft, Intel, Borland and others. The debugger used is gdb but the display and setup of the debugging GUI under the IDE can probably rival any other IDE for completeness.

So what’s to complain? Nothing really; but, just to nitpick, the fonts look a bit messy. There is no hinting on the fonts and it does look a bit drab. No hinting also means I have to use a higher font size than I normally do under VS and Code::Blocks. Talking about Code::Blocks, for me C::B still edges out in front of Netbeans just because it has a build-in GUI designer for wxWidgets, and well Netbeans dosen’t but that is probably just for me. I hope someone writes one soon 😀 . Netbeans is too good an IDE to ignore. However, I must say, I am impressed with Netbeans. It sure seems OSS IDEs are rapidly closing the gap between commercial ones.

Tryst with video recording.

Shooting a movie for the Doofus game turned out to be more than a headache; a bad case of migraine I must say. Well it all began soon after releasing the game. The logical next step was to shoot a movie/video to put on Youtube. What was supposed to be a 2 hour job turned out to be a lot harder than I had anticipated. Most screencap utilities do a pretty good job at capturing screen movies, however, what I failed to realize is the fact that most of them are hopeless when capturing any Direct3D or OpenGL rendered visuals withing a game. I am extremely disappointed with capture software that is available for recording an in-game movie. I tried several applications that are available, both free and commercial ones, but all of them turned out to be poor — either extremely slow or extremely buggy.

In the end I had to manually write an AVI capture facility into the engine code; ie. physically get the Back-buffer, StretctRect it into a texture, download it off the GPU and  store it’s contents into an AVI file via a bitmap, frame by frame. Similarly with the music and game sounds, for which I had to code in wave capture in OpenAL. Whew done! Unfortunately not all went as planned. I soon realized that the video and audio streams in the recorded AVI file went completely out of sync. That’s because the game’s frame-rate varies considerably while playing, whereas the sound is always played at the same rate. The problem unfortunately is — unlike the game the AVI file’s frame-rate is always fixed. So after a 1 min shoot, I could clearly notice a mismatch in video and sound. I tried unsuccessfully to correct the problem, but the problem still persists. That said, at least the results of  video capture were better than any 3rd party application I had tried before. So it wasn’t a total waste of time.

So yeah, I could shoot video clips, albeit not as good as I would have liked. I wanted a 1024×768 res video and all I could manage was a 640×480 one at pretty moderate quality given that all the streaming was done into a MPG4 compressed stream and there was a noticeable loss in quality. Then came the next challenge; editing the video into a full streaming movie. Movie maker was a the only free option available and the app is not too difficult to use. However, the app encodes videos only in WMA format and I couldn’t locate a MPG , AVI or an FLV option.  That meant I needed to convert the movie to a flash movie (FLV) so it could be streamed off the Internet using a SWF flash plugin. Bah! WTF! Well it turns out ffmpeg can re-encode movie files to most formats; including FLV and it’s free. Thank you ffmpeg.

Then it was Youtube. Well it seems when you upload a video to Youtube the server converts and re-encodes the uploaded video file using a really poor quality compression. I am not sure which format the FLV encoder on Youtube uses, but the results turned out to be a blocky pixelated mess. I guess, after some many conversion and switching formats, the video quality on Youtube turned out to be pretty poor. You can compare the quality with the ones on the Doofus website (the larger one here) and  you will understand what I mean.

Bah! The next time I am directly streaming content into a external HD video recorder via the TV-out option of the video card to avoid such craziness!