YesNoOk
avatar

Rezizing a hitbox and / or projectile (Read 2915 times)

Started by Shana Fenix, October 17, 2016, 07:58:51 am
Share this topic:
Rezizing a hitbox and / or projectile
#1  October 17, 2016, 07:58:51 am
  • **
  • Enpatsu Shakugan No Uchite
    • Germany
Hello there!
I'm making an attack that expands a flame pillar's size over time depending on a variable that counts up.
The problem with that it that I have yet to find a way to either:
1. Resize a projectile (I am currently displaying a growing explod instead)
or 2. Resize the helper or hit its hitbox that all of this runs in.

It just doesn't do when the pillar grows but the damage radius doesn't ; )
I could, of course, go and do the trial and error process of resizing the hitbox in each frame of the animation but that would take ages to do so I thought I might as well ask here for a possible solution while I work on someething else instead.
Re: Rezizing a hitbox and / or projectile
#2  October 17, 2016, 08:10:42 am
  • *****
  • Estoy siempre listo para un desafĂ­o.
    • Puerto Rico
    • im41784@yahoo.com
All you can do is resize it manually on each frame and it wouldn't take that long to do
Re: Rezizing a hitbox and / or projectile
#3  October 17, 2016, 08:20:01 am
  • **
  • Enpatsu Shakugan No Uchite
    • Germany
All you can do is resize it manually on each frame and it wouldn't take that long to do

Well, it depends on the length of the animation and how long it takes me to get the right width for it.
Re: Rezizing a hitbox and / or projectile
#4  October 17, 2016, 03:25:04 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
The hitboxes have to be done manually.

So box size is going to be a ratio thing.  If your Explod is scaling from 1.0 to 2.0 in 4 seconds (240 ticks), then you could calculate the correct box size at 240... then just divide to get all the inbetweens.

Example
scale 1.0 (Tick 0)
Box Size: 20 x 30

scale 2.0 (Tick 240)
So multiply the original dimensions by 2.
Box Size: 40 x 60

In this case instead of 240 1-tick anims for the hitbox, you would probably want to chop it down to just 12 or 24... or whetever, depending how much time you want to spend smoothing it out.

So divide by 12... this makes each frame a 20 tick duration.  For X you have a difference of 20, so divide that by 12 - this is how much must be added to each frame.  Repeat for Y value - difference is 30, so divide by 12.

Tick 0 - 20 x 30
Tick 20 - 21 x 32
Tick 40 - 23 x 35
Tick 60 - 25 x 38

...etc

If you know the basics in MS Excel you could make a formula to calculate all the values rather than punching a calculator.


If it's a round object you'll probably have to go in and add smaller boxes afterwards to smooth out the edges.  I don't think these can be calculated.


*EDIT*

So basically just figure out the first dimensions, the final dimensions, then divide the difference for each value.

Tick 0
Clsn1: 1
  Clsn2[0] = -44, -24, 20, 34

Tick 240
Clsn1: 1
  Clsn2[0] = -88, -48, 40, 68

So Tick 120 would be
Clsn1: 1
  Clsn2[0] = -66, -36, 30, 51

Last Edit: October 17, 2016, 03:46:22 pm by altoiddealer
Re: Rezizing a hitbox and / or projectile
#5  October 17, 2016, 06:42:58 pm
  • ****
    • Peru
I seem to recall the AngleDraw sctrl enlarges the sprites along with the collision boxes, though.

type = AngleDraw
trigger1 = 1
value = 0
scale = yourfloatvar,yourfloatvar

From there, you only need to figure out how much you want your fvar to grow over time.

Try it out and let me know if it works.
Millie, "Ozy and Millie" said:
"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."
Re: Rezizing a hitbox and / or projectile
#6  October 17, 2016, 07:04:04 pm
  • ******
You don't have to increase the hitbox size in every frame, only frames where there's a big enough difference to justify increasing the area it covers. Like, maybe increase the size of the hitbox every 15-20 frames instead.
Re: Rezizing a hitbox and / or projectile
#7  October 17, 2016, 09:42:13 pm
  • *****
  • Shame on you!
    • USA
If you use mugen to smoothly scale it up you might not know when to scale your hitboxes up.
One thing I did in my Sub-Zero edit was I duplicated the projectile inside of Fighter Factory 3.
Then I used FF3's image editor to resize the second projectile. Saved, and I used Onion Skin to see the new size of the sprite while in the animation with the original sprite. I just mapped out the hitboxes using the 2 reference points. It worked out perfect.
In my case I was sizing down but it'll work the same.

You could do altoiddealer's math or use the visuals and just eyeball it. Niitris is right though, one or two pixels isn't anything that needs to be mapped out.

I did something similar to this in my Samus. She has the charge beam. I just used debug with Ctrl+C on. Once it got to the next level I paused the screen, took notes, exited and edited the animation. Just did trial and error a few times and it's good enough imo. (Samus is still bad though <_<)
vVv Gouken718 vVv
Re: Rezizing a hitbox and / or projectile
#8  October 18, 2016, 12:28:38 am
  • **
  • Enpatsu Shakugan No Uchite
    • Germany
Thanks everyone. These tips should get me rollin'. ; )