Monday, 21 May 2018

"Kinder Morgan" 8-Bit Text Adventure

I decided to enter the AdventureJam 2018 contest. The challenge was to create an interactive fiction game in just two weeks. Just? I didn't think it would be a problem to come up with an original  two-word parser game in that time.
And I was right. It took me less than a few evenings and a weekend. The toughest part was coming up with a story. I have been very disturbed by the development of pipelines from the Tar Sands to transport bitumen to world markets. For example, I recently wrote a letter to Minster of Finance Bill Morneau against pipeline development.  I'd also read about anti-pipeline protesters who sabotaged pumping stations. These protesters had claimed they had carefully researched how to shut down the pipelines that they tampered with. This struck me as an interesting premise.  How could they be sure that they knew what they were doing?  They would have to have obtained documents to explain how to operate the equipment.  I thought that could serve as a central premise to some adventure.
I was also thinking it would be neat to incorporate an element of decision by the player to contribute to the protests or remain a bystander, since this was what I was doing by simply sitting at home writing letters to government ministers. A response acknowledging receipt of my letter from Minster Morneau arrived on the same day that he went on TV to announce that the Federal government was going to indemnify Kinder Morgan while the challenges to its pipeline were ongoing. It was like he was flipping me the finger personally.

So I created a little fantasy called Kinder Morgan to try to highlight the importance of the issue and the critical moment in history we are living through.  My son Charlie had helped me write and mail the letter to minister Morneau while he was home on Spring Break, so I suppose I was also thinking of the game as kind of a teaching moment for him. I hope he will join the political struggle for the future and move beyond mere clicktivism.  It was truly a child's morning when I walked to the mailbox with him after our protracted political discussion and writing session.

He graciously agreed to to play test the game.  He discovered a bug/quirk. He realized that he could easily use the game save feature to simply restart and try different responses to the final puzzle, until he got the right answer.  So I made the program notice whether you had made multiple failed attempts, or had actually figured out the clues to allow you to choose right on the last puzzle.  It only gives a fully positive win message and musical fanfare if you solve the puzzle on the first try.  My wife also noticed a spelling error on the win screen when reading my sons's text with the image attached showing he'd solved the game.  Thanks to both of them for their contributions.



Sunday, 20 May 2018

Uchuu Yusousen Nostromo

A few years back I stumbled across some screenshots of a game for the NEC PC6001 called Nostromo. Since the name of the spaceship from the movie Alien was "Nostromo" it seemed likely it was based roughly on that movie franchise. The goal of the game is to foray into a series of hallways and raid 8 lockers/rooms to retrieve various items while the alien hunts you down. I didn't have a fully operating emulator for the PC6001 back then so pretty much all I had to go by was an animated gift:


Based on that gif I came up with the following rendition of the game. I found the 8 box layout a little boring, so I added a little variety. So I alternated a second style of map. Since I didn't have a clue about the scoring or what the second number meant of the two number at the top left of the screen, I just had the player hit a key when she returned to base in the red area to signal that she was finished collecting.


Fast forward to today and Robert Allen Murphey on the Coco Facebook group mentioned that he was going to take a stab at playing my port. But he used a Japanese title for the game "Uchuu Yusousen Nostromo," which means "Space Freighter Nostromo." These additional words gave me some additional terms to search for to find out more about the game. I also had been able to get a working PC6001 emulator in the meantime, so I was able to download the game rom image load it up and extract the Basic source code. Although the game is credited to Akira Takiguchi and Masakuni Mitsuhashi on many sites, I noticed that the Basic source code had a set of remarks at the top indicating it was copyrighted by Hiromi Ohba. Here's the link to the original website I found that gave me access to the source code: http://seesaawiki.jp/chitentai/d/PC-6...
Although I was able to load the game into an emulator by James "the Animal" Tamer called "VTrek" (for virtual NEC Trek--the name of the version of the computer unsuccessfully distributed by NEC in North America) either bugs in the emulator or differences between the NEC Trek and the PC-6001 wouldn't allow me to run the game. So I had to rely on a video in which a Russian vlogger, Panteryasha, does a walkthrough/review of the game: https://youtu.be/xUDRF9JGlfk

Later my son Charlie used some of his computer voodoo skills to download the subtitles of the video and translate them into English, which was really helpful (see below). For one thing, Panteryasha noticed a bug that occurs in higher levels where you are required to collect 7 of each item, but the algorithm that randomly creates the layout of the items in the rooms/boxes (versus blank spaces and purple barriers) can only guarantee a maximum of 6 items for each item type. So you could end up with a screen that it was impossible to clear. However, unlike Panteryasha, I was able to see in the code that there was a possible out. You could let yourself be killed and then hit the "h" key and the screen would be re-drawn with new resources and a time penalty. I changed the 'h' key to "H" and instead of a time penalty I made it so that you lost any points you had accumulated on that screen.

This feature is not just useful for higher levels. Even on lower levels, if you are killed while carrying a load of items, you must then go back out and get at least enough new items for one of the item categories to push your number over the number required for that screen (the second number at the top left). Unless you reach that number the computer will not register that you have collected any items or give you a score for them when you return to the red home base.  However, if you have collected all the items on the screen before returning to your base and are killed, then you will not be able to have those items scored so you can complete the screen. I suspect the programmer added the "H/Help" restart feature to allow you to sacrifice a life in order to continue. The moral of the story is that you must get back to the red base area with at least one category of items at the target number if collected items are to be registered for scoring purposes.

I also replaced with pure Basic all the machine language calls and code in the original that handled player and monster movement. The NEC PC6001's Basic was a little slow, so I suspect that the programmers had to use machine code routines to get speed for the player and monster movement. Luckily the programmer used Basic for all the scoring and screen transitions. I did use a M/L Timer USR function provided by Darren/Mechacoco to handle the countdown timer part of the game, so it should portray accurate seconds. Thanks Darren! And thanks Charlie for translating the comments of the Russian reviewer for me.  Here's what I came up with:


The sound routines were still petty rough.  It took me a while to figure out some of the quirks of how the NEC's SOUND and PLAY commands work. Turns out some of the SOUND commands are just meant to reset the sound chip in various ways and not actually produce noises, so some of the sounds I thought were in the program were not really supposed to be there. I thought I had got a pretty good bug-free version when I noticed a really bad bug. I had never tried shooting at the outside white wall when I was play testing because I knew shooting was for the rooms in the interior, so I didn't notice that you could shoot the exterior wall and escape the screen and have your character POKE into memory areas where you shouldn't be allowed to go. I also added a saved high score feature. This necessitated re-working the main loop a little. Because the original program would simply re-RUN the whole program every time you lost, the programmer didn't care about properly RETURNing from the various main subroutines or resetting variables to zeros, etc. But since I wanted to save the high score from game to game I had to fix these problems. I also noticed that the nearest item type was worth more points (25) than the farthest (10), which seemed odd.  I reversed this order so that risking a longer journey to the left of the screen would be rewarded with higher points. I also changed the original T key layout to be further right on the keyboard, which was more comfortable. And I reduced the time allotted for each screen, as the original amounts seemed excessive:


It has been a long journey getting to a working rendition of this apparently classic Japanese early 8-bit game. It's even, if  Panteryasha is correct, considered one of the first examples of a horror game. This is apparently a result of the cut scenes with the monster and the higher levels when the monster flicks in and out of view, which is kind of creepy and a bit suspenseful. Still, I wonder whether it is true that is the first horror game. I'm aware of at least one game "Alien" for the ZX81 that has similar features, also based on the Alien movie, which might possibly be as early:


Both programs are dated to 1982 by various sources on the Net. I'll let retro-gaming archaeologists figure this out.  In the meantime, I hope some folks might  have some fun playing the MC-10 versions of these classic games.  If you are interested you can now download all my games and the VMC10 emulator by James "the Animal" Tamer from my GameJolt site:  https://gamejolt.com/games/jgmc-10games/339292. There are some instructions there that will help you get whatever program you are interested in running.  Here's a link to a full list of my games: https://jggames.github.io/Type-in-Mania.html. My most recent version of Nostromo is called "NOSTRO.C10".  The older version is called "NOSTROMO.C10".  I have left it there for historical purposes, but I really recommend playing the newer version.

Addendum:

I finally uncovered a mystery I had been pondering regarding the counting of items in the original code. I had not fully decoded the inventory logic of the original source and with the substantive changes I made re-coding key key input and movement, I think I obliterated a 5 item carry limit in the original game. I had always wondered why my version seemed much easier than the original seemed in videos I had watched. But that was because I could just venture out of the safe zone and collect items at will from any and all the rooms. This meant that there was no need for path planning and item accounting as you snuck around the hallways avoiding the monster and no need to make multiple return trips to the safe room to deposit those items when the item limit was reached.  It drastically changed the time needed in the time-trial intermediate challenges. The multiple return trips really require careful decisions about what to grab and where for best effect. Now that I've fixed my mistake there is actually a challenge getting all the required items within the time limit.  In my original version, you just went around gobbling up all items in an indiscriminate and returning to the safe zone, mostly with plenty of time left. I have to thank video blogger for tipping me off.  Unfortunately that video is no longer available.  He also discussed Manbiki Shounen and showed a very interesting version of it being played that I have never seen before. There are so many versions out there.  It's nice to see others exploring these classic and influential BASIC games.

