[patch] dynamic damage based on range - Page 2

[patch] dynamic damage based on range

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

MadRat wrote:This is a product of range and not flight-time, so high arc weapons won't be probably the best to use with this tag. Or am I missing something?

The first thought I had when reading about these new tags was for perhaps tank-vs-tank and battleship-vs-battleship duels. I like the inverse curve especially in that case.
I was about to say that the 'distanceTravelled' is 2 dimensional rather than 3, but actually i could well be wrong there. At any rate, it is the direct distance between two points - i.e. it does not follow the parabolic curve of a HT ballistic weapon, but rather is the point-to-point distance... however it it is in all 3 dimensions then with HT it's possible for the distance between the fire point and the top of the curve to be greater than the distance between the fire point and the end point. :| Perhaps it would be better to use 2d distance?

edit: actually, for a ballistic HT weapon it makes sense for the damage to first decrease than increase as the projectile speeds back up on its way back to the ground.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

It's the simplest way I could think of... I don't really want to measure the time the projectile traveled. I've already thought of the issues with non-LOS weapons but that's what you have a curve for... even though there are some issues like the normal curve will never reach the 0 point pr the inverted will never do full damage, in some cases.
FLOZi wrote:Perhaps it would be better to use 2d distance?
Hmm yeah. There should be some way to set the y value of the start pos and current pos to 0.


I thought of making the min damage a definable value rather than a modifier but you will have different types of damage.
For example weapon X does 50 damage against infantry (no armor) but only 30 to vehicles, min damage is 25. It would be 25 for both cases then so that is why I went with a modifier instead.

What I could do is the following:
dynDamageMin would only apply to the first damage type and all the others would be applied in a percentual manner. So it stays as it is, only that you can work with a number.


The patch file should be uptodate now.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

rattle wrote:I thought of making the min damage a definable value rather than a modifier but you will have different types of damage.
For example weapon X does 50 damage against infantry (no armor) but only 30 to vehicles, min damage is 25. It would be 25 for both cases then so that is why I went with a modifier instead.
Very good point
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

I've updated the .patch file again and added a method to CWeaponDefHandler rather than using a huge block of code whenever helper->Explode(...) is called.

Also I added the dynDamageRange tag, read the first post for other changes.

Works with beamlasers and lightning weapons too now.

All I need now is some people willing to test it if it works right because I lack the time.

Testbuild:
http://rattle.from-hell.net/spring/patc ... tbuild.rar
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Is the fact that almost all weapons exceed their range going to be a problem? Especially missiles, which can easily go three or four times the distance beyond their range.

Can you actually exceed 100% of the damage if you go beyond the range when using an inverse curve?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

No, traveledDistance is limited to the range tag so your weapon shouldn't do more than 100% damage. Negative damage doesn't happen either.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Good work, rattle.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Has this been comitted yet?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Hmm no.

edit:
Now it is in the mantis...
http://spring.clan-sy.com/mantis/view.php?id=528
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

edit: ignore this, i was DOIN IT WRONG
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Using these tags makes the weapon have impulse even if impulse was disabled (impulsefactor=0). That's a serious issue, it makes my units go flying left and right.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Uh, what? I never noticed that in all my testing of it.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Post Reply

Return to “Engine”