zork icon indicating copy to clipboard operation
zork copied to clipboard

Latest version 3.2B

Open TobiasKarnat opened this issue 4 years ago • 2 comments

The history section doesn't mention the original MDL was ported to DEC FORTRAN by Bob Supnik.

Which is important, because he has the newer version 3.2B from 1996 available on his home page (still in DEC FORTRAN) which is newer than this C port which is based on his older version 2.5.6. http://simh.trailing-edge.com/games/dungeon.zip

I know there is a 3.2B C port available, but this requires an additional library Glk and the even newer C++-17 port requires at least Gcc-7 which makes it less portable to especially older Unix systems. I could compile this version on AIX with XL C successfully.

Could the changes be merged into this version, maybe allow to build version 2.5.6 or 3.2B by an option in the makefile?

Edit: There is also a GNU G77 FORTRAN version of 3.2B available (needs dos2unix conversion and removal of ^L - sed -i 's/\o14//g' ). https://www.ifarchive.org/if-archive/games/source/dungn32b.zip

But I had no luck in converting it with f2c (probably GNU extensions?) and Ubuntu has no more f77, but gfortran which also doesn't like the code (I have no experience with Fortran).

TobiasKarnat avatar Jan 29 '20 22:01 TobiasKarnat

Changelog from dungeon_doc.txt inside dungeon.zip:

IV. Changes In Dungeon V3.x

V3.2 reflects a slightly later version of the MDL source than V3.0:

  • The verb COUNT has been added.

  • The object CHIMNEY has been added, for CLIMB UP CHIMNEY.

  • Many objects now recognize both singular and plural, where appropriate (eg, cliff/cliffs, jewel/jewels, corpse/corpses, ghost/ghosts, spirit/spirits).

  • Numerous refinements and traps have been added (eg, try KICKing THE BUCKET in the well, or SHAKing THE BOTTLE of water when it is full and open).

  • Certain passages are no longer traversible if holding the coffin. (You can still get the coffin out.)

The most significant changes from V2.x to V3.0 were:

  • Three new puzzles have been implemented: the Palantir puzzle, the Last Point puzzle, and the Dead Player puzzle.

  • The parser recognizes the first eight letters of words as significant.

  • The parser allows list of objects, separated by commas or AND, to be used with TAKE, PUT, and DROP, eg, TAKE SWORD AND LAMP. POSSESSIONS is a new collective noun (in addition to EVERYTHING and VALUABLES) that denotes every object you are carrying. The parser allows the EXCEPT construct to be used to qualify collective nouns.

  • As a result, multiple commands on the same line must now be separated by semicolons or periods, since commas are used for multiple objects.

  • The syntax for TELL (INCANT, ANSWER) requires the command (spell, answer) be enclosed in quotation marks, eg, TELL ROBOT "PICK UP LABEL". Either single or double quotation marks can be used to delimit the substring, but the beginning and ending quotation marks must match.

  • SAVE and RESTORE now accept an optional file name within quotation marks. If no file name is given, DSAVE.DAT is used.

  • AGAIN repeats the most recent successful command.

  • If you are killed, your belongings are scattered throughout the maze, rather than at the end.

V. Problems Fixed

The following problems from V3.1 have been fixed:

  • DROP ALL works in the dark.

  • TAKE/DROP/ALL BUT now works.

  • TAKE ALL will not take water from the bottle.

  • POUR WATER in y now works correctly.

  • PLAY x WITH y now works.

  • PUMP UP x WITH y now works.

  • FEEL is recognized as a synonym for RUB etc.

  • The weight calculations in TAKE and PUT now include contained objects correctly.

  • IT now works in more cases and reports problems correctly.

  • SHAKing an open object while up the tree is equivalent to dropping the contents of the object.

  • SPINning a turnable object no longer says the object can't be turned.

  • THROW x AT BOTTLE/LAMP are no longer handled like THROW BOTTLE/LAMP.

  • Several vocabulary miscodings (STACK, ROCK, SWITCH) have been fixed.

  • A bug which prevented objects present in multiple rooms from being implicitly found has been fixed.

  • Throwing water at the stove or into the well or down the slide now works correctly.

  • A problem with inferred objects has been fixed, eg, SWING SWORD will correctly pick the troll as the object of attack.

  • When the thief discards valueless articles, the correct message is printed.

  • When the thief robs you in broad daylight, a message is printed.

  • The granite wall in the Slide Room is now recognized.

  • If the adventurer attempts to tie the rope to the timber or coffin while carrying them, the correct message is printed.

  • The rope can no longer be tied simultaneously to the Dome Room railing and to the timber or coffin.

  • When using the rope to descend into the Puzzle Room, the correct message is printed.

  • If the adventurer misplays the Puzzle Room and blocks the entrance hole, subsequent attempts to re-enter will fail.

  • When the adventurer looks into a palantir while in the same room with another palantir, the correct message is printed.

  • If the player is killed after successfully exorcising the spirits, the description of the Land of the Living Dead is now correct.

  • If the player is killed, his possessions are scattered to the correct locations.

  • A negative score prints the correct condescending rank.

  • Lighting conditions while dead are now reported correctly.

  • TELL MASTER "KILL MASTER WITH SWORD" now kills the player.

  • KILL x WITH MASTER gives a more appropriate response.

  • Several bugs in which VERB x WITH OBJECT were treated as VERB OBJECT WITH x have been fixed.

  • In the end game, ANSWERing after failing the quiz no longer restarts the quiz, and ANSWERing after passing no longer continues the quiz.

  • In the end game, the prison door cell does not close when already closed.

  • Several subscript out of range problems, which randomly crashed the game in some environments, have been fixed.

