Water Works by The Micro User faulty?

having trouble with an archived file or want to correct something? report it here!
Michael Brown
Posts: 1896
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham

Water Works by The Micro User faulty?

Postby Michael Brown » Sat Nov 04, 2017 9:50 am

Hi all,

Does anyone have a BBC B working copy of a pipeline type game called Water Works by Michael Elson who wrote several BBC B games for the Micro User.

it featured in Volume 11 Issue 6 from August 1993

Once you have made a loop and time is out and the yellow floods the screen you get a Subscript at line 1680.
It works OK in master mode.

I suspect it just may have something to do with opening a file(s) and then *loading another file at &1100 as this may corrupt data?

anyone help?

Mick.

User avatar
lurkio
Posts: 1289
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Water Works by The Micro User faulty?

Postby lurkio » Sun Nov 05, 2017 12:02 pm

Don't know what the cause of the error is, but here's the disc-image for anyone who wants to try it (keys for one-player game are Z,X,F,C,G):

    WATERWK.ssd.zip
    .SSD DFS disc-image of Water Works from The Micro User (Acorn Computing)
    magazine, Vol. 11, No. 6, August 1993
    (4.59 KiB) Downloaded 10 times

Play online:

:-k

Michael Brown
Posts: 1896
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham

Re: Water Works by The Micro User faulty?

Postby Michael Brown » Sun Nov 05, 2017 12:13 pm

Just had another look.

Was wondering if it was due to poking to &7E or something as I think there may be emulation errors but it doesn't work under BeebEm or bem. Not able to check on a real BBC so if anyone can, then that would be great.

Mick.

PS Doesn't seem to work in Master mode either now! Sure it did once!

anyone got any ideas?

joachim
Posts: 114
Joined: Wed Jun 21, 2006 1:20 am

Re: Water Works by The Micro User faulty?

Postby joachim » Sun Nov 05, 2017 12:45 pm

Line 1680 indexes into a table at &1BB0 to get the subscript, so the obvious inference is that that table was corrupted somehow but I don't know how. I don't see how to blame filing operations since the table was initialized after all the loading, in line 150.

