Tuesday, July 6, 2010

Releasing Golem

Well, I've done it. =) I've released a new product over at ShadowTeq, called Golem, which is a brand new crafting bot. I built Golem a little differently than I've built products in the past - I departed from the tired tab-based single-form format that I've been using for years in EverHarvest, Market Sniper, AutoLotto, and even VanCraft.

The new system is something closer to a wizard view, where you select the task you want to perform and then are guided through how to perform it. Building this from scratch was a bit of a challenge - I ended up building a simple view engine, which hosts the form itself as well as provides View lookup services for the pages themselves. It works well enough, and provides a good deal of separation between the UI concerns and the rest of the application.

Essentially, each page of the application is a 'view,' implemented as a UserControl. These are dynamically created when they're needed, and destroyed when they're no longer displayed. This means that any state that needs to be displayed needs to be saved somehow - I solved this by making the application's controller accessible from the views themselves. No, this is not my ideal mechanism - but I didn't really feel like building an MVC framework myself, and I didn't want to use anybody else's.

Anyway, about Golem: the crafting engine itself was built using my new automation framework called Eidolon. Eidolon is by leaps and bounds more advanced than any other framework I've developed for these purposes, and makes building automation engines a complete snap. Just to give you an idea, the entire crafting engine for Golem takes up maybe 600 lines of code, and took me a few hours to bang out and make run well enough for beta. That's an incredibly small amount of time and code! Of course, I've been working on Eidolon for months - tweaking it, building prototype projects, etc.

One part of Eidolon that I'm particularly proud of is something I call Wraith. Wraith is my new microthreading / workflow library based around C# compiler generated state machines, via the 'yield return' keyword. Using Wraith has allowed me to build the crafting engine without having to worry about things like pausing or canceling early, because the tasks that the engine performs are done so in tiny pieces. Wraith essentially lets me write long blocks of code, but when they're executed they get broken up into small tasks, with pausing, quitting, and other code interleaved between the tasks.

One way I take advantage of that is in tell notification. Tell Notification is a feature that, while you're character is crafting, if you receive a direct message from another player, Golem will let you know about it. While important, Tell Notification has *nothing at all* to do with crafting - so it didn't make sense for me to build it directly into the crafting engine. So what I did was build a Wraith Service, which lets me hook into the task execution portion of Wraith, and have that Tell Notification service perform all the work of listening for these tells.

Alas, I'm rambling. All in all the release went well, and people are picking it up. There were a rocky couple of days where people were having trouble, but due to the diligence of a couple of my customers (thanks guys) we were able to beat the bug. Turned out I wasn't checking log lines for the possibility of null after pulling them out of the log - this was causing Null Reference exceptions, and crashing the program. Tough bug to find after all the obfuscation... =P

So far the ride's been fun - I'm sure it'll only get more interesting as time goes by. =)

1 comment:

John V. Petersen said...

Erik..

Just wanted to say thanks for your comment on my blog! I added your suggestion - and gave you credit of course!! :)

what's your twitter handle? Mine is johnvpetersen.



Again, thanks for your comment.