2025-07-21 21:03 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004883Spring engineGeneralpublic2015-07-07 14:03
ReporterGoogle_Frog 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionreopened 
Product Version 
Target VersionFixed in Version 
Summary0004883: 99..0.1-62 Offset Beam Friendly Fire
DescriptionInstant hit weapons with offset weapons can cause friendly fire. Weapons are supposed to do a check from their QueryWeapon piece just before firing because AimFromWeapon and QueryWeapon do not have to be the same piece.

In the replay both Freaker and Felon friendly fire. Warrior has an offset ballistic weapon and does not friendly fire.
Additional InformationReplay with ZK v1.3.7.1
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
related to 0004865new 99.0.1-41 Buggy target aquisition behaviour 
+Relationships

-Notes

~0014886

cleanrock (reporter)

I tested replacing aimFromPos with weaponMuzzlePos in CWeapon::HaveFreeLineOfFire and it seemed to fix this issue.

~0014887

cleanrock (reporter)

Fix 2cf6bf1de749bdddc17a893bce0545dbaaad913b committed to develop branch: fix 0004883, repo: spring changeset id: 5307

~0014889

hokomoko (developer)

The fix solves one issue but introduces another:
When trying to acquire a target, the muzzle point can be anywhere
and not necessarily where it has line of fire to the target. The aiming animation may bring it to have line of fire eventually.

Even if the line of fire check switches to the muzzlepos before firing, you'd still get the alternating target behaviour from https://springrts.com/mantis/view.php?id=4865

I think the only sensible approach is to ask the script for the eventual muzzle position - maybe in the form of a fake aiming function.

In the meanwhile I think it will be best to keep line of fire check to aimFrom, at least until the bugfix release.

~0014890

cleanrock (reporter)

hokomoko,
Can you give an example/setup of how i see the bug i introduced ?

~0014891

hokomoko (developer)

I've added a picture where a unit doesn't aim since its muzzle doesn't have line of fire to the target, while it actually would after aiming.

~0014892

hokomoko (developer)

And another with an annihilator in ZK:
Told it to fire at a point it can reach but it didn't aim at first, since line of fire from muzzlepos was blocked by terraform.
I then caused it to turn by aiming somewhere else, and ordered it to fire on the same target, this time there was line of fire from muzzlepos and it aimed and fired there.

~0014895

cleanrock (reporter)

Fix 3bfb97435145d42d2531304e422a3e92268bede3 committed to develop branch: Revert "fix 0004883"

This reverts commit 2cf6bf1de749bdddc17a893bce0545dbaaad913b., repo: spring changeset id: 5308

~0014924

sprung (reporter)

Would it be reasonable to just use the AimFrom piece when deciding whether to start aiming (fixing the Annihilator and IS-2 cases), and QueryWeapon piece when deciding whether to shoot (fixing Felon friendly fire)?

~0014925

hokomoko (developer)

Last edited: 2015-07-07 12:36

View 2 revisions

5 comments above you:
Even if the line of fire check switches to the muzzlepos before firing, you'd still get the alternating target behaviour from 0004865

~0014930

Google_Frog (reporter)

You would not get alternating target behaviour if the line of fire check from the muzzle position was only used as a shot blocking check. I think both the other bugs (not firing and the alternating target behaviour) are better than friendly fire.

I do not see how this:
"I think the only sensible approach is to ask the script for the eventual muzzle position - maybe in the form of a fake aiming function."
will fix the problem for Felon. I tried changing the AimFrom piece to the muzzle but friendly fire still occurred.
+Notes

-Issue History
Date Modified Username Field Change
2015-07-04 16:55 Google_Frog New Issue
2015-07-04 16:55 Google_Frog File Added: 20150705_004542_ScorpioBattleground_99.0.1-62-g2ce9818 develop.sdf
2015-07-05 09:03 cleanrock Note Added: 0014886
2015-07-05 09:32 cleanrock Changeset attached => spring develop 2cf6bf1d
2015-07-05 09:32 cleanrock Note Added: 0014887
2015-07-05 09:32 cleanrock Assigned To => cleanrock
2015-07-05 09:32 cleanrock Status new => resolved
2015-07-05 09:32 cleanrock Resolution open => fixed
2015-07-05 11:36 hokomoko Note Added: 0014889
2015-07-05 11:36 hokomoko Status resolved => feedback
2015-07-05 11:36 hokomoko Resolution fixed => reopened
2015-07-05 11:49 cleanrock Note Added: 0014890
2015-07-05 12:02 hokomoko File Added: is2doesntaim.png
2015-07-05 12:06 hokomoko Note Added: 0014891
2015-07-05 12:11 hokomoko File Added: annidoesaim.png
2015-07-05 12:11 hokomoko File Added: annidoesntaim.png
2015-07-05 12:13 hokomoko Note Added: 0014892
2015-07-05 12:50 cleanrock Changeset attached => spring develop 3bfb9743
2015-07-05 12:50 cleanrock Note Added: 0014895
2015-07-05 12:50 cleanrock Status feedback => resolved
2015-07-05 12:50 hokomoko Assigned To cleanrock =>
2015-07-05 12:50 hokomoko Status resolved => feedback
2015-07-05 12:51 hokomoko Status feedback => new
2015-07-05 15:14 hokomoko Relationship added related to 0004865
2015-07-07 12:32 sprung Note Added: 0014924
2015-07-07 12:35 hokomoko Note Added: 0014925
2015-07-07 12:36 hokomoko Note Edited: 0014925 View Revisions
2015-07-07 14:03 Google_Frog Note Added: 0014930
+Issue History