But do you get "Subscript" every time? My run (jsbeeb at lurkio's link) resulted in "No room at line 1750" at the end of the game. Not surprising in MODE 1 with PAGE at &1C00, but that must be the intended value of PAGE because of the abovementioned table at &1BB0. So I don't see how this game could ever have worked without shadow RAM.

User avatar
lurkio
Posts: 1289
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Water Works by The Micro User faulty?

Postby lurkio » Sun Nov 05, 2017 12:57 pm

Here's a screenshot from my JSBeeb link, showing the same error that Mick reported originally:

    Untitled.png
:?:

User avatar
lurkio
Posts: 1289
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Water Works by The Micro User faulty?

Postby lurkio » Sun Nov 05, 2017 12:59 pm

Michael Brown wrote:Not able to check on a real BBC so if anyone can, then that would be great.

Just tried it on my M128 with IFEL MultiOS in Model B mode. Same error ("Subscript at line 1680")!

:!:

User avatar
lurkio
Posts: 1289
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Water Works by The Micro User faulty?

Postby lurkio » Sun Nov 05, 2017 2:03 pm

On little more than a hunch, I changed all (two?) instances of &1BCF in the program listing to &1BFC. I was then successfully able to complete a loop in Level 1 and then move on to Level 2 -- but I now get the "No room" error!:

    Untitled.png
    Screenshot in Mac BeebEm

Here's my edited listing:

    Code: Select all

      10REM     Water Works
      20REM (c) Acorn Computing
      30REM   by Michael Elson
      40ENVELOPE 1,1,0,0,0,0,0,0,126,-20,0,-10,126,0
      50HIS=0:LEVEL=1
      60*LOAD CODE1
      70*LOAD CODE2
      80DIM O(1,4),D%(11,3),L%(1,13)
      90O=OPENIN("DATA"):FORX=0TO11:FORY=0TO3:INPUT#O,D%(X,Y):NEXT:NEXT:FORX=1TO13:INPUT#O,L%(0,X),L%(1,X):NEXT:CLOSE#O
     100*LOAD SPRITES 1100
     110FORY=0TO4
     120O(0,Y)=RND(7-(LEVEL>4)*4)-1
     130O(1,Y)=RND(7-(LEVEL>4)*4)-1
     140NEXT
     150FORX=&1BB0 TO &1BFC STEP4:!X=0:NEXT
     160?&1BFC=255
     170CL1=0:CL2=0
     180LEVEL=1:SCO=0
     190MODE1
     200VDU19,1,0,0,0,0,19,2,0,0,0,0,19,3,0,0,0,0
     210PROCT("WATER WORKS",420,990)
     220PROCT("Please select :    1 - One player game",50,928)
     230PROCT("2 - Two player game",658,896)
     240PROCT("3 - Expert game",658,864)
     250PROCT("Score =0",30,750)
     260PROCT("Distance needed =6",608,750)
     270PROCT("Level =1",30,782)
     280PROCT("Time =60",608,782)
     290PROCT("High score ="+STR$(HIS),30,814)
     300GCOL0,3:MOVE142,0:DRAW1104,0
     310DRAW1104,676:DRAW142,676:DRAW142,0
     320VDU23;8202;0;0;0;
     330?&74=&50:?&75=&18:CALL&C20
     340VDU19,1,1,0,0,0,19,3,3,0,0,0,19,2,4,0,0,0
     350G=GET-48
     360IFG<1 OR G>3 GOTO350
     370IF G=1 PL2=0:EP=0
     380IF G=2 PL2=1:EP=0
     390IF G=3 PL2=0:EP=1
     400VDU24,0;830;1276;950;
     410GCOL0,128:CLG
     420?&CBF=-98:?&CBE=-67
     430?&CBD=-68:?&CBC=-83
     440?&CBB=-103:?&CBA=-104
     450?&CB9=-73:?&CB8=-105
     460?&86=32:?&87=80
     470?&88=45:?&89=80
     480LA=0
     490?&CB7=PL2
     500PROCDIS1
     510TIME=0:E=FALSE
     520PROCSET
     530IFPL2=1 OR EP=1 PROCDIS2
     540CALL&9C6:IF PL2=1 CALL&AC6
     550GOTO570
     560IF E=TRUE GOTO670
     570CALL&BC0
     580IFINKEY-84 PROCLAY1 ELSE CL1=0
     590IFINKEY-89 OR INKEY-85 PROCLAY2 ELSE CL2=0
     600IFINKEY-97 DIS=0:TI=99
     610IFINKEY-82 THEN *FX210,0
     620IFINKEY-17 THEN *FX210,1
     630IFINKEY-56 time=TIME:REPEATUNTILINKEY$(1)="":REPEATUNTILINKEY$(1)<>"":TIME=time
     640IFLA=1 PROCFLOW:GOTO560
     650IFTIME>100 THEN TIME=0:TI=TI-1:PROCT(STR$(TI)+" ",800,782):SOUND1,1,6,10:IF TI=0 PROCFLOOZ
     660GOTO570
     670P=0
     680FORX=&1B00 TO &1BFC
     690IF ?X<>0 AND ?X<50 P=P+.5
     700NEXT
     710SCO=SCO-INT(P)
     720PROCT(STR$(SCO)+" ",254,750)
     730IF DIS>0 PROCT("GAME OVER",450,950) ELSE GOTO760
     740IF SCO>HIS PROCT("A NEW HIGH SCORE!",328,910):HIS=SCO
     750PROCT("Press SPACE for a new game",190,870):REPEATUNTILGET=32:GOTO150
     760PROCT("WELL DONE!",434,950)
     770PROCT("You have completed level "+STR$(LEVEL),270,910)
     780PROCT("Press SPACE to begin the next level",120,870)
     790REPEATUNTILGET=32:LEVEL=LEVEL+1
     800PROCT(STR$(LEVEL),254,782)
     810PROCSET
     820PROCT(STR$(TI),800,782)
     830PROCT(STR$(DIS),1152,750)
     840FORX=&1BB0 TO &1BFC STEP4:!X=0:NEXT:?&1BFC=255:CL1=0:CL2=0
     850A=&1850+144*((LEVEL-1) MOD3)
     860?&74=A MOD256:?&75=A DIV256:CALL&C20
     870VDU24,0;830;1276;950;:GCOL0,128:CLG
     880GOTO480
     890DEFPROCDIS1
     900FORY=0TO4
     910?&72=0:?&73=Y*28+76
     920?&74=((O(0,Y)*144)+&1100)MOD256
     930?&75=((O(0,Y)*144)+&1100)DIV256
     940CALL&91D:NEXT
     950ENDPROC
     960DEFPROCDIS2
     970FORY=0TO4
     980?&72=72:?&73=Y*26+80
     990?&74=((O(1,Y)*144)+&1100)MOD256
    1000?&75=((O(1,Y)*144)+&1100)DIV256
    1010CALL&91D:NEXT
    1020ENDPROC
    1030DEFPROCLAY1
    1040IFCL1=1 CL1=0:GOTO1080
    1050IF CL1>0 CL1=CL1-1:ENDPROC
    1060IF ?FNA(?&86,?&87)>100 ENDPROC
    1070IF ?FNA(?&86,?&87)>0 CL1=50:ENDPROC
    1080CALL&9C3:IF PL2=1 CALL&AC3
    1090?&72=((?&86-3) DIV6)*6+2
    1100?&73=((?&87+136)DIV12)*24-18
    1110?&74=((O(0,4)*144)+&1100)MOD256
    1120?&75=((O(0,4)*144)+&1100)DIV256
    1130CALL&91D
    1140IF PL2=1 CALL&AC6
    1150CALL&9C6
    1160?FNA(?&86,?&87)=O(0,4)+1
    1170O(0,4)=O(0,3)
    1180O(0,3)=O(0,2)
    1190O(0,2)=O(0,1)
    1200O(0,1)=O(0,0)
    1210O(0,0)=RND(7-(LEVEL>4)*4)-1
    1220PROCDIS1
    1230ENDPROC
    1240DEFPROCLAY2
    1250IFPL2=0 AND EP=0 ENDPROC
    1260IFCL2=1 CL2=0:GOTO1300
    1270IF CL2>0 CL2=CL2-1:ENDPROC
    1280IF ?FNA(?(&88-EP*2),?(&89-EP*2))>100 ENDPROC
    1290IF ?FNA(?(&88-EP*2),?(&89-EP*2))>0 CL2=50:ENDPROC
    1300CALL&9C3:IF PL2=1 CALL&AC3
    1310?&72=((?(&88-EP*2)-3) DIV6)*6+2
    1320?&73=((?(&89-EP*2)+136)DIV12)*24-18
    1330?&74=((O(1,4)*144)+&1100)MOD256
    1340?&75=((O(1,4)*144)+&1100)DIV256
    1350CALL&91D
    1360IFPL2=1 CALL&AC6
    1370CALL&9C6
    1380?FNA(?(&88-EP*2),?(&89-EP*2))=O(1,0)+1
    1390O(1,4)=O(1,3)
    1400O(1,3)=O(1,2)
    1410O(1,2)=O(1,1)
    1420O(1,1)=O(1,0)
    1430O(1,0)=RND(7-(LEVEL>4)*4)-1
    1440PROCDIS2
    1450ENDPROC
    1460DEFFNA(PLX,PLY)=&1BB0+(((PLX-3) DIV6)-1)*7+((PLY+136)DIV12)-15
    1470DEFPROCFLOOZ
    1480LX=26:LY=22
    1490?&7E=LX:?&7F=LY:CALL&BF0
    1500LA=1:CO=8:LD=2:LC=4
    1510ENDPROC
    1520DEFPROCFLOW
    1530SOUND1,-7,(8-CO)*5+150,1
    1540IF CO=0 CO=8 ELSE CO=CO-1:ENDPROC
    1550IFLD=0 LY=LY-1
    1560IFLD=1 LX=LX+1
    1570IFLD=2 LY=LY+1
    1580IFLD=3 LX=LX-1
    1590IFLY=0 OR LY=40 ORLX=0 ORLX=58 E=TRUE:ENDPROC
    1600IF?(&1BB0+(LX DIV6)*7+(LY DIV6))=8 OR ?(&1BB0+(LX DIV6)*7+(LY DIV6))=8+128 CO=30
    1610CALL&9C3:IF PL2=1 CALL&AC3
    1620?&7E=LX:?&7F=LY:CALL&BF0
    1630IF PL2=1 CALL&AC6
    1640CALL&9C6
    1650LC=LC-1
    1660IFLC>0 ENDPROC
    1670IF?(&1BB0+(LX DIV6)*7+(LY DIV6))=0 E=TRUE:ENDPROC
    1680LD=D%((?(&1BB0+(LX DIV6)*7+(LY DIV6))-1)AND127,LD)
    1690?(&1BB0+(LX DIV6)*7+(LY DIV6))=?(&1BB0+(LX DIV6)*7+(LY DIV6))+128
    1700IFLD=255 E=TRUE:ENDPROC
    1710SCO=SCO+1:IFDIS>0 DIS=DIS-1:PROCT(STR$(DIS)+" ",1152,750)
    1720PROCT(STR$(SCO)+" ",254,750)
    1730LC=6
    1740ENDPROC
    1750DEFPROCT(A$,X,Y)
    1760VDU24,X;Y-32;X+LEN(A$)*32;Y;
    1770GCOL0,128:CLG
    1780VDU26
    1790VDU5:MOVE X,Y
    1800GCOL0,1:PRINTA$
    1810MOVE X+4,Y-4:GCOL0,3
    1820PRINTA$:VDU4:ENDPROC
    1830DEFPROCSET:IF LEVEL>13 TI=20:DI=7+LEVEL ELSE TI=L%(0,LEVEL):DIS=L%(1,LEVEL)
    1840ENDPROC
:?:
Last edited by lurkio on Mon Nov 06, 2017 10:41 am, edited 1 time in total.

joachim
Posts: 114
Joined: Wed Jun 21, 2006 1:20 am

Re: Water Works by The Micro User faulty?

Postby joachim » Sun Nov 05, 2017 2:57 pm

lurkio, a small problem with your fix is that it makes it possible to build over the start tile — in fact I was able to get an infinite loop of fluid with an unbounded score this way. (The ?&1BCF isn't a typo, it's the address corresponding to the start tile.) I would instead try to fix it with something like (untested):

Code: Select all

1675IF?(&1BB0+(LX DIV6)*7+(LY DIV6))=255 E=TRUE:ENDPROC


Meanwhile, have you tried playing the game in Expert Mode? I'm finding it especially challenging because whenever the liquid reaches a piece that was taken from the right-hand dispenser it flows in a completely random direction.

Edit: And I know why! Line 1380 should read:

Code: Select all

1380?FNA(?(&88-EP*2),?(&89-EP*2))=O(1,4)+1
Otherwise it's drawing the piece from the bottom of the dispenser, but actually internally representing the piece from the top of the dispenser.

User avatar
lurkio
Posts: 1289
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Water Works by The Micro User faulty?

Postby lurkio » Sun Nov 05, 2017 4:19 pm

joachim wrote:lurkio, a small problem with your fix is that it makes it possible to build over the start tile — in fact I was able to get an infinite loop of fluid with an unbounded score this way. (The ?&1BCF isn't a typo, it's the address corresponding to the start tile.)

Oops! Well, I did say it was basically just a hunch!


joachim wrote:I would instead try to fix it with something like (untested):

Code: Select all

1675IF?(&1BB0+(LX DIV6)*7+(LY DIV6))=255 E=TRUE:ENDPROC

That prevents the Subscript error, but now there's the "No room" error to deal with:

    Untitled.png
:?:

joachim
Posts: 114
Joined: Wed Jun 21, 2006 1:20 am

Re: Water Works by The Micro User faulty?

Postby joachim » Mon Nov 06, 2017 3:27 am

lurkio wrote:That prevents the Subscript error, but now there's the "No room" error to deal with:

You can get "No room" at various different points in the game, but it's always at 1750. I suspect that passing those variable-length strings to PROCT chews up the heap somehow.

The only fix I know of for that kind of thing is to dimension your string to its maximum length the first time so that it doesn't have to be reallocated … but I don't know how to make that work when the string is the formal parameter of a PROC.

User avatar
lurkio
Posts: 1289
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Water Works by The Micro User faulty?

Postby lurkio » Mon Nov 06, 2017 10:40 am

joachim wrote:
lurkio wrote:That prevents the Subscript error, but now there's the "No room" error to deal with:

You can get "No room" at various different points in the game, but it's always at 1750. I suspect that passing those variable-length strings to PROCT chews up the heap somehow. The only fix I know of for that kind of thing is to dimension your string to its maximum length the first time so that it doesn't have to be reallocated … but I don't know how to make that work when the string is the formal parameter of a PROC.

I incorporated both your fixes into the program, and then I compressed the listing using the Pack routine in the PRES Advanced BASIC Editor ROMs. Please try the resultant new version of the game:

    WATERWK.ssd.zip
    Compressed version of Water Works
    (5.59 KiB) Downloaded 8 times
:?:

Michael Brown
Posts: 1896
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham

Re: Water Works by The Micro User faulty?

Postby Michael Brown » Mon Nov 06, 2017 12:07 pm

Fantastic work!

Just possibly 3 slight bugs left in the game.

Firstly pressing TAB makes the time go back up to 98. Not sure if this is a cheat or just something the author left in to test the game but it serves little other purpose.
If you change line 600 from D=0:T=99 to THEN T=1 then Time gets set to 0 and the flux starts. This saves having to wait and is in keeping with the other Pipe Mania type games.

Secondly, The score seems to change strangely after completing a level and sometimes ends up with a negative number.
If you change line 700 and remove the S=S~INT(P) then the score remains the same at the end of each level and the next score on the next level gets added to it etc etc.

Lastly, the one I have not been able to fix... If you build say 8 correct squares in a game where only 6 are required and then deliberately put an incorrect square in the way to get caught, then it takes you to the next level anyway, so there must be an error OR is this actually correct and if you simply have built more pipe sections than required then you go through to the next level if there is a break in it or not???.
D should be greater than 0 to get a "Game Over", but comes back as 0 so this could be the problem or part of it.

Hope this helps!
It will need proper play testing!

WaterWorks.zip
(4.33 KiB) Downloaded 9 times


Mick.
Last edited by Michael Brown on Mon Nov 06, 2017 5:38 pm, edited 5 times in total.

joachim
Posts: 114
Joined: Wed Jun 21, 2006 1:20 am

Re: Water Works by The Micro User faulty?

Postby joachim » Mon Nov 06, 2017 5:12 pm

Michael Brown wrote:Lastly, the one I have not been able to fix... If you build say 8 correct squares in a game where only 6 are required and then deliberately put an incorrect square in the way to get caught, then it takes you to the next level anyway, so there must be an error OR is this actually correct and if you simply have built more pipe sections than required then you go through to the next level if there is a break in it or not???.

I'm pretty sure this is intentional, because the commercial original (Pipe Mania) plays the same way, and so does Micro User's own previous version, Pipe Loonacy by Mike Goldberg. You just have to make the pipe long enough, there's no intention to make a loop. (That's why the playtesters didn't spot the "Subscript" bug that crashes the game when you make a loop — they weren't trying to make one!)

Michael Brown wrote:Secondly, The score seems to change strangely after completing a level and sometimes ends up with a negative number.
If you change line 700 and remove the S=S~INT(P) then the score remains the same at the end of each level and the next score on the next level gets added to it etc etc.

Explanation from the original instructions in Acorn Computing:
Michael Elson wrote:Scoring is quite simple – you get one point for each pipe section you place with half a point subtracted from your score for any unused sections of pipe left over at the end of the game.

I think this explanation is not quite correct, though, because it makes it sound as if an unused pipe section would get you +1 point for placing it then -½ point for not using it, for a total of +½ — whereas in the actual game you only get the -½.

Michael Brown
Posts: 1896
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham

Re: Water Works by The Micro User faulty?

Postby Michael Brown » Tue Nov 07, 2017 8:43 am

BTW do you have the full Acorn Computing instructions for the game?
And if so, could you post them here as I would like to include them in the instruction program.

regards,
Mick.

User avatar
billcarr2005
Posts: 1102
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: Water Works by The Micro User faulty?

Postby billcarr2005 » Tue Nov 07, 2017 10:26 am

Waterworks.jpg

Michael Brown
Posts: 1896
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham

Re: Water Works by The Micro User faulty?

Postby Michael Brown » Tue Nov 07, 2017 1:27 pm

Thank you Bill for those.

I will get them typed up and included into the game on Thursday.

Straight away though I see they say that player 2 uses Return whereas in the game it uses ].
Also it says in Expert mode use G and F whereas I think F should be H.
I expect this is so you can press both "place" keys with ease.
The only problem with this is that in 2 player mode, player 1 can catch the H key by mistake (or on purpose) when pressing G. This would give player 1 an unfair advantage, so by changing line 590 to use just the Return key and adding line 595 which uses H only if in Expert game mode by checking if J=1 first this problem is solved.

Noticed no mention about the TAB key in the above instructions.

Here is my latest version.
It has the corrected Return key instead of } and also H now only works in Expert game mode.
It has the original scoring routine (as the new instructions will explain this when I have added them).
It keeps TAB as starting the Water as I feel this to be better than extending the time.

WaterWorks.zip
(4.33 KiB) Downloaded 7 times


The only other slight problem I have found and not been able to sort is...
The instructions in the Micro User say you can change a piece by holding down the "place" key for a second.
This works fine in 1 player mode, but in the other modes player 2s "place" key does not allow him to change his piece but player 1s still does which is either a fault or unfair.

Any suggestions?
Mick.

joachim
Posts: 114
Joined: Wed Jun 21, 2006 1:20 am

Re: Water Works by The Micro User faulty?

Postby joachim » Tue Nov 07, 2017 3:44 pm

Michael Brown wrote:The only other slight problem I have found and not been able to sort is...
The instructions in the Micro User say you can change a piece by holding down the "place" key for a second.
This works fine in 1 player mode, but in the other modes player 2s "place" key does not allow him to change his piece but player 1s still does which is either a fault or unfair.

Works for me using lurkio's original jsbeeb link. Is it possible you broke something when changing around the use of H/}/RETURN as player 2's "place" key?

Michael Brown
Posts: 1896
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham

Re: Water Works by The Micro User faulty?

Postby Michael Brown » Tue Nov 07, 2017 5:33 pm

Yes your're right, the original is OK. It was me adding line 595 that caused the problem.
Was about to give up and let H get used when I tried this...

Changing line 590 to IF INKEY~74 PROC A ELSE IF INKEY~85 AND U=0 PROCA ELSE B=0 seems to solve it.

Attached is another copy for testing.

WaterWorks.zip
(4.34 KiB) Downloaded 6 times



thanks.
Mick.

Michael Brown
Posts: 1896
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham

Re: Water Works by The Micro User faulty?

Postby Michael Brown » Thu Nov 09, 2017 3:21 pm

As promised, here it is...

Water Works complete with full instructions from The Micro User.
I have also moved the cursor off routine closer to the Mode 1 statement in the main file to avoid the long flicker you get each time just before the options page.

Mick.

WaterWorks.zip
(5.19 KiB) Downloaded 5 times


Return to “archive issues”

Who is online

Users browsing this forum: No registered users and 2 guests