Random Thoughts of a Scatterbrain.
 Sunday, December 18, 2005

Workshop : JavaScript Combobox

12/18/2005 3:18:28 PM (Eastern Standard Time, UTC-05:00)

The default set of HTML controls do not include functionality like that of the WinForms combobox. For UI designers, this is usually resolved by having both a text box and a dropdown select box and allowing users to use one or the other. However, the big drawback of this approach is that it takes up what could be valuable real estate space and it's not necessarily the most elegant solution to the problem.

This workshop goes through how we can utilize the power of unordered lists and CSS to create a custom, JavaScript combobox.

If you're interested, check out the workshop.

Leave comments, questions, and criticisms in the thread.

 Friday, December 16, 2005

Asynchronous Callbacks with AJAX

12/16/2005 9:01:51 AM (Eastern Standard Time, UTC-05:00)

A blog post I came across should be of interest to anyone working with AJAX:

I've explained before why XmlHttpRequest should always be used asynchronously. In a nutshell, JavaScript is not multi-threaded, so the only way to keep your application and browser reasonably responsive is to use some kind of asynchronous pattern. This way, the multitasking is left to the hosting browser and the JavaScript developer can enjoy a relatively easier programming environment where he only needs to care about events and not about summoning threads and managing locks.

Add this small script to your page (preferably in the <head> section) and all your XmlHttp requests will be done synchronously no matter what the framework you're using is doing. This works with ASP.NET 2.0 callbacks in both IE and Firefox but breaks callbacks for Opera. I suspect that it would also work with other Ajax frameworks such as Atlas.

Supposedly, this will work with any AJAX framework.  I've been running into just this issue with AJAX.Net.  Having used both  AJAX.Net and Atlas somewhat extensively, I'll have to give the edge to Atlas for pure ease of use.

 Monday, December 12, 2005

Ebert on Games as Art, Part 2

12/12/2005 1:11:47 PM (Eastern Standard Time, UTC-05:00)

Over the last few weeks, there has been quite some noise regarding the debate as to whether video games should be regarded as a form of "art".  Certainly, this is not a new debate, but it has been reinvigorated as the new generation of hardware and software allow the game designers to build ever more photo-realistic environments and bring us closer to an interactive movie.

At the center of the debate, today, is Roger Ebert, one of the most respected and recognized authorities on motion pictures.  I must have missed the original source of the current dialogue (I can track it to the third Q&A on this page), but the resulting comments from around the world/web is interesting nonetheless.  There are so many great replies and comments, that it's hard to really summarize, but there are a few choice perspectives that I feel I should highlight.

Like Tim Maly, I don't think that a comparison of film to video games is one that has any relevance.  As Tim states in a letter to Ebert,

The invention of photography sparked a crisis in the world of painting: "Why should we paint if pictures can do it better?" But then painters figured out that there were lots of other things that they could do, that cameras can't.

Simon val Alphen adds,

Last year, I finally got around to reading Aristotle's Poetics and was charmed to discover that large sections involve Ari discussing the relative merits between the new-kid Tragedy versus the established form of Epic Verse. He cites other critics who argue that Tragedy, featuring vulgar elements such as singing and creating works of hugely less scale, is a lesser form than the traditional Epic Verse. Aristotle plays it cute, arguing what they've analyzed as weaknesses are in fact strengths, allowing Tragedy to move people in ways Epic Verse simply can't.

In general, I tend to agree with the opinion that games can't be compared to movies (nor should they be).  It's certainly not a crime to compare a gaming experience to a cinematic experience (read my review of MGS3 for PS2), as more developers start to create more story driven games, hire top notch voice acting talent, incorporate motion captured movement to create more fluid animation, and push the visual envelope that distinguishes the virtual world from the physical world.  But there will always be that element of interaction that seperates games from film.  This interaction, as Ebert and several correspondents point out, leads to an experience that is altogether incongruent to the principles of film.  However, as van Alphen suggests, video games offer an experience that simply cannot be delivered by film.

Of course, this is not to say that there are no similarities in the two mediums, but rather these similarities must be compared in different contexts and with regards to different factors.

There are many, many more great comments on Ebert's website that are worth reading through for offering well thought out responses to this dialogue which Ebert seems to have singlehandedly rekindled.  I, for one, am glad that Ebert has brought this discussion to a more mainstream outlet (as opposed to the geek-infested Internet forums and boards).

 Sunday, December 04, 2005

Engineers...

12/4/2005 1:09:26 PM (Eastern Standard Time, UTC-05:00)

Great thread with some funny jokes and what not about engineers.

Just a sampling:

There was an engineer who had an exceptional gift for fixing all things mechanical. After serving his company loyally for over 30 years, he happily retired.


Several years later the company contacted him regarding a seemingly impossible problem they were having with one of their multimillion dollar machines. They had tried everything and everyone else to get the machine to work but to no avail. In desperation, they called on the retired engineer who had solved so many of their problems in the past.

The engineer reluctantly took the challenge. He spent a day studying the huge machine. Finally, at the end of the day, he marked a small "x" in chalk on a particular component of the machine and said, "This is where your problem is."

The part was replaced and the machine worked perfectly again. The company received a bill for $50,000 from the engineer for his service. They demanded an itemized accounting of his charges.

The engineer responded briefly: One chalk mark $1; Knowing where to put it $49,999.

I also like this one:

To the optimist, the glass is half full. To the pessimist, the glass is half empty. To the engineer, the glass is twice as big as it needs to be.

 Saturday, December 03, 2005

Flash = Teh Suck

12/3/2005 1:27:34 PM (Eastern Standard Time, UTC-05:00)

I can't be the only one that think's Flash based websites suck can I?

I've never understood the appeal of Flash as a framework for structuring content to be honest.  I can understand using it for a few animated portions like a headlines type of object, but as a method of structuring content, it's simply annoying.

The worst are the Flash based ads that popup in the middle of what you're actually trying to read.  And to make it even worse, they invariably have annoying sounds, too.  Grrr...I really want to slap some of these site designers sometimes.

Yeah, a lot of these sites look great and have neat-o effects, but WTF, it's a waste of my time wating for this crap to download and then it annoys the hell out of me.  Oh, and what if I want to link to a particular piece of content?  Out of luck.

So why I am I so annoyed?  I was on the Acura website looking at the TSX.  But it's annoying as hell.  Not even an HTML option?  When I click the "Launch Acura.com" text, it opens another window.  WTF?  Seriously, whoever designed this needs to be smacked for such stupidity.  Once the window opens up, you start to notice the huge amount of laaaag when moving your cursor across the links at the top.  Wow, I'm just moving my freaking mouse across the top bar.  And it's not like it's some awesome OMGWTFBBQ!!?1?! special effects...the background just turns red ::incredulous::.  Not only that, I peek at my CPU utilization: 100% (I have a 2.4GHz Pentium 4 + 1.2GB Fast DDR RAM (Corsair XMS (Yes, this is excessive usage of nested parens (Blame SNE)))).  Goodness gracious, it seems like they expect all their users to have dual core Opterons with 4GB of RAM and an Nvidia 7800GT to be able to view their site.

Once I get onto the TSX subsection, I get more the same; my CPU utilization is insanely high for some stupid ass leaf falling effects.  I just want to look at pictures of the car, damn it.  Stop torturing me!

Okay, I just needed to vent and get that off my chest.  Seriously, I don't understand the concept of using Flash to structure content.  It's just plain stupid to me...

 Tuesday, November 29, 2005

Extraordinary Craftsmanship

11/29/2005 9:09:40 AM (Eastern Standard Time, UTC-05:00)

Wow.

and

Wow.

I think that's all I need to comment on these :-)

 Monday, November 28, 2005

Speculating on the next Gameboy

11/28/2005 12:26:03 AM (Eastern Standard Time, UTC-05:00)

