Skip to content

[Highly Customized] Jumpjet Tilts While Moving #1521

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

Merged
merged 11 commits into from
Apr 11, 2025

Conversation

CrimRecya
Copy link
Contributor

@CrimRecya CrimRecya commented Feb 11, 2025

  • Now you can make jumpjets tilt forward when moving forward and sideways when turning by setting JumpjetTilt to true.
  • The maximum tilt angle will not exceed 45 degrees.
    • The magnitude of the forward tilt is related to the current speed and acceleration. They are additive and have two coefficients that can be adjusted for details.
    • The magnitude of the sideways tilt is related to the current speed and rotation angle. They are multiplied and also have two coefficients that can be adjusted for details.

In rulesmd.ini:

[SOMEUNIT]                              ; UnitType, with Locomotor=Jumpjet
JumpjetTilt=false                       ; boolean
JumpjetTilt.ForwardAccelFactor=1.0      ; floating point value
JumpjetTilt.ForwardSpeedFactor=1.0      ; floating point value
JumpjetTilt.SidewaysRotationFactor=1.0  ; floating point value
JumpjetTilt.SidewaysSpeedFactor=1.0     ; floating point value

jjtilt

Copy link

github-actions bot commented Feb 11, 2025

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.

Copy link
Member

@Metadorius Metadorius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, few style and readability issues.

I have a few suggestions though:

  1. Ability to control how much the jumpjet tilts, I imagine via separate factors for forward and sideway tilts.
  2. Ability to account acceleration for directional tilt (when accelerating - tilt forwards, decelerating - tilt backwards to decelerate). This could work additionally to movement-dependant tilt.
  3. Debatable: ability to account speed for rotational tilt, because static helicopter rotating via tilt looks weird, and to do sharp turns at high speed you must tilt a lot. But maybe could just remove rotation sideways tilt when not moving.
JumpjetTilt.ForwardAccelFactor  ; FAF 
JumpjetTilt.ForwardSpeedFactor  ; FSF
JumpjetTilt.SidewaysRotationFactor  ; SRF
JumpjetTilt.SidewaysSpeedFactor  ; SSF

Pseudocode to show what I mean:

arf += movement_acceleration * FAF + movement_speed * FSF
ars += rotation_speed * SRF * movement_speed * SSF

(By the way, I am not sure I understand the current sideways rotation logic correctly. What does it depend on?)

What do you think?

@Coronia
Copy link
Contributor

Coronia commented Feb 12, 2025

If a tilting jumpjet is affected by EMP, it'll gradually resume to normal stance while being EMP'd. Not sure if it should behave like that

Copy link
Contributor

@Coronia Coronia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe there's no need to set it globally since you'll still have to customize those factors for each jumpjet. Otherwise LGTM

@TaranDahl
Copy link
Contributor

How about move JumpjetTilt= to [JumpjetControls] 🤔

@TaranDahl TaranDahl added ❓New feature ⚙️T1 T1 maintainer review is sufficient labels Mar 17, 2025
@CrimRecya
Copy link
Contributor Author

I imagined that perhaps there is no need for global label?
It seems that only helicopters require this function, while spacecraft may only need to tilt sideways, but this definitely requires customization. Other UFO or balloons/airships may not need this.

Copy link
Member

@Metadorius Metadorius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can imagine some quick/nimble helicopters tilting up to 90 degrees, so it would be good to have that as the limitation instead of 45. I doubt it will hamper usability, so why not?

Otherwise I have no complaints regarding this feature. Maybe it's worth adding a GIF to the docs? I suggest to use GifCam, as it doesn't make the GIF lose the quality.

@CrimRecya
Copy link
Contributor Author

CrimRecya commented Apr 11, 2025

I can imagine some quick/nimble helicopters tilting up to 90 degrees, so it would be good to have that as the limitation instead of 45. I doubt it will hamper usability, so why not?

That probably also requires modifying the shadow matrix to make it more effective. I will add it later.

@Metadorius
Copy link
Member

That probably also requires modifying the shadow matrix to make it more effective. I will add it later.

Oh, that's a fair comment, I didn't think of that. Feel free to merge as is then, the 90 degree adjustment can be made later. The shadow drawing doesn't make a lot of sense in the vanilla game so it needs a good rewrite.

@CrimRecya CrimRecya merged commit d60a9c2 into Phobos-developers:develop Apr 11, 2025
6 checks passed
@CrimRecya CrimRecya deleted the develop-JumpjetTilt branch April 17, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix and merge this ❓New feature ⚙️T1 T1 maintainer review is sufficient
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants