Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:49 29 Nov 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: More creaky old text adventures (SAAINT)

     Page 1 of 3    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 10:29pm 08 Jun 2021
Copy link to clipboard 
Print this post

Hey folks,

I am pleased to announce the release of SAAINT, the Scott Adams Adventure Interpreter for the Colour Maximite 2.

This is based upon the "Pirate Adventure" interpreter included on "The Welcome Tape" and its creation was instigated by Bill/@Turbo46 who did the early running with extending the interpreter. I then came in and did some rework, dragged my feet and then eventually added some bells, whistles and unnecessary lily gilding  

With the kind permission of Scott Adams this release is distributed with the 12 original Scott Adams Classic Adventures. You can also find a dozen or so more adventures by following the links from the SAAINT git repository. Please note that Bill and I did not test all the adventures to completion (or even a significant fraction of them) and I would be eager to hear if you encounter any issues - though be warned, most of the spelling mistakes are Scott Adams originals.

Get it here: https://github.com/thwill1000/cmm2-saaint-public/archive/refs/tags/release-2.0.0.zip

Read more about it here: https://github.com/thwill1000/cmm2-saaint-public





Happy adventuring,

Tom
Edited 2021-06-09 08:58 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 12:14am 09 Jun 2021
Copy link to clipboard 
Print this post

Thanks for uploading this set of 12 Scott Adams text adventures.
This is a GREAT addition to our collection of Color Maximite 2 programs.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6804
Posted: 10:13am 09 Jun 2021
Copy link to clipboard 
Print this post

Brilliant!!!!

What a lovely bit of history. I first played some of these on my Tandy Model 1.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 08:28pm 16 Jul 2021
Copy link to clipboard 
Print this post

Hi Tom, Have you considered making the *seed Meta-Command the default so that for normal operation the 'random' behaviour is consistent and repeatable?

For anyone interested I will explain: Most BASICs include a pseudo random number generator which will generate the same sequence of 'random' numbers each time a program is run.

The Scott Adams adventure system includes automatic actions that are executed under certain conditions. Many of these use a probability factor of 0-100 so that (say) chigger bites may become infected next move or the next or so on. Normally these 'random' occurrences are repeatable if exactly the same moves are made each time the adventure is played, thus making a walkthrough possible.

The CMM2 apparently has a true random number generator so that these 'random' occurrences will not be repeatable.

Tom has provided a *seed directive so that the interpreter provides it's own pseudo random number generator and this is automatically started when a walkthrough is replayed. So to record a walkthrough or for normal gameplay and to get repeatable results you need to invoke the *seed directive before beginning.

I just think that gameplay would be better using the interpreter's random numbers by default.

I hope I've got that correct.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 10:18pm 16 Jul 2021
Copy link to clipboard 
Print this post

Hey Bill,

  Turbo46 said  Hi Tom, Have you considered making the *seed Meta-Command the default so that for normal operation the 'random' behaviour is consistent and repeatable?


I could certainly do that if it would be useful, or even make it user configurable.

Note that some of what you say regarding SAAINT is not entirely accurate for the final released version:

   - SAAINT never uses the standard CMM2 RND() function it always uses a pseudo-random number generator (the same one documented in the CMM2 User Manual, p51, which I believe is fairly "standard" and also used by the GNU compiler collection.)
   - By default the value of the TIMER is used to seed this random-number generator.
   - The player can manually re-seed the generator with the meta-command *SEED <integer>.
   - The generator is automatically re-seeded with the number 7 when you start to record/replay a script/walkthrough. Thus if you are recording a walkthrough you do not have to manually invoke *SEED, infact I'm not sure there is any particularly good reason to manually invoke *SEED anymore.

Knowing this do you still want me to make a change ?

Best wishes,

Tom
Edited 2021-07-17 08:34 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 11:07pm 16 Jul 2021
Copy link to clipboard 
Print this post

Hi Tom,

You're correct, I didn't know that the CMM2 RND() was not used nor that the timer was used to seed the random number generator. I've long given up trying to understand the majority of the program.

The *SEED <integer> command is not described in the README file (the integer part). *STATE <integer> is but what is the integer for? Was that meant for *SEED?

