Jump to content


Photo

Portal Change Idea


12 replies to this topic

#1 Spider

Spider

    DEC (HL)

  • Administrator
  • 4,175 posts

Posted 08 May 2020 - 04:12 PM

I did have an idea the other day and today thought I'd try it. Although I'd made a mistake in my code and it did not work (plus something else, namely I think needing to shuffle a bit of code about) , the idea I thought may of had merit.

 

Two ways of doing it, either set the airbourne counter to #FF and jump back into the main loop or drop into the collision detection "kill" routine. It does seem slightly confusing as to if a POP is needed here to zap the last return address off the stack however.

 

Simply put the idea was : The Portal is fatal on contact unless its active. :)

 

The Kong caverns might be possible if jump and left is held down (not tested!) as M.W will not be in contact with it if he walks left under the earth wall with jump held down, causing him to leap up as soon as possible.

 

Just a passing thought...


Changing order to chaos since 1984

#2 IRF

IRF

    Advanced Member

  • Contributor
  • 4,458 posts

Posted 08 May 2020 - 08:24 PM

I think the check for whether Willy has entered a portal comes before the test for a standonable (or jumpoffable) platform underneath Willy.

Otherwise, Willy wouldn't be able to survive falling into the portal in Return of Kong...

#3 Norman Sword

Norman Sword

    Advanced Member

  • Member
  • PipPipPip
  • 332 posts

Posted 08 May 2020 - 09:43 PM

The portal routine as now:-

 

 

 

Used by the routine at 870E. First check whether Willy has entered the portal.
8FC5 LD HL,($80B0) Pick up the address of the portal's location in the attribute buffer at 5C00 from 80B0
8FC8 LD A,($806C) Pick up the LSB of the address of Willy's location in the attribute buffer at 5C00 from 806C
8FCB CP L Does it match that of the portal?
8FCC JR NZ,$8FDF Jump if not
8FCE LD A,($806D) Pick up the MSB of the address of Willy's location in the attribute buffer at 5C00 from 806D
8FD1 CP H Does it match that of the portal?
8FD2 JR NZ,$8FDF Jump if not
8FD4 LD A,($808F) Pick up the portal's attribute byte from 808F
8FD7 BIT 7,A Is the portal flashing?
8FD9 JR Z,$8FDF Jump if not
8FDB POP HL Drop the return address from the stack
8FDC JP $9028 Move Willy to the next cavern
Willy has not entered the portal, or it's not flashing, so just draw it.
8FDF LD A,($808F) Pick up the portal's attribute byte from 808F
8FE2 LD (HL),A Set the attribute bytes for the portal in the buffer at 5C00
8FE3 INC HL
8FE4 LD (HL),A
8FE5 LD DE,$001F
8FE8 ADD HL,DE
8FE9 LD (HL),A
8FEA INC HL
8FEB LD (HL),A
8FEC LD DE,$8090 Point DE at the graphic data for the portal at 8090
8FEF LD HL,($80B2) Pick up the address of the portal's location in the screen buffer at 6000 from 80B2
8FF2 LD C,$00 C=0: overwrite mode
;--------------------------

 

The changed code preceded by -. on each line

 

 

