• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Distance and Size Measurements (dat Math!) disjoint update 9.28

Veril

Frame Savant
Joined
Jun 20, 2008
Messages
3,062
Location
Kent Lakes, New York
Calculating distance between hit and hurtbubbles:

The z-offset had me stumped for a little while... but I've figured out a fairly simple way of finding the distance between 2 bubbles, assuming you know the true (bone and move specific) offsets and size of both.

space between 2 bubbles = {((x_offset_1-x_offset_2)^2+(z_offset_1-z_offset_2)^2)+(y_offset_1-y_offset_2)^2}^1/2 - (size_1+size_2)

disjoint variant, requires hurtbox1 and hitbox2 anchored to the same bone = {((x_offset_1-x_offset_2)^2+(z_offset_1-z_offset_2)^2)+(y_offset_1-y_offset_2)^2}^1/2 - (size_1-size_2)

This uses the Pythagorean theorum twice. WTF is Veril doing, you ask? Well you didn't actually ask but I'm answering anyway! The value we're trying to get is the distance between the closest points on each sphere. To find that you draw a straight line connecting the center point on each sphere. These points are represented by their respective coordinates on the grid (x,y,z). If you kids were paying in trigonometry you know that finding the distance between any 2 points can be determined with the simple a^2+b^2=length of the line ^2. But but but its got a z offset, so things are a bit more complicated. The "a" here isn't just the difference between the x offsets, because the length of this line is affected by the z offset. "b", which I'm gonna use to represent the vertical side of the right triangle, is unaffected by the z-offset.

So I use another right triangle to get my "a" value. Yayuhz! As I found with RocketPsi, it'll probably be better if I just scan in a visual explanation of this rather than try to write out this part... w/e...

The size component was simple as per the fact that "size"=radius. So I simply take the 1st part of the equation (which describes the line containing the central points of both spheres) and subtract the sum of size_1 and size_2. What's left is the distance between the surface of these bubbles (which IS the value that actually matters).

if the answer is 0 or negative: the bubbles ARE in contact with eachother.

This equation WILL work without bone specific offsets for finding disjointedness IF the two bubbles are grafted to the same bone (so, like, most attacks). I BEG you people to start posting hurtbox data as I have no way to use Tabuu atm (even at school, stupid net framework!).


Older stuff:

I had wondered how the size value in psa translated into actual hitbox size in the game. Rocketpsi gave me an idea as to how to setup a test for whether the size value was the radius or diameter, and I figured out a pretty simple proof that shows some important facts about these values:

Size = hitbubble radius

Here's how I figured that out (Rocketpsi brought up a different method to get the same result and put me on the right track, <3)

If the x offsets of two hitbubbles, grafted to bone 0, are equal to -x AND x respectively
AND size =x
AND y offset is the same for both
*there is hardly ever a z-offset for a bone 0 move

If size=radius

THAN the two hitbubbles will visibly meet at one point because hitbubble hacks appear very very very slightly larger (glow >.>) than the hitbubbles actually are and if size = radius you would have the point (0,0) as a point on the perimeter of both hitbubbles.

2xradius=diameter (for those who are less math savvy)

Proof: Bowser's dair looping hitbubbles are two size 4 hitbubbles with x offsets of 4 and -4 respectively. They visibly barely overlap in the video for Bowser's hitbubbles. Check the video posted in the visible hitbubbles link thread (good ****) for Bowser and look at the dair.

