Thursday, October 8th, 2009
Play Kings Quest, Space Quest, and More… Using Canvas Tag
Martin Kool and Sjoerd Visscher have gotten many of the old Sierra Online games running on the Canvas tag, including many of the Kings Quest series, Space Quest series, and Leisure Suit Larry.
Martin Kool describes some of the long process it took to get these into the shape they are:
In 2003, I created Good Old Adventures. It was a chat environment set in the Sierra worlds without actual gameplay. All images were manually crafted, copy/pasting from WinAGI Game Development Studio. A time consuming process.
Four years later I wrote a few conversion tools in .NET to extract Sierra’s in-game images and objects from the original games, and display them properly on the web. The “only thing” left to do then was to export and understand all in-game logics.I was able to convert the logic to javascript, but there was one big problem: Sierra’s code used GOTO statements, and those could jump anywhere in the code, even inside a nested “if”-statement. It seemed unsolvable in javascript.
I sat down together with Sjoerd Visscher, one of my collegues at Q42, and we came up with a solution. Using a decompilation approach to get rid of nested “if”-statements and putting the whole shebang inside a huge switch/case statement, we could mimic line numbers and GOTO’s while maintaining performance. World domination was within reach :-D
It was halfway 2008 when I started to work on it, and Sarien.net is the result.
















“I was able to convert the logic to javascript, but there was one big problem: Sierra’s code used GOTO statements, and those could jump anywhere in the code, even inside a nested “if”-statement. It seemed unsolvable in javascript.”
I solved that in my 2005 Web AGI Engine (http://web.ist.utl.pt/antonio.afonso/agi/) by separating the logic into different functions, whenever there was a new label I forked it into a new function and returned the number of that function.
Here’s the LSL logic compiled into JS: http://web.ist.utl.pt/antonio.afonso/agi/cache/
My compiler is written in PHP: http://web.ist.utl.pt/antonio.afonso/agi/logic.phps
Canvas tag? Where did you get that from? It’s all just a bunch of GIFs. It works in IE6! And by the way, I only helped with the GOTO issue, the rest is all Martin!
@aadsm: yes, that is basically the same solution. But in a switch statement it looks more like real line numbers. :-)
No canvas tag according to the DOM Inspector, just a bunch of PNGs
ahahahahahha
Also I tried to say HURRRRRRRRRRRRRRRRRR but it crashed :(
Silly HTML stripper
<div id=”canvas”>
Aha, that’s crazy! Didn’t realize it’s just a bunch of GIFs. I guess I just assumed that was the only way to do it.
All that work for GOTO and you could have used “Label Statements”:
.
http://bclary.com/2004/11/07/#a-12.12
.
https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Loop_Statements/label_Statement
I understand that goto and labels aren’t exactly the same but I bet you could have used them for some of the cases, or found better ways to handle it (like breaking things up into smaller functions and calling them).
@Brad Nueberg: So why don’t you update the headline then? It is misleading for people that don’t read the comments.
Phone developed into flower girl dressestoday by the beginning of the straight shape to the folded shape, and then to subsequent variants of screw-cap, slide, etc. discount flower girl dressesI experienced a 20-year history of continuous innovation. The first clamshell phone is available in January ,Motorola mermaid style wedding dresses328c, this phone is very pull stars at the time the wind. In the “bricks and mortar” era gathered, 328c, 95 mermaid wedding dressesgrams of weight is very thin and light, combined with an innovative folding design, make and receive calls need to be mobile to start walking in the street was very eye-catching. Now fold mobile phone has notmermaid syle wedding dresses as popular then,manufacturers have phased out this type of product development and production. Column V neck Pleated Satin Wedding DressIn modern times you want to use the compact feature-rich mobile phones, folding phones have evolved with our new concept of some of departure. But in the long history of mobile phones, there are still a lot of the classic folding mobile phones have brought us to allure,Column Sweetheart Pleated Satin Wedding Dress NEC N8, Motorola V3, Panasonic VS3, Nokia N93i … … those familiar with mobile phones to complete their historical mission, but deeply imprinted in our hearts.wedding dress