We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was looking into shocks3 and the logic behind it and I think there is a bug in the damping calculations.
In the original discussion for shocks3 this graph was posted:
I figured that making something to visualize different values would help me understand tuning a bit more.
So I looked at Actor::CalcShocks3 and reimplemented it in Python so I can quickly produce a plot of the same curve.
Here I noticed the same parameters produced a different plot:
I then plotted the original logic that Dohzer suggested:
Out of curiosity, I tried plotting the calculation that's in the game, but without the last d /= v
d /= v
I assume the goal was to get damping curves like the one that Dohzer posted in the Discord, meaning this is a bug?
Here's the Python code I wrote:
# pip install numpy pandas plotly from typing import Callable import numpy as np import pandas as pd import plotly.express as px def ror_shocks3(damp: float, slow: float, split: float, fast: float): def curve(v: float): v = np.clip(abs(v), 0.15, 20) d = damp * slow * min(v, split) + damp * fast * max(0, v - split) d /= v return d return curve def ror_shocks3_fixed(damp: float, slow: float, split: float, fast: float): def curve(v: float): v = np.clip(abs(v), 0.15, 20) d = damp * slow * min(v, split) + damp * fast * max(0, v - split) return d return curve def dohzer(damp: float, slow: float, split: float, fast: float): def curve(v: float): if v <= split: d = damp * slow * v else: d = damp * fast * (v - split) + (damp * slow * split) return d return curve damp = 5000 slow = 0.5 split = 1.2 fast = 0.2 curves = { 'Shocks3': ror_shocks3(damp, slow, split, fast), 'Dohzer': dohzer(damp, slow, split, fast), 'Shocks3 Fixed': ror_shocks3_fixed(damp, slow, split, fast), } def calc_curve(curve: Callable[[float], float], title: str) -> pd.DataFrame: v = np.linspace(0, 3.5, 100) d = [curve(x) for x in v] return pd.DataFrame({'velocity m/s': v, 'damping': d, 'curve': title}) curves_df = pd.concat([ calc_curve(curve, title) for title, curve in curves.items() ]).reset_index(drop=True) fig = px.line( curves_df, x='velocity m/s', y='damping', color='curve', line_dash='curve', range_y=[0, 6000], title=f'{damp=}, {slow=}, {split=}, {fast=}', ) fig.show()
The text was updated successfully, but these errors were encountered:
Only a few select mods seem to use shocks3, so this should be applicable. I'm checking it out.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I was looking into shocks3 and the logic behind it and I think there is a bug in the damping calculations.
In the original discussion for shocks3 this graph was posted:

I figured that making something to visualize different values would help me understand tuning a bit more.
So I looked at Actor::CalcShocks3 and reimplemented it in Python so I can quickly produce a plot of the same curve.
Here I noticed the same parameters produced a different plot:

I then plotted the original logic that Dohzer suggested:


Out of curiosity, I tried plotting the calculation that's in the game, but without the last

d /= v
I assume the goal was to get damping curves like the one that Dohzer posted in the Discord, meaning this is a bug?
Here's the Python code I wrote:
The text was updated successfully, but these errors were encountered: