Event-based server-gameloop in a server based game
Posted
by
Chris
on Game Development
See other posts from Game Development
or by Chris
Published on 2013-07-01T23:25:46Z
Indexed on
2013/07/02
5:14 UTC
Read the original article
Hit count: 525
I know that this site is full of questions about fixed gameloops and variable gameloops and different types of threading. But I coult find barely nothing that is related to server loops.
The server has no screen to draw on. It could just run as fast as possible, but of course this makes no sense. But should it really use single "ticks" and send the updates periodically after each tick and wait for the next "tick" to update its state. Is it applicable to replace the gameloop by multilpe events? Suchs as incoming network traffic or timers? I often heared that a gameloop should be determistic, but does it really matter? For instance, when you play a shooter game against humand players and/or AI you proably would never be ably to repeat the same input twice. Is it a good idea to lose determistic behavior if it is nearly impossible to reprodruce the same input twice?
So this question is more or less about whether an strictly event-based gameloop is adviseable or not and what are the pros and cons. I could imagene that an event-based gameloop could perform much faster and smoother, since you don't have bug CPU-spikes during the beginning of a new "tick".
The fact that I could not find much about an event-based gameloop for servers leads me to the conclusion that inefficient or too complicated to get a real benefit from it.
I'm sure if this is enough to get an idea from what I'm interessted to know, but I hope so.
© Game Development or respective owner