Jump to content
Jet Set Willy & Manic Miner Community

Fixing the 'Ramps vs Walls' Bug


IRF

Recommended Posts

Just a note on the file I posted:

 

What is happening?

In the original JSW, the code for jumping and moving up and down ramps, are set in one overall routine that detects wall blocks and stops movement.

Within the code of the original, was two sets of movement code that treated the movement going left and the movement going right differently.

 

Moving left.

The code for moving left omitted a check for head height blocks. This permits willies head to pass through blocks moving left. This also permits willies head to pass through blocks at head height when jumping. Another routine at #8df7 detects the passage through the block at head height and immediately pushes willy downward to cell align him into/onto the block below. In most cases this works well if willy is going upwards on a jump. If willy is going downwards on a jumping arc, then the code at #8df7 will appear to move willy suddenly downward. This is the characteristic jerk as willy hits a wall and slides down it into a gap.

Moving right

This code blocks the movement of willies head through a wall tile. The result is that willy can not jump into slots cut out of walls in the same manner. Because willies body and head do not enter in a wall tile, willy will slide down walls at a normal speed, until his feet land on something. 

 

consequence.

The slight difference in the movement is why the game has cut outs in vertical walls only in left jumped to walls. The same style cut out that exist in right cut out walls normally have a platform below the cut out, on which willy can land. It also is the reason for the jerk jumping left in certain circumstances that are not replicated going right.

 

Fixs

Various fixs can be applied and each fix might cure one or other problem.

1) stop willies head passing through a block.
This fix will stop the jumps into cut outs.

 

2) allow willies head to pass through a block going right.
This fix will enable jumps left and right into cut outs. But willy will pass through so many blocks it just looks wrong.

 

3) rewrite the lot.
This introduces so many new variables, that anything can happen. My thoughts on that are GOOD LUCK.

 

DEMO 
The demo program posted above changes its set of rules depending on what is happening.
1) If willy is walking up or down a ramp then it will check for willies head/body/above head(going up)/below head (going down).
When jumping the rules are changed. When jumping upward it checks above his head, his head and also his body. If not cell aligned it will check the third cell (lower body/under foot)
2) When jumping downward  it ignores the head check and checks for his body and if free to move also checks the cell below his body (under foot). This double check for body and lower body/under foot is needed to ensure that willy is actually passing into a gap in which he can fit. (two cells high)
If the two cells are free then the code permits willies head to pass through a wall block. The code at #8df7 will detect the passage through a wall block and immediately pull willy downwards into the gap. This is what happens in the original game. The only difference in this demo is that it now happens going left or right, but willies head is blocked from passing into wall blocks when walking, walking on ramps, or even jumping upward.

 

Any modification will invariably introduce new problems. Simply because the original game appears to have been constructed around the non symmetry of code. Some of these problems are very easy to fix others are waiting to come to light.

 

ADDENDUM

Most of the labels I have in this area have been moved/change/deleted . I have had to use an unchanged version, to find the address I am referencing. 

 

Over head wall check, that push's willy downward , as written by 

 

The complete Jet Set Willy RAM disassembly 2017 11 13

Edited by Norman Sword
Link to comment
Share on other sites

Some interesting analysis, thanks Norman!

 

