Skip to content

Conversation

@Pawmii
Copy link

@Pawmii Pawmii commented Oct 11, 2025

Description

Describe the changes
Fixed incorrect TPS calculation in Server.Tps.
Previously, it used the smoothed frame delta time (Time.smoothDeltaTime) and did not account for the server’s maximum TPS limit, which could cause it to report values higher than the configured cap.

What is the current behavior? (You can also link to an open issue here)
Server.Tps may return values higher than the server’s configured maximum tickrate (e.g. 60 TPS when max is 50).

What is the new behavior? (if this is a feature change)
Server.Tps now correctly clamps calculated TPS to the server’s maximum tickrate using Math.Min(tps, MaxTps) and bases the calculation on Time.deltaTime for more accurate real-time values.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No breaking changes.

Other information:
Small internal fix to improve TPS accuracy and consistency.


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

@github-actions github-actions bot added the API label Oct 11, 2025
@Someone-193 Someone-193 self-requested a review October 18, 2025 15:02
Copy link
Collaborator

@Someone-193 Someone-193 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we go from smoothDeltaTime to deltaTime? Is one particularly better, can you explain why?

@louis1706 louis1706 changed the base branch from master to dev October 22, 2025 17:08
@louis1706
Copy link

next time please target Dev branch

Copy link
Collaborator

@Someone-193 Someone-193 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk what the deal with the docs changes are, probably commits in master not in dev? Anyways, looks good if you're correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants