File tree Expand file tree Collapse file tree 1 file changed +25
-5
lines changed
Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,28 @@ The following data types are used:
114114* uuid is 16 bytes of a UUID
115115
116116the UUIDs are version 3 UUIDs, with the teeworlds namespace e05ddaaa-c4e6-4cfb-b642-5d48e80c0029
117- a tick is implicit in these messages when a player with lower cid is recorded using any of PLAYER\_ DIFF, PLAYER\_ NEW, PLAYER\_ OLD
118- e.g.
119- PLAYER\_ DIFF cid=0 … PLAYER\_ NEW cid=5 … PLAYER\_ OLD cid=3 has an implicit tick between the cid=5 and the cid=3 message
120- another correction:
121- the header is the teehistorian uuid followed by a zero-terminated string containing json in a self-explanatory format
117+
118+ (Implicit) Ticks
119+ ----------------
120+
121+ Teehistorian messages are associated with in-game tick numbers. The tick of a
122+ message depends on all previous messages. It can't be calculated locally.
123+
124+ * TICK\_ SKIP messages explicitly increase the tick by ` dt + 1 ` .
125+ * PLAYER\_ DIFF, PLAYER\_ NEW, PLAYER\_ OLD can implicity increment the tick by 1.
126+ They imply a tick increment, if the last message of the three kinds held an
127+ equal or lower cid and there wasn't a TICK\_ SKIP message inbetween.
128+
129+ In Python-like pseudocode:
130+ ``` py
131+ tick = 0
132+ implicit_cid = None
133+ for message in messages:
134+ if message.kind == TICK_SKIP :
135+ tick += message.dt + 1
136+ implicit_cid = None
137+ if message.kind is in [PLAYER_DIFF , PLAYER_NEW , PLAYER_OLD ]:
138+ if implicit_cid is not None and message.cid <= implicit_cid:
139+ tick += 1
140+ implicit_cid = message.cid
141+ ```
You can’t perform that action at this time.
0 commit comments