heightDamageBonus request

heightDamageBonus request

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

heightDamageBonus request

Post by Guessmyname »

Basically, it's a request to make weapons do more damage depending on how high up above their opponent they are. This is for games like S44, who could then represent weak upper armour and to all that would like to give further advantages to high ground.

The current plan is for it to work something like this:

Three tags in the mod definitions (heightDamageBonus, heightDamageThreshold and heightDamageScalar) that states whether or not the mod uses this feature, a threshold for angle calculations and a scalar for the bonus.

How it works
Damage dealt = Weapon damage for that armour class * vertical angle between the two units * heightDamageScalar, with two additional rules:
If vertical angle * heightDamageScalar is less than 1, the height bonus is not applied.
The lower of the two units has no bonus applied

Example One
Say Unit A is on higher ground than Unit B, but a long way away (for the sake of argument, assume it's hyperaccurate guided artillery that won't miss). Whilst higher than Unit B, it is a long way away: in sensible terms, due to projectile drop and all that, this would probably be a side-on hit if it made contact. However, because he take the angle, not the 'how further up the y-axis is A than B?' value, this is taken into account, and Unit A doesn't score stupid amounts of extra damage. It gets some though (however miniscule), so it's still worth sticking it high up on that hill.

Example Two.
Unit A and Unit B are in a ravine. A is the outside of the ravine, firing in. B is at the bottom, firing back. They are quite close to each other.
Assuming Unit A = Unit B (ie they're the same unit type), Unit A should win, because it gets the damage bonus, and the bonus will be higher than in Example One even if the ravine is actually smaller than the hill of Ex. One because we're taking angle, not the vertical distance
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: heightDamageBonus request

Post by Argh »

Can't the current armor system be used to accomplish this, or HitByWeaponID?
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: heightDamageBonus request

Post by Gota »

What i would like is for laser based weapons to not get a range bonus when they are on higher grounds.
What would be nice is the ability to get more los as turrets are built on higher gorunds and units being on higher grounds.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: heightDamageBonus request

Post by lurker »

Gota wrote:What i would like is for laser based weapons to not get a range bonus when they are on higher grounds.
Have you looked in the past few months?
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: heightDamageBonus request

Post by Pressure Line »

lurker wrote:
Gota wrote:What i would like is for laser based weapons to not get a range bonus when they are on higher grounds.
Have you looked in the past few months?
Do not feed the trolls.

Thats completely definable by the modder, (and iirc lasers always used cylinder targetting) lern2tdf Gota.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: heightDamageBonus request

Post by Evil4Zerggin »

Would something like

Code: Select all

flankingBonusMode = 3, --mode 1 would probably work too
flankingBonusMobility = 0,
flankingBonusMobilityAdd = 0,
flankingBonusMax = 1.25,
flankingBonusMin = 0.75,
flankingBonusDir = "0 -1 0",
be close enough? It is indeed based on attacker direction, not hit direction:
Unit.cpp wrote: const float3 adir = (attacker->pos - pos).Normalize();
[...]
float3 adirRelative;
adirRelative.x = adir.dot(rightdir);
adirRelative.y = adir.dot(updir);
adirRelative.z = adir.dot(frontdir);
[...]
damage *= flankingBonusAvgDamage - adirRelative.dot(flankingBonusDir) * flankingBonusDifDamage;
No threshold though.
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: heightDamageBonus request

Post by Pressure Line »

you could do it with HitByWeapon as well. just add a percentage onto the damage taken if it comes from above a certain angle.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: heightDamageBonus request

Post by lurker »

It won't be based on attacker direction for long now that better collision detection is in. :P
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: heightDamageBonus request

Post by Warlord Zsinj »

'better' is entirely arguable, atleast for 077b5 :P
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: heightDamageBonus request

Post by lurker »

It's not that collision isn't detected, it's that it forgets to apply the 'always damage what was hit' rule. Different functions. :P
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: heightDamageBonus request

Post by KDR_11k »

Could just add damage in UnitDamaged to avoid having to modify tons of COBs...
Post Reply

Return to “Feature Requests”