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

Scalable gearboxes rework #443

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Scalable gearboxes rework #443

wants to merge 14 commits into from

Conversation

thecraftianman
Copy link
Member

@thecraftianman thecraftianman commented Dec 24, 2024

Closes #100 and #250
Partial completion of #15

This PR contains a significant overhaul of gearboxes to turn them into customizable scalable entities. Some of the features include:

  • The 130 individual gearboxes have been condensed down into just 15
  • Mobility ropes are now fully clientside, and the setting now toggles their visibility globally rather than just for the local player's builds
  • Gearboxes now have customizable scale, gear count, and presence of dual clutch
  • Gearbox torque rating scaling has been reworked somewhat, but should still be mostly similar to the existing non-scalable ratings
  • Automatic and manual gearboxes can now use any gear amount from 3-10
  • Horsepower will now actually match the values that it displays as visually
  • Gear ratios have been inverted to be more realistic and their limits have been expanded from -1:1 to -10:10
  • All previous gearboxes should be fully backwards compatible

Use this at your own risk if you want to test it, as things should still be considered experimental and potentially unstable/breaking until this gets into the main branch.

Things still left to be done:

  • Further polish of the codebase and features
  • Disable mobility ropes by default for client performance (?)
  • Allow for 9/10 gear auto/manual boxes (?)
  • Implement gear ratios from [ BETA ] Mobility Update v2.12.7-beta #396 (if feasible for backwards compatibility)
  • Add alias definitions for ACF Extras gearboxes and remove the ACF-3 ones from the original mod (?)

This is not yet complete! Please don't try to use this yet if you are a player/server owner lol
- Mobility ropes are now entirely faked with clientside rendering instead of being actual ropes (using actual ropes with scalable entities like this looks awful)
- Lowered the minimum scale amount to 0.75 to allow for tiny clutches
- The mobility ropes setting now toggles visibility of all mobility ropes globally instead of only allowing the creation of ones owned by the local player
- Added some globals for controlling gearbox behavior
For some reason, these were occasionally loading in like normal gearboxes and were selectable from the menu, which was not supposed to happen.
Copy link
Member

@marchc1 marchc1 left a comment

Choose a reason for hiding this comment

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

Other than these commented out things I found and that weird menu issue, I don't immediately see anything off? I'll prob do a second pass later.

I tested four of my dupes, ranging from 2020 to 2024, and all seem to still work perfectly fine, so functionally I can't see anything wrong

lua/acf/core/classes/grouped.lua Outdated Show resolved Hide resolved
lua/acf/menu/items_cl/gearboxes.lua Show resolved Hide resolved
lua/acf/menu/items_cl/gearboxes.lua Outdated Show resolved Hide resolved
lua/entities/acf_engine/init.lua Outdated Show resolved Hide resolved
lua/entities/acf_gearbox/cl_init.lua Outdated Show resolved Hide resolved
lua/acf/entities/gearboxes/doublediff.lua Outdated Show resolved Hide resolved
lua/acf/entities/gearboxes/doublediff.lua Outdated Show resolved Hide resolved
lua/acf/entities/gearboxes/doublediff.lua Outdated Show resolved Hide resolved
lua/acf/entities/gearboxes/transfer.lua Outdated Show resolved Hide resolved
lua/acf/entities/gearboxes/transfer.lua Outdated Show resolved Hide resolved
thecraftianman and others added 5 commits December 26, 2024 14:31
- Removed lots of commented out chunks
- Fixed a bug where the menu would show dual clutch as enabled but the actual setting would be disabled right after opening the menu for the first time
- Fixed (?) a bug where the gearbox entity in the menu would throw an error after opening the page for the first time (I just increased the timer a bit)
- Allowed 9 gear auto/manual boxes
Removed the extra DrawRope calls since calling it in the draw hook just made every single mobility component draw the ropes again and again
Also start paving the way for eventually optionally generating a model for links in place of the simple ropes
Extends the gear ratio limits to -10:10 and inverts them relative to the existing ones. Based loosely on work by @Tyunge
@thecraftianman
Copy link
Member Author

This rework now also includes more realistic gear ratios as requested in #250 (1 / CurrentGearRatios and limits extended from -1:1 to -10:10), with the work being loosely based off of @Tyunge's gear ratio changes in #396. Assuming no bugs exist, all existing gearbox setups should be converted to use the new ratios seamlessly. As such, this branch will now also close #250 when merged.

@thecraftianman thecraftianman marked this pull request as ready for review January 16, 2025 04:52
@thecraftianman thecraftianman linked an issue Jan 16, 2025 that may be closed by this pull request
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.

[SUGGESTION] Increase gear ratio limit [SUGGESTION] Better gearbox customization
3 participants