Solving the HTH Combat Problem - Page 2

Solving the HTH Combat Problem

Requests for features in the spring code.

Moderator: Moderators

User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Couldn't the melee weapon have a range of about twice the footprint size, and the collision sphere cover about only half of the soldier?

IF footprint collision is how things work.. Archers would need good accuracy to hit the smaller sphere though... Hmmm
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

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).
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

Lasers with an AoE of 1 work just fine when they hit a unit directly. And since you can set their intensity very low to make them invisible, and they can move very, very fast while still having good collision detection (using the size= tdf tag), they should be ideal for melee simulation.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

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:

Image

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.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

What about big targets vs small targets? It would look a lot different based on if a giant Gundam was being stabbed vs if a little trooper was being stabbed.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

The only thing that would change, in that scenario, is the vector to the target. As you can see from the illustration, the distance would remain constant on either end of that. Responsibility for making the animation reflect the vector properly is the modder's.
User avatar
hrmph
Posts: 1054
Joined: 12 May 2005, 20:08

Post by hrmph »

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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

@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.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

Yeah, my (not really mine, its been stated before) idea works out just as Argh mentioned. I got halfway decent results playing with the heathawk in gundam using a trigger weapon and a damage dealing weapon, but it was nowhere near reliable enough to use more than rarely.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Could we get away with it for Jedi, nemo? Or would we need something more akin to what Argh is proposing?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

TBH, for it to look decent with Jedi, it'd work fine to use Nemo's solution, and then use an OnlyTargetCategory that prevented them from using their lightsabers on Really Huge Things, which would look lame anyhow.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

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.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Then strike close combat and have them waste each other using force powers. 8)
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Only the Sith Lord has aggressive force powers though.

Besides, people will want to see light sabers, I can assure you.

I can't wait to use the ground flashes which argh used in nanoblobs for the jedi, so that there are flashes whenever the lightsaber hits something... mmm....
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

Argh wrote:...
What we need is a type of weapon called HTHWeapon.
...
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:
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";
Meaning it doesn't even has any way of assigning "Meelee" type to a weapon.
Post Reply

Return to “Feature Requests”