2025-07-24 22:29 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003399Spring engineUnit Scriptingpublic2013-11-01 02:53
ReporterGodde 
Assigned ToKloot 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version91.0 
Target VersionFixed in Version 
Summary0003399: Bugged feature Line of Fire check / Bugged friendly fire Line of Fire check (for cannon weapons)
DescriptionFeatures prevent units with inaccuracy and/or AoE to fire at enemies nearby them.

===

Friendly units prevent units with inaccuracy and/or AoE to fire at enemies nearby them.
Steps To ReproducePlace an enemy unit infront of a wreck.
Get a unit with a weapon that has inaccuracy and/or AoE and AvoidFeature=true.
The unit can't fire at the enemy unless it moves a long way from the enemy.

===

Place an enemy unit infront of a a friendly unit.
Get a unit with a weapon that has inaccuracy and/or AoE and AvoidFriendly=true.
The unit can't fire at the enemy unless it moves a long way from the friendly unit.
It is more likely to fire if the enemy is behind the structure but not in front of it.
Additional InformationVideo:
http://www.twitch.tv/goddeofspring/b/357235254#
http://www.twitch.tv/goddeofspring/b/357252606#

Excerpt from lobby chat.

[13:49:01] <Godde> its kinda bizarre in NOTA
[13:49:09] <Godde> units will avoid features
[13:49:13] <Godde> but not friendly units
[13:50:20] <Godde> so they will not fire their guns if they might "hurt" the wrecks
[13:50:48] <ThePic> I HAZ HOSTAGE. DO NOT ATTACK or you hit the scrapped-toaster.

<[LCC]jK> the TryTarget code of cannons & missilelaunchers is bugged
<[LCC]jK> it doesn't check if the wanted enemy collision will happen before feature, neutral, friendly collision
<[LCC]jK> instead it checks the whole ray
<[LCC]jK> (in contrast to lasers)
[14:24:46] <[LCC]jK> it has nothing to do with AoE
[14:25:27] <[LCC]jK> all colspheres get a 3elmo safety radius extra
[14:25:42] <[LCC]jK> and it is in that range
[14:25:48] <[LCC]jK> so it is in the way
[14:26:33] <[LCC]jK> that it won't shoot a pw in front of the feature in contrast is a bug, cause it's collision point would be in front of the feature one
[14:26:46] <[LCC]jK> so the feature shouldn't be checked in first place
[14:28:04] <Godde> are friendlies checked before enemies aswell i guess
[14:30:02] <[LCC]jK> the bug is: it checks all the different types of collisions totally separate
[14:30:41] <[LCC]jK> everytime it checks the whole projectile ray for possible collisions
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0009600

Kloot (developer)

IMO it is *NOT* a bug.

If a cannon (uses TestTrajectoryCone) only has avoidFeature=true, then it will check *only* for the presence of features along its firing arc and block the shot if there is one. It does not and should not matter if there are also enemy units in front of this feature (whether the weapon has avoidEnemies=false or not), the flags have to be obeyed since shots can miss those.

~0009609

Godde (reporter)

So how do you disable TestTrajectoryCone? Why is it on by default? If this is a new behavior it should probably be turned off by default rather than breaking old mods.

~0009610

Godde (reporter)

Did someone just delete the "Bugged friendly fire Line of Fire check for cannon weapons" report I made?
You should check out the other video. http://www.twitch.tv/goddeofspring/b/357252606#
The plasma cannon is actually more likely to shoot if the enemy is behind a friendly unit than if the enemy is infront of the friendly unit.

~0009611

Kloot (developer)

You should update this report, not create many near-duplicates that are all a result of the same engine code.

"So how do you disable TestTrajectoryCone?"

You can't.

"Why is it on by default?"

Because cannons are ballistic weapons and arcs are not straight lines...

~0009612

Godde (reporter)

Not that I know how the code works but the "Cone" in TestTrajectoryCone indicates that it checks for more than just the arc to the enemy.
If or not a unit should fire when the spread might hit a friendly unit should be in the game developers hands.
Having a unit unable to fire at an enemy because it might miss and hit a feature is absurd and should definitely not be the default behavior.
As indicated in my second video it seems to be bugged as the plasma cannon fires when the enemy unit is behind a friendly unit but is more unlikely to fire when it is infront of it.
I'd say that those might be different bugs.

~0009614

jK (developer)

Are you sure the strange aiming in the video doesn't come from missing LOS? I don't see any radars there.

~0009615

Godde (reporter)

In the first video:
The Crabe LoS in NOTA is as long as its' range.
In the second video:
The enemy units are standing next to friendly units that provide LoS for the friendly plasma cannon.

~0009617

Kloot (developer)

could you run some tests with http://springrts.com/dl/buildbot/default/develop/91.0.1-1145-g0311b15/win32/ ?

(enable alt+b view if/when you do this)

~0009644

Godde (reporter)

The Crabe did well. It could even fire at the Peewee when the center of the Peewee was a little more than halfway into the colvol of the Corlab wreck. I think it could be good if units could fire at an enemy who have the center inside a feature colvol but still have some of its' collision volume outside the features colvol in the direction to the attacker.

I got some weird result in XTA patch 1.4. Now the plasma cannon worked well around wind generators as it would fire if it had free Line of Fire to the enemy Peewee.
On the other hand if a solar collector or an arm kbot lab was in the way of the enemy Peewee the plasma cannon would fire regardless and hit the solar panel or the lab. Both the solar collector and kbot lab change their colvol when they close or open which is different from the wind generator.
If you forced fired behind an arm t1 kbot constructor, the plasma gun would fire and hit the constructor while if you fired behind an Arm Com, the gun would refuse to fire. I don't know the difference between the kbot constructor and the Commander in that case.
+Notes

-Issue History
Date Modified Username Field Change
2013-01-15 16:03 Godde New Issue
2013-01-16 14:36 Kloot Note Added: 0009600
2013-01-17 22:20 Godde Note Added: 0009609
2013-01-17 22:42 Godde Note Added: 0009610
2013-01-17 23:04 Kloot Note Added: 0009611
2013-01-17 23:05 Kloot Description Updated View Revisions
2013-01-17 23:05 Kloot Steps to Reproduce Updated View Revisions
2013-01-17 23:05 Kloot Additional Information Updated View Revisions
2013-01-17 23:05 Kloot Summary Bugged feature Line of Fire check for cannon weapons => Bugged feature Line of Fire check / Bugged friendly fire Line of Fire check (for cannon weapons)
2013-01-18 13:10 Godde Note Added: 0009612
2013-01-19 10:05 jK Note Added: 0009614
2013-01-19 11:34 Godde Note Added: 0009615
2013-01-20 01:37 Kloot Note Added: 0009617
2013-01-20 01:37 Kloot Assigned To => Kloot
2013-01-20 01:37 Kloot Status new => feedback
2013-01-22 20:32 Godde Note Added: 0009644
2013-01-22 20:32 Godde Status feedback => assigned
2013-11-01 02:53 abma Status assigned => resolved
2013-11-01 02:53 abma Resolution open => fixed
+Issue History