As I was laying down to sleep, I started to think about the next generation Gameboy (GBX, Gameboy Next).  Honestly, I don't remember the train of thought that lead me to thinking about it, but I was sooo engrossed, that I had to get out of bed to jot down ideas and what not.

The first thing that came to mind is what type of media would Nintendo choose to use?  I think that any sort of optical or magnetic disk type media would be way too inefficient from a power and loading time perspective.  Clearly, Nintendo has always placed a big emphasis on quick load times, which are essential for portable gaming systems.  In addition, Gameboys have a rich tradition of looong battery life.  Disk based media require spinup time, which negatively affect load times.  So the only thing that comes to my mind is flash media (or small format hard drives, if they're cheap enough and sufficiently durable).  It will likely be a proprietary format (for reasons that will be discussed below). 

But to distribute flash media with each game is inefficient and costly (as was always the main issue with cartridge based systems aside from the size limitation).  We have already been told by Nintendo that the Revolution will offer games for download.  It would seem like this would also be the obvious choice for the GBX, with one radical difference: the games will be download only

Yes, download only.  This may sound bad for stores that sell games, but consider the facts: 1) stores will have an advantage in that they can distribute game related materials (manuals, freebies, etc.), 2) not everyone will have access to an internet connection, so stores will still need to have download kiosks, 3) stores will allow users to validate copies of existing software titles so that users can download.  That last point is of particular interest as it means that the GBX will have backwards compatability by allowing users to download copies of their old games.  We have a precedence for this as Revolution will allow users to download old NES and SNES games (and who knows what else, maybe even Sega Genesis games?!).  On point 1, all manuals will be made available online in PDF format for download.  On point 2, an internet connection will not be required to play the game, only to download the game.

All downloaded games are portable across units, but not across media.  What this means is that you can download a game to a particular media and you can then use that media in another unit to play the game, but you cannot copy the media.

Flash memory is relativley cheap nowadays, with retail prices for 1GB of memory ranging from $40-50.  For comparisons sake, the Gamecube disks are 1.5GB in capacity.  Keeping in mind that this is a portable system meant to be played on a small screen and the fact that flash memory prices will drop significantly in the next 1.5 to 2 years (the timeline for the GBX), we can postulate that a 2-4GB flash unit at $40-50 could hold a good number of games considering that the current DS memory cards are only supported up to 128MB.  Of course, the games themselves will be cheaper as the overhead of distributing the games is significantly reduced.  The cost of printing the games is completely eliminated.

The advantages of using flash media and downloads is easily apparent in the cost savings for Nintendo and the convenience for the user.  Using solid state memory allows for significant power savings and reduced loading times compared to magnetic and optical media.  For game saves, the GBX can either reserve game save space on the download media (for example, if the game is 120MB, 10MB may be reserved for the game saves for a total footprint of 130MB) or perhaps use a seperate, more conventional (non-proprietary) media, for game saves.

So why is a proprietary media required for the downloaded games?  The reason is that it must support certain measures to ensure that games are not duplicated (or at least not easily duplicated) and/or pirated.  More specifically, it must contain a write only section that cannot be altered. How does this all work out?  I'm glad you asked :-)

  • Each media will have a unique identifier (UIDMedia)
  • Each media will have a private key (KV,Media) and a public key (KU,Media)
  • Each GBX unit will have a global public key (KU,Global)
  • Nintendo servers will have a master database that contains the unique ID (UIDMedia) for every media manufactured along with the public key for the media (KU,Media)
  • Nintendo servers will also have a private key (KV,Global)

Certainly, there will be some sort of handshake procedure and what not to setup the connection for browsing game catalogs and initiating the download to ensure that only registered hardware (registered when manufactured) can connect to the servers, but I'm only going to cover how a theoretical download scenario could work after the handshake.

