<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Time%2C_frames_and_ticks</id>
	<title>Time, frames and ticks - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Time%2C_frames_and_ticks"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;action=history"/>
	<updated>2026-04-30T10:51:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26599&amp;oldid=prev</id>
		<title>Stgatilov: rendering time?</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26599&amp;oldid=prev"/>
		<updated>2020-08-02T10:10:08Z</updated>

		<summary type="html">&lt;p&gt;rendering time?&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:10, 2 August 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l45&quot;&gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;tr.frameCount&amp;#039;&amp;#039;&amp;#039; is number of &amp;lt;tt&amp;gt;idRenderSystemLocal::BeginFrame&amp;lt;/tt&amp;gt; calls. This is the number of frames rendered, this it has little relation to game time or astronomical time. Used inside renderer for various &amp;quot;last updated&amp;quot; properties and etc. Should not be used outside renderer.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;tr.frameCount&amp;#039;&amp;#039;&amp;#039; is number of &amp;lt;tt&amp;gt;idRenderSystemLocal::BeginFrame&amp;lt;/tt&amp;gt; calls. This is the number of frames rendered, this it has little relation to game time or astronomical time. Used inside renderer for various &amp;quot;last updated&amp;quot; properties and etc. Should not be used outside renderer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;backEnd.viewDef-&amp;gt;floatTime&#039;&#039;&#039; and &#039;&#039;&#039;tr.viewDef-&amp;gt;floatTime&#039;&#039;&#039; are some sort of rendering time. They are passed to materials as &amp;lt;tt&amp;gt;time&amp;lt;/tt&amp;gt; variables, also used in cinematics.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;std::time()&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Sys_GetTimeMicroseconds()&amp;#039;&amp;#039;&amp;#039; both return astronomical time since year 1970. Obviously, they never stop.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;std::time()&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Sys_GetTimeMicroseconds()&amp;#039;&amp;#039;&amp;#039; both return astronomical time since year 1970. Obviously, they never stop.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l68&quot;&gt;Line 68:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 70:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;com_frameTime&amp;#039;&amp;#039;&amp;#039; is some sort of overall runtime. Looks astronomical, but with the a strict discrete nature of updates. It is often used for GUI modeling. For instance, game console is modeled based on this time, so slowing down game time via cvars does not reduce console usability. Note that it never stops or changes speed, unlike game time.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;com_frameTime&amp;#039;&amp;#039;&amp;#039; is some sort of overall runtime. Looks astronomical, but with the a strict discrete nature of updates. It is often used for GUI modeling. For instance, game console is modeled based on this time, so slowing down game time via cvars does not reduce console usability. Note that it never stops or changes speed, unlike game time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Important cvars ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Important cvars ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26517&amp;oldid=prev</id>
		<title>Stgatilov: /* Modeling */</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26517&amp;oldid=prev"/>
		<updated>2020-07-25T11:21:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Modeling&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:21, 25 July 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l86&quot;&gt;Line 86:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 86:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The outermost loop is located in &amp;lt;tt&amp;gt;WinMain&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;win_main.cpp&amp;lt;/tt&amp;gt;. It simply runs &amp;lt;tt&amp;gt;idCommonLocal::Frame&amp;lt;/tt&amp;gt; every iteration.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The outermost loop is located in &amp;lt;tt&amp;gt;WinMain&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;win_main.cpp&amp;lt;/tt&amp;gt;. It simply runs &amp;lt;tt&amp;gt;idCommonLocal::Frame&amp;lt;/tt&amp;gt; every iteration.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Before main loop starts, a separate thread is started in &amp;lt;tt&amp;gt;Sys_StartAsyncThread&amp;lt;/tt&amp;gt;, calling &amp;lt;tt&amp;gt;Sys_AsyncThread&amp;lt;/tt&amp;gt; function every 3 ms (as of 2.08) by OS timer ([https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setwaitabletimer SetWaitableTimer]). This separate thread generates async tics. The function calls &amp;lt;tt&amp;gt;idCommonLocal::Async&amp;lt;/tt&amp;gt;, which looks at astronomical time and decides how many async tics to generate (targeting &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;exact &lt;/del&gt;60 Hz frequency). The async ticks are done in &amp;lt;tt&amp;gt;idCommonLocal::SingleAsyncTic&amp;lt;/tt&amp;gt;, which increments &amp;lt;tt&amp;gt;com_ticNumber&amp;lt;/tt&amp;gt; and pushes some more data to sound output.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Before main loop starts, a separate thread is started in &amp;lt;tt&amp;gt;Sys_StartAsyncThread&amp;lt;/tt&amp;gt;, calling &amp;lt;tt&amp;gt;Sys_AsyncThread&amp;lt;/tt&amp;gt; function every 3 ms (as of 2.08) by OS timer ([https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setwaitabletimer SetWaitableTimer]). This separate thread generates async tics. The function calls &amp;lt;tt&amp;gt;idCommonLocal::Async&amp;lt;/tt&amp;gt;, which looks at astronomical time and decides how many async tics to generate (targeting &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;average &lt;/ins&gt;60 Hz frequency). The async ticks are done in &amp;lt;tt&amp;gt;idCommonLocal::SingleAsyncTic&amp;lt;/tt&amp;gt;, which increments &amp;lt;tt&amp;gt;com_ticNumber&amp;lt;/tt&amp;gt; and pushes some more data to sound output.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The iteration of main loop on main thread &amp;lt;tt&amp;gt;idCommonLocal::Frame&amp;lt;/tt&amp;gt; calls:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The iteration of main loop on main thread &amp;lt;tt&amp;gt;idCommonLocal::Frame&amp;lt;/tt&amp;gt; calls:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26516&amp;oldid=prev</id>
		<title>Stgatilov: Added link to #4696</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26516&amp;oldid=prev"/>
		<updated>2020-07-25T09:08:49Z</updated>

		<summary type="html">&lt;p&gt;Added link to #4696&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:08, 25 July 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l114&quot;&gt;Line 114:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 114:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In original Doom 3, async tics happened every 16 ms, which caused a regular micro-stutter. This was fixed as part of [https://bugs.thedarkmod.com/view.php?id=4514 #4614] (linked forum threads are interesting to read). But since most of the game code stores time in integer number of milliseconds, the timestep had to remain 16 ms.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In original Doom 3, async tics happened every 16 ms, which caused a regular micro-stutter. This was fixed as part of [https://bugs.thedarkmod.com/view.php?id=4514 #4614] (linked forum threads are interesting to read). But since most of the game code stores time in integer number of milliseconds, the timestep had to remain 16 ms.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This leads to a strange effect that when uncapped FPS is off, game runs slower by 4% =)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This leads to a strange effect that when uncapped FPS is off, game runs slower by 4% =)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you like to review discussions and issues related to this topic, &quot;uncapped&quot; is a good word to search for, both on forums and on bugtracker.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Also, issue [https://bugs.thedarkmod.com/view.php?id=4696 #4696] serves as a good hub of issues caused by uncapped FPS mode.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Coding]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Coding]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26515&amp;oldid=prev</id>
		<title>Stgatilov: /* Important cvars */</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26515&amp;oldid=prev"/>
		<updated>2020-07-25T09:06:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Important cvars&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:06, 25 July 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l74&quot;&gt;Line 74:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 74:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;com_fixedTic&amp;#039;&amp;#039;&amp;#039;: enables &amp;quot;Uncapped FPS&amp;quot; mode. When value is 0, old 60-FPS mode runs, and every game modeling step is fixed to 16 ms. When value is 0, FPS can go higher than 60, but game modeling timesteps vary.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;com_fixedTic&amp;#039;&amp;#039;&amp;#039;: enables &amp;quot;Uncapped FPS&amp;quot; mode. When value is 0, old 60-FPS mode runs, and every game modeling step is fixed to 16 ms. When value is 0, FPS can go higher than 60, but game modeling timesteps vary.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;com_maxTicTimestep&#039;&#039;&#039;, &#039;&#039;&#039;com_maxTicsPerFrame&#039;&#039;&#039;, &#039;&#039;&#039;com_maxFPS&#039;&#039;&#039;: additional parameters for uncapped FPS mode. They are used to cap timesteps in game modeling in order to make physics stable. See rope physics issue [https://bugs.thedarkmod.com/view.php?id=4924 #4924] and [https://bugs.thedarkmod.com/view.php?id=4696 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Missing footsteps issue &lt;/del&gt;#4696] for rationale behind limits.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;com_maxTicTimestep&#039;&#039;&#039;, &#039;&#039;&#039;com_maxTicsPerFrame&#039;&#039;&#039;, &#039;&#039;&#039;com_maxFPS&#039;&#039;&#039;: additional parameters for uncapped FPS mode. They are used to cap timesteps in game modeling in order to make physics stable. See rope physics issue [https://bugs.thedarkmod.com/view.php?id=4924 #4924] and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Missing footsteps issue &lt;/ins&gt;[https://bugs.thedarkmod.com/view.php?id=4696 #4696] for rationale behind limits.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;timescale&amp;#039;&amp;#039;&amp;#039;: accelerates async ticks, making them happen faster. The intended effect is that game ticks (which are more of less tied to async ticks) will also happen faster, so the whole game will accelerate. I think it should only work without uncapped FPS. Unlike effect of &amp;lt;tt&amp;gt;g_timeModifier&amp;lt;/tt&amp;gt;, timesteps remain the same, but ticks happen more frequently than 60 times per second.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;timescale&amp;#039;&amp;#039;&amp;#039;: accelerates async ticks, making them happen faster. The intended effect is that game ticks (which are more of less tied to async ticks) will also happen faster, so the whole game will accelerate. I think it should only work without uncapped FPS. Unlike effect of &amp;lt;tt&amp;gt;g_timeModifier&amp;lt;/tt&amp;gt;, timesteps remain the same, but ticks happen more frequently than 60 times per second.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l81&quot;&gt;Line 81:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;g_stopTime&amp;#039;&amp;#039;&amp;#039;: stops game time from running completely. Game ticks don&amp;#039;t happen, game time does not increase. The only exception is that &amp;lt;tt&amp;gt;idPlayer::Think&amp;lt;/tt&amp;gt; is called in place of game ticks, so player can move around. Sometimes it&amp;#039;s very useful to enable it straight in debugger, in order to teleport to the place where some event has happened.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;g_stopTime&amp;#039;&amp;#039;&amp;#039;: stops game time from running completely. Game ticks don&amp;#039;t happen, game time does not increase. The only exception is that &amp;lt;tt&amp;gt;idPlayer::Think&amp;lt;/tt&amp;gt; is called in place of game ticks, so player can move around. Sometimes it&amp;#039;s very useful to enable it straight in debugger, in order to teleport to the place where some event has happened.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Modeling ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Modeling ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26514&amp;oldid=prev</id>
		<title>Stgatilov: com_maxFPS mentioned</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26514&amp;oldid=prev"/>
		<updated>2020-07-25T09:06:00Z</updated>

		<summary type="html">&lt;p&gt;com_maxFPS mentioned&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:06, 25 July 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l74&quot;&gt;Line 74:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 74:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;com_fixedTic&amp;#039;&amp;#039;&amp;#039;: enables &amp;quot;Uncapped FPS&amp;quot; mode. When value is 0, old 60-FPS mode runs, and every game modeling step is fixed to 16 ms. When value is 0, FPS can go higher than 60, but game modeling timesteps vary.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;com_fixedTic&amp;#039;&amp;#039;&amp;#039;: enables &amp;quot;Uncapped FPS&amp;quot; mode. When value is 0, old 60-FPS mode runs, and every game modeling step is fixed to 16 ms. When value is 0, FPS can go higher than 60, but game modeling timesteps vary.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;com_maxTicTimestep&#039;&#039;&#039;, &#039;&#039;&#039;com_maxTicsPerFrame&#039;&#039;&#039;: additional parameters for uncapped FPS mode. They are used to cap timesteps in game modeling in order to make physics stable. See rope physics issue [https://bugs.thedarkmod.com/view.php?id=4924 #4924] for rationale behind &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;it&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;com_maxTicTimestep&#039;&#039;&#039;, &#039;&#039;&#039;com_maxTicsPerFrame&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;, &#039;&#039;&#039;com_maxFPS&lt;/ins&gt;&#039;&#039;&#039;: additional parameters for uncapped FPS mode. They are used to cap timesteps in game modeling in order to make physics stable. See rope physics issue [https://bugs.thedarkmod.com/view.php?id=4924 #4924&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;] and [https://bugs.thedarkmod.com/view.php?id=4696 Missing footsteps issue #4696&lt;/ins&gt;] for rationale behind &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;limits&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;timescale&amp;#039;&amp;#039;&amp;#039;: accelerates async ticks, making them happen faster. The intended effect is that game ticks (which are more of less tied to async ticks) will also happen faster, so the whole game will accelerate. I think it should only work without uncapped FPS. Unlike effect of &amp;lt;tt&amp;gt;g_timeModifier&amp;lt;/tt&amp;gt;, timesteps remain the same, but ticks happen more frequently than 60 times per second.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;timescale&amp;#039;&amp;#039;&amp;#039;: accelerates async ticks, making them happen faster. The intended effect is that game ticks (which are more of less tied to async ticks) will also happen faster, so the whole game will accelerate. I think it should only work without uncapped FPS. Unlike effect of &amp;lt;tt&amp;gt;g_timeModifier&amp;lt;/tt&amp;gt;, timesteps remain the same, but ticks happen more frequently than 60 times per second.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26513&amp;oldid=prev</id>
		<title>Stgatilov: Initial version</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Time,_frames_and_ticks&amp;diff=26513&amp;oldid=prev"/>
		<updated>2020-07-25T09:02:58Z</updated>

		<summary type="html">&lt;p&gt;Initial version&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;TDM engine has:&lt;br /&gt;
* many variables storing current &amp;quot;time&amp;quot;&lt;br /&gt;
* some clocks, tics, and timers&lt;br /&gt;
* some cvars causing wildly different behavior of time&lt;br /&gt;
* some time-modifying cvars&lt;br /&gt;
&lt;br /&gt;
It is often necessary to understand the differences between various notions of time.&lt;br /&gt;
The purpose of this article is to help coders with it.&lt;br /&gt;
&lt;br /&gt;
Preliminary note: the original Doom 3 engine works under 60 FPS limit, with fixed game modeling timestep of 16 ms. It is also the default mode of TDM (as of 2.08). The new &amp;#039;&amp;#039;&amp;#039;Uncapped FPS&amp;#039;&amp;#039;&amp;#039; mode was added specifically in TDM: it can run with higher FPS, but models game with varying timestep. It can be enabled either as &amp;lt;tt&amp;gt;com_fixedTic 1&amp;lt;/tt&amp;gt; and by checkbox in graphics menu. The cvar was hijacked: it meant something completely different in original Doom 3 engine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Times ===&lt;br /&gt;
&lt;br /&gt;
The main types of time are:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;astronomical time&amp;#039;&amp;#039;&amp;#039;. This time goes exactly as the physical time outside of your computer does.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;game time&amp;#039;&amp;#039;&amp;#039;. This is the time going in-game in terms of gameplay. Mainly, all the physics are simulated based on this time.&lt;br /&gt;
&lt;br /&gt;
Of course, even if you choose one of these types, the exact value depends also on things like (not counting obvious beginning of era and measurement units):&lt;br /&gt;
&lt;br /&gt;
# Is the time paused or accelerated under some conditions? (e.g. some astronomical time can exclude time spent in main menu)&lt;br /&gt;
# Is the time save-game persistent, i.e. written to savefile and restored on load? (e.g. gameplay time shown to player at the end)&lt;br /&gt;
&lt;br /&gt;
Some additional timelike quantities include:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;frame number&amp;#039;&amp;#039;&amp;#039; (&amp;lt;tt&amp;gt;tr.frameCount&amp;lt;/tt&amp;gt;). This often serves as time in renderer. Some time ago similar notions were also used as time in game code, but it is completely wrong in &amp;quot;uncapped FPS&amp;quot; mode.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;async tick number&amp;#039;&amp;#039;&amp;#039; (&amp;lt;tt&amp;gt;com_ticNumber&amp;lt;/tt&amp;gt;). This is a counter incremented in separate thread every with 60 FPS speed. It approximately controls game time in default mode (uncapped FPS disabled). See modeling section for details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Notable values ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;gameLocal.time&amp;#039;&amp;#039;&amp;#039; represents game time in milliseconds.&lt;br /&gt;
It starts from zero when game/map is started.&lt;br /&gt;
It is persistent on save/load.&lt;br /&gt;
While it is kept roughly in sync with astronomical time, it can drift away due to accidental missed ticks and such.&lt;br /&gt;
Also, it is paused when player is in main menu, when &amp;lt;tt&amp;gt;g_stopTime&amp;lt;/tt&amp;gt; is enabled, and at &amp;quot;press attack to start&amp;quot; screen.&lt;br /&gt;
As seen in &amp;lt;tt&amp;gt;idGameLocal::RunFrame&amp;lt;/tt&amp;gt;, its speed is multiplied by &amp;lt;tt&amp;gt;g_timeModifier&amp;lt;/tt&amp;gt;, which is often used for debugging purposes.&lt;br /&gt;
This is the main time used everywhere: it controls physics, AI, animation, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;gameLocal.framenum&amp;#039;&amp;#039;&amp;#039; is the number of game ticks modeled during current game.&lt;br /&gt;
Unlike what words say, it has nothing to do with rendering frames.&lt;br /&gt;
Game tick is one call of &amp;lt;tt&amp;gt;idGameLocal::RunFrame&amp;lt;/tt&amp;gt;. Every such call, game time is incremented by the passed timestep. Obviously, timestep varies due to various factors (uncapped FPS, &amp;lt;tt&amp;gt;g_timeModifier&amp;lt;/tt&amp;gt;), so number of game ticks and game time can&amp;#039;t be obtained one from the other.&lt;br /&gt;
This value is persistent on save/load, paused by same things as &amp;lt;tt&amp;gt;gameLocal.time&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;tr.frameCount&amp;#039;&amp;#039;&amp;#039; is number of &amp;lt;tt&amp;gt;idRenderSystemLocal::BeginFrame&amp;lt;/tt&amp;gt; calls. This is the number of frames rendered, this it has little relation to game time or astronomical time. Used inside renderer for various &amp;quot;last updated&amp;quot; properties and etc. Should not be used outside renderer.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;std::time()&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Sys_GetTimeMicroseconds()&amp;#039;&amp;#039;&amp;#039; both return astronomical time since year 1970. Obviously, they never stop.&lt;br /&gt;
The latter function was added in TDM, and unless one second resolution is enough, better prefer it.&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Sys_Milliseconds()&amp;#039;&amp;#039;&amp;#039; returns astronomical time since the moment executable was started.&lt;br /&gt;
These values should not be used in general. Exceptions include: high-level time/game modeling code (to sync game time to astronomical),&lt;br /&gt;
reporting gameplay time to user (use &amp;lt;tt&amp;gt;m_GamePlayTimer&amp;lt;/tt&amp;gt; for this).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Sys_GetClockTicks()&amp;#039;&amp;#039;&amp;#039; relies on RDTSC counter, and returns number of CPU clocks passed since some moment.&lt;br /&gt;
God knows how it interacts with sleeping, variable CPU frequency, multicore coherency, etc., so it cannot be called exactly astronomical.&lt;br /&gt;
It can only be used for high-precision low-duration benchmarking on single core (e.g. SIMD code benchmarks), and never for anything important.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;gameLocal.m_GamePlayTimer&amp;#039;&amp;#039;&amp;#039; (both &amp;lt;tt&amp;gt;_timePassed&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;_msecPassed&amp;lt;/tt&amp;gt;) reflects how much &amp;#039;&amp;#039;&amp;#039;astronomical&amp;#039;&amp;#039;&amp;#039; time player has spent in action during current playthrough.&lt;br /&gt;
It&amp;#039;s sole purpose is to report &amp;quot;played for 45 minutes 13 seconds&amp;quot; to player when he finished mission. Never use it for anything related to gameplay/physics/rendering!&lt;br /&gt;
While it runs with the speed of astronomical time, it is 1) saved/restored in savegames, and 2) paused when player is at main menu or at &amp;quot;press attack to start&amp;quot; screen.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;com_ticNumber&amp;#039;&amp;#039;&amp;#039; is the number of async ticks happened since async thread was started (most likely since executable was started)&lt;br /&gt;
Async ticks are the calls of function &amp;lt;tt&amp;gt;idCommonLocal::SingleAsyncTic&amp;lt;/tt&amp;gt;, happening on a separate thread with help of OS timer.&lt;br /&gt;
It plays important role when uncapped FPS is off, since game ticks are more or less synchronized to async tics (although some drifts are possible as usual).&lt;br /&gt;
Unless you decide to change high-level game modeling code, better not mess with this value.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;com_frameNumber&amp;#039;&amp;#039;&amp;#039; is number of times &amp;lt;tt&amp;gt;idCommonLocal::Frame&amp;lt;/tt&amp;gt; was called. This is the upper-most function called in infinite loop. It is the number reported as &amp;quot;frame&amp;quot; by &amp;lt;/tt&amp;gt;com_speeds&amp;lt;/tt&amp;gt;. Not much else can be said here: just keep away from it.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;com_frameTime&amp;#039;&amp;#039;&amp;#039; is some sort of overall runtime. Looks astronomical, but with the a strict discrete nature of updates. It is often used for GUI modeling. For instance, game console is modeled based on this time, so slowing down game time via cvars does not reduce console usability. Note that it never stops or changes speed, unlike game time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Important cvars ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;com_fixedTic&amp;#039;&amp;#039;&amp;#039;: enables &amp;quot;Uncapped FPS&amp;quot; mode. When value is 0, old 60-FPS mode runs, and every game modeling step is fixed to 16 ms. When value is 0, FPS can go higher than 60, but game modeling timesteps vary.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;com_maxTicTimestep&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;com_maxTicsPerFrame&amp;#039;&amp;#039;&amp;#039;: additional parameters for uncapped FPS mode. They are used to cap timesteps in game modeling in order to make physics stable. See rope physics issue [https://bugs.thedarkmod.com/view.php?id=4924 #4924] for rationale behind it.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;timescale&amp;#039;&amp;#039;&amp;#039;: accelerates async ticks, making them happen faster. The intended effect is that game ticks (which are more of less tied to async ticks) will also happen faster, so the whole game will accelerate. I think it should only work without uncapped FPS. Unlike effect of &amp;lt;tt&amp;gt;g_timeModifier&amp;lt;/tt&amp;gt;, timesteps remain the same, but ticks happen more frequently than 60 times per second.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;g_timeModifier&amp;#039;&amp;#039;&amp;#039;: accelerates game time by this multiplier. Note that it is applied directly to timestep in &amp;lt;tt&amp;gt;idGameLocal::RunFrame&amp;lt;/tt&amp;gt;, it does not change the number of modeled game ticks, but makes every timestep longer. So it affects physics stability: setting high values can easily break things.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;g_stopTime&amp;#039;&amp;#039;&amp;#039;: stops game time from running completely. Game ticks don&amp;#039;t happen, game time does not increase. The only exception is that &amp;lt;tt&amp;gt;idPlayer::Think&amp;lt;/tt&amp;gt; is called in place of game ticks, so player can move around. Sometimes it&amp;#039;s very useful to enable it straight in debugger, in order to teleport to the place where some event has happened.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modeling ===&lt;br /&gt;
&lt;br /&gt;
The outermost loop is located in &amp;lt;tt&amp;gt;WinMain&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;win_main.cpp&amp;lt;/tt&amp;gt;. It simply runs &amp;lt;tt&amp;gt;idCommonLocal::Frame&amp;lt;/tt&amp;gt; every iteration.&lt;br /&gt;
&lt;br /&gt;
Before main loop starts, a separate thread is started in &amp;lt;tt&amp;gt;Sys_StartAsyncThread&amp;lt;/tt&amp;gt;, calling &amp;lt;tt&amp;gt;Sys_AsyncThread&amp;lt;/tt&amp;gt; function every 3 ms (as of 2.08) by OS timer ([https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setwaitabletimer SetWaitableTimer]). This separate thread generates async tics. The function calls &amp;lt;tt&amp;gt;idCommonLocal::Async&amp;lt;/tt&amp;gt;, which looks at astronomical time and decides how many async tics to generate (targeting exact 60 Hz frequency). The async ticks are done in &amp;lt;tt&amp;gt;idCommonLocal::SingleAsyncTic&amp;lt;/tt&amp;gt;, which increments &amp;lt;tt&amp;gt;com_ticNumber&amp;lt;/tt&amp;gt; and pushes some more data to sound output.&lt;br /&gt;
&lt;br /&gt;
The iteration of main loop on main thread &amp;lt;tt&amp;gt;idCommonLocal::Frame&amp;lt;/tt&amp;gt; calls:&lt;br /&gt;
# &amp;lt;tt&amp;gt;idSession::Frame&amp;lt;/tt&amp;gt; --- responsible for game modeling and possible waiting if working too fast.&lt;br /&gt;
# &amp;lt;tt&amp;gt;idSession::UpdateScreen&amp;lt;/tt&amp;gt; --- backend renders new frame to display, waiting for VSync if &amp;lt;tt&amp;gt;r_swapInterval&amp;lt;/tt&amp;gt; is enabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;idSessionLocal::Frame&amp;lt;/tt&amp;gt; is the most interesting place because it explains how rendering frames, async tics and game ticks are all tied together. While this function is called once per rendering frame, it does not necessarily performs one game tick per frame. The way it works depends on whether Uncapped FPS is enabled or not:&lt;br /&gt;
&lt;br /&gt;
* Disabled (default): Looks at async ticks number &amp;lt;tt&amp;gt;com_ticNumber&amp;lt;/tt&amp;gt;, let&amp;#039;s says it has increased by K since last time. If K == 0, then waits (nothing to do yet). Otherwise, models K game ticks, with timestep = 16 ms each.&lt;br /&gt;
* Enabled: Looks at how much astronomical time has passed since last time, let&amp;#039;s say it is dT ms. Unless this dT is too large, models one game tick with timestamp = dT. In order to cap timestep and stabilize game physics, timesteps longer than 17 ms are broken into several game ticks of equal duration. If dT is too small, then the function spinlocks a bit (limits FPS from above).&lt;br /&gt;
&lt;br /&gt;
Both code paths have a limit of doing 10 game ticks per call. If it is exceeded, then deltatime is lowered, allowing game time to lag behind astronomical time. Also, in both cases game ticks are not modeled immediately due because of &amp;lt;tt&amp;gt;com_smp&amp;lt;/tt&amp;gt;, only some variables are set.&lt;br /&gt;
&lt;br /&gt;
In fact, both approaches are trying to synchronize game time with astronomical time, but the old approach does this with intermediate layer of async tics generates by separate thread, while uncapped FPS mode is tied to astronomical time directly. The former is more deterministic in terms of game modeling, while the latter is more flexible to adapt timestep at higher FPS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;idSessionLocal::ActivateFrontend&amp;lt;/tt&amp;gt; is the function which calls:&lt;br /&gt;
# &amp;lt;tt&amp;gt;idSessionLocal::RunGameTics&amp;lt;/tt&amp;gt; --- performs game ticks modeling.&lt;br /&gt;
# &amp;lt;tt&amp;gt;idSessionLocal::DrawFrame&amp;lt;/tt&amp;gt; --- runs renderer frontend.&lt;br /&gt;
It is called on separate thread if &amp;lt;tt&amp;gt;com_smp&amp;lt;/tt&amp;gt; is enabled, and directly from &amp;lt;tt&amp;gt;idSessionLocal::UpdateScreen&amp;lt;/tt&amp;gt; if it is not.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;idSessionLocal::RunGameTics&amp;lt;/tt&amp;gt; calls &amp;lt;tt&amp;gt;idGameLocal::RunFrame&amp;lt;/tt&amp;gt; with timestep computed by &amp;lt;tt&amp;gt;idSessionLocal::Frame&amp;lt;/tt&amp;gt;, as many times as required. The latter function actually does the game modeling, increasing game tick number &amp;lt;tt&amp;gt;gameLocal.framenum&amp;lt;/tt&amp;gt; and game time &amp;lt;tt&amp;gt;gameLocal.time&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
&lt;br /&gt;
An attentive reader might have noticed that async tics are generated at frequency 60 Hz, game modeling timestep is 16 ms, and these two numbers don&amp;#039;t match.&lt;br /&gt;
As you know, VSync on standard monitors happens 60 times per second with good precision. In order to avoid micro-stutters, game ticks should happen with same frequency.&lt;br /&gt;
In original Doom 3, async tics happened every 16 ms, which caused a regular micro-stutter. This was fixed as part of [https://bugs.thedarkmod.com/view.php?id=4514 #4614] (linked forum threads are interesting to read). But since most of the game code stores time in integer number of milliseconds, the timestep had to remain 16 ms.&lt;br /&gt;
This leads to a strange effect that when uncapped FPS is off, game runs slower by 4% =)&lt;br /&gt;
&lt;br /&gt;
[[Category: Coding]]&lt;/div&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
</feed>