Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 17:24 18 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 3 of 5    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 10:00am 06 Dec 2020
Copy link to clipboard 
Print this post

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


I know that burden all too well.

  Quote  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"


Can you send me an extract from a .dmp file so I can see exactly what we are talking about?

  Quote  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?


Space "should" be fine. A lot of the complexity in "console.inc" comes from preventing line wraps occurring in the middle of words.

Best wishes,

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

Guru

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

The following is the above line from the Dump file processed by the modified advdata.inc file.
  Quote   17, 12, 12, 15, 14, 18,maze of pits
0, 0, 0, 0, 17, 0,*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
0, 0, 0, 20, 0, 0,*I'm on a narrow ledge by a chasm. Across the chasm is the Throne-room

The second line is wrapped by the forum post.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 10:21am 06 Dec 2020
Copy link to clipboard 
Print this post

Sorry Bill, I still don't understand what we are talking about. Could you email me the .dmp file and try to explain it to me again using different words.

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 01:17pm 06 Dec 2020
Copy link to clipboard 
Print this post

Hi Bill,

Thanks for the files, I hadn't expected the standard TRS-80 dat files to be text, I had assumed they would be binary. That must have made it easier for you to adapt my original file reading code.

Having looked at the file I think the strings have been preformatted for a 64 character display so the line breaks should be preserved as CRLF. What leads me to this conclusion is the inclusion of some completely empty lines amidst the text, obviously for emphasis when displayed to the user. I hope we don't end up with any strings more than 255 characters.

However, "console.inc" currently assumes the only whitespace it has to deal with is spaces. Until I have a chance to fix it I suspect that you may see some formatting problems when you start respecting the line breaks. If you want to pass the code back to me to take a look at that point then I'll deal with it ASAP.

Separately you may have noticed some superfluous strings at the end of the dat file. These aren't used by the interpreter but are comments used by Scott's in-house authoring tools.

Best wishes,

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

Guru

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

OK Tom,

I'll get a working script file for Adventureland first and test the CRLF additions.

The longest line so far is 195 characters so that will increase by replacing a single space character with CRLF several times. I guess a 'token' could be used like the underscore '_'.

From the data file for MISSION IMPOSSIBLE:
  Quote  "A movie runs telling about the reactor and its construction
interesting highlights:
1) Plastic DEFORMS strangely in radiation
2) Even short exposure to HIGH radiation is LETHAL, so suit up
"

That reinforces your view about retaining the format. Its length is 190 characters with spaces replacing line breaks.

I was concerned about the superfluous strings at the end but they are mentioned in the FM so I was happy to ignore them.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 10:35pm 06 Dec 2020
Copy link to clipboard 
Print this post

Bill,

I doubt there will be any strings longer than 255 characters, Scott Adams' games were renown for their terseness. If we wanted to use a token for the CRLF then I would suggest just using LF like UNIX does. But for the moment use CRLF and see what, if anything breaks.

Best wishes,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1595
Posted: 10:38pm 06 Dec 2020
Copy link to clipboard 
Print this post



Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1595
Posted: 08:45pm 16 Dec 2020
Copy link to clipboard 
Print this post

Hi Tom,

I finally made time to work on the SAAINT interpreter again.

MISSION IMPOSSIBLE makes use of the counter which has not yet been implemented.

I've added a counter plus the condition codes: 15, 16, 17, (18) and (19). Also commands: 77, 78, 79, (82) and 83. The ones in brackets are not needed for MISSION but because they were so similar to the others it was simple to do. These all involve the counter and are untested so far, maybe on the weekend - Christmas is getting in the way.

The counter should be added to the SAVE file now also. This will break existing SAVE files unless there is a way of detecting whether it exists in the file or not.

There are also eight alternate counters that may be used: alt_counter(7) which I have added now although they are not used... yet. They should also be saved and restored.

Speaking of SAVE files, what is the purpose of the "1" in the second line of the SAVE file? Is it intended to be a version number? Could I use it as such to indicate that version "2" contains the counter(s)?

  Quote  ' These global variables hold the current game state
DIM lx ' light duration
DIM df ' dark flag
DIM r  ' current room
DIM sf ' status flags
DIM counter ' counter - Bill
DIM alt_counter(7) ' alternate counters
' And ia() which contains the current object locations,
' but is declared by adv.read()


Cheers
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

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

Hi Bill,

It sounds like you are continuing to make good progress.

The second line in the save file format was indeed intended to be used for the file version so you can increment it when adding code to save the counters. Note it looks like there will also be "room registers" to add later, see CMD 87.

I personally wouldn't bother to continue supporting the v1 format, you can manually update your existing files to v2 if you need them. Any other v1 files that currently exist will be for "pirate" and SAAINT will no longer open the corresponding .dat file; my intention is to ask Scott if we can switch The Welcome Tape to using the commercial version of the "Pirate" .dat file instead of the BYTE Magazine version, in the unlikely event he says "No" we should be able to manually convert it over to the "new" format (not that new, I believe it is the TRS-80 format)

Merry Christmas,

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

Guru

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

Hi Tom,

I was thinking that I would cater for version 1 or 2 for the load file but always save the file in version 2 (obvious?). I'll add the alternate room registers while I'm at it - just in case.

Cheers
Bill

PS Where did the name for "persist.inc" come from?
Edited 2020-12-17 10:32 by Turbo46
Keep safe. Live long and prosper.
 
Turbo46

Guru

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

Hi Tom,

The counter commands are working, load and save games functions have been extended to cater for the counters and alternate rooms (version 2).

Adv04 adds command 88 - DELAY, I think I have that one sussed.
  Quote      CASE 88
     
' DELAY - Bill
     ' Delay for approximately 1 second
     PAUSE 1000


Adv05 introduces command 81:
EXm,CT
This command exchanges the values of the counter and the Par #1 alternate counter. There are eight alternate counters numbered from 0 to 7. Also, the time limit may be accessed as alternate counter 8.

This looks easy enough, just need to cover the possibility of Par #1 being the time limit AKA light level. That these have all been so easy to add is testament to the excellent structure of your interpreter.

Cheers
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 07:17pm 20 Dec 2020
Copy link to clipboard 
Print this post

More good progress Bill, even if you are still giving me too much credit for the interpreter.

I have been in contact with Scott Adams and he says he needs to talk with the other members of his current company before he can give his blessing to further distribution, so cross your fingers.

You asked in an earlier email about the possibility of an authoring system. That certainly shouldn't be that tricky, but I wouldn't want to stand on the toes of @johngill's ZILish.

Seasons Greetings from the plague ridden lands of the UK,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1595
Posted: 08:32pm 20 Dec 2020
Copy link to clipboard 
Print this post

Tom, I've added quite a few commands now but most have only been one or two lines of code. It's down to you that it's that simple.

Command 81 was a bit more involved but still only a few lines of code.

I've DUMPed all of the adventures now and there are only two more commands required, 75 and 87. They both are perhaps a little more tricky than:
counter = counter + 1

Adv14b 'Buckaroo Banzai' seems to be in a slightly different format and gives an error when using DUMP.

Regarding an authoring system, I'm thinking of knocking up a quick and dirty 'assembler' type thing to produce an 'adventure database' of only a few commands to allow easier testing of these commands. Testing to date involves following a walkthrough to the point where a command is used and seeing the effect. More time consuming than actually implementing the command!

Like your 'Pirate' interpreter, I'm the only one who has expressed interest in johngill's ZILish although I expect there a a few 'lurkers' who follow but do not comment. It would be nice if they did occasionally so that you could know that there is some interest.

It appears that Boris has cancelled Christmas but I hope you and your countrymen can still have a happy Christmas with your families.

Cheers
Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1595
Posted: 08:45pm 20 Dec 2020
Copy link to clipboard 
Print this post

  Quote  only two more commands required, 75 and 87

Sorry, I didn't read my notes properly, command 80 is also needed and that will complete the whole set of commands from the FM

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 08:56pm 20 Dec 2020
Copy link to clipboard 
Print this post

Hi Bill,

Sounds like you'll be released back to your other projects soon

  Turbo64 said  Adv14b 'Buckaroo Banzai' seems to be in a slightly different format and gives an error when using DUMP.


Apparently the adventure data file itself contains a bug, so that may be the issue here. Search https://github.com/MikeTaylor/scottkit for "Buckaroo Banzai".

  Turbo64 said  Regarding an authoring system, I'm thinking of knocking up a quick and dirty 'assembler' type thing to produce an 'adventure database' of only a few commands to allow easier testing of these commands. Testing to date involves following a walkthrough to the point where a command is used and seeing the effect. More time consuming than actually implementing the command!


That sounds like an idea. I was thinking that if I approach it then I'll probably just port/rewrite ScottKit (see previous link) in MMBasic.

  Turbo64 said  Like your 'Pirate' interpreter, I'm the only one who has expressed interest in johngill's ZILish although I expect there a a few 'lurkers' who follow but do not comment. It would be nice if they did occasionally so that you could know that there is some interest.


Agreed.

At the moment it looks like we may have tens of text adventures (hundreds if Z-MIM is updated to handle .z4 and .z5 formats) and two authoring systems ... outnumbering the known users substantially.

  Turbo64 said  It appears that Boris has cancelled Christmas but I hope you and your countrymen can still have a happy Christmas with your families.


Thanks Bill, alas the forum rules prevent me from expressing my true feelings about BoJo the Clown.

Merry Christmas,

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

Guru

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

  Quote  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. All of the rest look OK.

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.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1595
Posted: 07:30am 22 Dec 2020
Copy link to clipboard 
Print this post

Hi Tom,

I was just looking at implementing commands 75, 80 and 87.

I'd just like your understanding of 80 and 87.

80 EXRM0
This exchanges the values of the current room register with the alternate room register 0. This may be used to save the room a player came from in order to put him back there later. This should be followed by a GOTOy command if the alternate room register 0 had not already been set.

87 EXc,CR
This exchanges the values of the current room register with the Par #1 alternate room register. This may be used to remember more than one room. There are six alternate room registers numbered from 0 to 5.

As I see it, the alternate room registers need to be an array to contain the six possible exits, North, South etc. plus a string to hold the description.

Questions:
1. Do you think that any items located in that room should also be relocated to the alternate room? Not stated but that would seem logical to me, but messy to implement. How do you indicate an alternate room? Increase the number of rooms beyond the number in the database? Or use room 1000 as alternate room 0 etc. then any rooms starting at room 1000 could be trapped and treated as alternate rooms. Am I over thinking it?

2. Would you consider RM0 to be alt_room(0)?

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 09:42am 22 Dec 2020
Copy link to clipboard 
Print this post

Hi Bill,

It took me a few minutes to work out what you have been smoking . Fortunately I believe it is much simpler than you are thinking.

You are not literally exchanging rooms, you are just swapping the player's current position 'r' with a value stored in an array of integers alt_rooms(5). You may also need to display the room description for the new room.

e.g. to exchange with alternate room register 'x'

tmp = r
r = alt_rooms(x)
alt_rooms(x) = tmp
describe_room()


Best wishes,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1595
Posted: 10:43am 22 Dec 2020
Copy link to clipboard 
Print this post

Thanks Tom,

That's what I thought initially because I only allocated a single dimensioned array for alt_rooms(5). But I started over thinking it and got myself confused.

The two commands 80 and 87 should be pretty much the same then but the (x) for alt_room(x) will be 0 for command 80 and 'x = get_parameter(a)' for command 87 if I have it right now.

Are you sure about the 'describe_room()' because the next command for the first time it's used should be 'GOTOy' which should be followed by a 'DspRM' command although I can't confirm that it actually is.

Cheers
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

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

You're welcome Bill.

  Turbo64 said  The two commands 80 and 87 should be pretty much the same then but the (x) for alt_room(x) will be 0 for command 80 and 'x = get_parameter(a)' for command 87 if I have it right now.


I think so.

  Turbo64 said  Are you sure about the 'describe_room()' because the next command for the first time it's used should be 'GOTOy' which should be followed by a 'DspRM' command although I can't confirm that it actually is.


No, I'm not "certain", might be worth just trying without the describe_room() and see if as a result you get situations where you think a redescribe should have happened but didn't.

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.

I have deliberately not examined it in detail, but in the ScottFree interpreter any command that changes the state such that a redescribe might be required (e.g. movement, removing an object from a room, adding an object to a room) sets a 'redraw' flag which is checked in the main loop before do_automatic_actions() AND prompt_for_command() and calls describe_room() if it is set. describe_room() clears the flag. This presumably ensures a room is always redescribed if its description has changed even if the actual command data doesn't do it explicitly.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 3 of 5    
Print this page
© JAQ Software 2024