2019-12-08 14:16 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0005194Spring enginepublic2017-08-30 02:49
Assigned To 
Product Version101.0 
Target VersionFixed in Version 
Summary0005194: Torpedo units with muzzle up in the air and non-tracking torpedo projectiles can't hit targets
DescriptionTorpedo units with muzzle up in the air and non-tracking torpedo projectiles can't hit targets. They constantly undershoot.

If muzzle is in the water then shooting works as expected.
Steps To ReproduceFor ZK mod.

1) Change turrettorp's (Urchin) weapon to "tracks = false".
2) Put it on the small terraform spike (y=10 elmo).
3) cheat a target somewhere around in the Urchin's range.
4) Order the attack
5) Observe torpedo's projectile starts up in the air, plops in the water according to ballistic trajectory and then continues sinking to the ground. Hit point is far closer than unit actual position.
Additional InformationI believe no weapon should miss the target having perfect aiming and line of fire (unless it's mod-intended inaccuracy of some kind).

1st screenshot - torpedo is in the middle of its flight:

2nd screenshot - torpedo has just hit the ground and bounced:

3rd screenshot - torpedo behaves correctly if muzzle point is in the water:
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files




PepeAmpere (reporter)

confirmed in nota even for guided projectiles from torpedo bombers. once you want really bad-guided torpedo, you need very deep water to fix to momentum of the projectile falling from the plane

you have to set big turnrate which "fix" the physics of the torpedo once it gets into water but then you torpedo which can turn 180° without any problems


abma (administrator)

the projectile needs to brake more i guess when it falls into water... atm it seems only break when tracking to a target ?!

i don't see any code which breaks its falling (sinking?!) speed/rate when inside water:



lhog (reporter)

I think there should be a piece of code added to correct trajectory of torpedo upon its plop in the water. Not sure if it should be gradual (sort of short-lived tracking) or momentarily correction.


Forboding Angel (reporter)

Did any of you try giving the weapon a high acceleration? If it can accelerate quickly enough, that might mitigate the momentum. Try high acceleration with a high max velocity and see if that works.

The issue is more a problem of the maps themselves than the weapon. The most easily observable place for me was watching nota on SSI with torp bombers.

There's a catch though. Most spring maps with large waters areas aren't deep at all. It makes perfect sense that this is an issue because what the engine is doing makes sense. Unfortunately mappers have a very bad habit of incorrectly scaling heights. SSI for example, is about as deep as a kiddie pool.


PepeAmpere (reporter)

I was thinking the same but i tested that on many maps, tried to change acc, velocity, breaks, etc. Some maps have deep waters and only what helped was changing turnrate, which is hack (and produce unwated behavior of the projectile). If I understand right, real torpedoes thrown by airplanes does not need too deep water, especially the modern ones (or wwII jumping ones).


PepeAmpere (reporter)



PepeAmpere (reporter)

here falling angles, using torpedoes in shallow water, how height, speed => angle affects the behavior of the projectile https://youtu.be/w8XYZoR9ABE?t=12m22s


PepeAmpere (reporter)

Btw I prepared easy repro year ago

1) Take nota 1.91 or newer
2) host game on map Tangerine
3) set "mission_name" to "autotest/weapon/torpedo-air"
4) be spectator, put one "Mission AI" in ally 1 and one "Mission AI" in ally 2
5) run and observe the bug


Anarchid (reporter)

A ballistic weapon that does not interact with water and follows a predictable ballistic trajectory with no self-propulsion is actually a Cannon with waterWeapon=true.

For a bimodal weapon that is ballistic in air but becomes an unguided projectile with a new trajectory after traversing the water boundary, i think you should just write a gadget.

As a bonus point, you can add water splashes, something that engine torps don't do.


PepeAmpere (reporter)

My case - bimodal weapon - I wanted to avoid that gadget solution because the engine solution is not as bad (it simulates the vertical deceleration which is wanted, nice gameplay where badly placed torpedo can go under ship or hit bottom of the sea) - The problem is only in depth the torpedo reaches after getting under water surface - it looks like the vertical deceleration simulation is not taking in account that water is not air and using only "torpedoes aiming correction power" (turnrate) to correct the underwater paths vertical axis.

If you drop torpedo from

* fly alt 75 (our lancet in testing scenario)
* into sea with of depth -70
* with fly speed 6.5-10 (that defines the original move vector of the bomb before it fall down to sea)

... the torpedo really should not hit the bottom of the sea.

I bring this up that because its regression. I think the person who did the "sea depths" correction in 101.0 (im not able to find the commit, just remember the discussion) seems did not corrected the sim of torpedo in water (so seas were before considered 3x or how many times deeper and also the algorithm for vertical axis calculation/acc did something similar). If I'm right, the fix could be not as complicated.


Anarchid (reporter)

Oh. *This* sounds like a lack of friction.


Anarchid (reporter)

Note that your version is not the bimodal i'm talking about. Yours is an engine torpedo with friction increasing in water. The original reporter, however wants the projectile to change the trajectory but then apply no further guidance, be it fast or slow.


Anarchid (reporter)

Hmm. I've tried looking up whether you could just modify drag parameters for your torpedo. And apparently the only type of Spring projectile that has any drag whatsoever is FlyingPiece. Unless i'm missing something in my search.


Kloot (developer)

Last edited: 2017-08-30 02:49

View 2 revisions

wrt lhog's original ticket, it should be quite obvious that *unguided* torpedoes are not going to hit much of anything unless launched horizontally inside water. if the game allows building launchers on land, then their guidance is its problem to solve.

wrt pepe's "sea depths correction", I don't recall such a change in 101.0 and simulation logic also looks the same: torpedoes do not apply gravity in water until their ttl runs out, but also no friction so their turnrate alone has to counteract vertical momentum. it is possible that the engine used to "help" (guided and unguided) torpedoes level out when entering water, but if so that would have been an unphysical hack.

edit: indeed in 91.0 an extra dir.y *= 0.5 reduction was applied every frame above a certain depth.


-Issue History
Date Modified Username Field Change
2016-04-02 20:32 lhog New Issue
2016-04-18 02:00 PepeAmpere Note Added: 0016189
2016-04-18 04:14 abma Note Added: 0016190
2016-04-18 13:48 lhog Note Added: 0016191
2016-04-26 03:40 Forboding Angel Note Added: 0016207
2016-05-07 19:41 PepeAmpere Note Added: 0016277
2016-05-08 13:43 PepeAmpere Note Added: 0016281
2016-05-08 13:52 PepeAmpere Note Added: 0016282
2017-08-26 13:39 PepeAmpere Note Added: 0018287
2017-08-28 15:25 Anarchid Note Added: 0018291
2017-08-29 04:31 PepeAmpere Note Added: 0018293
2017-08-29 12:04 Anarchid Note Added: 0018294
2017-08-29 12:10 Anarchid Note Added: 0018295
2017-08-29 12:16 Anarchid Note Added: 0018296
2017-08-30 02:12 Kloot Note Added: 0018306
2017-08-30 02:49 Kloot Note Edited: 0018306 View Revisions
+Issue History