Sunday, 17 February 2019

The Bianco Mansion by Clive Gifford


Stumbled upon a text adventure in a PDF of a book on the Color Computer Archive. I couldn't find any information about it on any of the text adventure databases and forums I know about. Asked folks on Facebook if they had ever played "The Bianco Mansion" by Clive Gifford and had one response by Gareth Pitchford that it seemed similar to another game by Gifford for the Commodore 64 called "The Nielson Papers" http://solutionarchive.com/.../Nielson+Papers%2C+The.html. He felt that some of puzzles were the same. Unclear which version came first, although Gareth felt the Dragon version, published in More Games for Your Dragon 32 by Virgin Books, might be first. He noted about Gifford that:
He did a few "enter & retrieve" type-in adventures... I imagine the Nielson Papers is probably the recycled version, if anything... fleshed out a little for the C64... Seems a smart move to use the same premise multiple times and just tweak things for books for different machines.
Garry over on the CASA Solution Archive also typed in the code, using a Coco and found it to be a pretty standard adventure for the time.  In other words, difficult, not overly impressive and annoying.  He noted in the "Classics" forum:
It's really badly written. There are lots of bugs. There are lots of guess-the-verb scenarios, at least two situations where you have to use multi-word input with the two-word parser and at least one situation where you have to refer to an object that is not mentioned.
The game has potential, but suffers from juvenile inexperience and lack of testing. (The author was still at school when the book was written.)
In my MC-10 version I have fixed many of the bugs that Garry mentions. It's hard to remember them all. There was one where if you "wore" the gloves you got electrocuted when you cut the fence with the wire cutters to escape at the end. You had to be just carrying the gloves. I fixed the mult-sentence input for gaining entrance to the map room (critical). Now you can just type PUT or USE KNIFE and it will prompt you "IN WHAT". Then you can type "LOCK." There was a bug in the routine that was meant to display message about locked doors in rooms that have them-- a missing NEXT command--so it only caught rooms with locks on North walls. There was a bug that allowed you to use the knife to gain entry to the MAP room even if you didn't have the knife yet. There was a bug that disallowed the ATTACK and HIT verbs when interacting with security guard.

I also added the ability to ATTACK/HIT/KILL the guard with GUN, so you don't have to recognize that only SHOOT or FIRE work with the gun. Made a minor fix to the guard random location or relocation routine. I changed spelling of "electrocuted fence" to "electrified fence." Didn't Americanize "torch" to 'flashlight" though (obviously European setting). Added movement shortcuts (N/S/E/W). Added delays where some messages flashed too quickly. Fixed a bug that if you got caught in the vault, it took you to the wrong end of game subroutine (the one that suggested you escaped, but without the map). Added win and failure graphics for MC-10 and the ability to restart rather than have to hit Break and type RUN after those graphics were displayed.  Added word wrap for long and variable messages and added words for clarity in a few messages. Added basic story background and game objective instructions at the beginning (taken from the book):
For many years you have lived the life of a soul tormented with a need to find a particular map. You have at last found the building where it lies, the picturesque Bianco Mansion, home of Count Phillipe and Contessa Catherine de Bianco. They are away at present and you have entered the building. You must find the map and leave via the courtyard. Watch out for security guards!
You can play "BIANCO" via on-line MC-10 emulator here: http://faculty.cbu.ca/jgerrie/MC10/JG_MC_Text_Adventures.html

SPOILERS ALERT!

Here's the map I worked out:


Here's a video of me playing and failing to win:


ADDENDUM

Garry pointed out an error regarding "clue" and "help." Clue initiated the quit routine instead of being a synonym for help. Fixed this.

I think the author's intention was that if you enter the vault without the key the door shuts and you get trapped. I think this because if you type "unlock door" while in the vault without the key it displays a message that you are "trapped in the vault" and then takes you to the "failure" end routine. I fixed the vault interaction in the following way in my latest: If you search in the entrance room to the vault, it tells you the vault has a time lock door and is "currently open." Hopefully this is enough of a warning.

I also found some other quirks. The way the author did the checks for the ladder or stool, you could bring the ladder to the study, but then "climb stool" and get the map, or vice versa. Also, you could "put silencer on gun," and then drop the silencer, but the gun would still shoot in silent mode. The item handling prevented you from picking up the stool or the ladder if you have more than two items, but didn't prevent you from then simply picking up more items (up to the full five) after you had the stool or ladder. I fixed this:

430 IFS>4OR((L(8)=0ORL(13)=0)ANDS>2)THENPRINT"YOU MUST DROP SOMETHING FIRST.":RETURN
440 IF(CT=8ORCT=13)ANDS>2THENM$="TO CARRY THE "+O$(CT)+", YOU CAN ONLY CARRY 2 OTHER ITEMS.":GOSUB1:RETURN

I also fixed the ladder/stool handling this way: Now you can either be holding it or have dropped it in the room before typing "CLIMB STOOL" or "CLIMB LADDER". In any case the item (ladder or stool) is dropped in the room along with the map. Also added a check to prevent the map from being dropped again (out of your inventory) if you should climb the ladder or stool a second time in the study.

The "wear" command was weird. You could wear the gloves and seemed like you were also be able to wear the ring, but the ring didn't disappear from inventory like the gloves did when you put it on. I made it so that when you wear the ring, it is removed from inventory like the gloves. I also made it so that you could still drop either of these items when they were being worn. Similarly for the silencer, if you put it on the gun, it disappears from inventory, but you can also still drop it if you want, and then the gun goes back to no longer being silenced.
I also like that if you search in the paintings room, it says you spot a "Monet", but then if you type "get Monet" it says it isn't there. So I changed the program to sound the alarm and summon a guard if you try to "get Monet" in that room. I think this is in the spirit of the game. You're not there to be a common thief, but to seek the map that has fascinated you your whole life.

I also changed the fighting routine. Now if you use the wire cutters, the rope or your hands, you non-lethally subdue the guards. However, using the rope results in you losing the rope from your inventory (to tie up the guard). This was in response to a suggestion by Garry that it seemed a bit extreme based on the premise of the game to kill a guard who was "just doing his job".

Also, worked on a quirk about "opening" in the letter mentioned by Garry. Now trying to open the letter simply results in a message saying it doesn't have to be opened.

Finally, I added a message for the library regarding the reading of books in there ("there's too many") and added a "Nothing" message when you are carrying nothing.

ADDENDUM TO THE ADDENDUM

Found another bug. After you get the map you see a message "The Alarm has sounded. You don't have much time!" But if you drop the map and pick it up again, it gives you the same message, which means the end timer has been reset to 25. This can happen anywhere, so you can effectively reset the the timer at will postponing the arrival of the police/end as long as you like! I changed it so this message only will display once.

Thursday, 7 February 2019

"Bomb Run" for Homeputerium BASIC 10-Liners Programming Contest 2019


Got another entry pretty much squared away for the Homeputerium Basic 10-Liners contest.  It's called "Bomb Run" and it is based on some graphics ideas used by Robert Sieg a few years back in his game "SG6 Bomber." Robert is a prolific contributor to the MC-10 community, especially when it comes to programs that push the graphics of the MC-10 to the max. I think his game was meant as an experiment with the obscure (and neglected) semi-graphics 6 video mode of the MC-10. This mode gives you a screen of 64 by 48 pixels in two colours kind of like the lowres graphics of the Sinclair ZX81. However, unlike the ZX81, no text is available, although I have created a very chunky 3-pixel by 3 pixel character and number set for use in this mode. Here is a pic of a game I ported from the NEC PC6001 (it also uses an MC6847 graphics chip), which uses these characters:


Can you read the instructions?
Tom        Home
Wall        Yum
Key         Rock
1 Make  3 Load   Play
2 Cont   4 Save    Spc

The Motorola MC6847 is actually capable of putting 4 colours on the screen in this mode (as it does on the PC6001), but because of the simplicity/cost minimization of the MC-10 it is not wired up to fully utilize all the features of the chip. However, there is an alternate colour set to red and blue. You can see it here in a duelling cannons game I made:


The other color is orange, so on the whole this set is much brighter on screen. I switch to this alternate colour set when bombs hit their target to provide a flash effect. Robert does something similar in his original game. He switches right out of the mode and back into the 64 X 32 Semigraphics 3 (SG3) mode, which also has ASCII characters available.  It makes for some pretty freaky flashing. Here's a vid of Robert's game:


As you will see, I used much small targets than him. I found his targets just a little too easy to hit, even with the plane bobbing around. But I really liked his plane graphic and the scrolling concept. I programmed the game from scratch to make sure it fit 10 lines. I drew the graphics using a simple Semigraphics 6 graphic editor program that I created. It prints its screen to a text file which I can then just cut and paste from as needed into my program editor (Notepad).

Here is the program breakdown:

Initialize variables and input level of play
0 CLS:CLEAR1000:DIMT,P,B,X,YA$,B$,S,H,Q,R,LV:B=480:O$="":M=16384:Q=32:INPUT"LEVEL (1-3)";LV:LV=7-LV:IFLV<1ORLV>6THEN0
Build the long strings for the scrolling terrain. Objects are stored in string directly within the MID$ statements, which simply randomly pick the 3 characters needed for each type of object to be inserted after every 32 black block characters ("€"). 
1 CLS4:MI=MI+1:SOUND1,1:?@267,"MISSION"MI;:A$="":B$="":FORX=1TO7:FORY=1TOQ:A$=A$+"€":B$=B$+"€":NEXT:T=RND(9)*3:S=0:H=0:P=42
2 A$=A$+MID$("€€€€ƒ‚¤ƒ€ƒ‚€€‚€€ªª‚‚€ƒ€‹€",T,3):B$=B$+MID$("€€¶¢­½¨„¶‹™¹ˆŸµŠ»»¿½­¨¯ˆ‘—ƒ",T,3):NEXT:CLS0:POKE49151,28
Main loop. Just cycles through 210 of the two strings printed at the bottom of the screen using the MID$ function to display 31 characters from the current location. This creates the illusion of motion.  Bomb positions are calculated and printed to, or an empty string is printed at the bottom of the screen, until the space key is pressed to release a new bomb. Line 4 is where space key input is processed.
3 FORT=1TO210:?@B,"€";:?@P,"€‚„‚€€€";:?@P+Q,"€¿¿‹€";:?@P+64,"€€¸€€€";:IFRND(20)=1THENR=2-RND(3):P=P+R*-(P+R>36ANDP+R<50)
4 ?@448,MID$(A$,T,31);:?@480,MID$(B$,T,31);:B=B-(B<480)*Q:?@B,O$;:FORZ=1TOLV*2:NEXT:IFINKEY$=" "THEN?@B,"€";:O$="Â":B=P+99
Boundary checks for falling bombs are made here (if falling) and jumps are made if a hit occurs or if the bottom is reached, the bomb is "turned off" by swtching it character to a null string "".
5 IFB>448THENO$="":IFB<480THENS=S+1:Y=PEEK(M+B+Q):IFY>128ANDY<192THEN?@B-2,"ÄÿÿÿÈ";:?@B-2+Q,"ÄÿÿÿÈ";:POKE49151,68:S=S-1:GOTO9
End of the main loop.  After it, checks are made to determine if you have missed too many times, or whether you should loop back and start the run over.  If you miss too much the end routine is initiated, which displays your score, high score, and restart prompt.
6 NEXT:ON-(S<LVANDH<6)GOTO3:ON-(H=6)GOTO1:HS=SC*-(SC>HS)+HS*-(HS>=SC):CLS0:POKE49151,0:CLS:PRINT@44,"bomb run"
7 ?:?TAB(9)"BY JIM GERRIE":?:?TAB(8)"AND ROBERT SIEG":?:?:?:?"SCORE"SC"& LV"7-LV:?"HIGH"HS:?:?
8 INPUT"PLAY AGAIN (Y/N)";M$:MI=0:SC=0:ON-(LEFT$(M$,1)<>"N")GOTO1:END
Subroutine for hits on targets.
9 X=B-448:A$=LEFT$(A$,T+X-3)+"€€€€€"+MID$(A$,T+X+3):B$=LEFT$(B$,T+X-3)+"€ÇÍ€"+MID$(B$,T+X+3):SC=SC+1:H=H+1:POKE49151,28:GOTO6
Instructions as REM statements.
10 REM GRAPHIC CONCEPT FROM
11 REM "SG6 BOMBER" BY ROBERT
12 REM SIEG.
13 REM PRESS SPACE TO DROP
14 REM BOMBS. LV 1 = 6 MISSES
15 REM AND MISSION OVER.
16 REM LV 3 = 4 MISSES AND
17 REM MISSION OVER. YOU MUST
18 REM COMPLETE A MISSION
19 REM TO BE SENT ON ANOTHER.

