PySprint
PySprint copied to clipboard
FPS Limit and game Speed calibration
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.