   framedelimiter aka gamespeed and userinput
  Hello again,I hope that you aren't confused from the title.There are serveral little problems in my current project (3d social community).At the moment, the program has a very fluctuatic framerate addicting to the pc.Good computers do have more than 350 fps. Old systems are quite slower.The point is, this is an multiuser-program and I need to integrate a normal gamespeed or something link this. Does anyone have a tutorial or a hint for me?Another problem is my userinput. It already works (realized in a new Thread), but inputs are often captured more than one time. If I use the Thread.Sleep-function, partial inputs are not recognized.To my project: I use C# and the directX SDKSry for my bad english, best regardsFreeman4gu   
The canonical game loop.When it comes to input, you don't want it in a thread. In C#, you can listen to input events, and handle them as event handlers; that way, you don't miss quick events like a key-down followed by key-up.;  Hello hplus0603,ok the thread exists furthermore. But now I only use that thread to control the movement of the user. If you press spacebar then a static variable will change and movement is deactiviated and writing is activated in an event handler.Works really well :) and because of there isn't a thread.sleep the flow of the programm is worth better.I have to say, that the subject of the canonical game loop isn't clear for me at the moment, but I am trying to figure it out.   ;  Hello again,now I tried a bit. I think now every computer should have the same gamespeed, but because of the delimiter it doesn't look good, there are several breaks in the gameflow. The speed changes and the user (in this case: me) noticed it.I will post some code:________________________________________________________________________public static float gamespeed = 1.0f;private int LastGameTickCount = 1;protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){  float millysecs = Math.Abs(Environment.TickCount - LastGameTickCount);  gamespeed = millysecs / 1000;  LastGameTickCount = Environment.TickCount;   //(...)}public void ReadUserInput(){  (...)  figur_position.X -= vSide.X * 0.175f * gamespeed;  (...)}_________________________________________________________________________I hope that you can help me...   ;  TickCount is a terrible timer. You want to use something like System.Diagnostics.Stopwatch to track time, which has a lot better resolution.Then you have to realize that network packets may jitter, so you have to compensate for that, and you have to interpolate or extrapolate the player positions accordingly.