Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Allow customizing subterranean movement speed and allow parsing floating point Speed values

Open Starkku opened this issue 1 year ago • 5 comments

This should fix an issue introduced in 890eca0cd7eeb9298e876386cb2c3787bfb3e72b for tunnel locomotor where a distance check was made against unit's current speed without ensuring that SpeedPercentage which is normally not used by TunnelLocomotionClass is 1.0 instead of 0.0 and unhardcoding the subterranean movement speed.

Subterranean unit travel speed

  • Subterranean movement speed is now customizable, both globally and per TechnoType. If per-TechnoType value is negative, global value is used. This does not affect the speed at which the unit moves vertically when burrowing which is determined by Speed multiplied by [General]->TunnelSpeed.

In rulesmd.ini:

[General]
SubterraneanSpeed=7.5    ; floating point value
                         
[SOMETECHNO]             ; TechnoType
SubterraneanSpeed=-1     ; floating point value

Unit Speed setting now accepts floating-point values. Internally parsed values are clamped down to maximum of 100, multiplied by 256 and divided by 100, the result (which at this point is converted to an integer) then clamped down to maximum of 255 giving effective internal speed value range of 0 to 255, e.g leptons traveled per game frame.

Starkku avatar Oct 13 '24 19:10 Starkku

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Oct 13 '24 20:10 github-actions[bot]

Fuckery fixed.

But there is one small problem... tunnellolco This happens only when the unit doesn't burrow. If it the unit will burrow after turning, the graphic doesn't bug out. This also does not happen if SubterraneanUseSpeed= tags have default value.

mevitar avatar Oct 13 '24 22:10 mevitar

This also does not happen if SubterraneanUseSpeed= tags have default value.

It seems it was not this. I cannot reproduce this issue again no matter what SubterraneanUseSpeed= values i use, I have no clue why it happened in the first place, even though all of these units on that animation were affected at once.

mevitar avatar Oct 13 '24 23:10 mevitar

Maybe we need another flag like SubterraneanSpeed to control the tunnel speed instead of using the Speed flag directly. Just like JumpjetSpeed.

TaranDahl avatar Oct 14 '24 02:10 TaranDahl

Changed the movement speed to be customizable individually from regular Speed. The burrowing speed remains tied to regular Speed.

Starkku avatar Oct 14 '24 12:10 Starkku