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

Change driveshaft excessive angle check #461

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

bluemetaknight
Copy link

Not sure what the reasoning was behind the original implementation, but this makes more sense given how ACF.MaxDriveshaftAngle is defined.

This changes the behavior to check if either direction exceeds ACF.MaxDriveshaftAngle, from check if sum of direction deviations is greater than ACF.MaxDriveshaftAngle.

Not sure what the reasoning was behind the original implementation, but this makes more sense given how ACF.MaxDriveshaftAngle is defined.

This changes the behavior to check if either direction exceeds the maxdriveshaft angle.
@marchc1
Copy link
Member

marchc1 commented Mar 1, 2025

The intention behind sum was to try to solve all three scenarios; I believe if you do max, then the bottom-most scenario isn't handled.
image

I did consider max, but sum seems to make more sense here to handle that scenario. Would be fine with it though if max actually handles this properly...

Also, a nitpick on how you did it, Lua can handle multiple returns and you're making a table object for no reason. I would've just done return math.max(OutToIn,InToOut)

Something that got posted too which might be good to base things off of
drive-shaft-angles-1024x-1

@bluemetaknight
Copy link
Author

I don't think we should necessarily go by realism here given that we don't yet have the appropriate gearbox models to support realistic tank drivetrain designs. Given how ACF used to do mobility angle link checks, my implementation makes more sense. It should simply check if the angle of the virtual u-joints exceeds some angle, not that the driveshafts total direction change exceeds some angle. Until a full rework of mobility can be accomplished, we should stick to keeping behavior as close to original as possible while eliminating abnormal behavior, such as you pointed out in the discord.

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.

2 participants