Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 21:59 20 Apr 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 5 of 5    
Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1592
Posted: 06:19am 01 Jan 2021
Copy link to clipboard 
Print this post

Hi Tom,

I think I have transferred the files to you. Please let me know if you get them.
  Quote  Arrow2 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.

A bit of detective work suggests the verb should be 81. It's not used in the walkthrough and I don't think it's important. Possibly interpreters only throw an error when you try to use the noun/verb combination?

My idea of a menu for selection of the games is one that contains only the one game initially - Pirate. It would allow you to add or subtract games to or from its list. When adding it would present a list of data files in the DATA directory, allow you to add it to the list and prompt for a name for the game, possibly sort them alphabetically and save them to the menu file.

Happy new year, I hope it's better for everyone than the last.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 01:04pm 01 Jan 2021
Copy link to clipboard 
Print this post

Happy New Year Bill,

Files received.

I'm juggling a number of things at the moment, but will try to test this and get back to you ASAP.

Best wishes,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1592
Posted: 09:16pm 01 Jan 2021
Copy link to clipboard 
Print this post

No hurry Tom,

If you want to quickly find the additions I have made just look for 'Bill' in the comments. Please feel free to remove them, they are only there to point you to the damage I may have done.

For advdata.inc, you probably have better ways to do what I have done to import the data into a useable format.

Cheers,
Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1592
Posted: 01:45am 02 Jan 2021
Copy link to clipboard 
Print this post

Hi Tom,

Sorry I forgot to mention that Brian Howarth's games abbreviate the directions in the data file:
  Quote  0:    AUTO   ANY
1:    GO     NORT
2:    *ENTE  SOUT
3:    *BOAR  EAST

The interpreter shows:
  Quote  Obvious exits: Nort, Sout, East, West.

"N" works to go north
"GO NORTH" works too, but:
"GO NORT" doesn't.
That could be a bit confusing but I forgot to look for a remedy.

Cheers
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 08:59pm 02 Jan 2021
Copy link to clipboard 
Print this post

Thanks Bill, I'm sure I can find a "fix" for that.

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1592
Posted: 09:42pm 02 Jan 2021
Copy link to clipboard 
Print this post

I know you can Tom.

Thinking about that, he uses a vocabulary word length of 4 for that game and I guess that his game compiler truncates them to 4 characters. I haven't checked all of the available games but Scott Adams games use mostly a word length of 3. If that was used by others it may truncate the other directions as well.

Cheers
Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1592
Posted: 03:50am 05 Jan 2021
Copy link to clipboard 
Print this post

Hi Tom,

I've written a little utility to read a .dat file that uses LF characters as line endings and convert them to CR. It produces a second copy of 'filename.dat' named 'filename1.dat'. Use it on any .dat file which gives a 'line too long' error (like 'marooned.dat'). You may want to include it with the interpreter package.

Bill

lf2cr.zip
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 10:05am 05 Jan 2021
Copy link to clipboard 
Print this post

Hey Bill,

I believe you have got your carriage returns and line feeds mixed up. CR "\r" is ASCII 13 and LF "\n" is ASCII 10. So does that mean the the problem is actually files using only CR (i.e. those from a Mac) ? - that would explain why I've never seen this issue on the CMM2 despite working with files (including .BAS) using only *nix "\n" line-endings - I think MMBasic handles those fine.

The bullet-proof solution would be to treat adventure .dat files as binary and write our own read_line() function on top of that that can handle lines ending "\r" or "\n" or "\r\n".

Best wishes,

Tom
Edited 2021-01-05 20:06 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1592
Posted: 03:29am 06 Jan 2021
Copy link to clipboard 
Print this post

  Quote  I believe you have got your carriage returns and line feeds mixed up

Oops, that's what happens when I trust my memory. Benny Hill explained why you must never ASSUME.

I did some checking and found that:

Adv01.dat lines end with hex 0A.
MAROONED,dat lines end with hex 0D.
MMBasic lines in files saved by PRINT #n, "text" end with hex 0D OA.

  Quote  The bullet-proof solution would be to treat adventure .dat files as binary and write our own read_line() function on top of that that can handle lines ending "\r" or "\n" or "\r\n".

I think you're speaking 'C' but I agree, I think that MMBasic only has trouble with the 'MAROONED.dat' style. I see a problem if you are checking for 0A 0D you may be reading the first character of the next line if not EOF and would have to save that character for the next read_line() call.

If you are unable to, would you like me to have a go at it?

There is another problem. I found a copy of 'Mini-venture' by Bruce Hansen and it contains the line:
  Quote  "Matches/MATC/"-1

There is no space between the second quote and the room number. In Advdata.inc I have used the space between the quote and the number as the delimiter when parsing the line into room description and room number. That will have to change if that dat file is to be accommodated.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 04:06pm 07 Jan 2021
Copy link to clipboard 
Print this post

Hi Bill,

Unfortunately the latest UK lockdown and the requirements of child-care seems to have knocked me out of the game for the moment.

  Turbo64 said  I see a problem if you are checking for 0A 0D you may be reading the first character of the next line if not EOF and would have to save that character for the next read_line() call.


Yes, unless you are reading only a single byte from the file at a time (which I don't recommend) some form of buffering will be required. Because the actual data file is small compared to the CMM2's memory you could even read the whole file into a LONGSTRING and walk through that to identify the individual lines.

  Turbo64 said  If you are unable to, would you like me to have a go at it?


By all means if you are still interested then go for it.

  Turbo64 said  There is another problem. I found a copy of 'Mini-venture' by Bruce Hansen and it contains the line: ... That will have to change if that dat file is to be accommodated.


Sounds fairly niche, I'll leave it to your judgement.

Best wishes,

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

Joined: 31/07/2019
Location: Australia
Posts: 375
Posted: 04:03am 08 Jan 2021
Copy link to clipboard 
Print this post

Just for interest - ZORK on cheap itsy M4
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 03:10pm 24 Jan 2021
Copy link to clipboard 
Print this post

Hi Bill,

Just a line to say that I haven't forgotten about this and it has finally risen to the top of the stack.

Hope you are keeping well,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1592
Posted: 10:33pm 24 Jan 2021
Copy link to clipboard 
Print this post

Thanks Tom,

Good news! I knew you hadn't forgotten. I'm looking forward to the end result.

Cheers
Assistant Bill
Keep safe. Live long and prosper.
 
     Page 5 of 5    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024