Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Starkku
Copy link
Contributor

@Starkku Starkku commented Oct 13, 2024

This should fix an issue introduced in 890eca0 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.

Copy link

github-actions bot commented Oct 13, 2024

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.

@mevitar
Copy link

mevitar commented Oct 13, 2024

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
Copy link

mevitar commented Oct 13, 2024

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.

@TaranDahl
Copy link
Contributor

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

@Starkku
Copy link
Contributor Author

Starkku commented Oct 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants