Feature Suggestion: Hitbox

Are you experiencing a problem? Maybe you can't get your scripts to do what you need, or are frustrated by a feature you just can't seem to get working? Let us know about it here and we will try our best to help you out!
Post Reply
CeeJay
Posts: 224
Joined: Sat Jan 26, 2013 9:56 am

Feature Suggestion: Hitbox

Post by CeeJay »

Not sure where to stick this but I'll put it here seeing as the feature suggestion section is locked.

How about adding something like HITBOX_RADIUS and HITBOX_HEIGHT for THINGS ? If present, it won't affect the creatures height and width but only its actual hitbox (where you need to hit it to make a dent). If it is omitted, the RADIUS and HEIGHT will be used in its place instead, like normal.

This would open up a few possibilities, such as large armored creatures with small weak spots. Also, for Wolf3D this would allow enemies to be 64x64 in size (keeping the "blocky" nature of the original game) but with more appropiate hitboxes.

Just a thought.

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: Feature Suggestion: Hitbox

Post by Marscaleb »

I've thought from time to time that it would be nice if you could set up weak-spots. Mostly just so you could do head-shots, maybe "limbs" and "torso" regions too. It would be great if it responded to angles too, so you could have enemies with shields.
It would be a more complicated system, but if you were to go down this path, why not set that up instead? You could define "hit-regions" and then establish the effects they have with various weapons.

The way I see this working is you define a hit-region for the game to check. You define that hit-region's height, radius, height from the ground, and the angles where it is viable. Then specify the effects that region has according to what kind of weapons. (So so can have headshots or weakpoints only work with certain kinds of weapons, eg, can't get a headshot with an explosion.) You could list multiple hit-regions for the game to check for (I would assume the game would check them in the sequence you give them, so if there is any overlap you can make sure that certain things are checked first. The game would go through each of the character's hit-regions in sequence until it finds something it actually connects with.)
At the end of the list there would be a "default" region. (This would be assumed so if nothing is listed it doesn't cause an error.) The default region doesn't specify any radius or height or angles, but you can add it to just override the default reaction to getting hit with a weapon. So for example if they are armored except for that weak spot the default section could be set to deflect all shots. Although as I think about it further, that might be superfluous because you could just set up another hit-region at the end of the list that covers all angles and sizes if you wanted to do that. Eh, either way.

You'd want to be able to make (certain) weapons deal a damage modifier, or a set amount of damage, play a particular sound effect, (possibly have a generic "deflect" option that automatically deals no damage and plays a deflect sound,) pass through as if nothing was there, or trigger something in an external script within the character or the weapon. Ideally you should be able to set all of those to happen at once, so you can stack effects if needed. Oh and maybe have the weapon react as if it hit a wall, so if you have a grenade it can bounce off.

It's a more complicated system to be sure, but it would add a lot of flexibility. It would be fantastic for boss battles.

User avatar
Corbachu
Site Admin
Posts: 778
Joined: Fri Jun 08, 2012 11:22 am
Gender:
Contact:

Re: Feature Suggestion: Hitbox

Post by Corbachu »

There is a WEAKNESS feature that is similar:
WEAKNESS feature allows a monster to receive more damage from certain attacks than others. You can also specify a zone where the monster must be hit (when hit in other places, the weakness does not apply). The weakness zone can be a height range (in percentages) and/or an angle range (in degrees).

The weakness feature requires 'WEAKNESS.CLASS' to be present,
specifying what attack classes the monster is weak against.
Note that it will also _override_ any IMMUNITY or RESISTANCE
that the monster has (except for the INVULNERABLE special).

The following example shows all the commands. Everything
except 'WEAKNESS.CLASS' is optional.

WEAKNESS.CLASS=ABC;
WEAKNESS.HEIGHTS=75%:100%;
WEAKNESS.ANGLES=150:210;
WEAKNESS.MULTIPLY=3.0;
WEAKNESS.PAINCHANCE=100%;

When a thing is hurt via the weakness feature, it will try to
enter 'WEAKPAIN' states, but if it doesn't have them then the
normal PAIN states are used.

When a thing is killed, it will try to enter 'WEAKDEATH' states,
but if they don't exist then it will try OVERKILL states, and
finally it falls back to the normal DEATH states.
I have used this before in Hypertension to make headshots blow off heads, low blasts to blow off legs, etc. Seems its not in the DDF docs currently - I will add it soon.
\(סּںסּَ` )/ۜ

CeeJay
Posts: 224
Joined: Sat Jan 26, 2013 9:56 am

Re: Feature Suggestion: Hitbox

Post by CeeJay »

Yes, I know about the WEAKNESS feature.

What I am talking about is different. You have the height and width of the creature which could be anything, with what I am suggesting you make the creature's damage area independant from the height/width of the creature (normally it is the same) with the new command.

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: Feature Suggestion: Hitbox

Post by Marscaleb »

Coraline wrote:There is a WEAKNESS feature that is similar:
Oh! That's pretty useful!
The only thing that seems to be missing is an ability to let a shot pass through the object like it wasn't there, and an ability to specify a smaller radius.
The latter I would think is fairly important. Otherwise you could score a headshot if you fire past someone's shoulder. Plus it seems reasonable that a game playing like doom should count accuracy according to how close to the centerline of the object you hit.

Return to “Support and Help”