Monday, 4 February 2019

"Chopper" for Homeputerium BASIC 10-Liners Programming Contest 2019

This year for the Homeputerium Basic 10-Liner Contest I decided to try to create a simple version of Choplifter, which is a classic game that appeared on most of 8-bit computers (VIC, C64, Atari, Apple).  This is a pic of the Apple II version:
The game has a simple premise. Fly the chopper from left to right.  The landscape scrolls as you go.  Tanks and other threats appear to shoot you down. You must land to rescue the fleeing people. They will run to your chopper and climb in when you set down. Return to base for fuel and to offload.

Obviously despite the simple premise, it would still be too complex to have scrolling, running people,  homing attacks from attacking enemies and base interactions. But I thought, maybe I could at least have a chopper picking up people on a static screen, while avoiding random shots from two randomly moving tanks.

It worked. Some nice features presented themselves almost by chance.

The logic imposed by so few lines meant that I had to reuse the routine that prevents the helicopter from moving down below ground level by automatically reversing the chopper up one space if it goes too low. This is also a part of the random placement of soldiers routine. The occasional random motion upwards even if it is not near the ground gives the chopper a kind of buoyant feel, which I think adds something to the verisimilitude of its flight characteristics. This routine also gets used when you set down on top soldiers to pick them up. So setting down triggers new random placements of soldiers. I thought this was a bug, but I think it turned out to be a feature. It's kind of like in the original game when the soldiers come running when you touch down. It is mitigated somewhat by several factors. The tanks are continuously randomly "rolling over" many of the hapless soldiers who appear and the animation blanking routine of the chopper erases three spaces immediately below the chopper so you can only pick up one soldier at a time. The others get blown away by your powerful propeller. So be careful when and where to set down!

The shots moving in opposite directions can be challenging. Especially since they can screen wrap from the left and right side of the screen. You really have maintain global awareness of where the tanks are and plan your moves across the lines of fire very carefully. The speed of shots is pretty quick because the only check is whether a space is non blank (not black character 128). The line across the top stops all shots from going further and the single check jumps to a routine that determines if what was hit was the ceiling line, which simply triggers the next shot from the relevant tank, or the game over routine.

Random seed peek, initialization of main variables, poke lines top (blue block 175) and bottom (red block 191)
0 CLS:DIMK(255):M=RND(-(PEEK(9)*256+PEEK(10))):M=16384:T=416:P=T-32:R=T+16+RND(8):Q=R-29:H=0:V=128:L=10:K(65)=-1:G=32:GOTO9
1 K(83)=1:K(87)=-G:K(90)=G:K(74)=-1:K(76)=1:K(73)=-G:K(75)=G:CLS0:FORC=0TO31:POKEM+C,175:POKEM+C+480,191:NEXT:H=112:I=-33:J=-31

