PunyInform and Ozmoo

bbc/electron apps, languages, utils, educational progs, demos + more
Post Reply
User avatar
davidb
Posts: 3395
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

PunyInform and Ozmoo

Post by davidb »

This project looks interesting for budding adventure authors: PunyInform. The official site is here.

Edit: Topic title changed as suggested, with the aim of improving searchability.
Last edited by davidb on Fri Jul 24, 2020 1:33 pm, edited 1 time in total.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

davidb wrote: Thu Jul 16, 2020 3:27 pm This project looks interesting for budding adventure authors: PunyInform. The official site is here.
Thanks for that. I've been following the development of PunyInform in a very casual way, and I contacted one of the devs, who is also the developer of the C64 Z-Code interpreter Ozmoo, to ask how easy it would be to port Ozmoo to the Beeb: he wasn't optimistic because of the memory requirements.

But the reason I asked the question was that quite a while ago I'd tried Jon Welch's Z-Code interpreter (or "Z-machine interpreter") for the Beeb, which you can download from the Retro Software website, and I seemed to recall it ran very slowly, in MODE0 (or MODE128), probably on a Master, so I'd always assumed that a good Z-Code interpreter for the Beeb or Master just wasn't available.

But I've just downloaded a couple of zips from the Retro Software site, and I've found that -- as I think the website in fact states (and as I'd have realised if I'd bothered to read it properly!) -- there is a version of the Beeb Z-Code interpreter that is pretty good, if not perfect, at running "Z3" versions of Infocom games: I've just used it to run the Z3 version of The Hitchhiker's Guide To The Galaxy in Model B mode in BeebEm, and I've played around with it a bit, and although it's not blazingly fast, it's usable and it does seem to run the game without error:

Screenshot 2020-07-16 at 16.18.14.png

This is good news because the implication is that it should be possible to compile a game with Inform, using the PunyInform library, and have it run on a Beeb!

One thing that's slightly confusing is that I've got a version of the interpreter ROM that's been in my personal archive for a long time and that's different from at least one of the ROMs that I just downloaded from Retro Software today. The header in the old ROM from my personal archive says this:

Code: Select all

Z-Code Interpreter 0 (C) 2008 Jon Welch
Whereas the header in one of the ROMs I downloaded today says this:

Code: Select all

Z-Code Interpreter for BBC Model B 0 (C) 2008 Jon Welch
Weirdly, the old ROM from my personal archive -- can't remember where I got it from -- actually seems to work better in a Model B than the ROM which I downloaded today, even though the latter explicitly says it's for a Model B! The latter spewed a load of random Teletext graphics on screen when I tried to say EXAMINE NO TEA in Hitchhiker's!

:?

EDIT: Btw, the command that invokes the Z-Code interpreter is *Z-CODE. You can follow it with the name of a Z-Code game file to run the game: e.g. *Z-CODE HHGG

EDIT2: Looks like the ROM from my personal archive is very similar (just two bytes differ) to what's described as the "beta" version here:
Oh dear -- does that mean that the beta version of the ROM works better than the final release?!

:?:
Last edited by lurkio on Thu Jul 16, 2020 7:34 pm, edited 1 time in total.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

Here's Jon Welch's Z-Code interpreter running Library Of Horror, the demo game that comes as source code with the PunyInform library:

Screenshot 2020-07-16 at 18.22.50.png

I compiled the source on the commandline on my Mac, following the instructions here:
:idea:
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

lurkio wrote: Thu Jul 16, 2020 4:51 pm ... there is a version of the Beeb Z-Code interpreter that is pretty good, if not perfect, at running "Z3" versions of Infocom games: I've just used it to run the Z3 version of The Hitchhiker's Guide To The Galaxy in Model B mode in BeebEm, and I've played around with it a bit, and although it's not blazingly fast, it's usable and it does seem to run the game without error
Not quite! There's a moment in the Hitchhiker's game where you have to enter the command

Code: Select all

TYPE "GASHEE"
where the word in quotes might not be literally GASHEE but will be some equally alien-looking word. The point is that you actually have to include the literal quotation-marks in the command when you type it in, according to the solutions at CASA -- but the Beeb interpreter doesn't seem to understand quotation-marks! So you can't get past that point in the game on the Beeb.

I think this is a bug in the interpreter.

:!:

EDIT: If only Samwise had played a little further!:
OK, I can run both Zork and The Hitchhiker's Guide to the Galaxy. Haven't spent a lot of time on Zork, but I've just played through the first part of HHGTTG. I got 25/400 points, and it seems to be working perfectly!
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

lurkio wrote: Thu Jul 16, 2020 4:51 pm ... there is a version of the Beeb Z-Code interpreter that is pretty good, if not perfect, at running "Z3" versions of Infocom games: I've just used it to run the Z3 version of The Hitchhiker's Guide To The Galaxy in Model B mode in BeebEm, and I've played around with it a bit, and although it's not blazingly fast, it's usable
Actually, I think I was slightly misled by the speed advantage of having turned disc-drive noises permanently off in Mac BeebEm: the Z-Code interp seemed much faster than it "really" is. It has to access the disc a heck of a lot between turns:
:shock:
User avatar
davidb
Posts: 3395
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: PunyInform

Post by davidb »

Maybe the Ozmoo interpreter could be ported to machines with sideways RAM.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

davidb wrote: Fri Jul 17, 2020 10:17 am Maybe the Ozmoo interpreter could be ported to machines with sideways RAM.
Yes, I think that's an intriguing possibility, especially given that one of the features that the Readme says that Ozmoo supports is this:
Building a Z-code game without virtual memory. This means the whole game must fit in RAM at once, imposing a size restriction of about 50-52 KB. A game built this way can then be played on a C64 without a diskdrive.
There's also this:
Using an REU (Ram Expansion Unit) for caching. The REU can also be used to play a game built for a dual disk drive system with just one drive.
:?:
User avatar
Dave Footitt
Posts: 998
Joined: Thu Jun 22, 2006 10:31 am
Location: Abandoned Uranium Workings
Contact:

Re: PunyInform

Post by Dave Footitt »

This is great, I tried Inform 6.something a while back and thought it was a fantastic language for making this sort of thing!
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

Dave Footitt wrote: Fri Jul 17, 2020 12:53 pm This is great, I tried Inform 6.something a while back and thought it was a fantastic language for making this sort of thing!
It is, but the issue is the speed of the Z-Code interpreter for the Beeb, I think. I haven't tried it on a real Beeb with a real disc drive, but I fear it's gonna be painfully slow. I might give it a try later on.

Still, have you ever thought about porting Calypso to PunyInform..?! At the very least it might then be playable on Beeb emulators with drive noises turned off and the emulation speed cranked up!

:?:
User avatar
Dave Footitt
Posts: 998
Joined: Thu Jun 22, 2006 10:31 am
Location: Abandoned Uranium Workings
Contact:

Re: PunyInform

Post by Dave Footitt »

lurkio wrote: Fri Jul 17, 2020 1:34 pm Still, have you ever thought about porting Calypso to PunyInform..?! At the very least it might then be playable on Beeb emulators with drive noises turned off and the emulation speed cranked up!
Could certainly give that a go... Wonder how much work is involved?
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

lurkio wrote: Fri Jul 17, 2020 1:34 pmthe issue is the speed of the Z-Code interpreter for the Beeb, I think. I haven't tried it on a real Beeb with a real disc drive, but I fear it's gonna be painfully slow. I might give it a try later on.
https://www.youtube.com/v/9eneT9uHekk
Last edited by lurkio on Thu Dec 30, 2021 11:46 pm, edited 1 time in total.
User avatar
vanpeebles
Posts: 763
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: PunyInform

Post by vanpeebles »

I have some proper infocom games for the Tatung and they do hammer the disc drive a lot. I was surprised at first!
User avatar
Dave Footitt
Posts: 998
Joined: Thu Jun 22, 2006 10:31 am
Location: Abandoned Uranium Workings
Contact:

Re: PunyInform

Post by Dave Footitt »

I had a quick go at this, couldn't get Calypso to build (2 header files missing, so I think it might be more work than a quick recompile)

So I had a go at building their demo, and got a load of errors:

Code: Select all

Inform 6.34 (28th June 2018)                                                                                                                          
"lib/globals.h", line 222: Error:  Expected '->', '-->', 'string', 'table' or 'buffer' but found static                                               
[... lots more errors ...]
I'm building using this:

Code: Select all

 ../inform6/i6 +lib library_of_horror.inf
Has anyone had any success?
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

Dave Footitt wrote: Sat Jul 18, 2020 10:10 pmI had a go at building their demo, and got a load of errors ... Has anyone had any success?
Yes, it worked for me:

https://stardot.org.uk/forums/viewtopi ... 52#p279080

:idea:
User avatar
Dave Footitt
Posts: 998
Joined: Thu Jun 22, 2006 10:31 am
Location: Abandoned Uranium Workings
Contact:

Re: PunyInform

Post by Dave Footitt »

Hmm.. I get the same errors even with those switches, I'm using 6.34 too

Perhaps I'll drop the chap an email.

[edit] I briefly saw a list of pre-compiled versions before the post was deleted - interesting that those were compiled very recently, as opposed to mine. I've just pulled the latest and got 18 fresh commits so I'll rebuild my inform compiler tomorrow.
SteveF
Posts: 1663
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: PunyInform

Post by SteveF »

lurkio wrote: Thu Jul 16, 2020 4:51 pm Thanks for that. I've been following the development of PunyInform in a very casual way, and I contacted one of the devs, who is also the developer of the C64 Z-Code interpreter Ozmoo, to ask how easy it would be to port Ozmoo to the Beeb: he wasn't optimistic because of the memory requirements.
Ozmoo sounds pretty cool and I've been looking for some sort of "virtual memory"-ish project to tinker with, so I'm going to see what I can do with this. I'm starting by targetting the 6502 second processor, which gives C64-ish levels of free memory, so I can get the Acorn port mostly working before I start to fiddle with the virtual memory. I'm almost certain that with enough effort (which may or may not be forthcoming ;-) ) a good port can be done to the 6502 second processor. The developer may well be right about "plain" Beeb but I haven't really looked into that aspect of things yet. I'd hope that with sideways RAM it can be made to work, but that's for later, when I get the actual port mostly working on the second processor.

Quick screenshot as a not-very-tantalising teaser:
ozmoo-deja-vu-beeb.png
fredrikr
Posts: 78
Joined: Sat Jul 18, 2020 11:20 pm
Contact:

Re: PunyInform

Post by fredrikr »

Dave Footitt wrote: Sat Jul 18, 2020 10:55 pm Hmm.. I get the same errors even with those switches, I'm using 6.34 too

Perhaps I'll drop the chap an email.

[edit] I briefly saw a list of pre-compiled versions before the post was deleted - interesting that those were compiled very recently, as opposed to mine. I've just pulled the latest and got 18 fresh commits so I'll rebuild my inform compiler tomorrow.
There was a pre-release version of Inform 6.34 floating around in 2017-2018, and a package with this compiler and the Inform 6 library was created for Unix and uploaded to if-archive. I have been told that this, now obsolete package will be updated in a day or two.

PunyInform requires both bug fixes and a feature (static arrays) which were added to Inform in 2020. The release version of Inform 6.34, published in May 2020, is what you want to get. You can get it as inform634_source.zip at https://www.ifarchive.org/indexes/if-ar ... m6/source/ , and there are binaries for Windows and Mac in ../executables .
fredrikr
Posts: 78
Joined: Sat Jul 18, 2020 11:20 pm
Contact:

Re: PunyInform

Post by fredrikr »

Dave Footitt wrote: Sat Jul 18, 2020 10:10 pm I had a quick go at this, couldn't get Calypso to build (2 header files missing, so I think it might be more work than a quick recompile)
Game code written in PunyInform is about 97-99% the same as code using the standard library. One of the details that differ is the name of the include-files. For the standard library, you include "parser", "verblib" and "grammar". For Puny, you include "globals" and "puny".

But yes, you will probably need to read the manual and learn about the differences in order to convert your game to Puny. Once you change the names of the include files, you should start getting some errors which give you something to look for in the manual. You'll figure it out.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

fredrikr wrote: Sun Jul 19, 2020 12:11 am ... You'll figure it out.
Hi. I presume that's Fredrik Ramsberg, developer of Ozmoo and PunyInform..?

Welcome to Stardot! And thanks for the useful info.

:idea:
fredrikr
Posts: 78
Joined: Sat Jul 18, 2020 11:20 pm
Contact:

Re: PunyInform

Post by fredrikr »

lurkio wrote: Sun Jul 19, 2020 9:56 am
fredrikr wrote: Sun Jul 19, 2020 12:11 am ... You'll figure it out.
Hi. I presume that's Fredrik Ramsberg, developer of Ozmoo and PunyInform..?

Welcome to Stardot! And thanks for the useful info.

:idea:
I am he. I saw that we were getting traffic from Stardot and checked it out.

Thanks!

We'd love to see a BBC version of Ozmoo too. Tried to message Steve about it, but seems like I'm not allowed to send him messages, maybe because I have a new account.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

SteveF wrote: Sat Jul 18, 2020 11:34 pmOzmoo sounds pretty cool and I've been looking for some sort of "virtual memory"-ish project to tinker with, so I'm going to see what I can do with this.
Sounds like a very worthwhile project! Good luck!

