Author Topic: Hitbox Diagram  (Read 32038 times)

0 Members and 1 Guest are viewing this topic.

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 833
  • wht u mean
    • Awards
Hitbox Diagram
« on: September 01, 2013, 10:11:50 am »
Below I have included the hitbox diagram (final version II).  The majority of this data was acquired through trial and error testing of the recently released DK source code, along with "debug" in mame.  Dean, Jeremy and Jeff H did a majority, if not all of the data gathering, I simply put together a visual representation of their findings.

In order for a collision to "register", the objects must overlap by a minimum of 1 pixel (the black lines are the width of a single pixel in this diagram).

The hitboxes extend from the virtual center point (green labeled pixel in sprites, black for springs), symmetrically in both directions.


Object         box size        total size

Jumpman      4x6        =       9x13
Fireball         3x2        =        7x5
Foxfire          4x1        =        9x3
Barrel           2x2        =        5x5
Spring          2x2        =        5x5
Pie               8x3        =        17x7  <---Huuj

A few things worth noting: 

1.  Fireballs and Foxfires DO NOT have the same size hitbox. 
2.  The pie hitbox is the largest in the game, it extends 1 pixel beyond the left edge of the pie sprite. 
3.  Jumpmans' X,Y position is offset to the left by a single pixel for sprites with an un-even number of pixels, such as the climbing spirtes. 
4.  The spring hitbox is the same size regardless of a springs "scrunchiness". 
5.  The barrel hitbox is also offset by a single pixel to the bottom and left sides of the barrel sprite.
6.  The movement of Jumpman and other objects often proceeds at a rate greater than 1 pixel per frame; This means an object could potentially "penetrate further" before registering a hit; you may have 2 or more shared pixels on the X or Y field before a collision is "detected".



I have also drawn a few simulated collisions, to demonstrate the idea of the minimum overlap requirement for a "hit". (updated)




« Last Edit: November 08, 2013, 07:45:23 pm by f_symbols »
Member for 11 Years Former DK Remix World Record Holder DK Remix Killscreener DK 1M Point Scorer Blogger DK Killscreener Twitch Streamer

tom bradley

  • Guest
Re: Hitbox Diagram
« Reply #1 on: September 01, 2013, 11:20:25 am »
Wow this Is actually quite interesting Ethan! Did you figure the hitbox range out on your own, or did you find those images?

Offline up2ng

  • Senior Member
  • *
  • Posts: 242
    • Awards
Re: Hitbox Diagram
« Reply #2 on: September 01, 2013, 01:02:17 pm »
Ethan, you should double check your collision drawings.  I'm pretty sure these are all examples of non-collisions.  The pixels in these cases are "tangent" but NOT "overlapping".
Donkey Kong:  1,206,800  Kill Screen
Donkey Kong:  898,600     16-5
D2K:                 380,200     L=9
Donkey Kong Junior:  In Progress
Member for 11 Years DK 1.2M Point Scorer Wildcard Rematch Champion Blogger Former DK Level 1-1 World Record Holder Former DK No-Hammer World Record Holder DK 1.1M Point Scorer Individual Board Record Holder DK 1M Point Scorer Former DK World Record Holder - MAME DK Killscreener Twitch Streamer

Offline marinomitch13

  • Spring Jumper
  • *
  • Posts: 1806
    • How to Play DK
    • Awards
Re: Hitbox Diagram
« Reply #3 on: September 01, 2013, 01:10:49 pm »
That's what I was thinking, Dean. I thought you guys had concluded that it needs a 2 pixel overlap to be a collision. The spring drawing where it is barely hitting Jumpman's right toe definitely looks wrong to me; not enough overlap there.
"Thou hast made us for Thyself, and our heart is restless until it finds its rest in Thee." -Augustine, Confessions.
Member for 11 Years DK Killscreener Blogger Twitch Streamer

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 833
  • wht u mean
    • Awards
Re: Hitbox Diagram
« Reply #4 on: September 01, 2013, 04:27:33 pm »
And another fail  :'( ill fix it again.

I thought that the pixel-thick line had rectified that problem, as it stands now, they all have 1 shared pixel. The pie shows this more clearly; I showed the borders of the outer-pixel, which defines the hit-box, jumpmans' pixel-thick line is overlapping, giving 1 shared pixel.  If they need "2 shared pixels" I can take care of that, but as these drawings stand, They all have a single shared hitbox pixel (same X,Y value).  Tangental "collisions" would show the black lines adjacent to each other, rather than perfectly overlapping (that is the shared pixel, because the line is 1 pixel wide).

Either way, its really an easy fix, assuming the actual hitbox diagram is correct...

Thanks again for the continued input guys, I really want to get this right.
« Last Edit: September 01, 2013, 05:12:27 pm by f_symbols »
Member for 11 Years Former DK Remix World Record Holder DK Remix Killscreener DK 1M Point Scorer Blogger DK Killscreener Twitch Streamer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1529
    • Awards
Re: Hitbox Diagram
« Reply #5 on: September 01, 2013, 04:48:34 pm »

Everything except the spring has one green pixel.  Never noticed that before.

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 833
  • wht u mean
    • Awards
Re: Hitbox Diagram
« Reply #6 on: September 01, 2013, 05:06:38 pm »

Everything except the spring has one green pixel.  Never noticed that before.

Scott, the green pixel is the X,Y value point for the object of interest.  The sprite's do not have green pixels  :P
Member for 11 Years Former DK Remix World Record Holder DK Remix Killscreener DK 1M Point Scorer Blogger DK Killscreener Twitch Streamer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1529
    • Awards
Re: Hitbox Diagram
« Reply #7 on: September 01, 2013, 05:31:30 pm »
Scott, the green pixel is the X,Y value point for the object of interest.  The sprite's do not have green pixels  :P

Ok, so the spring also has a green pixel, but it's been obscured by the hitbox outline?

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline muscleandfitness

  • Pie Kicker
  • Elite Member
  • *
  • Posts: 324
  • Wall jump WR Holder x3
    • Awards
Re: Hitbox Diagram
« Reply #8 on: September 02, 2013, 01:02:42 am »
wht da hell is this...lol
59 wall jumps new world record on mame
55 wall jumps on a cab New World Record
longest convener ride in dk history New World Record
World Record for standing behind oil can until end of lev
A Reverse finish on Rivet  board. 12 ks's HS 992900
Member for 11 Years DK Killscreener Twitch Streamer

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 833
  • wht u mean
    • Awards
Re: Hitbox Diagram
« Reply #9 on: September 02, 2013, 10:26:56 am »
Scott, the green pixel is the X,Y value point for the object of interest.  The sprite's do not have green pixels  :P

Ok, so the spring also has a green pixel, but it's been obscured by the hitbox outline?

No objects have green pixels, I added the different colored pixel to show the "X,Y location" for each object;  We know where the sprite sits on screen, but where, within that sprite, does the game think you are (only a single X,Y value for each object)?  The changed pixels are to show where the " X,Y center" is for each object type.

EDIT: Kappa
« Last Edit: September 02, 2013, 10:47:07 am by f_symbols »
Member for 11 Years Former DK Remix World Record Holder DK Remix Killscreener DK 1M Point Scorer Blogger DK Killscreener Twitch Streamer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1529
    • Awards
Re: Hitbox Diagram
« Reply #10 on: September 03, 2013, 09:57:37 am »
No objects have green pixels, I added the different colored pixel to show the "X,Y location" for each object;  We know where the sprite sits on screen, but where, within that sprite, does the game think you are (only a single X,Y value for each object)?  The changed pixels are to show where the " X,Y center" is for each object type.

Yes, I understood that from the previous explanation.   :P

What I was really asking (observing, actually), was whether you intentionally chose a different designation for the 2 springs, since they are the only enemy objects whose X,Y coordinate is not marked with a green pixel.

