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

#21 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 23 April 2016 - 10:54 PM

There is a residual problem with the Bug Fix.

 

I was thinking that a bit of code in the Main Loop might fix it, as follows:

 

Load up the Airborne Status Indicator at #85D1.

Check: is it '1' (meaning that 'Willy is jumping')?

If not, then reset the Jumping Animation Counter at #85D5 to zero.

(But if the Airborne Status Indicator does have a value of 1, then the command which resets the Jump Counter to zero is bypassed via a relative jump.)

 

I have inserted the above (11 bytes) into the Main Loop (replacing the redundant 'Screen Flash Counter' code in the attached file), which has resolved the last remaining 'structural' problem with the patch.  There is still plenty of scope for the patch to be made more byte-efficient, though.  Or indeed, other options considered (such as Andrew Broad's suggestion).

Attached Files


Edited by IRF, 23 April 2016 - 10:56 PM.


#22 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 23 April 2016 - 11:16 PM

By “jumping left through overhead Earth cells”, I mean any of the following patterns:

(1a) ...    (1b) |..    (1c) ....
     |..         |..         ||..
     .WW         -WW         ?-WW
     .WW         -WW         ?-WW
     ?==         ?==         ??==

(2a) ....   (2b) |...
     |...        |...
     ....        -...
     ..WW        -.WW
     ..WW        ?.WW
     ??==        ??==

(3a) .....  (3b) .....
     .$...       .....
     ||...       |.|.. (Daniel Gromann’s overhead ILB)
     ...WW       ...WW
     ...WW       ...WW
     ...==       ....=
     .....       .....
     .....       .....
     .....       .....
     ?==??       ?==??
Key
.  Air
-  Water
|  Earth  
=  any stand-onable cell-type
?  any cell-type
$  Item
WW Willy
WW

I don't think that Willy actually jumps through the Earth block in scenarios 1b or 2b. Instead, he is projected straight downwards by the 'ILB' code. So he falls through, in the same manner as he does in the 'classic' ILB scenario.

EDIT: Ah, I see what you mean - he jumps through the lower Earth block for a single time-frame (although his filled-in sprite pixels don't actually enter that block), but then the upper Earth block coincides with his top-left cell so the ILB code makes him fall through the upper block.

It's interesting that he isn't also ejected downwards through the lower Earth block by the same mechanism (in defiance of the Water cells beneath)! I guess that's because he's falling, not still jumping, by that stage, and the code at 36540 is only reached during the Jumping Loop (i.e. when the Airborne Status Indicator has a value of 1: Willy is jumping; it's set to a different value when he's falling).

Edited by IRF, 24 April 2016 - 08:41 AM.


#23 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 24 April 2016 - 12:09 AM

Scenario 1b is actually present in original JSW in The Forgotten Abbey (jumping from the top of the ramp), and allows Willy to subsequently walk through head-height Earth cells and exit directly onto the conveyor in The Wine Cellar. However, if he doesn't keep the left key pressed until he is clear of the Earth cells on the right-hand edge of The Wine Cellar, then he can get stuck (because of the conveyor and the Earth cells above him), meaning the player has to abandon the game!

So it's definitely a bug that's worth fixing - at least in terms of preventing him walking leftwards through Earth cells (a bug which also allows Willy to get stuck in the Dr Jones elephant's head in the original game!)

Edited by IRF, 24 April 2016 - 12:47 PM.


#24 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 24 April 2016 - 11:09 AM

I've also tested jumping over the Barrel Guardian in 'Ballroom East', and crossing 'The Banyan Tree'


Another observation: In the original game [and with Andrew Broad's suggested alternative patch], both of those routes (when going leftwards) are made considerably easier because the ILB code rapidly speeds up Willy's descent as soon as his head becomes aligned with the Earth cell that sits above the two-cell Air gap into which he is jumping.

With my version of the patch in place, the timing of either jump is much more critical, as Willy has to fall at 'normal speed' until he is almost aligned with the gap, before he can proceed forward to land on the 'ledge'.

Banyan Tree is particularly difficult (jumping from the ledge between the Cyan Computer Chip and Magenta Gremlin), as he has to 'step back' above the Chip and jump left whilst the Gremlin is still quite high up in the intermediate cavity, in order to safely jump into the gap.

Edited by IRF, 24 April 2016 - 11:36 AM.


#25 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 24 April 2016 - 11:33 AM

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”.

Andrew, I think your idea for a patch, being much simpler in its approach, would take up about 28 fewer bytes than mine in the Move Willy (3) routine! Plus the 11 byte 'conditional initialisation' bit of code that I've just come up with for the Main Loop would be unnecessary. And of course it retains a class of quirky feature, and improves on it by allowing it to work in a symmetrical manner!

On the other hand, your idea could form the basis of adding EXTRA code which would REMOVE another quirk - the ability to land in Earth cells or jump through ILB's.

It's quite easy to disable those effects, by NOPping out the relative jump commands at 36903 and 37014. However, just doing that prevents Willy from walking along Earth platforms! But if a check is introduced, 'Is Willy Jumping?', in association with those relative jump commands, then it would be possible to 'fix' it in a satisfactory manner.

Of course, you may not consider that it needs to be 'fixed'. But what I am saying is it would be possible to come up with two alternative game engine options:

- a non-quirky one, with ILB jumps disabled, no jumping through overhead blocks, and no walking through head-height Earth cell, but the ability to jump onto precarious ledges retained (when jumping left) or introduced (when jumping right);

- a quirky one, retaining most of the existing quirky features, but removing the ability to walk left through head-height Earth cells (which is a dangerous bug as it allows Willy to get stuck, requiring the player to abandon the game), whilst expanding the range of quirky jumps available by letting Willy jump rightwards through overhead Earth cells (or onto a 'precarious ledge').

The latter is basically Andrew's suggestion. But I haven't seen it suggested before anywhere(?), so my byte-inefficient initial attempt at fixing the bug appears to have prompted some useful, brain-storming 'Thinking outside the (innocent-looking) box'!!


Edited by IRF, 26 April 2016 - 04:15 PM.


#26 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 25 April 2016 - 11:35 PM

One other point in relation to this Bug Fix - my variant means that Willy is safe from hitting a Fire cell that is embedded between Earth cells above and below it; whilst Andrew Broad's variant means it is possible for Willy to hit such a Fire cell if he jumps from a certain animation-frame.

 

(I've got Hornet's Nest in TNE particularly in mind here, given that the whole screen is a 'honeycomb' of Fire and Earth cells!)



#27 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 26 April 2016 - 11:26 PM

I've implemented the 'Andrew Broad variant' of the 'Don't Mind Your Head Bug Fix', and noticed some other interesting elements of it.

 

Before I go into detail, you might like to try out the following mini-challenge - load up the attached file, then try to collect all the Bathroom taps and exit to Top Landing (without losing any lives).

Attached Files


Edited by IRF, 27 April 2016 - 09:11 AM.


#28 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 27 April 2016 - 09:08 AM

The attached rzx demonstrates the problems with the 'Andrew Broad variant' of the Bug Fix - if Willy is underneath Earth blocks, and walking towards a head-height Earth block, if he holds the Jump key down then he can pass through the latter!  It also removes his ability to stand adjacent to a head-height Earth block and jump up onto it - instead, he jumps through it (in either direction)!

 

So I've come up with a 'hybrid' solution which resolves the above, but which retains [for moving left - and adds in the case of rightwards movement] Willy's ability to jump onto ledges underneath Earth blocks, or to quirkily jump through overhead Earth blocks.  This was achieved by inserting the following checks when Willy is trying to pass left or right through a cell boundary:

 

(1) firstly, is Willy jumping (is the Airborne Status Indicator at #85D1 set to a value of 01)?  If not, check for Earth blocks at head-height (in either direction), and block his progress (or not) accordingly;

(2) secondly, has Willy only just started his jump (is the Jumping Animation Counter at #85D5 reset to a value of 00)?  If so, check for Earth blocks at head-height (in either direction), and block his progress (or not) accordingly;

(3) in all other circumstances, the check for head-height Earth blocks is bypassed.

 

I have implemented the above in the attached 'hybrid fix' Z80 file (the relevant code once again starts at #9700).  Starting point set to The Bathroom, with the same layout as in the previous file - you will see that the original Bathroom tap in this test file is now uncollectable!

 

I think we've cracked it this time!!  (Except that there is plenty of scope for code optimisation!)

Attached Files


Edited by IRF, 19 December 2016 - 05:37 PM.


#29 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 1,951 posts

Posted 27 April 2016 - 09:06 PM

Very interesting!  :)



#30 IRF

IRF

    Advanced Member

  • Contributor
  • 3,939 posts

Posted 02 May 2016 - 09:39 AM


I think we've cracked it this time!!  (Except that there is plenty of scope for code optimisation!)

 

Case in point: On two occasions I used a two-byte 'FE 00' (Compare with zero) command, whereas a single-byte 'B7' (OR A) instruction achieves the same thing!


Edited by IRF, 02 May 2016 - 12:37 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users