Language…
14 users online: anonimzwx, BUX88, DanMario24YT, deported,  DeppySlide, Domokun007, ForthRightMC, hhuxy, Knight of Time, koffe190, lean4, Pizzagamer9791,  Ringo,  yoshi3706 - Guests: 303 - Bots: 259
Users: 64,795 (2,375 active)
Latest user: mathew

Questions about interactions

I have some questions about the original collision system:

1) the position of a sprite, where’s pointing? Top left, bottom left, right top or bottom right or another place??

2) the same question 1) but for mario because it looks that have a different rule for position.

3) if a hit box have the disp = (xdisp, ydisp) and the sprite position is (x,y), the position where start the hit box is (x+xdisp,y+ydisp) or (x+xdisp,y-ydisp)??

4) i know that the original routine of interaction works with fixed hit boxes that are hard coded on the rom, is there a way to use it with a custom box without use an specific patch?? In the case that the answer is yes, is there a way that others sprites can check that custom hitbox?

5) is there a way to use custom interaction points when you use the standar routine that check the floor or walls, without use a patch??

6) how works the interaction with slide blocks?

------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources


1) Typically top-left of its hitbox, although graphics can be positioned anywhere relative to that point. This lua script can display the hitboxes on sprites for you (only for the standard box sizes though).


2) Same deal for Mario, just his hitboxes are disjoint from the point as well. Regardless of whether he's big or small, though, the point that is considered his position remains unchanged. I believe it's 2 pixels left and 5 pixels above where his big object hitbox appears.


3) It's always addition. So if a hitbox has an X displacement of FE and Y displacement of 02, and the sprite's position is (5,5), then its hitbox starts at (3, 7).


4) For sprite hitboxes, yes. The original game even does it in certain places (such as the net gate, at $01BAFD). Just set the misc RAM addresses from the GetSpriteClippingA / GetSpriteClippingB routines manually. They are:
Code
GetSpriteClippingA:
	$04 - Clipping X displacement, low
	$05 - Clipping Y displacement, low
	$06 - Clipping width
	$07 - Clipping height
	$0A - Clipping X displacement, high
	$0B - Clipping Y displacement, high

GetSpriteClippingB:
	$00 - Clipping X displacement, low	
	$01 - Clipping Y displacement, low
	$02 - Clipping width
	$03 - Clipping height
	$08 - Clipping X displacement, high
	$09 - Clipping Y displacement, high

For object hitboxes, though, no. Those are handled within the object interaction routine itself, so you'll have to work out a patch to pass a hitbox into that.


5) For object interaction? Not without a patch. Though I'm not entirely sure what you mean.


6) By "slide blocks", do you mean slopes? Slopes are handled by just indexing a series of tables from $00E4B9 through $00E831 (see that general area in the ROM map for more details).
Sliding itself is handled as part of Mario's physics routine, and speeds for each type of slope are part of a series of large tables starting at $00D2CD.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer