Archive for the ‘des-cavernes’ Tag

Des Cavernes dans le poquette: Objects énigmatiques   4 comments

(This continues from my previous post about this French game for the Tandy PC-1 Pocket Computer.)

Last time, my two issues with Des Cavernes were

(a.) I only had a “simulator” and not an “emulator” and it doesn’t handle memory like the original PC-1 (or the equivalent Sharp 1211)

and

(b.) Jim Gerrie had a port but it seemed to be buggy.

Unfortunately, as of this writing nobody has dumped the BIOS for a PC-1 or 1211, so (a.) remains an issue, but Jim Gerrie has fixed his code, and the issue it had is fascinating and reflects on the raw ingenuity of early 80s programmers.

Before getting into that (and how the fixed game plays) I wanted to mention a second article from Trace Issue #2, the same one that Des Cavernes was printed in. There’s a page-long introduction to Crowther/Woods Adventure that gives a good window into the French knowledge of adventures circa April 1982.

A comic that goes with the article. The computer is saying “you are alone in a dark room… what should you do??”, with the responses “Oh… lighting…” and “don’t forget it”.

The article announces that the “famous” game Adventure, originally in FORTRAN for a PDP-10 can now run on a TRS-80. (This is referring to Microsoft Adventure, based on the version Gordon Letwin originally wrote for Heathkit.) It is “enough to entertain you for long hours, but in English”. I am not clear if the author was aware of Bilingual Adventure; probably not given it was written for the CP/M operating system.

The article goes on to say…

La disquette “adventure” inaugure un nouveau type de jeu où le participant tient un rôle et vit des aventures dont le déroulement est fonction de ses actes. Aux Etats-Unis, on achète une “disquette” d’aventures comme nous achèterions un “livre” d’aventures. Les auteurs ne sont plus Stevenson ou Conan Doyle mais Scott Adams et Microsoft … C’est le progrès !

…translating as:

“Adventure” inaugurates a new type of game in which the participant takes on a role and experiences adventures that unfold according to their actions. In the US, we buy an adventure “disk” like we would buy an adventure “book”. The authors are no longer Stevenson or Conan Doyle but Scott Adams and Microsoft … it’s progress!

Note the “new type of game” comment. This echoes the same line used introducing Omotesando Adventure to Japanese audiences. Additionally this gives the concurrent idea of “bookware”, that text adventures are about to supplant books, something that would briefly catch the imagination of the real publishing industry before disappearing shortly after.

Then, the publication’s “14 year old tester” named Stéphane (who “perfected his English with this game”) gives some “tips and tricks” for tackling Adventure. One section is on “Phrases magiques, passages secrets, objects énigmatiques” and mentions the magic words XYZZY and LWPI. (LWPI is specifically from Microsoft Adventure, and transports the player to a Software Den that’s only in that version and spinoffs. I really should write about it as a standalone article someday, although the differences are really quite minor.)

So while Folibus had technically just come out in a different publication, it was for an entirely different system and it isn’t like awareness of what an adventure even was would spread out immediately, and Adventure in particular was being played in English, not French, despite the technical existence of one translation.

This means that while Crowther/Woods Adventure was “famous”, Des Cavernes would be for some readers the first real encounter with anything like an adventure game.

Now, I’m hedging with “like” an adventure game because even with fixes in, Les Cavernes is a bit unusual, as it is an adventure-roguelike with everything randomly generated. Other than some language fixes, the big issue Jim Gerrie ran into with his port was with the quasi-random number generator itself.

In a technical sense, there is no such things as a random number generated by a regular computer chip. (It’s possible to hook up radio receivers to use atmospheric noise like the website random.org does, or use some related manner of gizmo; I’m meaning normal traditional computer chips.) The best they can do is apply a mathematical algorithm which provides a sequence which gives the appearance of randomness, and this can sometimes go awry. Usually this randomness gets kicked off by a “seed” of some sort, perhaps taken from the system clock (concatenate hours, minutes, and seconds, for instance, into one number) but it can be given explicitly, as Des Cavernes does.

10 “A”:INPUT “NO.=”;D,”L=”;F : F=4*F

In order to then turn this into something appearing “random”, the original game uses the SIN (sine) function. Quoting from Jim Gerrie:

In the end I realized the problem was also a result of a slightly lower level of mathematical accuracy between the MC-10 and Pocket PC. The game relies heavily on the mathematical accuracy of the Pocket PC and its BASIC. Simply put, it needs 10 decimal digits to come out of SIN, whereas the MC-10 could only give 9. That is because the decimal is multiplied by 100 to give two hole number digits, which are used for combat calculations, plus 8 decimal numbers, which are used to store maze node information for 4 directions of moves. The Pocket PC apparently could give you a number like

90.12345678

Whereas the MC-10 can only give you

90.1234567

The 8 decimal number give 4 groups of 2 numbers which store the node information for the four directions of movement. If the first digit is 4 – 9 then you can go in that direction. If the second digit is odd and there is a monster present, then you will be blocked. If you defeat the monster then you will be allowed to move to a new room by adding one to that digit to make it an even number and then a new SIN number will be generated based on the current number. Since I was missing an 8th decimal digit I made it so that it is simply replaced by a zero.

In other words, using 90.12345678 as an example, it was supposed to give the “random” two digit numbers of

12, 34, 56, 78

but instead was giving

12, 34, 56, 70

due to the pocket computer having one more digit of precision than the desktop computer, and since individual digits matter in terms of generating the rooms, always delivering a 0 was causing an issue.

This put together with other fixes create something resembling a game, although I did find I could still run into a “trap seed”, with a no-win scenario. For example, seed 1111, any difficulty:

Here’s the complete map of the level:

There are 10 rings scattered around (some may start in your inventory). If you have the appropriate ring, you can kill a particular monster. In the seed above, I only had RING #1, which apparently is no good with dragons. (KILL DRAGON just has a response of NO!, or if you prefer the French, NON!)

After mucking about with multiple failures, I found a better seed: 2321234. This starts you with rings 1 and 10, so there are technically 8 more rings to find. I played at difficulty 1 (the choices are 0 through 5); higher difficulties add more monsters so are more opportunities to get stopped.

This comes out to be a mess, but at least it is manageable with some persistence. The important thing is not to treat this like a game of Solitaire where you get one shot at a seed. There are far too many dead-end spots like the dragon room I showed earlier, or long dead-end loops (which I’ll show off in a second). No, what makes this playable (once you find a seed that works) is to keep returning to that same seed and add to the map you made last time.

For the map above (not complete) I “died” around 10 times hitting various impossible spots. The thing to keep in mind is that monsters generally don’t have to be killed (although killing one will get a point), and will only block some of the exits (or maybe even none of them).

Monsters will respawn when you re-enter a room. It may seem at first there is no such thing as re-entering a room — nearly everything is a one-way exit, and the two-ways exits I found I think were by luck only — but the map does create “loops” that will eventually return to sections. This is both good and bad; good in that there is some sort of continuity that makes it feel not like I’m just plotting the output of a spreadsheet, but bad in that the impossible loops I alluded to can happen.

Here I have marked out in yellow one such loop. If you enter into the loop without any way of killing the monsters within (vampire and dragon) you are stuck in a softlock with no way out and need to reset. This is very discouraging if you try a new seed each time, but it feels a little like a “discovery” when repeating multiple attempts on the same seed.

It turns out that this seed does have Ring #6 in a reachable spot, and that ring kills vampires (helpfully — and almost certainly by coincidence — there was a vampire in the same room as the ring so I could test it).

Since monsters respawn and each kill gets you a point, you can technically get an infinite score if you can find a loop that brings you by a monster you are able to kill. I found a perfect such spot, as either ring 1 or 10 (I have no way of knowing which) works on wizards.

Yes, that’s a two-way exit. This seems to be complete coincidence, although I do think the map-making algorithm (which I still don’t fully understand) does have “regions” where it is more likely to loop to a room that’s close than a room that’s far. I might be wrong about that guess, though. Since there are two killable monsters in adjacent rooms, it is possible to get any score at all desired by just hopping back and forth and using the KILL command over and over.

I confess I did not persist to try to get absolutely every ring, but in the end this is only adventure-adjacent; this is more of a strategy game like Wumpus which generates a layout you have to reckon with, and what you reckon with just might be impossible, but there’s nothing more complex than mapping going on (and keeping track of if you’re repeating a room you’ve already visited).

Still, I’m glad I got to play this, as it makes for another terrific example in the roguelike-adventure stash (they all take radically different approaches to how they generate their maps; probably the game most comparable to this one is The 6 Keys of Tangrin) and I got to boggle a bit over the sheer technical achievement: remember, this was on a pocket computer. I could see myself playing this more if the PC-1 was the only computer I had, and it was the only way to get at those new famous “adventures” and experience the “objects énigmatiques” within.

Also, despite the room names being generative off a list of descriptors, some of them briefly felt like real locations. Here, I’ve entered a teenager’s bedroom.

Posted September 12, 2024 by Jason Dyer in Interactive Fiction, Video Games

Tagged with

Des Cavernes dans le poquette (1982)   17 comments

For those anticipating the second Impact Softwear game, my apologies. It turned out The Quest was quite solidly RPG rather than adventure. I added a note to my last post with some screenshots.

But that leaves us room for an entirely different oddball game! Allow me to first discuss the French computer industry.

The early 80s were chaos; no particular manufacturer was dominant, and the French had their own standards that gave difficulty to importers. Instead of video signals in NTSC (US, Japan) and PAL (most of Europe), France had SECAM. An adapter was required, and it caused (for example) the VIC-20 to only work in black and white. Also, all keyboards in France (as had been standard for a long time) used AZERTY standard instead of QWERTY.

Amidst this chaos, the publication Hebdogiciel was founded by Gérard Ceccaldi in late 1983. It was a weekly that printed software listings for the entire menagerie of French computers. In the 6 January 1984 issue it printed the top 15 computers by number of listings sent in. Leading the pack were Texas Instruments with the TI-99/4A, Oric with the Oric-1, and Sinclair with the ZX81. (If you’re wondering why not the ZX Spectrum, the ZX81 came in France early, but the ZX Spectrum came out late. By the time it arrived the Oric had eaten up a chunk of the same market.)

A 1986 issue via eBay.

Noteworthy for today is that 4 of the systems in the top 15 — added together, 15% of listings sent in — were pocket computers. Specifically: the Hewlett-Packard HP-41, Casio FX-702P, Sharp PC-1500, and Sharp PC-1211. These are essentially beefed-up programmable calculators. Sharp had one out in 1977 that used assembly language, and by 1980 companies were coming out with programmable calculators that used BASIC.

The Sharp 1211, first out in 1980, was also released by Tandy as the TRS-80 Pocket Computer. I’ve seen many US and UK source code publications now, some of them system-agnostic, and the level of pocket computer coverage was not nearly as high as it was in France.

Here’s a video cued up to where someone plays a Lunar Lander game on a TRS-80 Pocket Computer:

This is all meant to lead to the fact it wasn’t odd for Charles Feydy’s game Des Cavernes dans le poquette (“The Caverns in My Pocket”) to appear as a type-in an a French computer magazine. Specifically, the code was for TRS-80 Pocket Computer, and appeared in the Tandy-focused magazine Trace in their April 1982 issue.

What is unusual is that it manages to squeeze an entire adventure game (kind of) in 4K.

I wanted badly to run the original.

There is such a thing as pocket computer emulation (see: PockEmul) and I tested it out a bit, but I found I really needed the original model for compatibility (either the Tandy PC-1 or the Sharp 1211) and it isn’t supported. I did find an old beta copy of PockEmul that has the 1211 but it gets listed as “experimental” and it broke in my attempts to use it.

I was able to run the PC-2 (that’s the next Tandy machine, also just a Sharp PC-1500) but was running into cryptic issues involving slight changes in the BASIC syntax and the system itself. For example, in the PC-1 version you can write F=4F meaning “the variable F is 4 times F”; that is, 4F with no symbol between the 4 and F assumes a multiplication. This no longer works in the PC-2 version. You need to write 4*F instead. The character limit is tight enough that if you try to add a multiplication sign there, you’ll bust the limit of memory, so you need to remove characters elsewhere to compensate.

The biggest issue is that the original game uses arrays in a way where memory-bleed is nearly a feature. Essentially, before the game starts, you’re supposed to set A$(22) all the way up to A$(65) to a series of text lines, like A$(22)=”E PORTE”. This uses a different part of memory to squeeze even more out of the PC-1. However, on the PC-2 the array memory gets reset on starting a new program, so any reference to A$(22) will be an out-of-array bug rather than the text it is supposed to have.

This error means “Array specified without first DIMensioning it.”

Fortunately, there’s a way to play without the calculator, because Jim Gerrie has ported the game to TRS-80 MC-10. In the process he translated it to English.

The text of the magazine talks about exploring dark and dangerous caves. There are apparently 10 “keys” that can be applied to monsters and get points, but it is unclear the author even intended for it to be possible to get 10 keys. I have gotten, out of all the maps I have tested, 0 of them.

Unfortunately, the game is very broken in terms of generating a level that can be beaten, even moreso than Orb. Jim Gerrie is still worried there might be a bug in his code, but the original is so hard to run I haven’t been able to compare.

You start by picking a “number” which is a random seed, followed by a “difficulty level” (no idea what that does, I didn’t see any difference) and then you’re off to the races:

In this room, you can go all four directions; the PATH, TUNNEL, and LARGE are all just for color. If there’s a monster they will be blocking at least one exit.

In this randomly generated level, there are exits to the north and the south, and one TROLL blocking the north and south. Since there is nowhere to go, the only command that works here is RESTART.

Sometimes it felt like I could actually explore a bit, and get the vibe of an environment:

However, this invariably always got shut down a few turns later when I get stuck again.

Seriously, where are the keys? Would this game have been printed in a magazine if it was so impossible or is it just leveraging some obscure aspects of the PC-1 hardware that would make the experience quite different than it is now?

So this post is maybe just a placeholder for if some expert on pocket computers can come along and tell us what’s really going on. The thread here is where the game was first unearthed and it includes a text file of the source code.

(Shoutout to Strident and Jim Gerrie who helped me get the files for this all this way back in this thread.)

Posted June 28, 2024 by Jason Dyer in Interactive Fiction, Video Games

Tagged with