Check out my
new book!
HTML5 Games book
Sierra AGI interpreter in JavaScript If you grew up in the eighties and played PC games, chances are you ran across one or more of Sierra On-Line's great adventure game series like King's Quest, Police Quest or the one in the picture above, Leisure Suit Larry, which was my first encounter with graphic adventure games and spawned a huge fascination with that particular genre.

These old Sierra games were built on an engine called AGI (Adventure Game Interpreter), which let you control the character with the arrow keys and issue commands by typing them. Later (in the late 80's) they switched to a more modern engine called SCI, allowing for better graphics and mouse control among other things, but the AGI games are what stands out in my memory when thinking back.

I usually only post about my own things here, but the other day I got an email from António Afonso who has been working on a project that is just too cool for school. What António has been working on is a port of AGI to JavaScript, enabling you to take on the role of everyone's favourite lounge lizard, Larry Laffer, right here in your browser. The game graphics have been exported to PNG files and everything is then served to the JavaScript interpreter via a custom XML format. The game logic itself has been converted to JavaScript code, but as António says, some AGI constructs don't translate well into JS, and he still needs to work out some issues relating to that.

It's not 100% complete, some features are still missing and it sometimes kills my browser, but it's an amazing feat just the same. The project is currently on hold as he's concentrating on finishing his master degree, but once he gets the bugs sorted out I'm sure it's going to be great.

Check out the AGI emulator here!

And while we're at it, let me just point to another similar project. James Urquhart has been working on a SCUMM interpreter that runs in JavaScript (via HaXe, a language that can compile to JavaScript and other languages). SCUMM is the adventure game engine developed by LucasArts for games such as Maniac Mansion, Monkey Island, etc. The JavaScript SCUMM interpreter is not at a playable state yet (and it sounds like this is as far as James wants to take it), but it's a pretty cool proof-of-concept nonetheless. Check it out here.

Finally, if you're working on (or know of) any other awesome JavaScript game related projects like these, feel free to leave a comment or email me.
⇓ 3 comments James Urquhart

Wow, it's nice to see an AGI interpreter written in JavaScript.

Thanks for the plug Jacob. Sadly as you mentioned, my SCUMM interpeter is not at a playable state yet. I've more or less stopped development at the moment as it looks like performance is abysmal in JavaScript (compared to Flash). And that is with just a skeletal script engine and room graphic renderer.

Perhaps if i re-writ the whole thing in pure JavaScript, wrote a re-compiler for the ByteCode, and found a more optimal way to perform the drawing to the Canvas i might stand a better chance.

Another factor in stopping development was that i needed to find a fast and accurate way of simulating 16bit signed integer operations for the script variables. Sad to say, after much mind boggling investigation, i haven't come up with something which appears to work properly... yet.

Happy JavaScripting,

~ James

June 16, 2008 at 11:50 AM
Jacob Seidelin

Yea, it's too bad you're not working on it anymore, I was very excited when you posted it. I haven't looked (much) at how you're doing things, but I trust that just making it do what it does in its current state was quite a challenge. Cheers.

June 19, 2008 at 9:13 AM

How do you walk? The arrow keys are not being nice

March 9, 2009 at 1:27 PM
Post a Comment