Circle (since we're ignoring the z-axis because the offset is 0)
hitbubble formula if the bone=0: (x-a)^2 + (y-b)^2+(z-c)^2=r^2
a = x offset
b = y offset
r = size = radius
x and y are variables the range of which is dictated by the radius. Here we have a finite number of values, as per there being a limit to the smallest distances measured in smash (the plank length of smash is .01 lol).

Bowser's dair loop hits:
b = y offset = 0
a = 4 or -4
r = 4

we're looking at distance between 2 hitbubbles on the x-axis, so we're going to have y = 0, and since its a circle any value of y has 2 corresponding x values.

(x±4)^2 = 16 for this to be true x = zero, which means for both these hitbubbles, they will land on the 0,0 point if r=size. Yay!



Known from hitbubble analysis: The distance values used for offsets are equal to those used for size. The smallest unit of distance in the game is .01 (the smallest interval for size and offsets). Knowing how hitbubble size mathematically equates to size in game is extremely useful right now because any move with bone 0 (and that includes a whole ton of MK's) can be modeled on an x/y axis perfectly in regards to exactly where the hitbox is.


So, hopefully this helps ppl :)


formula:
size in PSA=radius of hitbubble
(x-xoffset)^2 + (y-yoffset) = size^2 if bone = 0. (Rocketpsi was talking about doing a bone offset project and that would be amazing if it happened)
you can use this to find real range and graph it using a number of programs, especially if you have access to a school mathlab which I will soon.
hitbubble area = πr^2 (well, really 4/3 • πr^3 but we're ignoring z for now)


:lick:
 
Joined
May 3, 2009
Messages
7,190
I've been waiting a good while for this. Though I'm not savvy enough with PSA to have figured this out on my own.

Good ****.
 

KayLo!

Smarter than your average wabbit.
Joined
Dec 9, 2008
Messages
15,480
Location
Philadelphia, PA
3DS FC
3497-1590-7447
The funny thing is........ I was JUST about to ask how to measure distance in Brawl. Veril with the super mind read.
 

Veril

Frame Savant
Joined
Jun 20, 2008
Messages
3,062
Location
Kent Lakes, New York
dusting off my 7 year old calculus notes (well, 4-7 years old, I started taking calc classes at 16 and took more in college) to figure out how to figure out the range in the x and y axis when accounting for z, at specific values of z.

blech, updates will come on that eventually

sooooo
what I'm working with atm (use the formula from the OP, this formula is beyond our capacity to solve atm because of limited knowledge of the innate offsets of bones not even to mention the location of bones based on model changes associated with move animations)

(x-F(a,n,m,t))^2 + (y-F(b,n,m,t))^2 + (z-F(c,n,m,t))^2 = r^2
a,b,c = x,y,z offsets ....... x, y and z are variables constrained by the radius and offsets
r=radius
n=bone offset from bone 0
m=model change induced offset, is associated with the frame of the move (t)

really I should stop calling hitbubbles spheres, they aren't spheres, they are "balls". This distinction is actually kinda significant mathematically because a sphere is enclosed empty space. w/e
 

Luxor

Smash Champion
Joined
Jul 13, 2009
Messages
2,155
Location
Frame data threads o.0
...Beautiful. Essentially, until we get that last formula worked out, we can quantify disjoint but not overall range for any move, but we can get real total range for bone 0 moves only?
 

Veril

Frame Savant
Joined
Jun 20, 2008
Messages
3,062
Location
Kent Lakes, New York
lalalalala hurtballs?

BTW to find maximum range on a given axis (ex maximum horizontal range would be max displacement on the x axis) set Y=0.
 
Joined
May 3, 2009
Messages
7,190
This is looking awesome, but my brain is in "get the **** to sleep" mode. I'm definitely looking over this tomorrow after school though. I can work with it.
 

Luxor

Smash Champion
Joined
Jul 13, 2009
Messages
2,155
Location
Frame data threads o.0
So we can calc disjoint using the hurtbox values from Tabuu and PSA hitbox size? Sweet. I gotta download that .net framework. We still can't get overall range without knowing where every bone is on every frame of every animation though, right?
 

Veril

Frame Savant
Joined
Jun 20, 2008
Messages
3,062
Location
Kent Lakes, New York
We still can't get overall range without knowing where every bone is on every frame of every animation though, right?
Overall range isn't a good term. I think you mean, "exact positioning of all hurt/hitbubbles, animation frame-specific", for which "coverage" might be a better term.

It will never be possible to get that value without knowing bone offsets, which are animation frame specific. RocketPsi has teased me with hints that this will become a project, but I haven't seen evidence that this has been discussed. I have wanted to work on this but my knowledge in this area is still somewhat limited.

Finding bone location in relation to the TransN bone is probably the way to go.
 

rPSIvysaur

[ɑɹsaɪ]
Joined
Jun 7, 2009
Messages
16,415
I don't have the mathematical skills to be able to translate all those angles. (****in z-axis)

I hope that if someone can work out the angles they might be able to post some sort of formula. But it's really at a stand still at that point.
 

Veril

Frame Savant
Joined
Jun 20, 2008
Messages
3,062
Location
Kent Lakes, New York
dude... seriously

if you OR ANYONE could post the model data from brawlbox/tabuu I can figure it out. z-offset ain't no thang... anymore.

I just got screwed with a job prospect today (and out of the last of my savings traveling to the interview). Help me drown my sorrows in math plz ;_;
 

Veril

Frame Savant
Joined
Jun 20, 2008
Messages
3,062
Location
Kent Lakes, New York
disjoint formula posted. Really simple adjustment (checks space between closest surface point on the hurtbox vs. furthest surface point on hitbox)

collision bubble 1 is the hurtbox, bubble 2 is the hitbox, both are anchored to the same bone for this formula. If you want to calculate disjoint based on separate bones than you need bone specific offsets, which is something I could do if I understood brawlbox better... Gotta get on that.
 
Top Bottom