Beginning of Main Loop.  Print and move both tanks randomly.  Each tank has blank/black characters on it left and right sides of it, so it erases the left or right edges of itself as it moves in either direction.  Move shots and check if hit anything.  If so jump to hit routines at line 7 or 8.
2 ?@T,"€€‚€€";:?@T+G,"€„ˆ€";:T=T+2-RND(3):T=T-(T<416)+(T>441):?@P,"€";:P=P+I:ON-(PEEK(M+P)<>V)GOTO7:PRINT@P,"Ã";
3 ?@R,"€€Ž€";:?@R+G,"€„ˆ€";:R=R+2-RND(3):R=R-(R<416)+(R>441):?@Q,"€";:Q=Q+J:ON-(PEEK(M+Q)<>V)GOTO8:PRINT@Q,"Ã";

Blank helicopter's last location. Check for key input and then move by adding or subtracting appropriate amount from location based on key input and direction value stored in array for keys.
4 ?@H,"€€€€";:?@H+G,"€€€€";:H=H+K(PEEK(2)ANDPEEK(17023)):IFH>63ANDH<413THEN?@H,"‘˜‘˜";:?@H+G,"˜Ÿ˜€";:IFRND(L)>1THEN2

Randomly place new soldiers/and or check if too low or if soldier is immediately beneath chopper and jump to appropriate subroutines
5 IFH<64THENH=H+G:?@H,"‘˜‘˜";:?@H+G,"˜Ÿ˜€";:GOTO2
6 POKERND(28)+448+M,30:H=H-G:?@H,"‘˜‘˜";:?@H+G,"˜Ÿ˜€";:C=-(PEEK(H+M+65)<>30):?@H+64,"€€€€";:ONCGOTO2:SOUND183,1:SC=SC+1:GOTO2

Subroutines for shot hits.  Chopper?  Or ceiling?  If chopper (character<161) then jump to game over routine at line 9. Otherwise, must be ceiling so restart shot from tank's current location and go back to main loop.  
7 ON-(PEEK(M+P)<161)GOTO9:P=T-G:PRINT@P,"Ã";:GOTO3
8 ON-(PEEK(M+Q)<161)GOTO9:Q=R-29:PRINT@Q,"Ã";:GOTO4

Game over routine.
9 CLS:?@13,"CHOPPER":?:HS=SC*-(SC>HS)+HS*-(HS>=SC):?"SCORE"SC:?"HIGH"HS:?:SC=0:INPUT"AGAIN";M$:ON-(LEFT$(M$,1)<>"N")GOTO1:END

Remarks with instructions
10 REM USE awsz OR ijkl
11 REM TO MOVE CHOPPER
12 REM COLLECT WAITING
13 REM ^^ SOLDIERS ^^
12 REM BY JIM GERRIE
13 REM FOR TRS-80 MC-10
14 REM BASIC 10-LINER
15 REM CONTEST
13 REM 2019 GUNNAR KANOLD


Sunday, 7 October 2018

RetroChallenge 2018/09: Final fixes on Atari Adventure in BASIC

Made a few further last minute (after contest) fixes. There was a bug in the Bat routine so that it wouldn't necessarily steal an item from a room that it found you in. Left out a NEXT in the item search subroutine so it would only find the sword (item 0) if you dropped it in the room with the Bat flying at you. While I was at it, I added a new death scene for Dragons, which I have been thinking about for a while. A dead dragon is now displayed upside down when you stab successfully. Here's what it looks like now. Skip to the end, if you just want to see the death scene:


Here is the link to the RetroChallenge to see the results of this year's challenge:
http://www.retrochallenge.org/p/entrants-list-201809.html

P.S.

Fixed a problem with moving objects. There are two unused rooms, 21 and 22. I send anything you are carrying, or dragons that are killed, to room 21. You could think of it as the Valhalla room. However, there is another room that does not appear, room 22. When randomly moving objects around the program should avoid sending anything to room 21 (Valhalla), room 5 (the secret room) and room 22. However, I hadn't included code to avoid sending things to room 22, so occasionally items and dragons would go missing, at least for a time, from the accessible spaces of the map.

In making these changes, I also changed the moving object routine to avoid moving objects placed in the micro dot room and the room where the chalice is initially placed. This means that both of these items stay put and don't get moved around. But now, once they are moved from their starting rooms, they are able to be moved by the bat like any other object. In other words, these objects themselves used to be off limits for moving, but now it's just the rooms they are placed in that don't allow movement of items from them.