(I aplogize for the unconventional notation, as I'm too lazy to go in and format the HTML properly, so just follow along.  Also bear in mind that this is a very high level overview.)

  1. <Unit> M0 = Encrypt(KU,Global(UIDMedia)).  The first step is to create a message by encrypting the unique ID of the media using the public key of the Nintendo servers.  This ensures that only Nintendo servers, which have the private key, can decrypt the message and map the unique ID of the media to the public key of the media.  The message is sent to a Nintendo server.
  2. <Server> UIDMedia = Decrypt(KV,Global(M0)).  The server decrypts the message from the unit using the server's private key.  This results in the unique ID of the media.  The Nintendo servers contain a key map of media unique ID to media public key.
  3. <Server> M1 = Encrypt(KU,Media(KShared)).  Using the public key of the media, a shared key is encrypted to create one part of a message.
  4. <Server> M2 = Encrypt(KShared(FileGame)).  The game binaries are then encrypted using the shared key.
  5. <Server> MF = M1 + M2.  A final message is created by encapsulating the encrypted shared key and the encrypted game file.  This composite message is then returned to the GBX unit.
  6. <Unit> KShared = Decrypt(KV,Media(M1)).  The GBX unit obtains the shared key by decrypting the first part of the return message using the private key of the media (remember, it was encrypted using the public key of the media which is stored at the server).  The shared key is never stored in an unencrypted form.  Each time a player loads a game, the shared key is decrypted again.  Only the encrypted form of the shared key is stored (perhaps the unique ID of the media is also stored in the message as an added measure).  Because the shared key is encrypted with the public key of the media, only the private key of the media, contained in a read only region of the media, can be used to obtain the shared key.
  7. <Unit> FileGame = Decrypt(KShared(M2)).  The game file is read using the shared key.  Decryption is done in real time using hardware level decryption for performance reasons.

Essentially, this would be a form of DRM where the rights are associated with the media, not with the unit.

Bill Gates was straight on in commenting that the HD-DVD vs Blu-ray format war is insignificant due to the fact that this will be the last significant physical media (from a distribution perspective) for quite a while (at least when it comes to consumer electronics; holographic storage will eventually become the standard in ultra high capacity data storage).  Nintendo, I think, will be the first gaming company to move away from distributing physical media altogether by switching to a download only type of service for its next gen portable console.

Other random thoughts on the console are:

  • The DS screen resolution is currently 256x192 (for each screen).  PSP is 480x272.  I expect that, with the improvements in LCD and processor technology in the next two years, the GBX will have a resolution higher than the PSP (although we all know that Nintendo has a habit of undervaluing graphics capabilities).
  • It will have a 6 button design similar to the DS.  The current GBA has a 4 button design (A,B,L,R).  I picture a setup more like the GCN's, however, in that it will be three smaller buttons surrounding one large action button.
  • The unit will have a built in gyroscope.  This ties into the Revolution and some of the experimental games on the GBA which have built in motion sensors (WarioWare Twisted!).  Racing games, flight sims, etc. will be totally sick on this machine.  In addition, it may also connect to the Revolution as a wireless controller.
  • Following in the vein of the SP and the Micro, it will be slickIt will be sexy.  I picture it somewhat like an iPod Nano in terms of finish (except it'll be more resistent to scratches).
  • It will have built in wireless capabilities.  We see that Nintendo is finally coming around to all of this 'Net gaming and really embracing it (Mario Kart DS).
  • To enforce a kid-safe environment, as each unit will have a unique ID, Nintendo can create an architecture whereby each conversation and each exchange of text is logged and scanned in an asynchronous fashion.  Other users in a conversation may also choose to explicitly tag a conversation as breaching the terms of service.  Essentially, it would require a massive grid of computers to scrub recorded voice and text data for abuse.  In turn, Nintendo can punish those users by disabling voice and text capabilities (on the Nintendo network) for an increasing period of time with each infraction.
  • There is a very distinct possibility that we will be seeing an emergence of large capacity, small format hard drives in the next year.  This is related to the recent developments in storage design.  Specifically, perpendicular storage technology, which promises to increase disk density significantly.  Anywhere I've used "flash memory", it may very well be replaced with a micro harddrive boasting 20-40GB.
  • I think it'll look like the OQO ultraportable in terms of layout (the screen slides up to reveal the input buttons), except not as wide.  This would be inline with the design of the Gameboy Advance SP "clamshell" and would be great for viewing media when not gaming.  Which leads me to...
  • The GBX, contrary to Nintendo's typical stance on building pure gaming machines, will be a multimedia platform as well.  With the emergence of cheap, large capacity storage and the competition (Sony), it will be hard for Nintendo to ignore this functionality.
  • And finally, this being Nintendo, we know that there is going to be some sort of innovation that hasn't been done before on a handheld gaming system.  I predict that this will be stereoscopic 3D.  Yes, you read that correctly.  Sharp has already developed an LCD for cellphones which has this technology.  What's great is that the effect can be turned off in case it causes headaches and what not for certain users.

Okay, that's enough babbling and speculation from me.  Time to sleep damnit!  I dunno, I've somehow managed to hype myself up over my totally fabricated speculation :-D

But mark my words, I think what I've outlined here will come to be in the form of the next generation "Gameboy".

 Saturday, November 26, 2005

The Dangers of Prototyping

11/26/2005 2:02:59 PM (Eastern Standard Time, UTC-05:00)

I came across a good article on prototyping as I was reading about some of the reactions to the rumors that the Nintendo Revolution hardware will not be capable of much more than the current Gamecube hardware.

In my senior level software engineering course, my professor discussed that one of the pitfalls that was associated with building prototypes is that different audiences have vastly different expectations and draw different conclusions from prototypes.  For example, an architect that builds a prototype to demonstrate a new portal architecture doesn't necessarily have to make the UI look pretty.  Other developers can appreciate the architectural design elements such as how requests are handled, how state is handled, how communication is handled between different components and so on.  But show it marketing or sales in the same state, and the project could be dead in the water before it even starts, even though it may be the best portal architecture ever designed.

I think Nintendo took a big risk by showing demos of the new controllers in actions so early.  While it was necessary to prove that the new control schemes could work and work well, there is a (mis)perception around the gaming community that the early prototypes represent the final product in terms of graphical quality, even though we currently have no idea what kind of hardware the demos were running on.  The average Joe looks at the graphics of the current gen. hardware and then looks at the demos and will promptly proclaim that the Revolution sucks without realizing the true level of innovation and potential of the Revolution.

The article raises the question: "Is the Prototype the Production System’s Ugly Sister?"  Most of the time, yes.  But in some very special cases, the visual elements of the prototype, while they may have no significant impact from a software engineering perspective, become deal breakers:

The prototype does tend to be pretty ugly, and deliberately so. Absolutely zero time should be spent trying to make it look appealing. There are, however, a few notable exceptions to this:

  • The prototype’s goal is to prove that a particular technology can be made to look good (e.g. writing a GUI client with Java Swing). In this case, the prototype would be more of a proof-of-concept, and would consist primarily of GUI tricks and best practices to get the best out of the platform and widget toolkit being used. In fact, you would spend less time concentrating on actual functionality, because that’s not the point of the prototype!
  • The customer has difficulty distinguishing between form and function. If this is the case, it sometimes pays dividends to spend a little extra time making the prototype look good. Don’t go overboard though—remember what you’re creating is going to be abandoned pretty soon, in favor of a brand spanking new, shiny version with all mistakes learnt (at least that’s the plan!)
  • The prototype will also be used by Sales & Marketing, as an early sales pitch for your upcoming new product. In this case, looks and shininess (the “ooh” factor) probably take priority over real demonstrable functionality. Showing the customer your impressive 20-megabyte auto-generated comma-delimited invoice file might bore them faster than you think.

These are the exceptions, though. Most of the time, the prototype is intended primarily as a means of gaining insight into the ideal architecture, and is written in tandem with the design—before any production code gets written.

I've bolded the portions that I found to apply to Nintendo's current situation.  While I think that most people can understand that those demos were really designed to show off the controller, they have, nonetheless, inadvertantly relegated the Revolution to "has been" in the minds of many gamers that have associated improved visuals with "Next Gen".  So Nintendo has made the unfortunate mistake of not making the demonstrations "pretty" enough, even though they were mainly meant to demonstrate that the control scheme could work.  Of course, Nintendo can still blow us all away with XBox 360 level graphics, but they've already lost the attention of a percentage of hardcore gamers for whom graphical prowess is king.

The one thing to remember is that Nintendo has been working on this next gen. hardware for quite some time now.  There will be a new CPU from IBM and a new GPU from ATI.  I think the reasonable conclusion is that the graphics for the Revolution will be significantly better than those on the Gamecube and first gen. games will likely be on par with first gen. XBox 360 games.

 Tuesday, November 22, 2005

On Leadership

11/22/2005 9:14:00 PM (Eastern Standard Time, UTC-05:00)

I came across an editorial on CNNSI.com on, among other things, the play of Baron Davis and how he's helped turn the perpetually bad Warriors around and get them off to their best start in the franchise's history.

While the editorial relates to basketball, I think it serves as a great analogy to anything in life that requires leadership and teamwork.

"No disrespect to the point guards who were here in the past, but Baron's the type of point guard that makes everybody better," says backcourt mate Jason Richardson. "He gets in the lane and just finds guys. I been waiting for a guy like him to come and he took my game to another level."

This is not, incidentally, the type of quote one reads about Marbury, despite his career averages of 20 points per game and 8 assists. But this type of appraisal, I would argue, is a simple, but fail-safe way to assess any point guard: do his teammates like playing with him?

So how, exactly, does one make teammates speak of you with the enthusiasm of Rex Reed reviewing a big studio film likely to quote him in its print ads? "Everybody needs special attention, especially from a point guard," Davis explained. "It's about learning my teammates and their personalities. Being a point guard is about making the guys around you confident to where they feel like they want to play with you because they know that you're looking out for them. I study guys and know where they like the ball and where they are effective. When I played with David Wesley and P.J. Brown, I knew where they liked it and tried to get it to them in those areas."

Great lesson to learn on leadership, I think.

Gaming News Galore

11/22/2005 8:46:03 AM (Eastern Standard Time, UTC-05:00)

Yes, while I have absolutely no time for gaming these days (especially console gaming),  I still constantly trawl through the 'Net looking for news and info on the next gen. consoles.  I don't know why, as I don't seem to have much time to play console games anymore.

But in any case, today marks the official start of the Next Generation in the console wars.  Microsoft's XBox 360 officially releases today.  In addition, Sony announces that the price of the PS3 will debut at about $300-400, contrary to the earlier rumors that the pricepoint would be closer to $500+.  At $500+, I definitely wouldn't get one.  At $300-400, for a Blu-ray player, I'd probably pick one up.

I've been debating on whether it's worth it to get an XBox 360.  I didn't get the first XBox, even though there were some great games on it.  But I've got a nice, big HD set at home just yearning for the Next Gen. systems.  Oh who am I kidding, I don't have the funds for it in any case :P.

Meanwhile, I've also been reading about the poor manufacturing quality control for the first batch of XBox 360's.  Apparently, there have already been some "casualties" with the XBox 360's in circulation.  From what I've read, it's primarily a heat issue.  This makes me worry somewhat as the Nintendo Revolution's CPU is also being produced by IBM and the Rev. will be in a much smaller form factor.  If it's using a similar architecture, then it could be an issue.

Speaking of the Revolution, news on that front has been pretty mum.  My wife was playing Monkey Ball on the GC last night (I dunno what would compel her to suddenly want to play it, but she hooked up the GC and sat there basically all night playing it).  I sat there watching her twisting and turning her whole body (to no avail) as she guided here little monkey around the course.  Man, Rev. is going to rock sooooooooooo hard.

RSS 2.0 Atom 1.0 CDF