2019-12-14 22:06 CET

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0005860Spring engineGeneralpublic2018-01-13 01:50
Reporterraaar 
Assigned ToKloot 
PriorityhighSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version 
Summary0005860: units fail to aim uphill at targets near cliff edges even when they have a clear line of fire
Descriptionunits fail to aim uphill at targets near cliff edges even when they have a clear line of fire, and are within firing range.
Steps To Reproducemap : The Hole v1, or any map with sharp cliffs

- spawn units on the lower ground with long range lasers and cannons
- spawn units on the edge of the cliffs that should be targetable by the previously spawned units
- move the attackers along the ground to see if they're being able to aim and fire when they should be

Additional Informationon the attached picture, the red range line shows doesn't cross into the hilltop when viewed from the bot's perspective, although it apparently does when viewed from a normal TA-like overhead view. Maybe that's related.

setting targetborder=1 seems to not change the attackers behavior at all (does that tag actually work?)

This also happens on previous versions (tested 101.0)
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0018708

Kloot (developer)

you are aware that range by default is *three*-dimensional and that flat range *circles* projected onto the map do not convey this, right?

hint: calculate the *3D* distance between attacker and target with Spring.GetUnitPosition and compare this to the attacker's weapon range. use the Spring.GetUnitWeaponTest* and GetUnitWeaponHaveFreeLineOfFire callouts to verify your findings.

~0018709

Google_Frog (reporter)

In my experience the flat range circles convey the three dimensional nature of range. However, I would not rely on them completely as they have low resolution and only show range relative to ground height and ignore obstructions.

Here are two possibilities.
 - The rate at which weapons lose range with a height difference grows with the height difference. The range circle calculates of units tends to be above the ground. Therefore the target unit needs to be further from the edge of the circle with a larger height difference.
 - Weapons check their line of fire from the piece returned by AimFromWeapon to the aimpoint of their target. Tall units may look like they are peeking over a cliff while their aimpoint is in fact obscured.

I don't understand what you are talking about regarding the red range line crossing into the hilltop (or not) depending on the camera. The red range line is drawn in worldspace so in a sense its position should not depend on the camera position.

~0018710

raaar (reporter)

I thought the red range line was changing depending on the camera angle, but it seems it just shows through the terrain, so forget that.

I use heightmod=0.5 on the weapons, so the 3d range coverage is an ellipsoid stretched vertically 2x.

This is not a range issue as the unit can fire by moving farther from the cliff.

The aimpoint on the target is the pink dot in the middle of the radar tower (as shown on the picture).

I've made some tests and GetUnitWeaponHaveFreeLineOfFire returns false. Somehow spring thinks it's obstructed when it isn't (especially considering cannon weapons with parabolic trajectory)

~0018716

Google_Frog (reporter)

Run the test after allowing the weapon to aim ignoring terrain.

~0018719

raaar (reporter)

if I set avoidGround=0, the unit will happily fire and hit the target directly.

~0018720

Google_Frog (reporter)

It sounds like the bug is that the weapon is incorrectly detecting that it is blocked by terrain. You should give detailed steps to reproduce it, ideally with a minimod.

~0018722

raaar (reporter)

