Jump to content


Photo

'Don't Mind Your Head (While Walking Left)' Bug Fix for JSW


  • Please log in to reply
42 replies to this topic

#31 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 06 May 2016 - 12:02 AM

Oh, one other thing I meant to mention about this beforehand, but forgot - whilst the patch I ended up with retains the quirky ability to jump through overhead Earth cells, my initial version (which didn't allow Willy to progress onto a ledge under an Earth cell until the last minute) did add quite a bit more peril to the jump over the barrel in Ballroom East, and to crossing the Banyan Tree from right to left; I did rather like the extra challenge it brought to those screens.  :excl:



#32 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 13 January 2017 - 04:31 PM

Well done, Ian!  :)

 

Will you document the fix later on (the modifications to the code)?

 

Here you go, Danny - better late than never!:

 

Moving Left
 
#9032    C3 00 97
 
#9700    B7
              ED 52
              3A D1 85
              FE 01
              20 06
              3A D5 85
              B7
              20 05
              3A B2 80
              BE
              C8
              C3 35 90
 
Moving Right
 
#90A1   B7
             ED 52
#90A4   C3 18 97
 
#9718    3A D1 85
              FE 01
              20 07
              3A D5 85
              B7
              C2 A9 90
              3A B2 80
              C3 A7 90


Edited by IRF, 13 January 2017 - 06:11 PM.


#33 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 13 January 2017 - 07:44 PM

I think it would be better to check for Earth cells at head height when walking, but not when jumping, as this would retain a spectacular class of quirky features.
So the following features would be removed...

  • walking left through Earth cells at head height;
  • walking up through overhead Earth cells on ‘\’ ramps;
...while the following features would be retained...
  • jumping left through overhead Earth cells;
  • jumping left onto ledges with overhead Earth cells, as in “The Wine Cellar”;
...and the following features would be added:
  • jumping right through overhead Earth cells;
  • jumping right onto ledges with overhead Earth cells, as in “Emergency Generator”.

And so it has been done! (With some tidying up and efficiencies applied to the patch.) See the file attached to the first post in this thread.

A note of caution though - the patch might have unintended and unexpected consequences! Some manoeuvres that were previously possible might be rendered impossible!

As an example, you might not be able to progress very far at all in Andrew Broad's game 'JSW64MM: James Bond. The very first challenge in the opening screen 'Dr No' involves walking 'upstream' along a conveyor, and jumping over an approaching 'Honey Ryder' horizontal guardian, whilst being careful to avoid some low-lying Earth cells that are intermittently located above James' head.

I suspect that the patch would make the timing of that jump more difficult (as is the case when James is returning back down the conveyor at the end of the level - as explained below). But worse than that, it might actually make completing (or even effectively starting!) the level/game impossible!

Once the patch is in place, rightward jumps that abut against an Earth cell will end up with Willy (or in this case James) being expelled rapidly downwards once his head reaches the same height as the Earth cell. (As his attributes - though not any infilled part of his sprite - enter the Earth cell.) This is triggered by the 'Innocent-Looking Block' sub-routine at #8EBC. (Which explains the more critical time constraint to the jump referred to above.)

But as part of that process, the Movement Flag (Bit 1 of #85D0) is reset (see #8ECE). As a result, with the patch applied James would fall straight down onto the (leftward) conveyor after jumping right, and so he couldn't progress any further along it. (If you kept the Right key depressed, he could resist being dragged back to the left, but he would just stay on the spot until you let go.)

So - as always - you should fully play test any game in which you have applied the suggested patch!! (Although having said that, I've had a quick look through SkoolKid's screenshots of all the rooms in the original JSW, and I don't anticipate any unsurmountable problems there; in fact it fixes a few bugs, such as the ability to get stuck in the elephant's head in Dr Jones!

#34 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 14 January 2017 - 11:03 AM

A note of caution though - the patch might have unintended and unanticipated consequences! Some manoeuvres that were previously possible might be rendered impossible!

As an example, you might not be able to progress very far at all in Andrew Broad's game 'JSW64MM: James Bond. The very first challenge in the opening screen 'Dr No' involves walking 'upstream' along a conveyor, and jumping over an approaching 'Honey Ryder' horizontal guardian, whilst being careful to avoid some low-lying Earth cells that are intermittently located above James' head.

I suspect that the patch would make the timing of that jump more difficult (as is the case when James is returning back down the conveyor at the end of the level - as explained below). But worse than that, it might actually make completing (or even effectively starting!) the level/game impossible!

Once the patch is in place, rightward jumps that abut against an Earth cell will end up with Willy (or in this case James) being expelled rapidly downwards once his head reaches the same height as the Earth cell. (As his attributes - though not any infilled part of his sprite - enter the Earth cell.) This is triggered by the 'Innocent-Looking Block' sub-routine at #8EBC. (Which explains the more critical time constraint to the jump referred to above.)

But as part of that process, the Movement Flag (Bit 1 of #85D0) is reset (see #8ECE). As a result, with the patch applied James would fall straight down onto the (leftward) conveyor after jumping right, and so he couldn't progress any further along it. (If you kept the Right key depressed, he could resist being dragged back to the left, but he would just stay on the spot until you let go.)

So - as always - you should fully play test any game in which you have applied the suggested patch!! (Although having said that, I've had a quick look through SkoolKid's screenshots of all the rooms in the original JSW, and I don't anticipate any unsurmountable problems there; in fact it fixes a few bugs, such as the ability to get stuck in the elephant's head in Dr Jones!

 

Out of interest, I just playtested 'Dr No', with the check for Earth cells to the right of James' head disabled.  (It was a 'quick and dirty' test; I didn't implement the full patch, I just NOPped out #90A8; so in theory James could also walk through head-height Earth cells on both sides, although the opportunity to do so doesn't present itself in Dr No.)

 

I was correct in my suspicion that attempting to jump rightwards over Honey Ryder whilst halfway along the conveyor, taking advantage of the intermittent pairs of non-Earth cells in the overhead platform, does now cause James to fall to a standstill on the conveyor, even if you keep the Right key depressed.

 

However, it is possible to reach the lift at the bottom-right, if you run up the conveyor very closely behind Honey Ryder, and jump just before she turns round at the right-hand end.  That way, James has cleared past all of the overhead Earth cells before he attempts the jump.

 

But you have to wait till Honey has traversed the conveyor three times (first left, then right and left again) before you set off.  If you go too early (on the first occasion that Honey starts to go right), then you hit the side of the lift (fatally) just after you've jumped over her.

 

I then went on to complete the screen, but because of the extra delay involved in waiting for an extra 'Honey cycle', the time constraint is tighter, and it would be easier to run out of air supply before reaching the portal.  It's not too critical though.

 

******

 

So in summary, the patch doesn't affect the completability of the screen in this particular example, but it does serve as a reminder of the danger of 'unexpected consequences' when you're making any changes to the game mechanics (or to the game engine in general)!


Edited by IRF, 14 January 2017 - 11:50 AM.


#35 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 14 January 2017 - 02:02 PM

Another feature of the patch that I've just thought of - it allows Willy to jump rightwards and land on a platform that is up to four cell-rows below his starting position, if (but only if) he bangs his head on an Earth cell on the way down!  (A feat which he could already achieve jumping leftwards.)


Edited by IRF, 14 January 2017 - 02:02 PM.


#36 jgharston

jgharston

    JGH

  • Contributor
  • 17 posts

Posted 24 January 2017 - 09:55 PM

Is this quirk the one discussed here?



#37 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 24 January 2017 - 11:09 PM

Is this quirk the one discussed here?

 

Yes - I've come up with a fix which stops Willy from walking leftwards through an Earth cell at head-height, yet which still allows him to jump leftwards through an Earth cell at head-height (thus retaining some quirky manoeuvres, and also my patch doesn't prevent Willy from completing The Wine Cellar as the simple fix does).  As a bonus, I've also enabled the same quirky features whilst jumping (but not walkingrightwards.



#38 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 18 February 2017 - 08:49 PM

Here you go, Danny - better late than never!:

Moving Left

#9032 C3 00 97

#9700 B7
ED 52
3A D1 85
FE 01
20 06
3A D5 85
B7
20 05
3A B2 80
BE
C8
C3 35 90

Moving Right

#90A1 B7
ED 52
#90A4 C3 18 97

#9718 3A D1 85
FE 01
20 07
3A D5 85
B7
C2 A9 90
3A B2 80
C3 A7 90


I think that both cases of 'FE 01' in the above can be replaced with a '3D' (DEC A) command, with the same effect on the Zero Flag but saving one byte in each case (i.e. two bytes saved in total).

Come to think of it, Matt Smith could have pulled off that trick at the start of 'Move Willy (1)', saving another byte at #8DDF.

There may well be other cases in the original code where a CP 01 could be replaced with a DEC A, or conversely a CP FF with a INC A. (There's even a CP 00 in the 'Move Willy (3)' routine, at #8FE2, where an OR A would do the trick in one byte! That's a check if Willy is jumping when he's moving leftwards; the equivalent command when he's moving rightwards does use an OR A!)

P.S. The INC A or DEC A optimisations are only possible if you're only checking whether a variable matches with values of FF or 01; not if the same part of the code subsequently goes on to use the value of the variable for some other purpose. (Otherwise you'd have to decrement or increment the A register back to its original value, thus negating the byte-saving!)

Edited by IRF, 22 February 2017 - 11:13 PM.


#39 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 20 December 2017 - 01:31 AM

Going further into 'quirky territory' (which is admittedly rather off-topic for a thread that started off trying to eliminate a quirk!), it would be possible to devise a bit of code, analogous to that at #8EBC, but which had the opposite effect!

i.e. if Willy becomes cell-row aligned (only occupying two rows) with his legs occupying an Earth cell (i.e. he has just jumped up and through an overhead Earth block, and is nearly at the top of his jump), then the code could rapidly adjust his y-coordinate upwards by one cell-row, depositing him on top of the Earth block!

This would effectively allow him to jump to a normally unreachable height! (Three rows above his starting point.). A new kind of Superjump!!

 

And so it has - eventually - been done!

 

Please see the attached file.  There is an overhead 'Innocent-Looking Block' in The Bathroom; try and perform a 'standard' quirky jump through it (you can attempt this from various heights, via the stepped water cells which I've provided at the bottom of the ramp).

 

Most of the more familiar quirky manoeuvres involving jumping through Earth cells have been 'switched off' for the descent part of Willy's jump, but something novel occurs on the ascent if you jump from a certain position... (i.e. try an upwards jump through the block, starting from the floor level).

 

P.S. This 'New Superjump' relies on the fact that I haven't remedied the asymmetrical earth-at-head-height bug in the attached file.  (i.e. Willy cannot perform this feat when jumping rightwards, only leftwards.)

Attached Files


Edited by IRF, 20 December 2017 - 10:49 AM.


#40 IRF

IRF

    Advanced Member

  • Contributor
  • 4,334 posts

Posted 24 December 2017 - 09:53 AM

Note that this patch only tests for Willy's legs entering a wall tile/Earth cell, not floor tiles/Water, so it doesn't have the same effect on the general jumping dynamics as my other patch which inverts the jumping logic (i.e. the one that tests for underfoot platforms before adjusting Willy's y-coordinate).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users