Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.ruhr-uni-bochum.de!news.rwth-aachen.de!uni-paderborn.de!fu-berlin.de!news.belwue.de!scsing.switch.ch!swidir.switch.ch!in2p3.fr!univ-lyon1.fr!pasteur.fr!jussieu.fr!math.ohio-state.edu!howland.erols.net!netcom.com!erkyrath
From: erkyrath@netcom.com (Andrew Plotkin)
Subject: Fwd: Multiple undo
Message-ID: <erkyrathDxG66E.2ry@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
Date: Mon, 9 Sep 1996 04:08:38 GMT
Lines: 134
Sender: erkyrath@netcom3.netcom.com

-----------------

From kbracey@art.acorn.co.uk Sun Sep  8 21:07:09 1996
Date: Fri, 06 Sep 96 10:19:33 BST
From: Kevin Bracey <kbracey@art.acorn.co.uk>
To: erkyrath@netcom.com
Subject: Re: Undo and the Twelve Cube Puzzle (was: [Inform] Turn off "undo")

Andrew,

Unfortunately our news server here at Acorn seems to be on the blink,
so a couple of replies I've attempted to post to this thread seem to have
disappeared into a black hole. If you haven't seen the two messages below,
do you think you could post them on my behalf?

Thanks,

Kevin
=====


Path: nh.acorn.co.uk!nh.acorn.co.uk!not-for-mail
From: kbracey@art.acorn.co.uk (Kevin Bracey)
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] Turn off "undo"
Date: 2 Sep 1996 12:09:52 +0100
Organization: Acorn Computers Ltd, Cambridge, England
Lines: 31
Sender: daemon@nh.acorn.co.uk
Message-ID: <50efa1$89e@nh.acorn.co.uk>
References: <erkyrathDwx2Mn.8tv@netcom.com>
NNTP-Posting-Host: nh.acorn.co.uk

In article <erkyrathDwx2Mn.8tv@netcom.com> erkyrath@netcom.com (Andrew Plotkin) writes:

>aultman@koala.scott.net wrote:
>> >> In Inform, is there any way I can turn off the "undo" feature in my
>> >> game?
>>
>> You might not want to bother with this, because the feature can be (and
>> has been) implemented in Z-code interpreters, anyway. I'll always be able
>> to Alt-U in Frotz, no matter what your code says.
>
>This is a flaw in Frotz, as far as I'm concerned. What if I want to write 
>a puzzle like the 12-cubes one in Spellbreaker? Should I just add a note 
>saying "This game does not work correctly in Frotz. Use a different 
>interpreter."?
>

Hear, hear! I felt very strongly that this was definitely a cheat, so I chose
specifically not to implement it in Zip 2000. One potential excuse for Frotz'
Alt-U is that the current Inform library prevents multiple undo, but that is
a "feature" of the library that can (and I think should) be removed. I feel
that you should be careful to not provide "too much" help to the player in
the interpreter. Scrollback (not yet in Zip 2000 - sorry people!) and full
command line editing and recall are fine, but hotkey saving and undoing allow
bypassing of restrictions intentionally placed by the author.

(As an aside, this is why Zip 2000 doesn't provide a Save as dialogue box -
it would effectively be a hot-key save. I will at some stage attempt to do
it "legally" but messily, by entering a SAVE command into the input buffer.)

Kevin
=====


Path: nh.acorn.co.uk!nh.acorn.co.uk!not-for-mail
From: kbracey@art.acorn.co.uk (Kevin Bracey)
Newsgroups: rec.arts.int-fiction
Subject: Re: Undo and the Twelve Cube Puzzle (was: [Inform] Turn off "undo")
Date: 4 Sep 1996 11:09:54 +0100
Organization: Acorn Computers Ltd, Cambridge, England
Lines: 55
Sender: daemon@nh.acorn.co.uk
Message-ID: <50jkhi$89f@nh.acorn.co.uk>
References: <50hmfb$oes@mars.worldonline.nl>
NNTP-Posting-Host: nh.acorn.co.uk

In article <50hmfb$oes@mars.worldonline.nl> marnix@worldonline.nl (Marnix Klooster) writes:

> The limitation to single undo is part
>of the design of the Z-machine.  (Roughly speaking, the Z-machine is
>the game file format that Infocom used for their interactive fiction.)
>Since Inform produces game files in Z-machine format, this limitation
>is inherent to all Inform games.  No library hacking can help you
>overcome this.  That is the reason for the above-mentioned library
>flag: it protects the programmer from trying to perform undo
>(technically, the RESTORE_UNDO instruction) twice in a row; what
>happens when you try this is undefined, i.e. different interpreters
>might react differently, or even crash.
>
>About Zip 2000: I suspect that Kevin Bracey, the author of this
>interpreter, has silently extended the Z-machine, so that multiple
>RESTORE_UNDO instructions *do* work.  Kevin, can you confirm this?
>(And maybe post a description on the Z-machine mailing list?)  The
>multiple undo facility in Frotz is independent of the Z-machine's undo
>mechanism.  This makes it work on all Infocom & Inform games, even
>pre-version-5 ones (which don't have the SAVE_UNDO and RESTORE_UNDO
>instructions).
>
>Summarizing: if a game is to understand things like "undo 3", apart
>from library changes one needs to change the Z-machine specification,
>and use an interpreter that understands this extension.  Zip 2000
>silently seems to have done the latter.
>

RESTORE_UNDO more than once may be undefined, according to the
Specification, but that doesn't stop an interpreter from providing
multiple undo. Zip 2000's multiple undo code was adapted from Frotz',
with the hotkey functionality removed. A stack of n previous positions
is maintained, together with a pointer. One undo restores the previous
position and moves the pointer back one. The next undo will then
go to the next position back. More than n undos in succession will fail.
This behaviour is also provided by Frotz, IIRC, in addition to its
hotkey.

No Infocom games have any check to prevent multiple undo being attempted,
and work very nicely with Zip 2000's multiple undo. This suggests to me
that the Specification is incorrect; too many RESTORE_UNDOs (ie 2 in a
standard interpreter) should just generate the fail response (ie
return 0); behaviour should not be "undefined".

Likewise, this suggests that the Inform library should not have the check
to prevent multiple undo.

And for the rest, I say again that hotkey undo is cheating!

Kevin
=====

-- 

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."
