Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:22 04 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Scott Adams Adventure Game Interpreter

     Page 4 of 5    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 03:29pm 22 Dec 2020
Copy link to clipboard 
Print this post

  Turbo46 said  
  thwill said  Apparently the adventure data file itself contains a bug

That bug isn't the only only one, DUMP errors out with a 'index out of bounds' or some such while reading the commands. I didn't bother following it further.


Maybe I'll take a look if/when we have permission from Scott to distribute.

  Turbo64 said  If Scottkit came as a plain executable file (maybe it does, I don't know) I'd give it a go but I don't want to jump through all the hoops of learning how to compile it just for a one off.


If it is *really of interest* to you then I can try and create an executable for you. The code is Ruby and I *believe* standalone executables can be generated from that ... though that might just mean that the Ruby virtual machine is package wholesale with it. Let me know if you want me to try.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 12:59am 23 Dec 2020
Copy link to clipboard 
Print this post

Thanks again Tom,

  Quote  That note about command 80 and GOTOy is because the first time EXRM0 is used alt_room(0) will be 0, and thus unless immediately followed by a GOTO the player will be left in room 0, i.e. nowhere.

and how do you describe 'nowhere'?

Command 80 is used a few times in adv06 and often a DspRM occurs later in the same line so I am comfortable to leave it out.

Regarding adv14b, I may have a look at it but I suspect that the data probably needs a bit of massaging. I suspect that it exploited the early versions of BASIC ability to happily accept early exits from FOR loops, subroutines and so on.

On Scottkit, thanks for the offer but as I am apparently the only one interested and it would be a steep learning curve to achieve little. I wouldn't bother. I'll try johngill's ZILish when I get the time and try to come to grips with that.

Merry Christmas
Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 07:13am 23 Dec 2020
Copy link to clipboard 
Print this post

Hello again Tom,

I promise I have not been smoking anything but, what do you understand from command 75 (the last one!)

75: BYx<-x
Put the Par #2 object in the same place as the Par #1 object. If the Par #2 object is being carried, this will pick up the Par #1 object too, regardless of the carry limit. If this changes the objects in the current room, the room will be displayed again.

It seems to me that he has the Par #1 and Par #2 mixed up in (perhaps) the second sentence? Does he mean: "If the Par #1 object is being carried, this will pick up the Par #2 object too"

Or maybe I'm just getting too old for this and am too easily confused.

Merry Christmas
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 09:15am 23 Dec 2020
Copy link to clipboard 
Print this post

Hi Bill,

  Turbo64 said  and how do you describe 'nowhere'?


Fair point, well made .

  Turbo64 said  Command 80 is used a few times in adv06 and often a DspRM occurs later in the same line so I am comfortable to leave it out.


OK.

  Turbo64 said  Regarding adv14b, I may have a look at it but I suspect that the data probably needs a bit of massaging. I suspect that it exploited the early versions of BASIC ability to happily accept early exits from FOR loops, subroutines and so on.


Perhaps, but my understanding is that long before adv14b Scott had moved away from his original BASIC interpreter.

  Turbo46 said  It seems to me that he has the Par #1 and Par #2 mixed up in (perhaps) the second sentence? Does he mean: "If the Par #1 object is being carried, this will pick up the Par #2 object too"


I have checked the Scottfree interpreter and it simply moves the Par#1 object to the same room as the Par#2 object. So it looks like it may be the first sentence that is wrong.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 09:36am 23 Dec 2020
Copy link to clipboard 
Print this post

Hi Tom,

  Quote  I have checked the Scottfree interpreter and it simply moves the Par#1 object to the same room as the Par#2 object. So it looks like it may be the first sentence that is wrong.


Yes, while watching TV, I was wondering if I had it backwards. You might expect it was the Par #1 object to be acted on. I'll implement it that way and see what happens. It should also GET the Par #2 object if you are carrying the Par #1 object, shouldn't it?

The Github Scottkit site suggests that 14b was not written by Scott Adams but I don't know.

Merry Christmas
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 10:56pm 23 Dec 2020
Copy link to clipboard 
Print this post

Hi Bill,

  Turbo46 said  It should also GET the Par #2 object if you are carrying the Par #1 object, shouldn't it?


GET just means move the object to room -1, and DROP just means move it from room -1. So you don't need any special handling. i.e. if the Par#2 object is already being carried (room -1) then CMD 75 will move the Par#1 object to room -1, the same as GETting it.

What you do need to decide is whether to redescribe the current location if the Par#1 object is being moved to or from the current room 'r'. Scottfree sets its 'redraw' flag in this case as I described a few posts back.

Best wishes,

Tom
Edited 2020-12-24 09:05 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 11:05pm 23 Dec 2020
Copy link to clipboard 
Print this post

Hello again Tom,

I think I had that sussed. This is what I have done (plus debug print)

  Quote      CASE 75      
     
' - Bill - not sure if this command should display the room
     ' Put the Par #1 object in the same place as the Par #2 object.
     ' If the Par #2 object is being carried, this will pick up the
     ' Par #1 object too, regardless of the carry limit.
     ' If this changes the objects in the current room, the room will be displayed again.
     x = get_parameter(a)   ' x = object 1
     y = get_parameter(a)   ' y = object 2
     ' p = (x = r) or (y = r) ' was either in the current room?
     ia(x) = ia(y)
     
' IF p then describe_room()
     PRINT " CMD 75 just executed"


As before, I thing a dspRM follows if needed.

Cheers
Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 11:08pm 23 Dec 2020
Copy link to clipboard 
Print this post

PS I noticed that your case 72 (EXx,x) does not display the room if it changes it. Again it's probably not necessary.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 11:11pm 23 Dec 2020
Copy link to clipboard 
Print this post

  Turbo46 said  As before, I thing a dspRM follows if needed.


OK, so you are saying that the redescribe is already handled in the specified CMD sequence of the adventures you have looked at so far? Great, jobs a good 'un then.

Merry Christmas,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 11:21pm 23 Dec 2020
Copy link to clipboard 
Print this post

  Turbo46 said  PS I noticed that your case 72 (EXx,x) does not display the room if it changes it. Again it's probably not necessary.


Yes, looks like I copied the comment about redescribing the room from the "notes" but then didn't actually implement it. Also see the TODO I wrote for case 62. Either you assume the adventure data correctly handles these cases or you use a belt and braces approach like Scottfree and make sure a redescribe always happens. Only extensive playtesting can really resolve that conundrum.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 11:55pm 23 Dec 2020
Copy link to clipboard 
Print this post

  Quote  Only extensive playtesting can really resolve that conundrum.

Yes, unfortunately, without an 'official' manual it's hard to tell. It may be covered by a following dspRM or a message. You might not even notice while playing the game.

Anyway I have implemented commands 75, 80 and 87. They should complete the full set of commands. I'll do some testing after Christmas.

Merry Christmas
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 04:53pm 24 Dec 2020
Copy link to clipboard 
Print this post

Good news Bill, I have permission from Scott Adams to distribute the enhanced interpreter AND make all his classic adventures available for download. The only thing I wanted but didn't get was permission to edit the original adventure data files, I wanted to fix the typos.

Merry Christmas & Happy New Year,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3662
Posted: 05:02pm 24 Dec 2020
Copy link to clipboard 
Print this post

Good!

(Thanks, Scott.)

John
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 09:42pm 24 Dec 2020
Copy link to clipboard 
Print this post

Thank you Tom and thank you Scott!

That's a nice Christmas present. Yes, there are few typos and/or spelling mistakes.

I think that lets out adv13 and adv14b though.

adv13 is "The Sorcerer of Claymorgue Castle". the data needs to by altered to load because the object data is formatted slightly differently. I did alter it and loaded it and the game ran OK. But early in the game you have to open a cabinet which is not listed among the visible items. It was one that also included graphics in most versions apparently and the cabinet is shown graphically. I saw it on Youtube. That may be a problem throughout the game - I don't know.

adv14a does not load as mentioned before (and may not be Scott's).

All it needs now (I think) is a way of selecting which game to play. I was thinking of a data file with the game titles and the file names and using that to select the game from a menu.

Adv01, Adventureland
Adv02, Pirate Adventure
Adv03, Secret Mission
etc.

Merry Christmas
Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 07:34am 27 Dec 2020
Copy link to clipboard 
Print this post

Hi Tom,

Flushed with success I though I would try some of Brian Howarth's games. The first one failed with the same message as adv14b (not 14a as above) so I had a look further.

The interpreter expects the action data to come in multiples of 2 lines. But some of the later ones and some of Brian Howarth's have an odd number of lines.

  Quote    ' Read action table.
 FOR i = 0 TO cl STEP 2
   j = i +
1
       
INPUT #1,ca(i,0)
       
INPUT #1,ca(i,1)
       
INPUT #1,ca(i,2)
       
INPUT #1,ca(i,3)
       
INPUT #1,ca(i,4)
       
INPUT #1,ca(i,5)
       
INPUT #1,ca(i,6)
       
INPUT #1,ca(i,7)
       
INPUT #1,ca(j,0)
       
INPUT #1,ca(j,1)
       
INPUT #1,ca(j,2)
       
INPUT #1,ca(j,3)
       
INPUT #1,ca(j,4)
       
INPUT #1,ca(j,5)
       
INPUT #1,ca(j,6)
       
INPUT #1,ca(j,7)
 
NEXT i


I'm not sure why it was written like that unless it was made to make the program more obscure. It certainly didn't make it more compact. So I re-wrote it to:

  Quote    ' Read action table.
 FOR i = 0 TO cl
   
FOR j = 0 TO 7
     
INPUT #1,ca(i,j)
   
NEXT j
 
NEXT i



That worked. I can now load and run adv14b plus those of Brian Howarth that I tried. So now there a few more available.

I'll send the files back to you when I've done a bit more testing.

Cheers
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 02:57pm 27 Dec 2020
Copy link to clipboard 
Print this post

Hi Bill,

I hope you had a good Christmas.

  Turbo64 said  ... Yes, there are few typos and/or spelling mistakes.

I think that lets out adv13 and adv14b though.

adv13 is "The Sorcerer of Claymorgue Castle". the data needs to by altered to load because the object data is formatted slightly differently. I did alter it and loaded it and the game ran OK. But early in the game you have to open a cabinet which is not listed among the visible items. It was one that also included graphics in most versions apparently and the cabinet is shown graphically. I saw it on Youtube. That may be a problem throughout the game - I don't know.

adv14a does not load as mentioned before (and may not be Scott's).


I think Scott still owns the copyright, he just didn't write that adventure personally.

The way to get around this stipulation that we leave the data files unedited is to code any massaging of the data for specific files into the interpreter data loading routines. i.e. if loading adventure X then replace messages/actions A,B,C with.

  Turbo64 said  All it needs now (I think) is a way of selecting which game to play. I was thinking of a data file with the game titles and the file names and using that to select the game from a menu ...


That's what I would have suggested too.

As it happens I didn't actually ask for explicit permission to package all the adventures with the interpreter, because I wasn't really expecting to receive permission to host them all for download - a pleasant surprise. Under the circumstances I'm inclined to take it as read and package them in a standalone interpreter distribution. For the Welcome Tape my intention is to update the interpreter but only include Pirate Adventure (and a pointer as to where to get more adventures) so as to keep that as legally unimpeachable as possible.

  Turbo64 said  Flushed with success I though I would try some of Brian Howarth's games. The first one failed with the same message as adv14b (not 14a as above) so I had a look further.


You are an adventure porting machine .

  Turbo64 said  The interpreter expects the action data to come in multiples of 2 lines. But some of the later ones and some of Brian Howarth's have an odd number of lines.

 ' Read action table.
 FOR i = 0 TO cl STEP 2
   j = i + 1
       INPUT #1,ca(i,0)
       INPUT #1,ca(i,1)
       INPUT #1,ca(i,2)
       INPUT #1,ca(i,3)
       INPUT #1,ca(i,4)
       INPUT #1,ca(i,5)
       INPUT #1,ca(i,6)
       INPUT #1,ca(i,7)
       INPUT #1,ca(j,0)
       INPUT #1,ca(j,1)
       INPUT #1,ca(j,2)
       INPUT #1,ca(j,3)
       INPUT #1,ca(j,4)
       INPUT #1,ca(j,5)
       INPUT #1,ca(j,6)
       INPUT #1,ca(j,7)
 NEXT i


I'm not sure why it was written like that unless it was made to make the program more obscure. It certainly didn't make it more compact.


Actually Bill, I think you made it that verbose, my original version was the more succinct:

 For i = 0 To cl Step 2
   j = i + 1
   Input #1,ca(i,0),ca(i,1),ca(i,2),ca(i,3),ca(i,4),ca(i,5),ca(i,6),ca(i,7),ca(j,0),ca(j,1),...
 Next i


Which I suspect more closely resembles the original TRS-80 BASIC construct ... though that would have had to use GOTO rather than FOR/NEXT.

  Turbo64 said  So I re-wrote it to:
 ' Read action table.
 FOR i = 0 TO cl
   FOR j = 0 TO 7
     INPUT #1,ca(i,j)
   NEXT j
 NEXT i



Looks good.

  Turbo64 said  That worked. I can now load and run adv14b plus those of Brian Howarth that I tried. So now there a few more available.


I've had a brief look and can't find any contact details for Brian Howarth, though there are a couple of websites / copies of these adventure files that "suggest" he released them into the Public Domain.

If you really want to go for gold take a look at:
   https://www.ifarchive.org/if-archive/scott-adams/games/scottfree/mysterious_blorb.zip
as the Blorb files therein contain the in-game graphics (.PNG) for Brian Howarth's Mysterious Adventures.

Find out more about Blorb format here:
   https://ifarchive.org/indexes/if-archiveXprogrammingXblorb.html

  Turbo64 said  I'll send the files back to you when I've done a bit more testing.


Then I'll have to do some real work rather than pontificating

Best wishes,

Tom
Edited 2020-12-28 03:47 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 09:25pm 27 Dec 2020
Copy link to clipboard 
Print this post

Hi Tom,

  Quote  I think Scott still owns the copyright,

Yes, from the dat file:
  Quote  "`Buckaroo Banzai`"
"Adventure by Scott Adams & Phillip Case"


  Quote  Actually Bill, I think you made it that verbose...

Which I suspect more closely resembles the original TRS-80 BASIC construct

Yes again, because in the later versions each item of data is on a separate line.

  Quote  The way to get around this stipulation that we leave the data files unedited is to code any massaging of the data for specific files into the interpreter data loading routines. i.e. if loading adventure X then replace messages/actions A,B,C with.

That may open a can of worms. There other cases where multiple messages would look better on the same line but the command set cannot cater for it. Display message number 1-51 does just that, there is no way for the interpreter to know if the next message would look better on the same line.

I wouldn't like the job, I'd probably add my own typos. I would not be surprised if there are a few in the comments I've added to the interpreter et al because MMEdit doesn't have a spell checker for words other than BASIC reserved words. Even though I thought I checked my previous post fairly carefully I still managed to miss one.

Thanks Mr Z-MIM but I think I'll leave Blorb to someone more capable.

Cheers
Bill

PS. I forgot to say that Brian Howarth's games use the value 255 instead of -1 for objects that are in your possession. I change it to -1 when importing in advdata.inc.
Edited 2020-12-28 11:02 by Turbo46
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 06:10am 28 Dec 2020
Copy link to clipboard 
Print this post

Hi again Tom,

I tried running the dump utility on a few more data files. All of the Brian Howarth files load OK but one, Arrow2. It throws an 'index out of bounds' error in advdata.

The noun/verb data on one line is 837 which decodes to noun = 5 and verb = 87 but the maximum vocabulary size is 82. The data in the Blorb file is the same so I don't know about that one.

I tried some of the 'otheradv' files. Marooned.dat gave a 'line too long' error. Looking at the file in Notepad and LibreOffice Writer gave no indication of extra funny characters. DOS MMBasic gave the same error reading the first line (apparently just a number). In the end I loaded it into MMEdit, went way down the file, and replaced a quote with another one so MMEdit would save it. After that it loaded OK into dump so there must have been some weird invisible stuff in that file. A hex editor might show it up maybe.

I'm just about over this adventuring so soon I'll send the files back to you so you can see what I've done to them and perhaps tidy them up and design a menu for selecting adventures.

Cheers
Bill

Addendum: I tried Epsilon's Hex Editor on marooned.dat and found that the lines were ending in a LF character and not a CR character like the rest. That must have confused MMBasic into thinking the file was all one big line. Thanks to Epsilon.
Edited 2020-12-28 16:30 by Turbo46
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 08:45am 28 Dec 2020
Copy link to clipboard 
Print this post

Hi Bill,

Sounds like your Labours of Hercules are almost at an end, well done.

I'm surprised that the line endings are giving grief, I had thought, through experience, that MMBasic could read files with either even though it always writes CRLF.

I look forward to seeing your finished result and already have some ideas for implementing the menu.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 11:55pm 28 Dec 2020
Copy link to clipboard 
Print this post

  Quote  I look forward to seeing your finished result


You may not think so when you see advdate.inc. I'm sure you can improve it.

Cheers
Bill
Keep safe. Live long and prosper.
 
     Page 4 of 5    
Print this page
© JAQ Software 2024