-.8fc5  ld  de,(#80b0) ; portal  address to de
-.8fc8  ld hl,(#806c) ; will att to hl
-.8fcb  or a
-.8fcc  sbc hl,de    ;  a collision sets the zero flag
-.8fce  ex de,hl
-.8fcf  ld a,(#808f)   ;the portal colour
-.8fd2  jr nz,part2
-.8fd4  pop hl  ; we clear the stack
-.8fd5  bit 7,a  ; decide if portal or death
-.8fd7  jp nz,#9028 ; next cavern
-.8fda  jp #8d0f           ; the kill routine
-.8fdd nop       ; spare 5 bytes
-.8fde nop
-.8fdf nop

-.8ff0 nop
-.8fd1 nop

 

part2
8FE2 LD (HL),A Set the attribute bytes for the portal in the buffer at 5C00
8FE3 INC HL
8FE4 LD (HL),A
8FE5 LD DE,$001F
8FE8 ADD HL,DE
8FE9 LD (HL),A
8FEA INC HL
8FEB LD (HL),A
8FEC LD DE,$8090 Point DE at the graphic data for the portal at 8090
8FEF LD HL,($80B2) Pick up the address of the portal's location in the screen buffer at 6000 from 80B2
8FF2 LD C,$00 C=0: overwrite mode

 

 

; the problem that I see with doing this is the vagueness of the collision detection.

 

An outline :- subject to typing errors and miscalculations. plenty of space to fit the code.


Edited by Norman Sword, 08 May 2020 - 10:12 PM.


#4 andrewbroad

andrewbroad

    Advanced Member

  • Contributor
  • 79 posts

Posted 08 May 2020 - 11:32 PM

JSW64 Trigger Stopper Guardian Item Portal... :ph34r:


Dr Andrew Broad


#5 Spider

Spider

    DEC (HL)

  • Administrator
  • 4,175 posts

Posted 09 May 2020 - 03:07 PM

Thanks all.

 

What I'd thought of (and just thought not tried that method) was just after the checks for if M.W is in the Portal or not and if its flashing or not, there's code to just draw it. Replacing that with the "Kill" routine might of worked, except the JR is a bit out of range. This would of needed two small jump address changes to ensure the routine jumped after the 'modified section'

 

I see I do not need to do this now, thanks. :D


Changing order to chaos since 1984

#6 Spider

Spider

    DEC (HL)

  • Administrator
  • 4,175 posts

Posted 09 May 2020 - 03:11 PM

I think the check for whether Willy has entered a portal comes before the test for a standonable (or jumpoffable) platform underneath Willy.

Otherwise, Willy wouldn't be able to survive falling into the portal in Return of Kong...

Did you mean if he uses the Portal to hide ? :) In theory he could be walking left with jump enabled under the earth cell so should jump the gap and not touch the Portal.

 

As otherwise he'd only enter it when it was flashing at cavern completion ? :unsure:


Changing order to chaos since 1984

#7 IRF

IRF

    Advanced Member

  • Contributor
  • 4,458 posts

Posted 09 May 2020 - 03:38 PM

Did you mean if he uses the Portal to hide ? :) In theory he could be walking left with jump enabled under the earth cell so should jump the gap and not touch the Portal.

As otherwise he'd only enter it when it was flashing at cavern completion ? :unsure:


Can't do that in Manic Miner. If you try to jump over the portal when traversing at the lower level, then Willy doesn't land on the far side, but drops into the portal, and you have to jump back out again. (But with your modification, he would die before he got the chance to jump back out!)

You could perform such a jump in JSW, but only when jumping from right to left, not vice versa.


Edited by IRF, 03 July 2020 - 10:07 AM.


#8 Spider

Spider

    DEC (HL)

  • Administrator
  • 4,175 posts

Posted 09 May 2020 - 04:52 PM

I'd not tested it. :)

 

I suppose a tiny bit of cavern tweaking would allow it to happen but I do see what you're saying now.


Changing order to chaos since 1984

#9 Spider

Spider

    DEC (HL)

  • Administrator
  • 4,175 posts

Posted 02 July 2020 - 08:36 PM

I think this may be something I'd like to implement in one future game project perhaps. Ideally with a warning and maybe some careful cavern design so that the Portal is 'in the way' a bit too, as in not buried in a corner harmlessly ;)


  • IRF likes this
Changing order to chaos since 1984

#10 IRF

IRF

    Advanced Member

  • Contributor
  • 4,458 posts

Posted 03 July 2020 - 10:29 AM

I think this may be something I'd like to implement in one future game project perhaps. Ideally with a warning and maybe some careful cavern design so that the Portal is 'in the way' a bit too, as in not buried in a corner harmlessly ;)

 

The portals in the Kong caverns are unavoidably "in the way" - i.e. it's impossible to collect all the items without passing through the portal en route.  So those layouts would need to be changed, in order to allow you to avoid entering the portal prematurely if it's fatal to do so!


Edited by IRF, 03 July 2020 - 10:30 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users