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
heightDamageBonus request
Moderator: Moderators
Re: heightDamageBonus request
Can't the current armor system be used to accomplish this, or HitByWeaponID?
Re: heightDamageBonus request
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.
What would be nice is the ability to get more los as turrets are built on higher gorunds and units being on higher grounds.
Re: heightDamageBonus request
Have you looked in the past few months?Gota wrote:What i would like is for laser based weapons to not get a range bonus when they are on higher grounds.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: heightDamageBonus request
Do not feed the trolls.lurker wrote:Have you looked in the past few months?Gota wrote:What i would like is for laser based weapons to not get a range bonus when they are on higher grounds.
Thats completely definable by the modder, (and iirc lasers always used cylinder targetting) lern2tdf Gota.
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: heightDamageBonus request
Would something like
be close enough? It is indeed based on attacker direction, not hit direction:
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",
No threshold though.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;
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: heightDamageBonus request
you could do it with HitByWeapon as well. just add a percentage onto the damage taken if it comes from above a certain angle.
Re: heightDamageBonus request
It won't be based on attacker direction for long now that better collision detection is in. 

-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: heightDamageBonus request
'better' is entirely arguable, atleast for 077b5 

Re: heightDamageBonus request
It's not that collision isn't detected, it's that it forgets to apply the 'always damage what was hit' rule. Different functions. 

Re: heightDamageBonus request
Could just add damage in UnitDamaged to avoid having to modify tons of COBs...