2020-08-03 22:36 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006342Spring engineGeneralpublic2019-11-30 17:29
Assigned To 
Product Version104.0 +git 
Target VersionFixed in Version 
Summary0006342: maintenance : beamlaser weapons do not respect heightMod weapon def
Descriptionbeamlaser weapons do not respect heightMod weapon def

relatively short-ranged laser units on MF have heightMod=0.5, which means they should be able to shoot twice as high as they can shoot far.

often when targetting enemies on the edge of tall cliffs or aircraft near the edge of their ranges, they'll shoot but the laser doesn't connect.
Additional Informationyou can see that happening on the attached replay.
TagsNo tags attached.
Checked infolog.txt for ErrorsIrrelevant
Attached Files




raaar (reporter)

they don't seem to respect cylindertargeting either. They'll try to shoot as if they had extra range, but it's like the laser didn't get as big of a range increase as it should have and stops short.


Kloot (developer)

"heightMod=0.5, [] means they should be able to shoot twice as high as they can shoot far"

this is completely wrong.

heightMod=X simply and only causes any elevation difference between attacker and attackee to be multiplied by X when *considering* potential targets for attack, it does *not* modify the actual weapon range (how far projectiles will travel) in any way. hence "they'll shoot but the laser doesn't connect", which should also tell you why the default heightMod value is 1 for BeamLasers and LightningCannons.


raaar (reporter)

That's not what the wiki says.

float heightMod  default: 0.2 (0.8 for #Cannon, 1.0 for #BeamLaser and #LightningCannon) 

    Changes the spherical weapon range into an ellipsoid. Values above 1.0 mean the weapon cannot target as high as it can far, values below 1.0 mean it can target higher than it can far. For example 0.5 would allow the weapon to target twice as high as far.

I'm pretty sure they get a bit of increased range upwards. Where's the code for that?

how do we get beamlasers to shoot higher than they can shoot far then?
There should be a way to do that.


Kloot (developer)

Last edited: 2019-11-25 11:19

View 2 revisions

the ultimate authority on how the engine works is always the code, not the wiki.

to get "beamlasers to shoot higher than they can shoot far", use the AllowWeaponTarget callin and return false for any target outside whatever elliptical range volume you care to define. this implies the actual (spherical) range should be set equal to the maximum *vertical* range you want to allow, with the callin artificially restricting it in the horizontal dimension.


raaar (reporter)

I have units aiming every frame (using the reaimtime feature added on 104.0.1+), so allowweapontarget is going to be called every frame for every target in range (the max range), right?

so if i send a 100 infantry bots with lasers against each other, they're going to have to also make 100 distance checks every frame on top of what the engine already does???

I think the code should be fixed to allow beams to comply with those weapon defs the same way the other weapons do.

-Issue History
Date Modified Username Field Change
2019-11-17 17:43 raaar New Issue
2019-11-17 17:43 raaar File Added: beamlaser_heightmod_bug_Tabula-v6_104.0.1-1429-g1add37c maintenance.sdfz
2019-11-17 19:09 raaar Note Added: 0020236
2019-11-20 12:03 Kloot Note Added: 0020250
2019-11-25 03:59 raaar Note Added: 0020257
2019-11-25 11:18 Kloot Note Added: 0020258
2019-11-25 11:19 Kloot Note Edited: 0020258 View Revisions
2019-11-30 17:29 raaar Note Added: 0020267
+Issue History