2025-07-22 20:57 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003368Spring engineGeneralpublic2012-12-14 04:23
Reportersilentwings 
Assigned TojK 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version91.0.1+git 
Target Version92.0Fixed in Version 
Summary0003368: weapons with noexplode=1 cause damage indefinately
DescriptionWhen a weapon with noexplode=1 is fired into a unit, the projectile carries on doing (damage and lives on) to the unit long after it has passed through the unit.

The projectile seems like it is somehow trapped inside the unit and will vanish and stop doing damage if the unit walks out of the range from which the weapon was originally fired.

Replay is with the dgun of the decoy com in BA, on DSD with 91.0.1-588. This is the bug DeadnightWarrior talks about in http://springrts.com/phpbb/viewtopic.php?f=12&t=29155&start=20#p533167.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • ? file icon 20121209_222803_DeltaSiegeDry_91.0.1-588-g723101f develop.sdf (41,640 bytes) 2012-12-09 23:36
  • jpg file icon dgun_bug.jpg (337,524 bytes) 2012-12-10 22:12
  • diff file icon mantis3368-fix.diff (1,118 bytes) 2012-12-11 15:56 -
    diff --git a/rts/Sim/Projectiles/ProjectileHandler.cpp b/rts/Sim/Projectiles/ProjectileHandler.cpp
    index afe39d7..6ea1ea5 100644
    --- a/rts/Sim/Projectiles/ProjectileHandler.cpp
    +++ b/rts/Sim/Projectiles/ProjectileHandler.cpp
    @@ -411,11 +411,9 @@ void CProjectileHandler::CheckUnitCollisions(
     				unit->SetLastAttackedPiece(cq.lmp, gs->frameNum);
     			}
     
    -			const float3 newpos = (cq.b0) ? cq.p0 : cq.p1;
    -			if ((newpos - p->pos).dot(p->speed) >= 0.0f) { // only move the projectile forward
    -				p->pos = newpos;
    -			}
    +			p->pos = ((cq.p0 * cq.b0) + (cq.p1 * cq.b1)) / (int(cq.b0) + int(cq.b1));
     			p->Collision(unit);
    +			p->pos = ppos0;
     			break;
     		}
     	}
    @@ -444,11 +442,9 @@ void CProjectileHandler::CheckFeatureCollisions(
     		}
     
     		if (CCollisionHandler::DetectHit(feature, ppos0, ppos1, &cq)) {
    -			const float3 newpos = (cq.b0) ? cq.p0 : cq.p1;
    -			if ((newpos - p->pos).dot(p->speed) >= 0.0f) { // only move the projectile forward
    -				p->pos = newpos;
    -			}
    +			p->pos = ((cq.p0 * cq.b0) + (cq.p1 * cq.b1)) / (int(cq.b0) + int(cq.b1));
     			p->Collision(feature);
    +			p->pos = ppos0;
     			break;
     		}
     	}
    
    diff file icon mantis3368-fix.diff (1,118 bytes) 2012-12-11 15:56 +

-Relationships
+Relationships

-Notes

~0009499

Kloot (developer)

broken by 70dfdb78a2d19ecc03e83e09fdbc758ee20804b7

DO NOT "SIMPLIFY" CODE FROM OTHERS IF YOU DO NOT UNDERSTAND WHY IT WAS WRITTEN A CERTAIN WAY!

~0009500

jK (developer)

Last edited: 2012-12-10 04:22

View 2 revisions

I hope this fixed it. If there are still bugs, caused by my commit, I didn't noticed just tell so :)

PS: I made this not just for simplicity, it also makes damage more `stable` cause the distance is always the same, while before the interpolated position differed every time and so the damage.

~0009509

Deadnight Warrior (reporter)

After jK's fix the situation is like in the picture. Dgun is able to pierce through unit and reach max range where it dissapears, albeit at a rather strange trajectory, as shown in the picture.

~0009510

silentwings (reporter)

Reopened in view of Deadnights picture (it would only let me set status to 'new')

~0009512

jK (developer)

hmmmm seems it triggers a unexpected behavior:

When the projectile is _in_ the colvol (didn't checked yet if ppos0, ppos1 or even both must be in it) it returns the colvols center pos as collision point. So interpolating between the ingress & egress points (as kloots patch is doing) returns then a point _not_ on the path of projectile.
I don't know if this is a bug, never the less it's unexpected. So I was thinking about to solve it by not moving the projectile at all if it is already inside of the colvol. Ideas kloot?

~0009513

Kloot (developer)

Last edited: 2012-12-13 01:41

View 7 revisions

It won't matter for the simulation because calculated distance is always zero (causing maximal damage) for projectiles inside a colvol, but it can for rendering, so that might be the best solution. Only problem is distinguishing the inside case where b0 && b1 from the outside case where b0 && b1 as well (fast-moving projectiles can easily trigger this).

+Notes

-Issue History
Date Modified Username Field Change
2012-12-09 23:36 silentwings New Issue
2012-12-09 23:36 silentwings File Added: 20121209_222803_DeltaSiegeDry_91.0.1-588-g723101f develop.sdf
2012-12-10 00:29 Kloot Note Added: 0009499
2012-12-10 04:12 jK Changeset attached => spring develop 80f94b12
2012-12-10 04:12 jK Assigned To => jK
2012-12-10 04:12 jK Status new => resolved
2012-12-10 04:12 jK Resolution open => fixed
2012-12-10 04:16 jK Note Added: 0009500
2012-12-10 04:16 jK Status resolved => feedback
2012-12-10 04:16 jK Resolution fixed => reopened
2012-12-10 04:22 jK Note Edited: 0009500 View Revisions
2012-12-10 22:12 Deadnight Warrior Note Added: 0009509
2012-12-10 22:12 Deadnight Warrior File Added: dgun_bug.jpg
2012-12-11 09:57 silentwings Note Added: 0009510
2012-12-11 09:57 silentwings Status feedback => assigned
2012-12-11 09:57 silentwings Status assigned => new
2012-12-11 15:56 Kloot File Added: mantis3368-fix.diff
2012-12-12 05:46 abma Changeset attached => spring develop 80311190
2012-12-12 05:46 abma Assigned To jK => abma
2012-12-12 05:46 abma Status new => resolved
2012-12-12 05:48 abma Product Version => 91.0.1+git
2012-12-12 05:48 abma Target Version => 92.0
2012-12-12 23:21 jK Assigned To abma =>
2012-12-12 23:21 jK Note Added: 0009512
2012-12-12 23:21 jK Status resolved => feedback
2012-12-13 01:26 Kloot Note Added: 0009513
2012-12-13 01:29 Kloot Note Edited: 0009513 View Revisions
2012-12-13 01:35 Kloot Note Edited: 0009513 View Revisions
2012-12-13 01:38 Kloot Note Edited: 0009513 View Revisions
2012-12-13 01:39 Kloot Note Edited: 0009513 View Revisions
2012-12-13 01:41 Kloot Note Edited: 0009513 View Revisions
2012-12-13 01:41 Kloot Note Edited: 0009513 View Revisions
2012-12-13 18:33 jK Status feedback => resolved
2012-12-13 18:33 jK Resolution reopened => fixed
2012-12-13 18:33 jK Assigned To => jK
2012-12-13 18:34 jK Assigned To jK =>
2012-12-13 18:34 jK Status resolved => feedback
2012-12-13 18:34 jK Resolution fixed => reopened
2012-12-14 04:23 jK Status feedback => resolved
2012-12-14 04:23 jK Resolution reopened => fixed
2012-12-14 04:23 jK Assigned To => jK
+Issue History