I currently have a game loop that fires off about 20 times per second that updates the game state based on inputs and then package up the result to send off to clients.
My “tick” is currently a counter that I += 1 to every game loop and slap on the packets before I send them off. I am worried that this will not be a feasible path if I want to run the server continuously.
When should I reset the counter? Should I do it before it converts from int to long or wait for a different time? Is there a better made tick timer that will handle this for me?
Im using python 2.7.
Use an
intlike you mentioned.ints have arbitrary precision, you don’t need to worry about wrap around or any of those effects.