Solving the HTH Combat Problem
Moderator: Moderators
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
If weapons only damage when it's area of effect hit's the center of the target, it is, indeed, horendous.
That would explain my complaints that weapons do not deal the intended amounts of damage, varying especially when targeting enemies of diferent sizes.
Although it wouldn't explain why beam weapons seem to consistently deal 80% (made up value) of intended damage while BeamLaser weapons vary from 40% to 80% acording to the enemy, this with both the Beam and the Laser having the same traditional AreaOfEffect of 8 (which wouldn't ever damage, for example, a Golliath).
That would explain my complaints that weapons do not deal the intended amounts of damage, varying especially when targeting enemies of diferent sizes.
Although it wouldn't explain why beam weapons seem to consistently deal 80% (made up value) of intended damage while BeamLaser weapons vary from 40% to 80% acording to the enemy, this with both the Beam and the Laser having the same traditional AreaOfEffect of 8 (which wouldn't ever damage, for example, a Golliath).
I have a solution. And it's simple, and should be easy to program.
What we need is a type of weapon called HTHWeapon.
It works like this:

And the code would look something like this pseudocode:
Get location of target.
Weapon Range = Weapon Range + Target Radius + Attacker Radius
Seek normal solution allowing firing to happen
When condition = true, fire.
This weapon, in short, would always detonate at the center of the target, no matter how large a disparity there was between the two objects' relative sizes. The range tag would be the maximum range- adjusting it down to 0 would mean that the Attacker's Radius would have to come into contact with the Target's Radius. Designers would probably want to keep that a bit larger, of course.
What we need is a type of weapon called HTHWeapon.
It works like this:

And the code would look something like this pseudocode:
Get location of target.
Weapon Range = Weapon Range + Target Radius + Attacker Radius
Seek normal solution allowing firing to happen
When condition = true, fire.
This weapon, in short, would always detonate at the center of the target, no matter how large a disparity there was between the two objects' relative sizes. The range tag would be the maximum range- adjusting it down to 0 would mean that the Attacker's Radius would have to come into contact with the Target's Radius. Designers would probably want to keep that a bit larger, of course.
Does the way that Nemo mentioned work? With the 'attack' animation (sword swinging, whatever) being played when the invisible laser goes off it will look like melee combat. But the weapon might intersect with the model it is attacking. Has anyone tried this? (I understand this is more of a temporary bandaid solution rather than the permanet fix that argh is suggesting) You should write a patch argh, this seems simple compared to all the particle effects beauties.
@Hrmph:
Nemo's solution has been tried, and found badly wanting. Because of size disparities between radii, one either ends up with solutions that are bumping collision spheres but never satisfying, or with solutions where a valid hit can be generated, but too large of a gap remains between units to look decent.
As for writing a patch... I am definately not averse to that, but I will need to figure out how I'm going to get the shooter's radii, as well as the defender's radii.
Nemo's solution has been tried, and found badly wanting. Because of size disparities between radii, one either ends up with solutions that are bumping collision spheres but never satisfying, or with solutions where a valid hit can be generated, but too large of a gap remains between units to look decent.
As for writing a patch... I am definately not averse to that, but I will need to figure out how I'm going to get the shooter's radii, as well as the defender's radii.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Luke did wipe out an ATAT on his own, and a lightsaber was involved in the process 
But what about when two jedi clash? Would the combat look realistic/be logical? We got it working quite well in OTA, but none of that would transfer to spring, I daresay, especially when people will be wanting to zoom in nice and close and watch the jedi go at it.

But what about when two jedi clash? Would the combat look realistic/be logical? We got it working quite well in OTA, but none of that would transfer to spring, I daresay, especially when people will be wanting to zoom in nice and close and watch the jedi go at it.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
We already have the class CMeeleeWeapon. Although i seem to remember something around the "isn't implemented" some time ago. Indeed, weapon loader, CWeaponDefHandler::ParseTAWeapon in:Argh wrote:...
What we need is a type of weapon called HTHWeapon.
...
https://taspring.clan-sy.com/svn/spring ... andler.cpp
has:
Code: Select all
if(weaponDefs[id].dropped) {
weaponDefs[id].type = "AircraftBomb";
} else if(weaponDefs[id].vlaunch){
weaponDefs[id].type = "StarburstLauncher";
} else if(beamlaser){
weaponDefs[id].type = "BeamLaser";
} else if(weaponDefs[id].isShield){
weaponDefs[id].type = "Shield";
} else if(weaponDefs[id].waterweapon) {
weaponDefs[id].type = "TorpedoLauncher";
} else if(weaponDefs[id].name.find("disintegrator")!=string::npos) {
weaponDefs[id].type = "DGun";
} else if(lineofsight) {
if(rendertype==7)
weaponDefs[id].type = "LightingCannon";
else if(beamweapon)
weaponDefs[id].type = "LaserCannon";
else if(weaponDefs[id].visuals.modelName.find("laser")!=std::string::npos)
weaponDefs[id].type = "LaserCannon"; //swta fix
else if(/*selfprop && */weaponDefs[id].visuals.smokeTrail)
weaponDefs[id].type = "MissileLauncher";
else if(rendertype == 4 && color == 2)
weaponDefs[id].type = "EmgCannon";
else if(rendertype == 5)
weaponDefs[id].type = "Flame";
// else if(rendertype == 1)
// weaponDefs[id].type = "MissileLauncher";
else
weaponDefs[id].type = "Cannon";
}
else
weaponDefs[id].type = "Cannon";