(I think the code you're referring to, which ejects Willy downwards from a wall tile during a jump, is at #8EBC.)

 

 


Any modification will invariably introduce new problems. Simply because the original game appears to have been constructed around the non symmetry of code. Some of these problems are very easy to fix others are waiting to come to light.

 

Indeed!  I only discovered today that the alternative fix which I came up with to allow Willy to jump into cut-out gaps in walls (namely to increment his horizontal movement one more time at the end of a jump, by replacing the RET at #8EB5 with a JUMP to #8FBC), has an unforeseen and critical impact on the game - because each jump takes Willy one horizontal increment further, the sequence of jumps along the conveyor in 'Under the Drive' no longer allow Willy to complete that room (and hence he can't complete the game, unless the layout of that room is changed!)

Edited by IRF
Link to comment
Share on other sites

Another routine at #8df7 detects the passage through the block at head height and immediately pushes willy downward to cell align him into/onto the block below. In most cases this works well if willy is going upwards on a jump. If willy is going downwards on a jumping arc, then the code at #8df7 will appear to move willy suddenly downward. This is the characteristic jerk as willy hits a wall and slides down it into a gap.

I would add that when Willy is moving upwards, he has only usually moved up by one increment when the code kicks in, so the push back downwards is also only by one increment and therefore doesn't seem as stark. Whereas when he is on the way down, the code takes effect as soon as his head is aligned with the block, so the instantaneous downwards adjustment is an entire cell-row - much more noticeable.

 

I think it could be solved by only preventing the wall-head check when Willy is jumping AND the Jump Counter (#85D5) has reached a value of 11 (#17 in hex) i.e. one increment before the end of the jump, which occurs when #85D5 = 18 (#12).

Edited by IRF
Link to comment
Share on other sites

  • 2 months later...

Just a note on the file I posted:

 

What is happening?

In the original JSW, the code for jumping and moving up and down ramps, are set in one overall routine that detects wall blocks and stops movement.

Within the code of the original, was two sets of movement code that treated the movement going left and the movement going right differently.

 

Moving left.

The code for moving left omitted a check for head height blocks. This permits willies head to pass through blocks moving left. This also permits willies head to pass through blocks at head height when jumping. Another routine at #8df7 detects the passage through the block at head height and immediately pushes willy downward to cell align him into/onto the block below. In most cases this works well if willy is going upwards on a jump. If willy is going downwards on a jumping arc, then the code at #8df7 will appear to move willy suddenly downward. This is the characteristic jerk as willy hits a wall and slides down it into a gap.

Moving right

This code blocks the movement of willies head through a wall tile. The result is that willy can not jump into slots cut out of walls in the same manner. Because willies body and head do not enter in a wall tile, willy will slide down walls at a normal speed, until his feet land on something.

 

consequence.

The slight difference in the movement is why the game has cut outs in vertical walls only in left jumped to walls. The same style cut out that exist in right cut out walls normally have a platform below the cut out, on which willy can land. It also is the reason for the jerk jumping left in certain circumstances that are not replicated going right.

 

Fixs

Various fixs can be applied and each fix might cure one or other problem.

1) stop willies head passing through a block.

This fix will stop the jumps into cut outs.

 

2) allow willies head to pass through a block going right.

This fix will enable jumps left and right into cut outs. But willy will pass through so many blocks it just looks wrong.

 

3) rewrite the lot.

This introduces so many new variables, that anything can happen. My thoughts on that are GOOD LUCK.

Norman, I have now managed to achieve a rewrite of Willy's movement code which allows him to make jumps into 'cut outs' between underfoot and overhead wall blocks, such as the ledges in the Wine Cellar, AND which preserves the smooth arc of Willy's jumps, avoiding the sudden 'jerking downwards' as he hits a wall which you described above.

 

All of which is implemented in a symmetrical manner, with shared code for both leftwards and rightwards movement. ;)

 

Please see the file titled 'After Comprehensive Willy Movement Rewrite', attached to this post:

http://jswmm.co.uk/topic/415-comprehensive-rewrite-of-willys-movement-code/?do=findComment&comment=9109

 

N.B. Achieving this required a redesign of the following:

 

- the 'Move Willy (1)' routine [deals with vertical movement - a modified version of the 'eject Willy downwards if his head enters a wall block' subroutine at #8EBC is used to eject him upwards if his feet enter a wall block!];

 

- the 'Move Willy (3)' routine [deals with horizontal movement, including along ramps - the changes were mostly taken from your code, as provided elsewhere in this forum, but with some minor tweaks - Willy's head can only enter a wall block if he is jumping and his Jump Counter variable holds a value of 17, one increment short of the end of the jump], and;

 

- the 'Draw Willy' routine [to over-ride the tendency to draw Willy downwards whilst he is standing on a ramp if he is also standing on a wall tile - I drafted my own code for this purpose, although part of it was initially based on one of your contributions].

Edited by IRF
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.