Interview
Interview with Shawn "Hanzo" Holmes
Interview with Shawn "Hanzo" Holmes
Jun. 7, 2001 12:00 AM
Midnight approaches and you're still battling with your latest Web application. You may feel the urge to kill the darn thing. Well, there's good news: now you can, thanks to Shawn "Hanzo" Holmes and Unweb (www.iamunweb.com). Playing Unweb enables you to exact your revenge, with extreme prejudice, on those pesky Web pages.
Unweb is an online game that allows you to "fight" and hopefully "kill" a Web page. In the last few months it has taken off like a southern California wildfire. I had a chance to talk to Hanzo and get the developer's perspective on this unique and addictive new Web pastime.
CFDJ: In your own words, what is Unweb?
Hanzo: Unweb is a game in which you create a character, arm it with equipment, and fight monsters. The catch is, the monsters are Web sites.
CFDJ: Web sites - how do you fight a Web site? Is that anything like fighting with source code?
Hanzo: In a sense, yes. In Unweb, there are easy Web sites to defeat, and very powerful ones that can take quite a beating and still kill you with ease. The strength of the Web site is determined by the quality of HTML found in the Web page.
CFDJ: By "quality of HTML," do you mean "properly formatted HTML"?
Hanzo: That's one of the factors, yes. It looks for simple mistakes that could be construed as poor HTML, and starts flagging them accordingly. When the Web page is completely parsed, the flags are counted up and the stat generation begins. There are also a few key features in a Web page that can be found that significantly increase or decrease the stats for that particular Web site, such as the <BLINK> tag.
CFDJ: I hope <BLINK> would be a negative factor. Do you take into account artistic style or just technical aspects?
Hanzo: You assume correctly on the <BLINK> tag flag. It's pretty difficult to programmatically gauge the artistic value of anything, and this is a very simple game at the core, so really, it's purely a technical algorithm. Unweb has a set of things it looks for, and as it finds fewer and fewer of those particulars in a given Web page, that page's stats are reduced.
CFDJ: Why the name Unweb?
Hanzo: To me, it was a fairly natural title. You're fighting Web sites, and hopefully defeating them. Since the Web is often compared metaphorically to spiders spinning webs, I thought about the reverse of spinning a web, which would be unraveling or simply unwebbing. Unweb came out of that.
I did think about calling it Deweb, but it sounded too much like Diablo (on which a lot of elements of Unweb are based), so I tossed that idea.
Needless to say, I've had a lot of mixed opinions on the title "Unweb."
CFDJ: What possessed you to write Unweb - midnight coding and bad Chinese carryout?
Hanzo: Actually, it was a blown processor. In September of last year I had a few problems with my computer and had to borrow a temporary CPU from a friend. It wasn't nearly fast enough to allow me to feed my Diablo II hunger at the time, so I started spending the evenings exploring a project I had started to improve my experience with ColdFusion's Regular Expressions.
CFDJ: What are the vital statistics for Unweb?
Hanzo: 122 templates, approximately 7,500 lines of code. The core game took about three months to write, with some further enhancements and improvements added over the next month or so. The database is SQL Server 7.0. As for developers, I did all of the CFML coding myself. I was lucky to have a very talented graphic artist, who helped with images and game design, and I had an excellent database programmer, who came in after Unweb went live, to help improve the performance of the stored procedures. I also worked closely with a friend who helped move the majority of the bottleneck code out into a C++ COM object.
CFDJ: It sounds like Unweb was an exercise in ColdFusion's Regular Expressions. Were there any challenges in using ColdFusion?
Hanzo: Plenty, but regular expressions were far from the real issues at hand. With Unweb I had to write code for an entirely new type of user: a gamer. People weren't going to be hitting a page and sitting for 30 seconds reading the content; they were going to be hammering it. They were also going to use the Web against me, by trying everything they could to "get out of jail free," like using the back button to escape a fight they were losing, or hacking in a URL string to try to get free items from the store.
For the most part the challenges in Unweb were unique and unlike anything I had encountered as a Web applications programmer. Writing game code is very different from writing a shopping cart.
During the initial database problems I was having, I went to my DB programmer for help and asked, "Can you write me a stored procedure that returns 10 random records from a table?" He said that he had been a DB programmer for 11 years, and had never been asked that question once.
Of course, he did it and did it wonderfully. That's just an example of the kind of craziness a project like this entails.
CFDJ: So Unweb was a very different project from more "serious" work, but no less challenging and time-, er, life-consuming.
Hanzo: Absolutely, and if anything, it taught me a lot more about the many aspects of ColdFusion that I don't use in my day-to-day programming, such as <CFHTTP>, the COM object connectivity with <CFOBJECT>, and so on.
It also pushed me to learn how to code CFML much more efficiently. Trust me, I researched every known possibility that would gain me 10ms in template execution time. For the most part, many of the tricks I learned gained me hundreds of ms.
CFDJ: So the Unweb project was serious fun. Were there any features cut from Unweb because of ColdFusion limitations that you could not overcome?
Hanzo: The only idea that was dropped near the end was the idea of a helper: a sort of "guide" that gave you tips and told you a bit of the story behind Unweb. I even sat down and had this entire story line written up that subtly and cutely referenced the creation of the Web and HTML, and how there was a great war between these people who followed HTML over SGML and CGI and...well...it became quite the joke near the end. I was even going to have someone read the story to you, via MP3.
Unfortunately, I just looked at it before I was about to start beta testing Unweb publicly and thought it would just come across as either too corny and stupid, or annoying. I didn't want to annoy players away, so I cut the story and guide-person idea.
CFDJ: Let's talk about Unweb's foundations. I understand you used the FuseBox methodology. Why FuseBox?
Hanzo: We use FuseBox pretty exclusively where I'm employed. I'm very comfortable and happy with it; I think if you're a CFML developer, there really is no reason to go with any other methodology.
For the record, Unweb is one giant FuseBox with 40 fuses. My next project will push that into separate FuseBoxes for each section of the game.
CFDJ: In what ways did FuseBox aid in the development of Unweb?
Hanzo: FuseBox definitely accelerated the development of Unweb. ColdFusion projects, in general terms, lack a lot of solid design processes near their inception, and are often not visually modeled out or documented. There was a lot of that in Unweb; it was a "fix as you go" project. FuseBox lends itself well to that style of project, since you always have your basic structure that works right from the start. All you need to do is add or remove components as you go, and they don't stop the site from working, even if large portions of it are causing problems.
CFDJ: I have to ask about the "monster" calculation. I know that it's a closely guarded secret, but was it a monster to write?
Hanzo: No, not at all. It actually does very simple HTML checking and, for the most part, is not tricky at all. Thankfully, because of its simplicity, it was easy to move out into a COM object, since it made up the core of the initial problems that Unweb first started experiencing when it was made live. Since I learned quickly that <CFHTTP> doesn't do all that well under extreme pressure, I had to get some help. Thankfully, we moved the HTTP fetching and parsing out into a .DLL and it has been much more stable since.
CFDJ: It sounds like you're an advocate of mixed-technology development. Has your mix of technology - ColdFusion, FuseBox, COM objects and SQL Server 7.0 - made it difficult to find a host?
Hanzo: Somewhat. As you can imagine, the COM object poses the greatest risk...while at the same time, it restricts me to a Win32 host. It would have been cool to be able to have the COM object done as an EJB, because then I would've been open to any platform. Still, the COM was a lifesaver. Currently, it's in the process of being moved to a professional, dedicated CF host that's reviewing the COM object. If they give me the thumbs-up, it should be moved shortly and will be performing much better.
I was actually approached at one point by a large, game-themed Web host who liked the idea of Unweb and offered to host it. Once we started getting into the low-level issues of the hosting, however, they backed out after discovering it was written in ColdFusion. They simply weren't interested in picking up a CF license. It's too bad it didn't work out, but there are always other options.
CFDJ: Unweb has taken on a life of its own. Did you expect and plan for this?
Hanzo: I had absolutely no idea that it would ever get as popular as it has. I get e-mails daily from people who have just discovered it and have all kinds of questions...and I can actually feel that they're excited about it. That just blows me away. I get e-mail from people in Hungary, Germany, and France...I usually have to translate their e-mails with an online translator just to help them out.
I was surprised when I had 100 users in the database, and, only a month later, I had 100 users playing concurrently. As it stands now, there's about 10,500 users in Unweb, which equates to about 12,000 characters (each player can have several characters). And mostly, its success has spread simply by word of mouth.
The part that I'm most proud of is this little Unweb community that seems to have spawned. When Unweb was first live, and I watched the message board get its first few posts, there would be questions such as "Hanzo, what's this?" or "Hanzo, how do I beat this Web site?"
CFDJ: Wow. With such rapid growth, have you had any problems with scale?
Hanzo: A few. When I had my first hundred or so concurrent users, I definitely saw where my initial pitfalls were in the code. And remember, this is not an ordinary site, so we aren't talking several hundred users just reading a news blurb or looking at an image. With Unweb, users act more like an uncapped load-testing tool: they hit the site and hit it hard, clicking submit buttons and links over, and over, and over...as fast as humanly possible. Some users even open multiple windows and start several fights at once.
I also had to deal with "scripters" - players who wrote little macros or "scripts" that played Unweb for them - repeatedly fighting weak Web sites at a blinding rate with no user input needed, which, of course, ended up hammering the Web site into oblivion.
Never mind the fact that I didn't have the most incredible hardware in the world to start with (the Web server ran Unweb and a gaming news site that streamed music to users, and both sites used SQL Server that was - yep, you guessed it - also on the same box). I spent quite a few nights going back over the code, and that's when my real learning began: to discover any and every trick to optimize ColdFusion code, and implement those tricks as fast as possible. I'm confident that the build I have now could handle a much heftier load than the first public version of Unweb, providing I get it successfully moved to a new host.
CFDJ: What does the future hold for Unweb? Will there be an Unweb II?
Hanzo: While there are no immediate plans for an Unweb II, per se, I've definitely started developing a new game that will play very similarly to Unweb, but offer much more detail and give the player a lot more stuff to do.
This time around, I'm sitting down and laying out the plans for the game before any code is written. I already have some mock-ups of new ideas, such as player versus player (one of the most requested suggestions for Unweb) in a pseudo real-time environment (still in CFML, mind you), as well as a new layer of management strategy.
CFDJ: Thank you, Hanzo. What parting words do you have for anyone inspired to create such a unique entertainment experience using ColdFusion?
Hanzo: It absolutely can be done. Writing Web games is definitely a way to breathe life into Web development with ColdFusion, and if you succeed, you'll never again look at another Web project in the same way.
About ColdFusion News DeskCFDJ News Desk monitors the world of ColdFusion to present developers with updates on technology advances, new features and performance enhancements concerning ColdFusion, business trends, ColdFusion-related products, standards discussions, and industry commentary.