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

FPS Limit and game Speed calibration #81

Open
salem-ok opened this issue Dec 12, 2021 · 0 comments
Open

FPS Limit and game Speed calibration #81

salem-ok opened this issue Dec 12, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@salem-ok
Copy link
Owner

salem-ok commented Dec 12, 2021

Not knowing anything about gamedev, I've made a very crude attempt to adapt the game speed to the host performance:

                            current_fps = round(1000/frame_duration)
                            if current_fps <= 90 and current_fps > 0:
                                pysprint_car.frame_rate_speed_modifier = 1 + (100/current_fps)/11
                                pysprint_car.rotation_step_modifier =  1 + (100/current_fps)/14
                            else:
                                pysprint_car.frame_rate_speed_modifier = 1
                                pysprint_car.rotation_step_modifier =  1

The result is not perfect and depending on your computer speed you will not be able to compare lap times like for like today.

This is a MUST before implementing network play.

@salem-ok salem-ok added enhancement New feature or request help wanted Extra attention is needed labels Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant