Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - Collision Detection | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
francoispress

Goomba
Level: 8

Posts: 3/30
EXP: 2158
For next: 29

Since: 05-14-05

Since last post: 168 days
Last activity: 167 days
Posted on 05-14-05 04:39 PM Link | Quote
How is collision detection done in Super Mario World? This has always intrigued me. Is it tile-based or sprite-based. Perhaps I will get into Super Mario World because it could attract more tourists to my site. It also looks like fun.
Smallhacker

Green Birdo

SMW Hacking Moderator
Level: 68

Posts: 1613/2273
EXP: 2647223
For next: 81577

Since: 03-15-04
From: Söderhamn, Sweden

Since last post: 10 hours
Last activity: 9 hours
Posted on 05-14-05 06:48 PM Link | Quote
It's tile based when it comes to tiles and sprite based when it comes to sprites.


(edited by Smallhacker on 05-14-05 01:49 AM)
francoispress

Goomba
Level: 8

Posts: 6/30
EXP: 2158
For next: 29

Since: 05-14-05

Since last post: 168 days
Last activity: 167 days
Posted on 05-14-05 07:31 PM Link | Quote
Originally posted by Smallhacker
It's tile based when it comes to tiles and sprite based when it comes to sprites.


What would you concider tile based? Walls, blocks, ground, etc? I'm still confused.
Juggling Joker

Boomerang Brother
SMW Hacking Moderator
Yeah, JAMH is still being worked on.
Level: 48

Posts: 832/1033
EXP: 811447
For next: 12096

Since: 03-15-04
From: Wyoming

Since last post: 2 days
Last activity: 3 hours
Posted on 05-14-05 07:55 PM Link | Quote
The only collisions that matter to the game is when a sprite touches a Layer 1 (or Layer 2, in some levels) object. Everything else is ignored, at least as far as I know.
Smallhacker

Green Birdo

SMW Hacking Moderator
Level: 68

Posts: 1614/2273
EXP: 2647223
For next: 81577

Since: 03-15-04
From: Söderhamn, Sweden

Since last post: 10 hours
Last activity: 9 hours
Posted on 05-14-05 08:19 PM Link | Quote
Don't forget that (most) sprites turns around if it collides with another sprite. Also, don't forget Mario to sprite collision.
Juggling Joker

Boomerang Brother
SMW Hacking Moderator
Yeah, JAMH is still being worked on.
Level: 48

Posts: 837/1033
EXP: 811447
For next: 12096

Since: 03-15-04
From: Wyoming

Since last post: 2 days
Last activity: 3 hours
Posted on 05-14-05 09:42 PM Link | Quote
Yeah, I forgot Sprite to Sprite. Silly me. And I consider Mario a sprite, albeit a little more unique than the rest of the bunch.
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 869/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 05-15-05 01:01 AM Link | Quote
The SNES does not have hardware collision detection, so it must instead utilize the screen location of each sprite. There's usually a "box" of coordinates programmed to match each sprite's size (though in SMW's case, each box is probably 16x16, aside from special sprites like Rexes and Dino-Rhinos), and if one sprite's collision box enters another's, the game runs an appropriate routine (hurt Mario, flip sprite, power-up, etc.).

For a good example of collision detection boxes, play Vectorman for the Genesis and press ABACAB while paused. The little lights that appear indicate where collision detection will occur.
DisruptiveIdiot

Paratroopa
Level: 21

Posts: 93/147
EXP: 42614
For next: 7329

Since: 04-09-04

Since last post: 4 days
Last activity: 5 hours
Posted on 05-15-05 05:07 AM Link | Quote
Originally posted by BMF3PO
The SNES does not have hardware collision detection, so it must instead utilize the screen location of each sprite. There's usually a "box" of coordinates programmed to match each sprite's size (though in SMW's case, each box is probably 16x16, aside from special sprites like Rexes and Dino-Rhinos), and if one sprite's collision box enters another's, the game runs an appropriate routine (hurt Mario, flip sprite, power-up, etc.).

For a good example of collision detection boxes, play Vectorman for the Genesis and press ABACAB while paused. The little lights that appear indicate where collision detection will occur.


How complicated is the collision code? Has it been mapped out fully yet? Just curious, I might have some ideas to fiddle with if they're feasible.
Sukasa

Boomboom
Error 349857348734534: The system experienced an error.
Level: 57

Posts: 556/1981
EXP: 1446921
For next: 39007

Since: 02-06-05
From: *Shrug*

Since last post: 6 days
Last activity: 1 day
Posted on 05-15-05 11:39 PM Link | Quote
AFAIK It has not, although I would think that it wouild work something like the example below.

'get the sprite's size

(commented out becaue the code for the tables I was using was rather large)

'now check it with the player's X coordinate.

(the code is almost the same as the snippet below)

'Now, if the the X coords were reasonably close, check the Y co-ords

if Px > Ex then
if (px - Ex) < es AND (px - ex) < ps then coll = TRUE
else
if (ex - px < es AND (ex - px) < ps then coll = TRUE
End If

'now do the damage routine if there is a collision...
francoispress

Goomba
Level: 8

Posts: 14/30
EXP: 2158
For next: 29

Since: 05-14-05

Since last post: 168 days
Last activity: 167 days
Posted on 05-16-05 08:46 AM Link | Quote
Originally posted by BMF3PO
The SNES does not have hardware collision detection, so it must instead utilize the screen location of each sprite. There's usually a "box" of coordinates programmed to match each sprite's size (though in SMW's case, each box is probably 16x16, aside from special sprites like Rexes and Dino-Rhinos), and if one sprite's collision box enters another's, the game runs an appropriate routine (hurt Mario, flip sprite, power-up, etc.).

For a good example of collision detection boxes, play Vectorman for the Genesis and press ABACAB while paused. The little lights that appear indicate where collision detection will occur.


So it's tile based just like I thought. Wouldn' that have and effect on the graphics? Oh, but wait... graphics are stored as tiles anyways. I'm wondering if these collision detections take into account transparent areas. And why does Mario or any of the other characters always hit platforms, ground, pipes, or walls perfectly? Why is there not overlap of the 2 sprites when the collision detection occurs? What would be your approach to this?
Sukasa

Boomboom
Error 349857348734534: The system experienced an error.
Level: 57

Posts: 559/1981
EXP: 1446921
For next: 39007

Since: 02-06-05
From: *Shrug*

Since last post: 6 days
Last activity: 1 day
Posted on 05-16-05 09:30 AM Link | Quote
actually, if you look very closely, mario overlaps all other objects and spries by one pixel before he interacts with them.
francoispress

Goomba
Level: 8

Posts: 23/30
EXP: 2158
For next: 29

Since: 05-14-05

Since last post: 168 days
Last activity: 167 days
Posted on 05-17-05 12:48 AM Link | Quote
Originally posted by Darkflight
actually, if you look very closely, mario overlaps all other objects and spries by one pixel before he interacts with them.


Hmm... but how does one deal with the collision detection between sprites that are not box-like. You know, bubbles. How are their collision detection mapped? Is it safe to say that the bounding box would be completely inside the bubble?
Sukasa

Boomboom
Error 349857348734534: The system experienced an error.
Level: 57

Posts: 566/1981
EXP: 1446921
For next: 39007

Since: 02-06-05
From: *Shrug*

Since last post: 6 days
Last activity: 1 day
Posted on 05-17-05 05:14 AM Link | Quote
They still have the box-shaped collision perimeter, just their ASM deals with it instead.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Super Mario World hacking - Collision Detection | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.017 seconds.