|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005860||Spring engine||General||public||2018-01-02 04:11||2018-01-13 01:50|
|Product Version||104.0 +git|
|Target Version||Fixed in Version|
|Summary||0005860: units fail to aim uphill at targets near cliff edges even when they have a clear line of fire|
|Description||units 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 Reproduce||map : 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 Information||on 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)
|Tags||No tags attached.|
|Checked infolog.txt for lua Errors|
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.
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.
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)
|Run the test after allowing the weapon to aim ignoring terrain.|
|if I set avoidGround=0, the unit will happily fire and hit the target directly.|
|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.|
it should be reproduceable on any game on the map "the hole v1"
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.
|Fix 1dfb23b88a882820e4c1a1c6b5df69ce13b5d727 committed to develop branch: fix 0005860, repo: spring changeset id: 9402|
spring: develop 1dfb23b8
Timestamp: 2018-01-13 01:51:10
|mod - rts/Game/SelectedUnitsAI.cpp|
|mod - rts/Game/UI/UnitTracker.cpp|
|mod - rts/Map/Ground.cpp|
|mod - rts/Map/Ground.h|
|mod - rts/Rendering/Env/Particles/Classes/SmokeTrailProjectile.cpp|
|mod - rts/Rendering/Env/Particles/Classes/WreckProjectile.cpp|
|mod - rts/Rendering/Env/Particles/ProjectileDrawer.cpp|
|mod - rts/Sim/Features/Feature.cpp|
|mod - rts/Sim/Misc/InterceptHandler.cpp|
|mod - rts/Sim/MoveTypes/HoverAirMoveType.cpp|
|mod - rts/Sim/Projectiles/PieceProjectile.cpp|
|mod - rts/Sim/Projectiles/Projectile.cpp|
|mod - rts/Sim/Projectiles/ProjectileHandler.cpp|
|mod - rts/Sim/Projectiles/WeaponProjectiles/LaserProjectile.cpp|
|mod - rts/Sim/Projectiles/WeaponProjectiles/MissileProjectile.cpp|
|mod - rts/Sim/Projectiles/WeaponProjectiles/TorpedoProjectile.cpp|
|mod - rts/Sim/Projectiles/WeaponProjectiles/WeaponProjectile.cpp|
|mod - rts/Sim/Units/CommandAI/BuilderCAI.cpp|
|mod - rts/Sim/Units/CommandAI/CommandAI.cpp|
|mod - rts/Sim/Units/CommandAI/MobileCAI.cpp|
|mod - rts/Sim/Units/Scripts/UnitScript.cpp|
|mod - rts/Sim/Weapons/Cannon.cpp|
|mod - rts/Sim/Weapons/Cannon.h|
|mod - rts/Sim/Weapons/EmgCannon.cpp|
|mod - rts/Sim/Weapons/FlameThrower.cpp|
|mod - rts/Sim/Weapons/LaserCannon.cpp|
|mod - rts/Sim/Weapons/MissileLauncher.cpp|
|mod - rts/Sim/Weapons/Rifle.cpp|
|mod - rts/Sim/Weapons/StarburstLauncher.cpp|
|mod - rts/Sim/Weapons/Weapon.cpp|
|mod - rts/System/myMath.cpp|
|mod - rts/System/myMath.h|
|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|