it should be reproduceable on any game on the map "the hole v1"
(https://springfiles.com/spring/spring-maps/hole)

I tested with metal factions v0.991, spawning repeatedly "sphere_radar_tower" near the cliff edge on the raised platforms near the corners, then any of these attack units ("sphere_rock", "gear_aggressor","sphere_charger","sphere_bit") and moved the attacker around near the cliff to see where it can fire or not.

~0018725

Kloot (developer)

Fix 1dfb23b88a882820e4c1a1c6b5df69ce13b5d727 committed to develop branch: fix 0005860, repo: spring changeset id: 9402
+Notes

-Related Changesets
spring: develop 1dfb23b8
Timestamp: 2018-01-13 01:51:10
Author: Kloot
Details ] Diff ]
fix 0005860
mod - rts/Game/SelectedUnitsAI.cpp Diff ] File ]
mod - rts/Game/UI/UnitTracker.cpp Diff ] File ]
mod - rts/Map/Ground.cpp Diff ] File ]
mod - rts/Map/Ground.h Diff ] File ]
mod - rts/Rendering/Env/Particles/Classes/SmokeTrailProjectile.cpp Diff ] File ]
mod - rts/Rendering/Env/Particles/Classes/WreckProjectile.cpp Diff ] File ]
mod - rts/Rendering/Env/Particles/ProjectileDrawer.cpp Diff ] File ]
mod - rts/Sim/Features/Feature.cpp Diff ] File ]
mod - rts/Sim/Misc/InterceptHandler.cpp Diff ] File ]
mod - rts/Sim/MoveTypes/HoverAirMoveType.cpp Diff ] File ]
mod - rts/Sim/Projectiles/PieceProjectile.cpp Diff ] File ]
mod - rts/Sim/Projectiles/Projectile.cpp Diff ] File ]
mod - rts/Sim/Projectiles/ProjectileHandler.cpp Diff ] File ]
mod - rts/Sim/Projectiles/WeaponProjectiles/LaserProjectile.cpp Diff ] File ]
mod - rts/Sim/Projectiles/WeaponProjectiles/MissileProjectile.cpp Diff ] File ]
mod - rts/Sim/Projectiles/WeaponProjectiles/TorpedoProjectile.cpp Diff ] File ]
mod - rts/Sim/Projectiles/WeaponProjectiles/WeaponProjectile.cpp Diff ] File ]
mod - rts/Sim/Units/CommandAI/BuilderCAI.cpp Diff ] File ]
mod - rts/Sim/Units/CommandAI/CommandAI.cpp Diff ] File ]
mod - rts/Sim/Units/CommandAI/MobileCAI.cpp Diff ] File ]
mod - rts/Sim/Units/Scripts/UnitScript.cpp Diff ] File ]
mod - rts/Sim/Weapons/Cannon.cpp Diff ] File ]
mod - rts/Sim/Weapons/Cannon.h Diff ] File ]
mod - rts/Sim/Weapons/EmgCannon.cpp Diff ] File ]
mod - rts/Sim/Weapons/FlameThrower.cpp Diff ] File ]
mod - rts/Sim/Weapons/LaserCannon.cpp Diff ] File ]
mod - rts/Sim/Weapons/MissileLauncher.cpp Diff ] File ]
mod - rts/Sim/Weapons/Rifle.cpp Diff ] File ]
mod - rts/Sim/Weapons/StarburstLauncher.cpp Diff ] File ]
mod - rts/Sim/Weapons/Weapon.cpp Diff ] File ]
mod - rts/System/myMath.cpp Diff ] File ]
mod - rts/System/myMath.h Diff ] File ]

+Related Changesets

-Issue History
Date Modified Username Field Change
2018-01-02 04:11 raaar New Issue
2018-01-02 04:11 raaar File Added: fire_uphill_red_line.png
2018-01-05 14:29 Kloot Note Added: 0018708
2018-01-06 02:02 Google_Frog Note Added: 0018709
2018-01-07 23:06 raaar Note Added: 0018710
2018-01-08 06:25 Google_Frog Note Added: 0018716
2018-01-09 07:17 raaar Note Added: 0018719
2018-01-09 09:09 Google_Frog Note Added: 0018720
2018-01-12 03:17 raaar Note Added: 0018722
2018-01-12 17:19 Kloot Assigned To => Kloot
2018-01-12 17:19 Kloot Status new => assigned
2018-01-13 01:50 Kloot Changeset attached => spring develop 1dfb23b8
2018-01-13 01:50 Kloot Note Added: 0018725
2018-01-13 01:50 Kloot Status assigned => resolved
2018-01-13 01:50 Kloot Resolution open => fixed
+Issue History