The following problems from V3.0 have been fixed:

  • Resurrection after death works correctly.

  • The load calculation for going up the chimney works correctly.

  • DIG x WITH y gives a more appropriate response.

  • Many spelling errors have been corrected.

  • Some (but not all) of the problems founding in porting to MS DOS have been corrected.

The following problems from V2.6 have been fixed:

  • If you ask for your SCORE while it is negative, you get an appropriate condescending message.

  • The command TELL ROBOT "DESTROY ME" destroys you rather than the robot.

  • Unexpected events (such as appearance of the thief, or failure of a command) wipe out any subsequent commands on the current line, to prevent unexpected catastrophes.

  • TAKE BOTTLE OF WATER, and other situations involving "OF", now work correctly.

  • The grating in the Clearing cannot be referenced until the leaf pile has been dislodged. If the grating is unlocked but closed, attempting to go up from the Grating Room gives the right message.

  • ^Z (end of file) in response to the input prompt no longer crashes the program.

  • THROUGH is no longer a synonym for WITH, so LOOK THROUGH WINDOW will parse, while LOOK WITH WINDOW will not.

  • EVERYTHING now gives the correct message.

  • The thief demon now reports the results of its criminal activity correctly.

In addition, numerous detailed responses have been added for wayward or strange situations, as appropriate.

TobiasKarnat avatar Jan 29 '20 22:01 TobiasKarnat

Since I retranslated starting from the version 2.6A Fortran source (under C2021 within my copy of zork-fortran) and have mostly reconciled it with this C translation (under C1991 and also under my copy of this "zork" archive) - which comes off of the slightly later version 2.6B of the Fortran source, you can review the translate log and History file to see what kinds of things you'll need to do to complete a translation with f2c. The changes made, starting from the raw f2c conversion, are described in a fair amount of detail (and you can always see them directly by reviewing the branch history diff listings).

It is certainly do-able to re-root the C translation in version 3.2 and to even merge it with this (or better: my) C translation; with a few provisos: most of the file-splittings in pre version 3 Fortran (e.g. dso{1,2,3,4,5,6,7}.c instead of just dso.c) were compromises made to respect the limitations of Fortran compilers of the time and are not necessary any more. The splits were kept intact in the C translations, but where undone in the Fortran versions by version 3 and files were reintegrated. There are far fewer source files in version 3 than in version 2.

Besides re-merging split files, other files were joined together, e.g. cat {clockr,demons,actors}.f >timefnc.f. And, in addition, contents within the files were moved around to other files (e.g. CLOCKD moved from verbs.f to timefunc.f).

GitHub does not handle file splittings and file joinings very well (i.e. there is no "git merge A B into C" or "git split C into A B"). So, it will be difficult to history-log the transitions in going from version 2 to 3. Yet, the transition process in going from version 2 to 3 - for both the Fortran version and any C translation of it - should be logged and it shouldn't just be simply a conversion rooted in version a 3 Fortran source as its starting point. It should be rooted in the earliest available sources.

The first of the two links you posted from the (insecure) simh-trailing-edge link is version 3.2A and is already on GitHub in another archive also named "zork-fortran". The second of the two links you posted is version 3.2B.

LydiaMarieWilliamson avatar Oct 10 '21 01:10 LydiaMarieWilliamson