Also what program should be used to read README.MD? it looks a bit strange in Notepad unless the ''' is intentional.

Having said that I would still like the option to have the *SEED command user configurable as default. Sometimes it's better to write down the steps rather than record them. I would nearly always forget to invoke it first.

Cheers

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 11:15pm 16 Jul 2021
Copy link to clipboard 
Print this post

  Turbo46 said  Hi Tom,

You're correct, I didn't know that the CMM2 RND() was not used nor that the timer was used to seed the random number generator. I've long given up trying to understand the majority of the program.




  Quote  The *SEED <integer> command is not described in the README file (the integer part). *STATE <integer> is but what is the integer for? Was that meant for *SEED?


Yes, that was a typo, the <integer> argument was for *SEED not *STATE. I have fixed that on GitHub.

  Quote  Also what program should be used to read README.MD? it looks a bit strange in Notepad unless the ''' is intentional.


It's Markdown and intended for presentation by GitHub itself, i.e. https://github.com/thwill1000/cmm2-saaint-public/blob/main/README.md

As a format I acknowledge it is not ideal for reading natively on the CMM2, but it's not completely awful either and it saves me from maintaining two versions of the README.

  Quote  Having said that I would still like the option to have the *SEED command user configurable as default. Sometimes it's better to write down the steps rather than record them. I would nearly always forget to invoke it first.


OK, I will see if I can oblige.

Best wishes,

Tom
Edited 2021-07-17 09:16 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 11:21pm 16 Jul 2021
Copy link to clipboard 
Print this post

  Quote  Yes, that was a typo

Aha! so you are human.

  Quote  I will see if I can oblige

Thanks

Cheers
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 02:08pm 17 Jul 2021
Copy link to clipboard 
Print this post

Hi Bill,

Assuming I haven't messed something up you can find SAAINT version 2.0.2 in the usual place:

   https://github.com/thwill1000/cmm2-saaint-public/releases/latest.

ChangeLog
---------

Version 2.0.2 - 17-Jul-2021:
- Added "seed" key to "saaint.ini". If the value is > 0 then the random number
  generator will be seeded with this value when an adventure is started or
  restored. Otherwise the random number generator is seeded from the TIMER.


If you add this:

seed = 42


to the "src/saaint.ini" file (which is created the first time SAAINT is run) then the value 42 will be used to re-seed the PRNG each time an adventure is started or restored.

I have left the default behaviour of seeding the PRNG from the TIMER the same as it was in the previous version since the lack of predictability is the original expected behaviour for all these adventures.

Hope this works for you,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 12:23am 18 Jul 2021
Copy link to clipboard 
Print this post

Thanks Tom,

42, the number made famous by another Adams.

Sorry for bothering you with this since I seem to be the only one interested and considering I can't find the time to finish my own related project.

A couple more questions if I may:

After recording or playing a script, is the random number generator re-seeded from the timer or .INI file?

Can one make their own .WLK file? Is it the same format as a .SCR file and will an un-encrypted .WLK file run.

Sorry that's more than a couple.

Cheers
Bill
Keep safe. Live long and prosper.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6804
Posted: 08:50am 18 Jul 2021
Copy link to clipboard 
Print this post

Will it run on a PicoMite (yet), Tom?

Do we need to find a I2C alphanumeric keyboard first?

;)
Edited 2021-07-18 18:54 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 09:08am 18 Jul 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  Will it run on a PicoMite (yet), Tom?

Do we need to find a I2C alphanumeric keyboard first?

;)


Way ahead of you.

Just porting Yellow River Kingdom as a warm up and also to help shake-out any bugs / differences in MMBasic from CMM2. Though I have a suspicion when I move to porting SAAINT itself there will be some issues with the file-system commands as IIRC Peter did some fiddling to make the use of relative paths with various commands more friends on the CMM2 and I don't know if that has made the transition to the Pico. Also the walkthrough encryption code won't work unless the Pico gets sufficient CSUB support so that CSUBs can be used as alternatives to DATA statements.

I have already got my mini I2C keyboard: https://www.thebackshed.com/forum/ViewTopic.php?TID=13915

I am also keeping half an eye on the main Pico/LCD thread so I have some idea what to do about the display - I will be asking questions .

Maybe within a month of two I will have a hand-held dedicated SAAINT console that nobody needs or wants .

Best wishes,

Tom
Edited 2021-07-18 19:09 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9131
Posted: 09:16am 18 Jul 2021
Copy link to clipboard 
Print this post

  Quote  Pico gets sufficient CSUB support so that CSUBs can be used as alternatives to DATA statements.


There is support in the Pico to use fonts in this way - see the b0 post
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 09:25am 18 Jul 2021
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Pico gets sufficient CSUB support so that CSUBs can be used as alternatives to DATA statements.


There is support in the Pico to use fonts in this way - see the b0 post


Thanks Peter, will look at that when I port.

Best wishes,

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 11:26am 18 Jul 2021
Copy link to clipboard 
Print this post

  Turbo46 said  Thanks Tom,

42, the number made famous by another Adams.




  Quote  Sorry for bothering you with this since I seem to be the only one interested and considering I can't find the time to finish my own related project.


I never find you a bother Bill.

  Quote  After recording or playing a script, is the random number generator re-seeded from the timer or .INI file?


It shouldn't be getting re-seeded AFTER either of these events.

The PRNG is re-seeded:

1. When you "Start a new game" - from the seed value from the .ini file
2. When you "Restore a saved game" - from the seed value from the .ini file
3. When you start to *RECORD a script - using the seed value 7
4. When you start to *REPLAY a script - using the seed value 7

In the case of 1 or 2 if the .ini file does not exist, or the value in the .ini file is not an integer > 1 then the TIMER is used as the seed value.

If this doesn't meet with your observations then please let me know and provide instructions to reproduce the problem.

  Quote  Can one make their own .WLK file? Is it the same format as a .SCR file and will an un-encrypted .WLK file run.


The format is the same as the .scr file, but is encrypted using https://github.com/thwill1000/cmm2-sptools/blob/master/src/spcrypt/spcrypt.bas.

If you can wait a couple of days I will update SAAINT to support unencrypted walkthroughs too.

Best wishes,

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 11:52am 18 Jul 2021
Copy link to clipboard 
Print this post

  Quote  The format is the same as the .scr file, but is encrypted using https://github.com/thwill1000/cmm2-sptools/blob/master/src/spcrypt/spcrypt.bas.

Thanks, that's what I expected.

  Quote  I will update SAAINT to support unencrypted walkthroughs too

Thanks again, that will allow one to make their own .WLK file although I suppose a script file will achieve the same result.

Cheers
Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 12:08pm 18 Jul 2021
Copy link to clipboard 
Print this post

  Turbo46 said  Thanks again, that will allow one to make their own .WLK file although I suppose a script file will achieve the same result.


Yep, using a script file isn't much different except for their expected location in the filesystem and the meta-command used to invoke *REPLAY instead of *WALKTHROUGH.

The reason that "walkthroughs" exist in SAAINT was to facilitate testing, and the reason they are encrypted is so that their presence in the distribution doesn't spoil the enjoyment of SAAINT's many devoted users      . Plus it was interesting to implement the MD5 and XXTEA algorithms and, God help me, it was even ultimately useful in the day job.

Anyway it won't be a big deal to add support for unencrypted walkthroughs so I will do it.

Best wishes,

Tom
Edited 2021-07-18 22:10 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 03:20pm 20 Jul 2021
Copy link to clipboard 
Print this post

Hi Bill,

Assuming I haven't messed something up you can find SAAINT version 2.0.3 in the usual place:

  https://github.com/thwill1000/cmm2-saaint-public/releases/latest

ChangeLog
---------

Version 2.0.3 - 20-Jul-2021:
- Added support for unencrypted walkthough (.wlk) files.
  These are in the same format as ordinary script files but should be put in
  the directory containing the corresponding "<adventure>.dat" and be named
  "<adventure>.wlk".
- Changed location of "saaint.ini" file from "<saaint-root>/src"
  to "<saaint-root>". If the .ini file is not present in "<saaint-root>" but
  is present in "<saaint-root>/src" then it will be moved.
- Changed location of temporary files from "<saaint-root>/src"
  to "<saaint-root>/tmp".


Hopefully this will meet your needs.

Best wishes,

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4253
Posted: 07:37pm 22 Jul 2021
Copy link to clipboard 
Print this post

nice piece of work Tom, works flawless.

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 09:55pm 22 Jul 2021
Copy link to clipboard 
Print this post

  Volhout said  nice piece of work Tom

Thanks .

  Quote  works flawless.

That seems unlikely .

Best wishes,

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