Q3 physics: pmove_fixed & pmove_msec
Posted: Fri Apr 06, 2018 21:59
Hi,
you may be aware of the internal Q3 function pmove() which calculates your position by movement (and weapon recoil) and that its calculation depends on the g_gravity setting of the server (which we will ignore as g_gravity is set to "800" by default) and its calling depends on the actual frame rate of the client (your com_maxpfs).
That means,
- if you have (constant) 100 FPS then every 10 msec a frame is received by the server and every 10 msec the pmove() function is called.
- if you have (constant) 125 FPS then every 8 msec a frame is received by the server and every 8 msec the pmove() function is called.
- if you have (constant) 200 FPS then every 5 msec a frame is received by the server and every 5 msec the pmove() function is called.
The issue hereby is that the result of the pmove() calculation varies and depends how often it is called/executed.
You can test this by yourself if you deactivate VSYNC in your OS graphics driver settings, start Q3, go in your console, execute /devmap q3dm6 and try out the following com_maxfps settings: "100", "125", "200", "333". The difference between "100" and "333" should be obvious (if your machine cannot reach such high FPS just reduce your resolution for this test). You could also try out the famous bridge to rail jump which should be easy with 333 FPS.
In fact, 333 FPS is the value that gives the lowest possible gravity and the highest recoil when g_gravity is "800" (default). You could also test that and see completely different results when you change g_gravity.
Furthermore, if you have inconstant FPS then the pmove() function is also called inconstantly which results in slightly different in-game positioning although you do the exact same mouse/key movements. Therefore the Q3 command pmove_fixed has been included.
pmove_fixed
When enabled the pmove() function is called according to the value in pmove_msec which is 8 by default. That means that the calculation result is always like it would be if you have 125 FPS (=1000/8) and it does not matter anymore what your actual FPS might be. With pmove_fixed you get the same positioning results whether you have 100 FPS or 333 FPS or any other value.
The issue with pmove_msec now is that it should be set to a value that matches your average FPS because if you have 200 FPS and use pmove_msec = "8" the position calculation is done as you would have 125 FPS and this leads to display stuttering. Sometimes you even cannot see your own actual position and experience "warping" on your client. This is of course not very practicable as your movement and aiming does not match the actual positions and therefore you cannot hit or move accurately.
But if you want to set pmove_msec to another value as "8" the engine reacts very confusingly (at least for me):
Single player baseq3:
- com_maxfps = "200"; pmove_fixed = "0"; pmove_msec = "8": everything runs smooth but I cannot do bridge to rail jumps
- com_maxfps = "200"; pmove_fixed = "1"; pmove_msec = "8": everything stutters a lot but I can do bridge to rail jumps
- com_maxfps = ""200"; pmove_fixed = "1"; pmove_msec = "5": is not possible as pmove_msec are always reset to "8"
Single player unfreeze:
- com_maxfps = "200"; pmove_fixed = "0"; pmove_msec = "8": everything runs smooth but I cannot do bridge to rail jump.
- com_maxfps = "200"; pmove_fixed = "1"; pmove_msec = "8": everything stutters a lot but I can do bridge to rail jump.
- com_maxfps = ""200"; pmove_fixed = "1"; pmove_msec = "5": the setting of pmove_msec most often show "8" and sometimes "5", i have some stutters and sometimes I can do bridge to rail jump, but most often fail
I have no clue why the value of pmove_msec is reset by baseq3 and why it shows different values in unfreeze (just execute pmove_msec very fast to see the actual value in the console after you set it to "5") but I am not able to set it to the value I need.
Furthermore, I tested this yesterday evening (German time) on the unfreeze server while 20 players were online and experienced more and more stuttering the longer I played. Then I tested it last night around 4 a.m. (German time) only against bots and the stuttering did not increase over time. I will test this further as I reinstalled my graphics driver.
Please try it out for yourself and tell me your experiences so far as I would like to clarify this issue as I really have either in-game moving or display issues which is frustrating. Thanks a lot!
you may be aware of the internal Q3 function pmove() which calculates your position by movement (and weapon recoil) and that its calculation depends on the g_gravity setting of the server (which we will ignore as g_gravity is set to "800" by default) and its calling depends on the actual frame rate of the client (your com_maxpfs).
That means,
- if you have (constant) 100 FPS then every 10 msec a frame is received by the server and every 10 msec the pmove() function is called.
- if you have (constant) 125 FPS then every 8 msec a frame is received by the server and every 8 msec the pmove() function is called.
- if you have (constant) 200 FPS then every 5 msec a frame is received by the server and every 5 msec the pmove() function is called.
The issue hereby is that the result of the pmove() calculation varies and depends how often it is called/executed.
You can test this by yourself if you deactivate VSYNC in your OS graphics driver settings, start Q3, go in your console, execute /devmap q3dm6 and try out the following com_maxfps settings: "100", "125", "200", "333". The difference between "100" and "333" should be obvious (if your machine cannot reach such high FPS just reduce your resolution for this test). You could also try out the famous bridge to rail jump which should be easy with 333 FPS.
In fact, 333 FPS is the value that gives the lowest possible gravity and the highest recoil when g_gravity is "800" (default). You could also test that and see completely different results when you change g_gravity.
Furthermore, if you have inconstant FPS then the pmove() function is also called inconstantly which results in slightly different in-game positioning although you do the exact same mouse/key movements. Therefore the Q3 command pmove_fixed has been included.
pmove_fixed
When enabled the pmove() function is called according to the value in pmove_msec which is 8 by default. That means that the calculation result is always like it would be if you have 125 FPS (=1000/8) and it does not matter anymore what your actual FPS might be. With pmove_fixed you get the same positioning results whether you have 100 FPS or 333 FPS or any other value.
The issue with pmove_msec now is that it should be set to a value that matches your average FPS because if you have 200 FPS and use pmove_msec = "8" the position calculation is done as you would have 125 FPS and this leads to display stuttering. Sometimes you even cannot see your own actual position and experience "warping" on your client. This is of course not very practicable as your movement and aiming does not match the actual positions and therefore you cannot hit or move accurately.
But if you want to set pmove_msec to another value as "8" the engine reacts very confusingly (at least for me):
Single player baseq3:
- com_maxfps = "200"; pmove_fixed = "0"; pmove_msec = "8": everything runs smooth but I cannot do bridge to rail jumps
- com_maxfps = "200"; pmove_fixed = "1"; pmove_msec = "8": everything stutters a lot but I can do bridge to rail jumps
- com_maxfps = ""200"; pmove_fixed = "1"; pmove_msec = "5": is not possible as pmove_msec are always reset to "8"
Single player unfreeze:
- com_maxfps = "200"; pmove_fixed = "0"; pmove_msec = "8": everything runs smooth but I cannot do bridge to rail jump.
- com_maxfps = "200"; pmove_fixed = "1"; pmove_msec = "8": everything stutters a lot but I can do bridge to rail jump.
- com_maxfps = ""200"; pmove_fixed = "1"; pmove_msec = "5": the setting of pmove_msec most often show "8" and sometimes "5", i have some stutters and sometimes I can do bridge to rail jump, but most often fail
I have no clue why the value of pmove_msec is reset by baseq3 and why it shows different values in unfreeze (just execute pmove_msec very fast to see the actual value in the console after you set it to "5") but I am not able to set it to the value I need.
Furthermore, I tested this yesterday evening (German time) on the unfreeze server while 20 players were online and experienced more and more stuttering the longer I played. Then I tested it last night around 4 a.m. (German time) only against bots and the stuttering did not increase over time. I will test this further as I reinstalled my graphics driver.
Please try it out for yourself and tell me your experiences so far as I would like to clarify this issue as I really have either in-game moving or display issues which is frustrating. Thanks a lot!