Sunday, 26 May 2019

Ken Fujisawa's "In the Woods"

"In the Woods" from partially converted Sanyo PHC-25 version
I ran across an interesting article on Japanese programmers who contributed to the explosion of Japanese gaming in the early 80s. "Gamasutra" aka John Szczepaniak discusses some of the seminal games and most influential programmers of the industry. In his notes at the end he lists "[*7] Ken Fujisawa. Creator of... In the Woods (AX-2)." AX-2 was a multi-game distribution for the NEC PC6001 that I was familiar with because it also contained "Nostromo," which is a game I converted a while back. I decided to look into "In the Woods" and see if I could also convert it. I found some info on the Net, including the screenshot above, provided by someone trying to see if the game could be converted to run on the Sanyo PHC-25. The Sanyo was an 8-bit machine of a similar time period as the NEC PC, and which also used a Z-80 processor and the MC-6847 as its graphics chip.

I looked back into my files and I still had the files from the AX-2 distro.  This was good because when I searched on the Net again, I couldn't relocate the file. Maybe it has been taken down-- AX-2 was a commercial product.  Seems like things are heating up a bit when it comes to copyright issues.  The Cocotalk folks were discussing the ethics of porting and re-coding on their last podcast. Don't know if I am doing anything wrong.  I am reusing old code I find on the Net, but I feel a little better about the fact that I don't sell any of the programs which result from my efforts. I'm just using code as material for my own little retrocomputing coding projects.  I always try to leave references or even add references to the original authors.

NEC Trek Intro (Compare with above)
I was able to load the game into James the Animal Tamer's "Virtual NEC Trek" emulator.  However, since the NEC Trek is a North American version of the PC 6001, its doesn't have all the hardware additions for displaying Japanese characters.  This means the screen doesn't display like it should.  So I had to use the screen shots from the Sanyo and send them to my son, who can work with the Japanese characters. He was able to give me a rough translation of the Sanyo instruction screen, which was helpful for both coding the game and trying to play the hobbled Nec Trek version.

NekTrek Game Screen
One feature that would be impossible to recreate on the MC-10 version is the use of two different color palettes on the same screen. It is neat to see the Orange and Red palette and the Dark Green and Green palette being used on the same screen. But the MC-10 just doesn't have the circuitry for running the MC-6847 in such a complex way.  Still, I made the instruction screen use the Red and Orange palette to hint at the look of the original. I also took out all the commands referring to the "STICK", since there are no joysticks for the MC-10. It's really easy to convert BASIC games from the NEC PC-6001. LOCATE X,Y commands become PRINT@X+Y*32.  SCREEN and COLOR commands are just omitted, since multiple palettes are out. There was some graphic animation using LINE commands that had to be redone using simple semigraphics text characters.  At the end a village is displayed and its gate opens up to permit the successful adventurer in after she has successfully navigated "the woods."  I say "she" because the story is evocative of Little Red Riding Hood.

The following is a transcript of my son Charlie's attempt at translation (via text messaging). You can see the english instructions I was able to get out of his attempts in the video of my MC-10 version of the game:

  • "Before the clock strikes 12:00, you must get to the village, marked by the diamond(♦)"...
  • "However, if:"...
  • "You run into a big tree(?) marked by the ♠"
  • Something about eating five ♣
  • "Then you'll die"
  • I don't know if it's saying if you do or don't eat them
  • Oh they're mushrooms!
  • I think the last part says something about waiting for the mushrooms before you get to the village
  • Do you know the gameplay for this?
  • Also just so you know, I'm saying the clubs are mushrooms
  • No, my final verdict is that the mushrooms are poisonous and eating 5 kills you
  • And then the last part is warning you to hurry before too many appear

Thanks Charlie! Your input, as always, makes a vital contribution to my programming efforts.  I also have to thank Darren (Mechacoco) for the use of his TIMER USR routine to allow me to properly keep track of the seconds countdown like in the original.

