Skip to content

Commit 7177b8c

Browse files
authored
Improve sim time doc
1 parent 8f704f0 commit 7177b8c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Doc/Reference/SimTime.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ In order for time-reliant decorators (cooldown, delay, interval, timeout, wait a
1010

1111
## Setting the time
1212

13-
Depending on the intended use case, there's a couple of approaches to setting the time:
13+
```
14+
SimTime.time = 34.14f; // Set the current time (unitless/client specific)
15+
```
1416

15-
1- If all the agents/tickers in your game use the same time, consider setting `SimTime.time` at the beginning of each iteration (or game/physics frame)
17+
When do we need to set the time?
1618

17-
2- In less common cases, different agents may each use their own time. For example, in a turn based game, 'tactical time' (round count) may be used to evaluate some agents while other parts of your game may use real time for animation.
19+
- If all the agents/tickers in your game use the same time, consider setting `SimTime.time` at the beginning of each iteration (or game/physics frame)
20+
21+
- In less common cases, different agents may each use their own time. For example, in a turn based game, 'tactical time' (round count) may be used to evaluate some agents while other parts of your game may use real time for animation.
1822

1923
**Sim time is not thread safe** - you may use sim time in a multi-threaded environment, provided all agents use the same time, and all threads complete work within the current iteration.
2024

0 commit comments

Comments
 (0)