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

Fix catastrofic rotation after undocking from space station. #5422

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

azieba
Copy link
Contributor

@azieba azieba commented Nov 19, 2022

When ship docks with space station on autopilot it often generates pairs of big torque and force values that mostly cancel each other in normal flight. Problem starts with docking because when the flight state is changed to DOCKING which translates to m_isMoving==false for DynamicBody then the last unprocessed m_torque and m_force are stored. Those unconsumed torque and force values are later processed after undocking sequence completes and ship switches to FLYING state. This often results in catastrophic rotation + linear movement with ship just throwing forward thruster for few seconds. In many cases it is fatal. I have attached a savegame - those torque and force values are serialized. It can be used for reproducing the result - just load the save and press F5 to undock. You can also fly around the space station and dock couple of times - maybe with 3rd person view - to see if you can make the game store such values yourself.
So the fix is simple resetting torque, force, velocity and rotation when DynamicBody state is changed to m_isMoving==false.
I could not find a bug report for this thing.

The save game:
test.gz

@impaktor
Copy link
Member

I could not find a bug report for this thing.

Indeed, I'm fairly sure this has never been reported anywhere.

@sturnclaw sturnclaw merged commit 3f5ba7f into pioneerspacesim:master Nov 24, 2022
@azieba azieba deleted the fix_undocking branch November 24, 2022 16:02
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