Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Another Z-Machine interpreter

16 views
Skip to first unread message

qp...@yahoo.com

unread,
Jan 8, 2006, 3:38:03 AM1/8/06
to
I've written yet another Z-Machine interpreter. This one is in
JavaScript.

You can try it at http://www.geocities.com/qpliu/if

It only supports version 5 and 8 story files, as there's no point in
supporting Infocom files that you can't put on the web.

Ironically, it requires a fast computer to be playable.

I've tried Firefox, Microsoft Internet Explorer and Safari. Except for
scrolling to the right place and some clunkiness with keyboard input,
it looks reasonable under Firefox and Safari. MSIE appears not to
support the styles "white-space: pre" and "position: fixed", so the
upper window will not appear correctly under MSIE. I don't know about
other browsers.

This version is a one week hack, so there will be bugs. I have played
The Dreamhold, The Edifice, and Winter Wonderland to completion on
it, though.

Wei-ju Wu

unread,
Jan 9, 2006, 9:30:43 AM1/9/06
to
Hi,

10 seconds for "Spider and web" really seems a little long especially
since my browser (Safari) blocks all input to other windows as well
during that time. Pretty impressive work though.

The Zork Trilogy is made public now, so these are Infocom games that
could be supported and are Z3 files.

The "Gnusto" project, another JavaScript-based Z-code interpreter, has
a Just-in-time compiler, which saves a lot of decoding time if this is
an issue in your case, but be aware that you only cache the readonly
part of the instruction memory, because there is the possibility that
the game could generate code during its runtime in dynamic memory.

Wei-ju

John W. Kennedy

unread,
Jan 9, 2006, 2:59:34 PM1/9/06
to
qp...@yahoo.com wrote:
> MSIE appears not to
> support the styles "white-space: pre" and "position: fixed",

It doesn't. Microsoft doesn't have to support anything it doesn't want
to, because No One Beats The Mob.

--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"

ChicagoDave

unread,
Jan 9, 2006, 10:30:15 PM1/9/06
to
This is about the cleanest code I have ever seen for a z-terp. Pretty
damn cool.

David C.

qp...@yahoo.com

unread,
Jan 9, 2006, 10:35:51 PM1/9/06
to
Wei-ju Wu wrote:
> Hi,
>
> 10 seconds for "Spider and web" really seems a little long especially
> since my browser (Safari) blocks all input to other windows as well
> during that time. Pretty impressive work though.

Maybe a JIT compiler would make it playable. I hadn't considered that
before. A good reason to use eval(). It would be an interesting
project.

For now, I'm more interested in writing my first piece of IF, foolishly
deciding to eschew the inform library, as there is so much in it that I
won't need, such as light sources, dark rooms, non-player actions, much
of object manipulation, etc.

> The Zork Trilogy is made public now, so these are Infocom games that
> could be supported and are Z3 files.

Well, a handful of games isn't compelling enough for me to add z3
support, though anyone who wants to is free to do so.

What I wanted to do was to make it possible to throw a story file up on
some web site and have it playable on the site without any special
server support. And Infocom games don't fit into that.

prof...@yahoo.com

unread,
Jan 11, 2006, 12:47:25 PM1/11/06
to

qp...@yahoo.com wrote:
> I've written yet another Z-Machine interpreter. This one is in
> JavaScript.

That is an impressive feat!

Dennis G. Jerz

Fredrik Ramsberg

unread,
Jan 11, 2006, 2:47:50 PM1/11/06
to
qp...@yahoo.com wrote:
> I've written yet another Z-Machine interpreter. This one is in
> JavaScript.
>
> You can try it at http://www.geocities.com/qpliu/if

Nice work!

I'd like to experiment with it out on my own server, but it's not
obvious to me how to get it running. Could you provide a zip archive
with all the files necessary to get it to run a game, or just some sort
of instructions?

/Fredrik

qp...@yahoo.com

unread,
Jan 11, 2006, 8:39:20 PM1/11/06
to

First, you need to make a base64-encoded version of your story file
available on your server. (XMLHttpRequest tends to mangle binary
files.)

Then, the simplest thing would be to have a web page with something
like this:

<iframe width="80%" height="500" id="iframeid" name="iframename"
style="border-width:1; border-style:solid"></iframe>
<script src="http://www.geocities.com/qpliu/if/muttonate.js"></script>
<script language="JavaScript"><!--
ZInterp(document.getElementById("iframeid"),"/path/to/your/base64/encoded/story/file")
--></script>

Or, you can get muttonate.js from
http://www.geocities.com/qpliu/if/muttonate.js
and put it on your server and point to that in the script tag instead.

> /Fredrik

0 new messages