My Original Thinking

At first, I thought you might have used a green pixel for each spring's X,Y location, then superimposed the hitbox rectangle on top of it, obscuring the pixel.  I quickly dismissed this possibility, since it suggests that the X,Y position is located along the perimeter of the hitbox (which doesn't really make sense).

My Current Thinking

After looking at the diagram again, I noticed a black pixel centered within the interior of each spring's hitbox.  I'm now assuming that you chose a different color convention (black instead of green) for those X,Y coordinates.  Correct?

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 833
  • wht u mean
    • Awards
Re: Hitbox Diagram
« Reply #11 on: September 03, 2013, 10:06:42 am »
Sorry scott  >:( The change of pixel color was simply a contrast issue; I tried to select the colors that would "pop" out of the sprite, so the viewer would notice it readily :)
Member for 11 Years Former DK Remix World Record Holder DK Remix Killscreener DK 1M Point Scorer Blogger DK Killscreener Twitch Streamer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1529
    • Awards
Re: Hitbox Diagram
« Reply #12 on: September 03, 2013, 10:16:59 am »

Got it.  Thank you for tolerating my idle curiosity.   :)

Phew!  Nice to finally be on the same page.

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Jeffw

  • Guest
Re: Hitbox Diagram
« Reply #13 on: November 07, 2013, 05:12:45 pm »
So, in a few recent games of mine I've been on pie factory wanting to climb up the right side retractable ladder but a freezer has been above me and I wasn't totally sure whether or not there was room to squeeze past it. I figured I should probably learn more about the hotboxes of Mario and the fireballs so that I can always know when it is safe to squeeze past such a fireball.

I'm interested if anyone knows the farthest left that a fireball/firefox can be above a ladder before it becomes unsafe to climb past it on the left, and also the farthest right that it can be before it becomes unsafe to climb past it on the right. Screenshots of the farthest left/right would be preferable if anyone has any for both fireballs and firefoxes. Also, if this can be answered I would like to find out if there's some rule that can be followed so that you always judge when it's safe, something like "It's safe to go whenever the left eye of the fireball is to the right of the right edge of the ladder" (I just made that rule up so I don't know if it's true).

Also, for a freezing fireball at the top right of pie factory, once the fireball has frozen there are two possible places where the fireball can freeze. Typically one spot will be slightly to the left of the retractable ladder and one will be to the right, although these two locations can vary from being far apart away from the ladder to being nearly on top of each other directly on top of the ladder. I would like to know which side of the fireball gives you more room to climb, or in other words, as the 2 freezing locations move closer and closer together does it become unsafe to climb on the left of the fireball or the right of the fireball first?

Lastly, if a freezer has frozen in the leftmost of the two possible freezing locations, I would like to be able to predict based on it's position whether or not it will be possible to squeeze past it on the left side when it moves to the rightmost freezing location, and come up with similar rule for this as above. If this can be figured out it would allow for making it past a freezer that is on the upper right of pie factory without first waiting for a freeze since you could safely climb as soon as it leaves it's leftmost freezing location.

These questions about freezers at the top right of pie factory would also apply to freezers that have reached the top right of barrels. The answers in this case will likely be different than those for pie factory since I doubt the top ladder on barrels has the same positioning relative to the right edge of the top girder as the retractable ladder's positioning relative to the right edge of the screen on pie factory.

If nobody can answer any of these I'll look into this stuff myself.

Offline marinomitch13

  • Spring Jumper
  • *
  • Posts: 1806
    • How to Play DK
    • Awards
Re: Hitbox Diagram
« Reply #14 on: November 07, 2013, 05:27:41 pm »
That's tough. One would also have to systematize a way to make sure jumpman is positioned in precisely the same way every time at the top of the ladder.
"Thou hast made us for Thyself, and our heart is restless until it finds its rest in Thee." -Augustine, Confessions.
Member for 11 Years DK Killscreener Blogger Twitch Streamer