[Techincal] FPS vs TPS
Need some help from the tech savvy folks up here.
A random thought just came to me and I can't figure it out. It kinda bugs me a bit:
Assume that a player is playing Minecraft with 60FPS. Since Minecraft runs on a 20TPS, where basically everything gets updates 20 times per second (50ms per update), there will be 3 frames rendered on the player's side, while the game only updates once.
We don't see any stutter in player or mob movements that represents the 20 TPS, so how does Minecraft handle this discrepancy?
My initial impression is that Minecraft calculates these things separately, where on the server side, the position and velocity of stuff gets updates only 20 times per second.
Then on the client side, player movements are processed locally, and other movements are calculated and rendered using the data from the server, with interpolated data.
Also, is this the reason why, as mentioned by Mumbo Jumbo in this video, [https://www.youtube.com/watch?v=rY5NZ0PVcTQ&t=1193s](https://www.youtube.com/watch?v=rY5NZ0PVcTQ&t=1193s)
Minecraft is exact with the minecart position but not players?
A random thought just came to me and I can't figure it out. It kinda bugs me a bit:
Assume that a player is playing Minecraft with 60FPS. Since Minecraft runs on a 20TPS, where basically everything gets updates 20 times per second (50ms per update), there will be 3 frames rendered on the player's side, while the game only updates once.
We don't see any stutter in player or mob movements that represents the 20 TPS, so how does Minecraft handle this discrepancy?
My initial impression is that Minecraft calculates these things separately, where on the server side, the position and velocity of stuff gets updates only 20 times per second.
Then on the client side, player movements are processed locally, and other movements are calculated and rendered using the data from the server, with interpolated data.
Also, is this the reason why, as mentioned by Mumbo Jumbo in this video, [https://www.youtube.com/watch?v=rY5NZ0PVcTQ&t=1193s](https://www.youtube.com/watch?v=rY5NZ0PVcTQ&t=1193s)
Minecraft is exact with the minecart position but not players?
Commentaires
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
The minecart vs player difference is because minecarts are fully server-authoritative while player movement has that client prediction layer. So minecarts snap to exact positions but players can have slight desync issues
So if I understood correctly, "Client-side Prediction" describes the method where some calculations are performed on the client side in order to reduce feedback latency, therefore making the game feel more responsive to players.
Also to see if I understand things correctly, are these reasonable interpretations of how stuff gets calculated? Ignoring the latency part first, assuming everything were calculated simultaneously.
Case 1:
Player A, B, C (60FPS, 20TPS) are all moving East at x=0, with the velocity 1m/frame at Frame 0/Tick 0.
Player A stops at frame 1.
Player B reverses and goes 1m/frame West at frame 1.
Player C reverses and goes 1m/frame West at frame 2.
Then on Frame 3 (Tick 1), the server will conclude from the client side data that:
Player A is at x=1, not moving.
Player B is at x=-1, moving West.
Player C is at x=1, moving West.
Case 2:
Player A, B, C (60FPS, 20TPS) are all moving East at x=0, with the velocity 1m/frame at Frame 0/Tick 0.
Connection was cut off from everyone for 1 second (60 Frames) before reconnecting, during which:
Player A kept moving East.
Player B stopped moving at Frame 30.
Player C reversed and started moving West at Frame 30.
Since the server recieved no updates, it assumeed everyone maintains their original movements.
On Frame 60 (Tick 20) when the client-side data finally comes:
Server side data:
Player A: x=60, moving East.
Player B: x=60, moving East.
Player C: x=60, moving East.
Client side data:
Player A: x=60, moving East.
Player B: x=30, not moving.
Player C: x=0, moving West.
So the server then corrects the positions based on the updated values, resulting in:
Player A: No correction.
Player B: Snaps to x=30.
Player C: Snaps to x=0.
If you've read the post thoroughly, you would have realized that:
1. I understood the difference between TPS and FPS
2. My question was about how Minecraft works when these two numbers are different.
So I would appreciate it if you, before replying condescendingly assuming others' ignorance, read the post thoroughly.
If you don't, then I guess we have very different opinions on condescension.
However, due to the original reply being deleted, it'd be difficult to discuss in detail.
Also just to make this Minecraft related, I really like the new baby chicken.