Btw, I presume that that screenshot's just a mock-up..? In any case, please consider providing a MODE7 option in your port of Ozmoo, for speed's sake! (And for clarity/smoothness of on-screen text. MODE7 is "the best of MODEs".)

:?:
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

fredrikr wrote: Sun Jul 19, 2020 10:00 am We'd love to see a BBC version of Ozmoo too. Tried to message Steve about it, but seems like I'm not allowed to send him messages, maybe because I have a new account.
Correct. (I've sent you a quick PM, but, as you say, you won't be able to reply.)

I'll ask the mods to consider switching PM-sending on for you.

:idea:
User avatar
danielj
Posts: 9900
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: PunyInform

Post by danielj »

lurkio wrote: Sun Jul 19, 2020 10:07 am
fredrikr wrote: Sun Jul 19, 2020 10:00 am We'd love to see a BBC version of Ozmoo too. Tried to message Steve about it, but seems like I'm not allowed to send him messages, maybe because I have a new account.
Correct. (I've sent you a quick PM, but, as you say, you won't be able to reply.)

I'll ask the mods to consider switching PM-sending on for you.

:idea:
Done!
SteveF
Posts: 1663
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: PunyInform

Post by SteveF »

lurkio wrote: Sun Jul 19, 2020 10:01 am
SteveF wrote: Sat Jul 18, 2020 11:34 pmOzmoo sounds pretty cool and I've been looking for some sort of "virtual memory"-ish project to tinker with, so I'm going to see what I can do with this.
Sounds like a very worthwhile project! Good luck!

Btw, I presume that that screenshot's just a mock-up..? In any case, please consider providing a MODE7 option in your port of Ozmoo, for speed's sake! (And for clarity/smoothness of on-screen text. MODE7 is "the best of MODEs".)

:?:
Thanks!

It's real code. :-) I've attached an SSD - just press SHIFT-BREAK - if anyone wants to have a play, but this is extremely under-tested and still a work-in-progress. You definitely won't be able to save or load the game and it needs a second processor at the moment. The text output is also unnecessarily slow as it does a VDU 31,x,y before printing every character.

Press SHIFT if the output pauses (there's currently no "more" prompt). Otherwise it should be fairly unsurprising to use.

You can switch to mode 7 by editing the "CHECK" BASIC program on the disc, or just do:

Code: Select all

MODE 7
*RUN OZMOO
However, the inverse video status bar won't be in inverse video on mode 7 at the moment. Otherwise it should work fine.

Jumping the gun a bit: for mode 7, would it be better to have:
  • 40 characters in the status bar with no inverse video, as currently happens
  • 37 characters in the status bar with inverse video, and the status bar "indented" compared to the rest of the screen using 40 character black and white - the screenshot of Jon Welch's interpreter above shows this
  • 37 characters in all lines with foreground and background colours user-selectable and the status bar reverse video and not "indented"
?

The code is on github: https://github.com/ZornsLemma/ozmoo/tree/acorn

If you do have a play with this please let me know how you get on, but it's pre-alpha quality at the moment so don't get too upset if you find problems!
Attachments
ozmoo-preview-2020-07-19.zip
(20.82 KiB) Downloaded 124 times
fredrikr
Posts: 78
Joined: Sat Jul 18, 2020 11:20 pm
Contact:

Re: PunyInform

Post by fredrikr »

Wow, you've come a long way with that port already!

If you plan on supporting z4+ games, and you have a different number of characters in the statusline compared to the rest of the screen, you would need to use this width for the top window in general (In z4+, the statusline is just a top window of height 1).

Would it be possible to make your changes part of the main Ozmoo distribution, as a separate build mode?
SteveF
Posts: 1663
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: PunyInform

Post by SteveF »

fredrikr wrote: Sun Jul 19, 2020 1:13 pm Wow, you've come a long way with that port already!
Thanks Fredrik! The code's pretty clear and that certainly helps. :-)
fredrikr wrote: Sun Jul 19, 2020 1:13 pm If you plan on supporting z4+ games, and you have a different number of characters in the statusline compared to the rest of the screen, you would need to use this width for the top window in general (In z4+, the statusline is just a top window of height 1).
Yes, I definitely plan on supporting these, so thanks for the warning. I don't think there will be a technical problem here, it's just a question of what tradeoffs users would prefer in mode 7 (in which changing colours uses control codes that take space on the screen). One reason I'm working in mode 6 (as in the original blue and white screenshot above) to start with is that it is a closer match to the C64 screen so I don't get caught out by things like this.
fredrikr wrote: Sun Jul 19, 2020 1:13 pm Would it be possible to make your changes part of the main Ozmoo distribution, as a separate build mode?
That would be cool if/when the port gets to a stable state. I'm trying to make the changes sensitively as I go, using !ifdef/!ifndef ACORN to bracket my changes, and I'd hope to tidy this up further when the port is more stable.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

SteveF wrote: Sun Jul 19, 2020 12:44 pm It's real code. :-)
:shock: Talk about "burying the lede", Steve! =D> =D> =D>

I'll reply in greater detail once I've recovered a bit..!

:idea:
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: PunyInform

Post by lurkio »

SteveF wrote: Sun Jul 19, 2020 12:44 pm It's real code. :-) I've attached an SSD - just press SHIFT-BREAK - if anyone wants to have a play
Seems to work very well! Only had a quick play so far, but, once it's loaded, the demo game doesn't seem to need to access the disc very much, if at all! Brilliant!

SteveF wrote: Sun Jul 19, 2020 12:44 pm Jumping the gun a bit: for mode 7, would it be better to have ... 40 characters in the status bar with no inverse video, as currently happens
There's a cleanness to the current look which I quite like, but what about a slight modification that would only sacrifice one char (on a 40-char screen mode where chars-per-line are a precious commodity): have the status line be in cyan, while the text on the rest of the screen is just white and uses the full 40-char width?

SteveF wrote: Sun Jul 19, 2020 12:44 pm 37 characters in the status bar with inverse video, and the status bar "indented" compared to the rest of the screen using 40 character black and white - the screenshot of Jon Welch's interpreter above shows this
That would also be fine, although you're "losing" a couple of precious chars to Teletext control codes!

SteveF wrote: Sun Jul 19, 2020 12:44 pm 37 characters in all lines with foreground and background colours user-selectable and the status bar reverse video and not "indented"?
I personally feel that's my least favourite option. I think that to lose a few chars per line for all of the main game text isn't great when you've only got 40 chars to begin with. Those few chars make a big difference to the general look and readability of the text. (Just ask fuzzel!)

Thanks for working on this. It's a fantastic project, a great contribution to text adventuring in general and obviously to text adventuring on the Beeb specifically!

=D> =D> =D>
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: PunyInform

Post by leenew »

This is a great project!
I hadn't heard of it before today!

Lee.
User avatar
Dave Footitt
Posts: 998
Joined: Thu Jun 22, 2006 10:31 am
Location: Abandoned Uranium Workings
Contact:

Re: PunyInform

Post by Dave Footitt »

Well this is all very exciting :lol:
fredrikr wrote: Sun Jul 19, 2020 12:11 am Game code written in PunyInform is about 97-99% the same as code using the standard library. One of the details that differ is the name of the include-files. For the standard library, you include "parser", "verblib" and "grammar". For Puny, you include "globals" and "puny".

But yes, you will probably need to read the manual and learn about the differences in order to convert your game to Puny. Once you change the names of the include files, you should start getting some errors which give you something to look for in the manual. You'll figure it out.
I've updated Inform, InformLib and PunyInform from GitHub, and I can now build the example adventures! Many thanks, having the same version number confused me. I now get:

Code: Select all

~/Develop/calypso$ ../inform6/i62 +../PunyInform/lib/ calypso.inf                                                            
Inform 6.34 (21st May 2020)                                                                                                                           
line 1009: Error:  Expected routine name but found GamePreRoutine                                                                                     
> [GamePreRoutine                                                                                                                                     
line 216: Error:  No ...Sub action routine found for action: "LookUnder"                                                                              
line 358: Error:  No ...Sub action routine found for action: "Swim"                                                                                   
line 612: Error:  No ...Sub action routine found for action: "Burn"                                                                                   
line 641: Error:  No ...Sub action routine found for action: "Wave"                                                                                   
line 641: Error:  No ...Sub action routine found for action: "Swing"                                                                                  
line 806: Error:  No ...Sub action routine found for action: "GetOff"                                                                                 
line 946: Error:  No ...Sub action routine found for action: "Empty"                                                                                  
line 946: Error:  No ...Sub action routine found for action: "EmptyT"                                                                                 
line 6: Warning:  Defined constant "MANUAL_PRONOUNS" declared but not used                                                                            
Compiled with 9 errors and 1 warning (no output)                                                                                                      
So it doesn't look like too much work to do!
Post Reply

Return to “8-bit acorn software: other”