Since I was viewing that video I decided to revisit some other playthrough videos. As I watched them, I noted that there was also another aspect of movement logic that I had failed to implement accurately.  I hadn't noticed it but the gun (or whatever it is the player shoots with) only seemed to work on the outside of the walls to the rooms with the items.  In other words, you could use that weapon to break into rooms, but not out. In my version you could just shoot into a room and out the other side, effectively "mouse holing" your way around and avoiding the main halls and the monster.  Again, this made things easier than the original.

I began to look for other things I might have missed.  And I noticed two more.  First, I didn't zero the items you were carrying (contrary to what I say in my original post) if you got caught and presumably slaughtered by the alien.  I didn't "see this" in the video playthroughs as much as remember reading about it when doing my original research into the game. There is a feature that you can hit H when killed (when the screen goes to the organ alternate colour palette for a brief time after you get caught. Then the screen will refresh with a complete supply of items in the room again, but it will cost you a life.  I remembered reading that people had to use this only some of the higher levels because the random populating of items sometimes wouldn't supply the 7 items that your were required to retrieve on those levels.  So I had changed the max item you could be asked to get as the levels went up to 6.  There will always be at least 6 items from the room item populating algorithm.  But I recalled surmising that the feature was also needed sometimes if you simply got killed while carrying a lot of items.

The second thing I noticed as I watched the playthroughs again was that it seemed to take 3 shots to break through the walls.  My routine only required two shots.  So I upped it to 3.  Again, something that might make mine a little easier.  Given all these changes I also had to return the time limits to their original 100 second and 300 second amount, which I had brought down in my version because it runs faster and was easier.  Now you need all that time to do the extra maneuvering that was required in the original and the time limits really do loom as a threat.  So now the game mimic more accurately the challenge of the original and maybe even adds some challenge because I think my version runs faster despite  being all BASIC and not really on some M/L routines for key input and player movement.

In the following playthrough I make it to the stage, often missed by commentators, that really demonstrates the suspense and horror aspects of the game. At higher levels the alien appears and disappear at random while moving, creating a creepy suspenseful atmosphere conducive to jump scares. These levels are preceded by a graphic image of the baby alien (around 10:02 in the video), which is a reference to the scene when the alien first appears from the stomach of one of the characters in the movie Alien and then disappears into the bowels of the ship...



2023/12/11.

Second Addendum:

So I noticed a remark in John Szcepaniak's book "The Untold History of Japanese Game Developers" by the programmer of Nostromo Akira Takiguchi:
JS: Nostromo was also inspired by Mr Suzuki's unreleased game, called Dojin?
AT: Yes, certainly. I created Nostromo on a PET CBM. Later Mitsuhashi-san ported it to PC-6001. My idea was different from Dojin - actually, Dojin was a very interesting and playable game. But the enemy was always viewable by the player. So because I loved [the film] Alien, as well as Star Wars, I wanted the enemy invisible to the player. Visible only when it is viewable by your character. So that's the idea of Nostromo.
The highlighted text solved a mystery for me regarding the levels of the game when seeing the Alien becomes intermittent, which helps create a big part of the "horror" of this early survival horror game.  I had made the disappearance simply random. I had seen the effect in an old video playthrough by Panteryasha (now gone see transcript below) of the Alien appearing and disappearing on higher levels. But now I realize that Takiguchi probably had simply been calculating when the player and alien were on the same X or Y axis (i.e. line of site down a hallway). Obviously, the alien would also flash briefly when it was on any parallel hallways, but that was probably what had given me the impression of intermittency and randomness.  Now that I realized the proper dynamic, it made much better geometric sense what was happening. You'd only see the alien when it popped around corners on a hall you were in and headed towards you. Otherwise, all you would get were flashes when it crossed any X or Y axis compared to yours on parallel hallways. Very creepy.  I've fixed it now (I hope).  I'll have to try to get my son and chief tester Charlie to give it a go and try to play through to the higher levels where this effect occurs.  I don't have the manual dexterity any more to get that far in the game.

2026/03/22

Transcript of Panteryasha's video:
Kind: captions Language: ru Hello everyone, with you Lelia! I greet you on my channel - Pantheresha. Choosing a game for the next flop, I suddenly wondered which game in the horror genre was the first? And for a short while, it turned out that it was "AX-2: Uchuu Yusousen Nostromo". But as long as I pronounce the Japanese language for a long time, I will simply call it Nostromo Vpricini, the information is not 100%, because it was not possible to find reliable sources. that the first horror game was Nostromo. And so, the game dates back to 1981. And even on some gaming portals there is an exact release date - this is December 31, 1981 Of course this is doubtful, but we will miss this point - we will not discuss it further. Manual on the game and at least some intelligible description, in these your Internet, it was not found, but some magically preserved cover of the game! So let's together guess at the cover - what kind of animal is this. Using translators from the lunar, we learn that the game is called AX-2: Space transport ship "Nostromo" ... Nostromo ... hmm, is it a game of the movie "Alien" or what? The film was released on the screen in 1979, and the game itself is laid out on the shelves in 1981, so it may well be true. But the image of the globular ball enveloped by some tentacles does not cause an association with Aliens ... Let's return to the title, at first I thought that Uchuu Yusousen is the name and surname of the programmer who wrote this game, But no, but it turns out that he created the game, then a student of Tokyo University and was part of the microcomputer club of the University of Tokyo, which by the way financially supported the not-unknown Taito - Akira Tagiguchi, who later created the famous "Olion". Nostromo was created for the computer PET 2001 and later ported to PC-6001 - Masakuni Mitsuhashi and received in the title, proud AX! And the prefix AX in the name of the game - it was an attempt to create a recognizable brand all the same Inf slip slipped that yes - when creating the game Akira was inspired by the film "Stranger". Well, let's change into the suit of a spaceship pilot and start this game. The key is to start! The original game Nostromo - went to the computer PET-2001 But, unfortunately, I could not find the rum with the game. Therefore, we will play the official port on PC-6001. Actually, the cover considered earlier was from the edition with PC-6001. As I do not have this computer, we will naturally play on the emulator. So let's try to run! How many pages? I do not know what that means, but we'll press one. Load the cassette ... And start ... Wow, great - it works! In the game, the sounds are those. If you listen for a long time, your ears will become clouded! Although for 1981 - it was, perhaps, super! But in our time - it's impossible to listen to it. Therefore we will insert our musical accompaniment And this is music from Sergey Kirsten. Links to his work - can be found in the description of this video. If you watch this game according to the script of the film, then a circle, this is the main character - Helen Ripley. A dog in the shape of a dog sign is an Alien. The game throws us into the compartment of the cargo ship Symbols of maps - mean some resources that need to be collected to support the life of the ship. These resources are in containers. In principle, the task is simple. But we are hampered by an Alien who constantly persecutes us. And yet, we are complicated by the fact that we can carry no more than five units of resources in the red zone of rescue. In this game, there are advantages for Ripley and is that the Alien can not enter the red zone and into the containers where our vital resources are located Wow! In this game there is a screensaver! Mmm ... And here's the Stranger! But for 1981 - it was, most likely, scary! And this level, is a bonus stage, where the Alien stands still, and we at this time should collect four units of each resource. Question! Why this game belongs to the genre of horror? After all, in appearance - this is another variation of PecMena ... But that's the point! The bottom line is that from the seventh level, the Alien becomes invisible, but we hear it and a few steps from us - we begin to see it! In principle, as straight in the movie, where he attacks from various unexpected places for the crew of the ship. And here at the eighteenth level I have a problem - that we need to collect seven units of each resource, but as we can see - the bubi, the crucifixes and ... there six pieces - six units each! Well, let's try to collect everything and see what happens ... So this is what? Glitch games? We collected everything that is possible and in the end we do not have enough for one unit of three resources. And the game does not end. We can only wait for the timer to end or jump into the Alien's jaws, so that it will not be long. Hmm ... And the most interesting is that it's not a glitch! And so conceived! And there is no escape on this ship ... And in any case, we will die sooner or later! But the finale will be one ... It's death ... And this is Japan ... It's fucking-Akira Tagiguchi ... It's 1981, his mother ... That's it, actually, the story of horror games began That's all. With you was Lyolya. All for now! Put your likes and subscribe to my channel!