I used my replacement for the PLAY command to translate some of the music from the original using only the SOUND command of the MC-10. Here is that subroutine:
0 DIMN(21)
1 CC=1:FORC1=1TO63STEP3:N(CC)=VAL(MID$("087103113129142149161171181185193200203209215219221223229231233",C1,3)):CC=CC+1
Because MC-10 Basic is usually faster than NEC Basic, I was able to add a little challenge. The delay loop on input gets shorter for each successfully completed screen. So controlling the player avatar, which I made an X (instead of an @) should get a little more challenging (faster) as you progress. I also added a cumulative score to tally your diamonds from each completed screen. The original didn't seem to keep track from screen to screen. I also added a high score routine. Not sure what characters were originally used, but I suspect that it was the card suit characters: the spade for trees, the diamond for your goal, and the club for mushrooms. I used the up arrow for trees, since they kind of look like pine trees, periods for "little" mushrooms and the astrix for the diamond.  I'll leave it to you to judge if they work.  Here's a vid of what I came up with:


Based on some input from Keiichi Shiga on the Japanese Vintage Computer Users group on Facebook, I fixed up the instructions. I also, changed the way that the score is displayed. Now it counts down from the 20 diamonds that you start with every screen followed by your total cumulative score.  Also, your lives countdown from 5 for mushroom hits.  When you hit zero... you're dead.

The game "In the Woods" can be found and played under "Our Classic Basic Games" menu item on our GameJolt Page: Just select "Play Game" then click "Play Our Classic Basic Games," select "In the Woods" from the cassette menu and finally type RUN and hit ENTER.  Then enjoy a classic Japanese 8-bit BASIC computer game from the early 1980s.

Monday, 13 May 2019

Telengard in 20K TRS-80 MC-10

I have ported Telengard from TRS-80 Model 1/3 to TRS-80 MC-10. Had to sacrifice fountains, misty grey cubes, jewel encrusted thrones and mysterious boxes with buttons, but it now fits in a 20K 8-bit computer. Still present are altars, teleports, stairways, pits and elevators. It has a procedurally generated dungeon map, which means it has 50 levels and millions of rooms! Here's a link to an neat interactive map.

To get it down to under 20K I used MCX hardware add-on and its extended BASIC as emulated in VMC10 to renumber the code. The nice thing about the MCX hardware is that it allows for over 30K of memory, which provides the initial space required to work on the code while also being able to run and debug one's edits. Eventually I got to a point, where it fit in the regular 20K and I simply turned off the MCX and extra memory.

Lots of little sacrifices were needed. No character name. Separate screen (hotkey-H) to display items carried.  No command help screen (the original use of the H key). I shortened and standardized many messages, which means that some of the unique and quixotic ones have disappeared. No title screen.

All the spells and magic are there, although I have yet to test the highest level spells (above 2).  All the monsters are there.  All the special items (scrolls, rings, etc.).  You can save your game progress when you make it to an Inn, but unlike the original game, you can also save your game at any point in the dungeon by hitting the * symbol. When you save the game while in the dungeon you will be returned to your save point.

I used the senior TRS-80 Model 1/3 BASIC source as the start because is was already setup to use only 16 rows. Its graphics were simple semigraphic block character-based. In many ways my version looks more like the Apple or PET versions because it uses text character graphics, such as dashes and exclamation marks for doors and an X for the player. It is a complicated game with "permadeath" being the main experience of players at the beginning. A good manual is a must for playing it properly.

New Easter Egg

I have hidden "The Orb of Charlie" (in honour of my son Charlie) at a specific location on level 3 as a goal for play. Once you retrieve the ORB it will be permanently displayed in the bottom right of the screen. This addition is meant to be some minor recompense for the loss of the major location items (fountains, thrones, etc).

I really enjoyed finding out some of the complex and somewhat contentious history of this program by Daniel Lawrence, which stretches all the way back to the mainframe and mini-computer network systems, before jumping to the first home-computers in the late 70s.

Now the MC-10 can be numbered among those computers that have a version of this classic program-- albeit a somewhat simplified version-- but with some unique features of its own.