Language…
6 users online: Daniel30sp, Golden Yoshi, mason, pedro1994, PopCorn181, Stars - Guests: 123 - Bots: 205
Users: 69,706 (2,534 active)
Latest user: Daniel30sp

Trying to make Marios Hitbox 8x16 only when small ducking

I'm trying to change Mario's hitbox to become 8x16 only while small and ducking, and I have been looking over the ROM map, google searching, forum searching, and can't seem to figure this out. I did find two pieces of code that alter Mario's hitbox, but I don't know what to change to get the desired effect. Could someone help me out? I am looking for this to be a global effect as well, not level specific like the second patch indicates.

Here is the code I found:
Here
Code
;Big Mario hitbox to Small Mario hitbox
org $00EB79
db $A9,$00

org $01B4C0
db $A0,$00

org $03B67C
db $A9,$00

;No ducking
org $00D604
db $80

org $01EB16
NOP #2
LDA $73


And this code as well:
Here
Code
;LEVEL SPECIFIC HITBOX PATCH
;ORIGINAL BY KPhoenix
;EDITS BY CHIBIKKO
;Ram Controlled Hitbox Version
;By: Chdata & Chibikko
;***Incompatible with Jagfillit's $19 Expand Patch - Although I made him a new version that lets you do the same thing as this patch***

lorom
header

!RAMHitBox = $87	;FREE RAM ADDRESS
		;CLEAR = NORMAL
		;1 = SMALL
		;2 = BIG

org $EB77
JML main_1

org $01B4BA
JML main_2

org $03B676
JML main_3

org $10ED04

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
db "STAR"	; RATS tag
dw Endcode-Startcode 
dw Endcode-Startcode^#$FFFF 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
Startcode: 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 

main_1:		;;;;;;;;;;;;;;;;

LDX #$00

LDA !RAMHitBox
BEQ NORMAL_1
DEC
BRA JML_1

NORMAL_1:
LDA $19

JML_1:
JML $00EB7B

main_2:		;;;;;;;;;;;;;;;;

LDA #$00
LDY $73
BNE CODE_01B4C4

LDA !RAMHitBox
BEQ NORMAL_2
DEC
TAY
CPY #$00
BNE CODE_01B4C6
JMP CODE_01B4C4

NORMAL_2:
LDA #$00
LDY $19
BNE CODE_01B4C6

CODE_01B4C4:
LDA #$08

CODE_01B4C6:
LDY $187A
BEQ CODE_01B4CD
ADC #$08

CODE_01B4CD:
JML $01B4CD

main_3:		;;;;;;;;;;;;;;;;

LDX #$00
LDA !RAMHitBox
BEQ NORMAL_3
DEC
EOR #$01
ORA $73
;LDA $73
BEQ CODE_03B681
INX

NORMAL_3:
LDA $73
BNE CODE_03B680
LDA $19
BNE CODE_03B681
JML $03B680

CODE_03B680:
JML $03B680

CODE_03B681:
JML $03B681
;;;;;;;;;;;;;;;;;;;;;;;
Endcode:
;;;;;;;;;;;;;;;;;;;;;;;
print "I'm psychic, I knew that you would patch this."
print "-Chdata-"
You could try this tool to change the hitbox.
Do note the warnings and test thoroughly though.
Originally posted by TheBiob
You could try this tool to change the hitbox.
Do note the warnings and test thoroughly though.


Thanks for the reply TheBioB, your tool works well. But Mario's hitbox while small and small ducking are the same in Vanilla SMW, so changing his small hitbox with your tool, alters it globally instead of only while ducking, unless I am missing something?

I'd like Big Mario (and powerups) to retain their 16x32 hitbox.
I'd like Small Mario to retain his hitbox of 16x16.
I'd like Big Mario + ducking to retain his 16x16 hitbox.
I'd like Small Mario + ducking to change to an 8x16 hitbox, then revert to 16x16 when standing.

I thought it might be something along the lines of calling a routine that checks something like:

>if small = Vanilla 16x16 hitbox
>if small + d-pad down input = hitbox of 8x16
(NOTE: I'm unsure if a ground interaction flag is also needed to prevent Mario's hitbox changing to 8x16 in midair, although I don't believe that it would have any negative effects if it did.)

Obviously Vanilla SMW does something very similar when Big Mario ducks by changing his normal 16x32 hitbox to a 16x16 hitbox when ducking. Can this code by hijacked and modified to achieve results while small? Or modify this routine, copy it to some Freespace, then call upon it while small ducking only?

What I'm trying to accomplish is allowing Mario to avoid ceiling hazards while small ducking, but still be killed by the same hazards if small and not ducking. I also still need him to be vulnerable to attacks, so making him invincible while ducking to avoid collision isn't feasible.

Thanks again for any help or insight on how to achieve this.
Quote
>if small = Vanilla 16x16 hitbox
>if small + d-pad down input = hitbox of 8x16

Obviously Vanilla SMW does something very similar when Big Mario ducks by changing his normal 16x32 hitbox to a 16x16 hitbox when ducking

What the game does is take a couple of variables like ducking, powerup, yoshi etc to calculate an index to a table containing his sizes which isn't that easy to just manipulate without rewriting that part.

The easiest way I can think of that doesn't include messing with that is to take "flagtemplate.asm" and change it to use the new values when he's small and ducking.

For that open "flagtemplate.asm" and change !RAM_flag to
Code
!RAM_flag = "$73 : EOR #$04 : ORA $19"

Including quotation marks (") then change all
Code
BNE .newHitbox

to
Code
BEQ .newHitbox


Use that file as the template file the tool uses and everything you change in the tool for small mario will only affect the ducking small mario and nothing else.