Hi,
I don't know if this is the right place to ask and if its hard to understand what i mean or not but i hope its not that hard to understand.
Im trying to make a multiplayer game and i have a while loop that executes while the game is running but with faster computers and internet you can perform more updates than slower computers and also walk faster, attack faster etc. so i want to limit the updates per second to 60 or something like that so everyone will be the same. I know kinda how it works by calculating the difference between the last update and now. But i dont understand what every variable is doing and what it means. Can someone show me a little program that just has 60 updates per second and prints out the frames per second and the ticks per second which will be resetted every time and will be always around 60 but not more than that and just explain with comments very simply what it did?
Simply i want 2 variables which will be increased by 1 around 60 times and they will be printed out every second and then reset it again.
The output should be 95% of the time: "Frames: 60 - Updates: 60" so the game will be ipdated 60 times every second and the fps will be 60 too if the computer can do that else it may be less and laggy but maximum 60 for fast computers. But the Updates should be 60 for any computer.
Thanks in advance,
Aigyptus