Skip to content

Commit 3742437

Browse files
committed
deploy: 3a67cdd
1 parent 2a95e5d commit 3742437

31 files changed

+449
-7
lines changed

.doctrees/bots/index.doctree

24 Bytes
Binary file not shown.

.doctrees/bots/performance.doctree

7.46 KB
Binary file not shown.

.doctrees/environment.pickle

2.35 KB
Binary file not shown.

_sources/bots/index.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ Specifically, bots cannot cheat - no more than a regular player could.
1010
setup
1111
programOverview
1212
programSafety
13+
performance
1314
troubleshooting

_sources/bots/performance.rst.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Performance
2+
===========
3+
Some hints on improving performance.
4+
5+
Distribute work over multiple ticks
6+
-----------------------------------
7+
Most events in the game take some time: shooting, moving, building, processing, etc.
8+
Therefore, it is generally unnecessary to keep updating everything all the time.
9+
10+
It is recommended to split work between multiple ticks to save some cpu time.
11+
Use switch on ``workStep++ mod 10``, and update different systems (eg. analyzing enemies, controlling armies, building, etc..).
12+
Note the use of ``workStep``, which is different variable than the tick provided by the game.
13+
This is to ensure continuous processing of all systems in case that some game ticks are skipped.
14+
15+
Be mindful of potential changes in the game state (eg. entities being destroyed) in between processing different systems.
16+
17+
Performance Statistics
18+
----------------------
19+
The game provides several statistics related to performance, which you can monitor and adapt your program.
20+
21+
- mainThreadUtilization - fraction (0..1) of the time the main thread does any work, vs time it sleeps.
22+
- ping - network delay measured in milliseconds.
23+
- networkUp - network bandwidth use measured in KB/s, from client to game server.
24+
- networkDown - same going from game server to client.
25+
26+
Profiling
27+
---------
28+
The game has built-in performance profiler.
29+
When enabled, it will open a browser with real-time flame-graphs of tasks running on all threads in the game client.
30+
31+
You may also inject your own profiling events.

bots/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
<li class="toctree-l2"><a class="reference internal" href="setup.html">Setup</a></li>
225225
<li class="toctree-l2"><a class="reference internal" href="programOverview.html">Program Overview</a></li>
226226
<li class="toctree-l2"><a class="reference internal" href="programSafety.html">Program Safety</a></li>
227+
<li class="toctree-l2"><a class="reference internal" href="performance.html">Performance</a></li>
227228
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
228229
</ul>
229230
</li>
@@ -302,6 +303,12 @@ <h1>Bots<a class="headerlink" href="#bots" title="Link to this heading">¶</a></
302303
<li class="toctree-l2"><a class="reference internal" href="programSafety.html#hardened-library">Hardened Library</a></li>
303304
</ul>
304305
</li>
306+
<li class="toctree-l1"><a class="reference internal" href="performance.html">Performance</a><ul>
307+
<li class="toctree-l2"><a class="reference internal" href="performance.html#distribute-work-over-multiple-ticks">Distribute work over multiple ticks</a></li>
308+
<li class="toctree-l2"><a class="reference internal" href="performance.html#performance-statistics">Performance Statistics</a></li>
309+
<li class="toctree-l2"><a class="reference internal" href="performance.html#profiling">Profiling</a></li>
310+
</ul>
311+
</li>
305312
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
306313
</ul>
307314
</div>

bots/performance.html

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.

bots/programOverview.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
<li class="toctree-l2"><a class="reference internal" href="setup.html">Setup</a></li>
225225
<li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Program Overview</a></li>
226226
<li class="toctree-l2"><a class="reference internal" href="programSafety.html">Program Safety</a></li>
227+
<li class="toctree-l2"><a class="reference internal" href="performance.html">Performance</a></li>
227228
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
228229
</ul>
229230
</li>

bots/programSafety.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head><meta charset="utf-8"/>
44
<meta name="viewport" content="width=device-width,initial-scale=1"/>
55
<meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
6-
<link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" /><link rel="next" title="Troubleshooting" href="troubleshooting.html" /><link rel="prev" title="Program Overview" href="programOverview.html" />
6+
<link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" /><link rel="next" title="Performance" href="performance.html" /><link rel="prev" title="Program Overview" href="programOverview.html" />
77

88
<!-- Generated with Sphinx 8.2.3 and Furo 2024.08.06 -->
99
<title>Program Safety - UW API documentation</title>
@@ -224,6 +224,7 @@
224224
<li class="toctree-l2"><a class="reference internal" href="setup.html">Setup</a></li>
225225
<li class="toctree-l2"><a class="reference internal" href="programOverview.html">Program Overview</a></li>
226226
<li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Program Safety</a></li>
227+
<li class="toctree-l2"><a class="reference internal" href="performance.html">Performance</a></li>
227228
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
228229
</ul>
229230
</li>
@@ -312,12 +313,12 @@ <h2>Hardened Library<a class="headerlink" href="#hardened-library" title="Link t
312313
<footer>
313314

314315
<div class="related-pages">
315-
<a class="next-page" href="troubleshooting.html">
316+
<a class="next-page" href="performance.html">
316317
<div class="page-info">
317318
<div class="context">
318319
<span>Next</span>
319320
</div>
320-
<div class="title">Troubleshooting</div>
321+
<div class="title">Performance</div>
321322
</div>
322323
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
323324
</a>

bots/setup.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
<li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Setup</a></li>
225225
<li class="toctree-l2"><a class="reference internal" href="programOverview.html">Program Overview</a></li>
226226
<li class="toctree-l2"><a class="reference internal" href="programSafety.html">Program Safety</a></li>
227+
<li class="toctree-l2"><a class="reference internal" href="performance.html">Performance</a></li>
227228
<li class="toctree-l2"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
228229
</ul>
229230
</li>

0 commit comments

Comments
 (0)