All throughout the years, there have been complaints about all kinds of unexpected and abnormal manifestations like misses and swingthroughs. Well, this is how melee impact is being calculated in Savage:
- Every model is defined by accurate, finely tuned bounding boxes, which change position with the model, along with the body movements.
- Spinning (turning) your unit has a natural maximum speed limit. You can't spin uncontrollably.
- The weapons have an 'active' tip, a collision detector box positioned at the sharp end.
- Movements are fluid and realistic, for instance gravity prevents the unnatural uphill leaping, and inertia does not allow sudden changes in direction.
- IMAGE 1: The vector of the weapon movement is calculated so that damage only occurs when the weapon hits an enemy while moving along the logical slashing path.
- IMAGE 2: Backhits are not possible (rotating the unit in the opposite direction of the movement of the axe, so that the weapon touches the enemy regardless).
- IMAGE 3: No collision, no damage. Weapons can fit between the enemy's body parts, leading to millimetric and realistic misses.
Isn't this a beautiful, natural, perfect, boring melee system?
Well, scratch that
. We've got none of that crap. We've got this:
We have a system that lets us spin like crazy, doing ten 360's per second, hit with the weapon moving away, don't worry about angle, inclination or which part of the weapon hits. We have uphill leaps, we can leap and bounce and change direction repeatedly and instantly. And what makes it really fun, is the ease of hitting, which would have been impossible without these HUGE, SIMPLE and FEW collision boxes. Who cares about realistic combat physics, this is a game!
So, each unit's hittable area is defined by a bounding box. Even though, surprisingly, in lego's and pred's cases, they're the same: 12 width, 12 length, 32 height, 50 melee range. What measure units these numbers are supposed to be, i don't know
. Let's call them MU. I'll call the boxes around the units passive, and the ones in front of them, active.
The active box is a projection of the passive box with the length specified in the .object file of the given unit, inheriting its width and height. So, basically, the bigger the unit, the wider the active box. This box is the 'weapon'. Actually, the box is longer then the weapon, in most cases. To land a hit on an enemy, you need to have your melee box touching the enemy while the swing is active. Mohican made the crosshair turn red (the color can be changed btw) when the hit is active, meaning in its damaging period.
A swing is defined by a few parameters: duration, active window, combo time etc. For instance the 1st melee swing of the pred looks like this: 2000ms from start to finish (returning to idle position, which can be interrupted if you continue the combo), the impact time is between 600 - 800ms (only 200ms!!), and after 666ms you can spam click so the next combo hit activates. Lego's has 2160ms duration, impact between 567-700ms (133ms!, one third less than pred's), and can continue the combo after 1333ms. So you see, you actually have a window of opportunity of LESS THAN A FIFTH OF A SECOND to make sure your hit (the active box) touches the enemy.
The actual, visible position of the unit doesn't affect the passive box at all. It still is the same, and still there, if you don't move the mouse, regardless of what your unit LOOKS like it's doing, or WHERE it is. This is the pred being idle, notice how it moves out of the box. If you would hit its back full on, it wouldn't count.
So the position of the body/weapon and the state of the animation does not affect collision detection. No matter what the animation shows, the active box will always point forward and only the mouse moving can change its position, not the animation. I've taken pictures of the frames defining the start and the end of the active periods of the swings, and you can see where they start and end visually.
Pred: 1. Widest extension of the arm back. 2. Frame when the hit becomes active. Notice the melee box is nowhere near the claw. 3. Last active frame. 4. The first frame after the swing loses damage status.
Lego: 1. The furthest position of the axe for building momentum. 2. The beginning of the active period. 3. A random frame during the time when the axe is in the active box. 3. The 1st frame after the active period is over.
This seems unfair, but while the pred's swing during the active period describes a full half a circle (180 degrees of motion), the lego's axe barely does 1 quarter (90 degrees).
As you can see in the images below, the weapon/claw can be completely inside the enemy, visually, and still have no effect. You MUST make sure the active box intersects with the enemy's passive box AT THE RIGHT TIME so you can land the hit.
Examples of valid hits: 1. Pred active box barely touching the lego passive box, but touching it nonetheless. A teensy bit more to the right than the (1) image from the No-Hit collage. 2. Pred hitting the lego the first instant the swing becomes active, even if his claw is very far away, like... Australia! 3. The absolute farthest you can be from the enemy when hitting. 4. Backhit. Pred 1st swing from his right to his left, away from lego, then pred moved to its right to intersect the lego's box long AFTER the claw moved away fro the lego. In fact, the swing is close to ending.
Examples of the boxes not intersecting, even if the pred claw is seriously going through the lego, visually: 1&3. Boxes not touching doing 1st swing. 2. Boxes not touching while claw is in the lego box when doing 2nd swing.
It's not all good, tho. The length of the active box, even though it makes the game nicer by not having to be right next to your enemy to hit, has a downside: it can hit through stuff like props or other units. 1. Normal every-day hit. 2. Hit through a tree. 3. Three legos easily fit inside the active box of a pred. 4. Hitting 3 legos at once.
As you know, the most fun to play and hit with are the units with wide animations, with a horizontal, sweeping melee motion. That allows you to SEE when the tip of the weapon hits the enemy and time your swings. That's why the shaman's hammer hit is hard to aim because it has a downward motion - no side view, hard to predict, and the addition of a 2nd horizontal combo hit to the shaman in Evolution makes it easier for him to land shots. That's why the scavenger players tend to hit away from the unit, not in front of it, to follow natural sword motion, outwards, but the collision box is EXACTLY THE SAME. The animation illusion also makes stalker players rarely hit to their sides, but in front of them, where the claws are.
So these bounding boxes and the hit trace system are unchanged in Savage from the dawn of time. The melee collision 'detector' is not a line, it's not the the tip of the weapon, and it's not a tapered box. It's this bigass right angled box as wide as the bounding box of the unit and 5 times as long. That makes it easy to hit, a precise system like the fake one i presented in the beginning would be REALLY frustrating and dull. Anything we would do to change and refine this will only make it WORSE! Every single hit will be harder to land. Anyway, since Mohi added melee interpolation between server frames, swingthroughs simply cannot happen. If it does, it's only in your head!
I hope you managed to read it all the way, and i'll think about adding some duel vids with the bounding boxes on. BB!