Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 03:34 05 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 2 of 5    
Author Message
Turbo46

Guru

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

Ooops, it isn't actually but:
 con.println("Version 1.0", 1)

is.

Sorry to bother you again. I did RTFM but it didn't fully sink in.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

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

  Turbo46 said  Ooops, it isn't actually but:
 con.println("Version 1.0", 1)

is.

Sorry to bother you again. I did RTFM but it didn't fully sink in.

Bill


OK I'm still a bit flummoxed. Is there a question here or have I resolved it?

Going to sleep now,

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

Guru

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

You have resolved my stupid question. Thanks.

Good night.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

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

Hi Bill,

  Turbo64 said  
  Quote  that's largely down to Scott Adams' original design.

That's true of the database but the Interpreter and it's support files are all your original work. The only things I recognise are the variable names and some of those had to be changed because MMBasic wont allow string variables and numerical variables to have the same name (and rightly so).


I still think that the majority of the credit goes to Scott Adams for the design of the table based action system, so simple (ignoring the data packing) once you grok it.

When you've finished your activities I may take a pass through the code and replace all Scott's original obscure 2-letter variable names with something more friendly ... that is assuming you don't have designs on porting this to the CMM1 where the short variable names would be helpful ... alas I think the CMM1 is probably "dead" which is a shame, I think it has a charm all of its own, it just needs an MMBasic update and some CSUS support.

  Turbo64 said  
  Quote  Don't forget to add your name to the developer credits

I don't think so. I'm just mucking around the edges. I'll add comments as to the changes that's all.


Don't undersell your contribution. The changes to the code might be relatively simple, but the investment in testing time for these enhancements has no doubt been substantial.

  Turbo64 said  Some of your instructions you have given above on debug, record etcetera could be available in a Readme file. I'll have a look at that.


Thanks Bill, that would be welcome.

Best regards from rainy Manchester,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
markboston36
Regular Member

Joined: 27/10/2020
Location: United States
Posts: 76
Posted: 05:10pm 02 Dec 2020
Copy link to clipboard 
Print this post

why not just write a new interpreter that can read these file formats? seems easier then having to deal with something that might not be yours to change.
 
thwill

Guru

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

  markboston36 said  why not just write a new interpreter that can read these file formats? seems easier then having to deal with something that might not be yours to change.


Hi Mark,

My understanding is that strictly speaking any interpreter that Bill or I might write for this file format would be "fruit of the poisonous tree" because we have both looked extensively at the original source code from Byte magazine. Neither of us could create a "clean room" implementation based on the document I linked earlier; that is even assuming that document is not itself "fruit of the poisonous tree".

I'm not really concerned. I have corresponded with Scott Adams and whilst I don't have a legal documents I have his emailed (and Facebook) permission to port/derive an interpreter for the CMM2 and distribute both it and the "Pirate" data file on the Welcome Tape. Additionally I have his permission to extend the interpreter to play his other games or "original works". I have not asked his permission to distribute his other games as I do not intend to do so. I am aware that this amounts to little more than a "Gentleman's Agreement" and I don't care. No money is involved, I have "cover" from my record of our correspondence and if at some future point one of his heirs issues a "cease&desist" order I will be both suprised/flattered that they noticed and then just shrug my shoulders and move on.

Best Wishes,

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

Guru

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

  markboston36 said  why not just write a new interpreter that can read these file formats?

There is no need for a 'new' interpreter I have modified the advdata.inc to read these files into the data format expected by the interpreter. The existing interpreter only needs modification to add new commands, probably created for later adventures. Pirate was his first one, Adventureland was the second. Thanks for your interest.

  thwill said  the investment in testing time for these enhancements has no doubt been substantial

Only because of my lack of knowledge and experience.

I have also implemented the command:
  Quote  74 AGETx Always pick up the Par #1 object, even if that would cause the carry limit to be exceeded. Otherwise, this is like command 52, GETx.

I believe his will allow you to 'pick up' things like chigger bites and infections. Not tested yet, that's the next job. Then I'll look at the the dreaded 73 CONT command.

A chigger is apparently a little red flea or mite, the female can lay her eggs under the skin causing infections. Nice.

Bill
Edited 2020-12-03 09:14 by Turbo46
Keep safe. Live long and prosper.
 
thwill

Guru

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

  Turbo46 said  ... Pirate was his first one, Adventureland was the second. Thanks for your interest.


Actually Adventureland was first, an attempt to create, at least in spirit, a version of Colossal Cave/Adventure/Zork that would run in 16K.

  Turbo46 said  
  thwill said  the investment in testing time for these enhancements has no doubt been substantial

Only because of my lack of knowledge and experience.


I can see I'm not going to win this "argument" and thus bow to your wisdom

  Turbo46 said  I have also implemented the command:
  Quote  74 AGETx Always pick up the Par #1 object, even if that would cause the carry limit to be exceeded. Otherwise, this is like command 52, GETx.

I believe his will allow you to 'pick up' things like chigger bites and infections. Not tested yet, that's the next job. Then I'll look at the the dreaded 73 CONT command.


Excellent.

  Turbo46 said  A chigger is apparently a little red flea or mite, the female can lay her eggs under the skin causing infections. Nice.


And that comes from someone living in the land of venemous spiders.

Best wishes,

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

Guru

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

  Tom said  Actually Adventureland was first

Sorry, I'm wrong again. There is a list here I think all or most are in the zip file in one of your earlier posts.

I probably should dump them all to find the commands missing from interp.bas so I can implement and test them. Sometimes I wonder why I am doing this. I've always liked the idea of adventure games but rarely had the patience to follow them through to the end.

  Quote  And that comes from someone living in the land of venemous spiders.

The snakes keep them under control.

Bill
Keep safe. Live long and prosper.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3018
Posted: 01:55am 03 Dec 2020
Copy link to clipboard 
Print this post

  Turbo46 said  A chigger is apparently a little red flea or mite, the female can lay her eggs under the skin causing infections. Nice.

I have experience with chiggers from picking blackberries in Alabama. They are too small for you to notice them, but they migrate on your body to restrictions like belts or shoe tops, and then they, as Wikipedia says, "inject digestive enzymes into the skin that break down skin cells". Infections are rare, but the itching is maddening. Ah, but the blackberry pie! With homemade vanilla ice cream. Or for breakfast with cream (my father's favorite).

You pays your money and you takes your chances.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 09:25pm 03 Dec 2020
Copy link to clipboard 
Print this post

  lizby said  
  Turbo46 said  A chigger is apparently a little red flea or mite, the female can lay her eggs under the skin causing infections. Nice.

I have experience with chiggers from picking blackberries in Alabama. They are too small for you to notice them, but they migrate on your body to restrictions like belts or shoe tops, and then they, as Wikipedia says, "inject digestive enzymes into the skin that break down skin cells". Infections are rare, but the itching is maddening. Ah, but the blackberry pie! With homemade vanilla ice cream. Or for breakfast with cream (my father's favorite).

You pays your money and you takes your chances.

We had about 2 acres of wild blackberries on a hillside in Walton NY in the 1940s and there were no chiggers! Those blackberries were delicious.

Paul in NY
 
Turbo46

Guru

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

Blackberries, when I was young there were lots of blackberries in the Adelaide hills. We used to pick them and my mother made jam (jelly?) and jam tarts (jelly pies?) from them. If I remember correctly they were full of thorns and stained your fingers. Sadly I think they've all been poisoned.

No chiggers though.

Bill
Edited 2020-12-04 17:24 by Turbo46
Keep safe. Live long and prosper.
 
Turbo46

Guru

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

The interpreter:

I've implemented the 74 - AGETx command and that works OK. I presume that any subsequent 52 - GETx command will complain if you have too many items in the inventory.

Onto the CONT command. I've looked at the part of the database concerned:
157:  DRO   WAT   HAS 12   IN 18    Par 12   Par 13   Par 0    MSG:54  CONT    EXx,x   0
158:  0     0     IN/W 0   Par 56   Par 0    Par 0    Par 0    EXx,x   0       0       0
159:  GET   FIR   IN/W 0   Par 0    Par 0    Par 0    Par 0    MSG:51  0       0       0

157:
DRO drop
WAT water
HAS 12 bottle of water
IN 18 bottom of chasm
Par 12 bottle of water
Par 13 empty bottle
Par 0 ?
MSG: 54 “sizzle”
CONT set the CONT flag to ‘TRUE’
Exx,x swap the location of the bottle of water with the empty bottle.
0
------------------------
CONT flag is set so probably increment something and do next entry
------------------------
158:
0 verb is 0
0 noun is 0   " verb and noun are zero so CONTinue
IN/W 0 glowing *FIRESTONE*   ' item 0
Par 56 *FIRESTONE* (cold now)
Par 0 glowing *FIRESTONE*
Par 0 room 0 (storeroom)
Par 0 ?
EXx,x swap the location of the cold *FIRESTONE* with the glowing *FIRESTONE*
0
0
0
------------------------
159:
GET not 0 so reset the CONT flag and get next command from the player

I'm not sure when Par 0 refers to a room or item number or whether it is to be ignored.
Keep safe. Live long and prosper.
 
thwill

Guru

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

Hi Bill,

  Turbo46 said  The interpreter:

I've implemented the 74 - AGETx command and that works OK. I presume that any subsequent 52 - GETx command will complain if you have too many items in the inventory.


I would imagine so.

  Quote  Onto the CONT command. I've looked at the part of the database concerned:
157:  DRO   WAT   HAS 12   IN 18    Par 12   Par 13   Par 0    MSG:54  CONT    EXx,x   0
158:  0     0     IN/W 0   Par 56   Par 0    Par 0    Par 0    EXx,x   0       0       0
159:  GET   FIR   IN/W 0   Par 0    Par 0    Par 0    Par 0    MSG:51  0       0       0

157:
DRO drop
WAT water
HAS 12 bottle of water
IN 18 bottom of chasm
Par 12 bottle of water
Par 13 empty bottle
Par 0 ?


This trailing parameter is ignored because it is not required by any of the commands in action 157.

  Quote  
MSG: 54 “sizzle”
CONT set the CONT flag to ‘TRUE’
Exx,x swap the location of the bottle of water with the empty bottle.
0
------------------------
CONT flag is set so probably increment something and do next entry
------------------------


Yep. In theory you also need to reset 'ip', the parameter pointer but that will happen automatically when you call do_commands() for action 158.

  Quote  

158:
0 verb is 0
0 noun is 0   " verb and noun are zero so CONTinue
IN/W 0 glowing *FIRESTONE*   ' item 0
Par 56 *FIRESTONE* (cold now)
Par 0 glowing *FIRESTONE*
Par 0 room 0 (storeroom)
Par 0 ?
EXx,x swap the location of the cold *FIRESTONE* with the glowing *FIRESTONE*
0
0
0
------------------------


My only surprise here is that there is a condition as well as additional commands. I'm guessing that condition only applies to the commands on this line and not those on the previous despite it being a CONTinued action.

So this is saying that following on from the previous action line if the player is carrying, or in the same room as the "glowing *FIRESTONE*" then exchange the "*glowing *FIRESTONE*" (Par 0) with the "*FIRESTONE* (cold now)" (Par 56). The two remaining Par 0 in that action are ignored because there is no command to consume them.

  Quote  159:
GET not 0 so reset the CONT flag and get next command from the player

I'm not sure when Par 0 refers to a room or item number or whether it is to be ignored.


The one you annotated with the (?) is ignored as is the one you annotated with (room 0 - (storeroom)). There is only one command on that line EXx,x which just consumes the first two parameters (56 & 0), treating them as object numbers.

Hope that clarifies things,

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

Guru

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

  Quote  My only surprise here is that there is a condition as well as additional commands. I'm guessing that condition only applies to the commands on this line and not those on the previous despite it being a CONTinued action.

Yes, I thought of it as a separate command executed immediately after the previous one that needed a condition to satisfy the interpreter (of course I could be wrong ...again).

  Quote  The one you annotated with the (?) is ignored as is the one you annotated with (room 0 - (storeroom)). There is only one command on that line EXx,x which just consumes the first two parameters (56 & 0), treating them as object numbers.

Hope that clarifies things,

It does, thanks.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

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

Hi Tom,

Well I did a bit more reading of the FM (Flamin' Manual?) and understand more of the database structure and the packing involved and how it is interpreted.

Then I actually did get the CONT command working (yes!). I did use a Global though. It doesn't seem to break anything else in the Interpreter either.

If you like, I can send you a copy of the interp.bas, advdata.inc and save files for the Adventureland game so that you can restore what I have done to best practice before I do any more damage to it.

I should probably create a working 'script' file for testing as well and tidy up the umpteen nesting levels of IF statements in the advdata.inc file first though.

Cheers

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

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

Well done Bill, I had every confidence in you.

Once you are happy with what you've got then attach it in an email to me so I can take a look. Then if I think it's necessary I'll have a word with Scott and we can make some decision on how to make it available to others.

Best wishes,

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

Guru

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

Hi Tom,

I Hope it can be made available to others who may want to try adventure games other than Pirate.

As I said in the email I sent you, I tried adventure number three MISSION IMPOSSIBLE and ran slam-bang into another problem. The first two didn't use counters but this one does. They only seem to have significance to the adventure commands within the game and not on the game interpretation, so they may be relatively easy to implement. I'm reluctant to implement any command I can't test though. The ones in question are: 77, 78, 79, and 83.

There appear to be several counters:
THE counter
Alernate counters(0-7)
The time limit, AKA alternate counter 8, AKA artificial light level.

None of these appear to be used by the interpreter. Can you confirm that?
Are you sorry that you started this? (I am).

I'll have a look in a day or two. Do you want me to look at that before I send anything to you?

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

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

Hi Bill,

  Turbo46 said  Hi Tom,

As I said in the email I sent you, I tried adventure number three MISSION IMPOSSIBLE and ran slam-bang into another problem. The first two didn't use counters but this one does ...


I can confirm that the original "interp.bas" does not support any counters (except the light source). It sounds like you have a grasp of how it should work, and as you suggested via email a global array would seem appropriate.

  Quote  Are you sorry that you started this? (I am).


Not at all, but if you are not enjoying yourself then please stop.

  Quote  I'll have a look in a day or two. Do you want me to look at that before I send anything to you?


I am in no hurry, send it to me if/when you want feedback and/or it is ready.

Best wishes,

Tom
Edited 2020-12-06 19:39 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

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

No, I'm not sorry but I am hooked and it's keeping me away from other projects.

One thing, a few messages in the adventures span several lines.
  Quote  "*I'm at the bottom of a very deep chasm. High above me is
a pair of ledges. One has a bricked up window across its face
the other faces a Throne-room"

So far I have been concatenating them with an added space (" ") between them. Maybe it's better to insert a CRLF (chr$(13) + chr$(10)) instead to avoid the line wrapping maybe in the middle of the word. I'm assuming the interpreter could handle that? What do you think?

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