I had also forgotten to prevent dragons from being selected when the bat was randomly moving things, so they could be brought back to life after being sent to Valhalla (room 21). Now items in room 21 are not allowed to be selected for random moving. This includes dead dragons, but it also includes the item being carried, so I was actually able to simplify the selection routine. It just excludes items in room 21, and things in the micro dot room and chalice room.

Finally, I also fixed the map in the White Castle. Now you have to pay close attention to the map in order to find a way into the hidden section... and out again!

Monday, 1 October 2018

RetroChallenge 2018/09: Saved just before the Bell by Solar Penguin!

A big thank you to the Solar Penguin for noticing a spelling mistake on the final screen when you win (take a look at the end of the video in my last post). I fixed it and found a few more speedups. Also tweaked the game levels and fixed the bat movement timer so it didn't reset every time you moved from screen to screen. Now the bat's activities should occur on a more regular basis. Here's a new playthrough, in which the chalice turned out to be fairly easy to secure. But I still manage to get killed a few times.


Hope this fix makes it into the RetroChallenge. I also added a REMark to the code with a shout-out in honour of the contest (you can see it at the beginning of the video). Thanks to all for sharing in the fun!

Wednesday, 26 September 2018

RetroChallenge 2018: Finally Done?

End Credits
Made a few final bug fixes that quash minor non-critical visual quirks. The dragons didn't initialize properly if they showed up on the first screen at the Gold Castle. Tried to deal with the possibilities of "spawn killing" when you enter a room and a dragon is right on top of you. Now placement is confined to the centre area.  This should leave a little space for you to enter rooms, and if you're quick, get out or move away before the dragon or bat can get you. Replaced all two character string variables with single character variable names. Anything to help a little with speed.

Think the game is winding down to completion.  Can't think of any major changes, besides adding some better sound or music. Still might put an upside-down dead dragon graphic in, but I'm not feeling motivated to create such flourishes. Perhaps, when my son Charlie is home for Canadian Thanksgiving he'll be able to give me some feedback for improvements. But the contest will be finished by then. So I think this might be it for posting.

Tuesday, 25 September 2018

RetroChallenge 2018: That Pesky Bat

The Bat Swoops In!
Noticed another quirk in game play that needed ironing out. If you entered a room with the bat in it and dropped the item you were carrying, the bat would fly to you, notice you weren't carrying anything, exit the screen and choose a random item from anywhere in the dungeon to move.  This made it too easy to avoid the bat stealing important stuff from you.

Now you can't just drop an item to avoid the bat stealing it from you. The bat will always steal an item from the room you're in, if it catches you and if one is available.  If not, then it will pick a random item from somewhere random in the dungeon and move that.

Also, I sped up the whole routine of the bat moving things. This means that when you're moving around and the bat is moving things off screen, the pause in your movement is much less noticeable (I hope).  Also I tweaked the levels so there is more delay between mouth opening and closing at the lowest level than at the highest.  There was too little difference between level 1 and level 3, at least when it came to killing dragons (i.e. striking when their mouths are closed).  Also, I increased the contrast between the three types of dragon, so purple (Barney) is more clearly less threatening than the blue dragon (Blue Streak).

Made it so items and dragons can appear in the Yellow Castle room. For some reason I had considered this room out of bounds for items and dragons being placed there. Can't recall my thinking, but it will help speed things a little not to exclude it.  This change also allowed me to tweak the routine that places the sword at the beginning of the game. Now, on levels 1 and 2, the sword will always show up in one of the rooms near your starting position at the Yellow Castle or by the castle itself.  But on level 3, there is a chance the sword will be hidden in one of the big rooms near the White Castle, which will make for a little more challenge in getting armed.

I'll put the new version up in the regular places soon. Until then it's on Github. ADVENTR37.TXT

https://github.com/jggames/trs80mc10/tree/master/quicktype/Dungeon/Adventure