summaryrefslogtreecommitdiff
path: root/docs/tasd-spec-0001/draft-tasd-spec-0001.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tasd-spec-0001/draft-tasd-spec-0001.txt')
-rw-r--r--docs/tasd-spec-0001/draft-tasd-spec-0001.txt160
1 files changed, 88 insertions, 72 deletions
diff --git a/docs/tasd-spec-0001/draft-tasd-spec-0001.txt b/docs/tasd-spec-0001/draft-tasd-spec-0001.txt
index 6903ec8..33b32ef 100644
--- a/docs/tasd-spec-0001/draft-tasd-spec-0001.txt
+++ b/docs/tasd-spec-0001/draft-tasd-spec-0001.txt
@@ -7,7 +7,7 @@ Independent TAS Console Replay Research Group V. Grey
Bigbass
rasteri
- 1 February 2025
+ 16 April 2025
TASD File Format Specification Version 1
@@ -16,13 +16,14 @@ Independent TAS Console Replay Research Group V. Grey
Abstract
The *TASD* file format is used for storing "Tool Assisted Speedrun"
- or "Tool Assisted Superplay" (TAS) data for TAS replay devices to
- replay on physical video game console hardware. The format is
- defined to be expandable for future needs. The format is also
- defined to be parsable by programs that do not understand portions of
- the format, whether that is due to incomplete support of the format
- specification or due to new features being added to later versions of
- the specification at a later date.
+ or "Tool Assisted Superplay" (TAS) input and configuration data for
+ use with devices (known as "TAS replay devices") that replay inputs
+ on physical video game hardware. The format is defined to be
+ expandable for future needs. The format is also defined to be
+ parsable by programs that do not understand portions of the format,
+ whether that is due to incomplete support of the format specification
+ or due to new features being added to later versions of the
+ specification.
This document defines the file format specification for *TASD* files.
@@ -133,8 +134,8 @@ Table of Contents
1. Introduction
The Tool Assisted Speedrun Dump (*TASD*) interchange format is a file
- format for storing data to allow "Tool Assisted Speedruns" or "Tool
- Assisted Superplays" to be played on physical video game console
+ format for storing data that enables "Tool Assisted Speedruns" or
+ "Tool Assisted Superplays" to be played on physical video game
hardware using TAS replay devices. Created to be hardware and
software agnostic, the *TASD* interchange format uses a key-based,
binary, packet format to break up pieces of information into easily-
@@ -148,9 +149,10 @@ Table of Contents
predefined delimiter to separate pieces of data.
While files generated by emulator dump scripts should provide as much
- information as possible, because packets are optional, the file can
- be expanded later with any additional data as desired. No
- intermediary file format is necessary.
+ information as possible, they may be unable to provide everything.
+ Since packets are optional, the file can be expanded later with any
+ additional data as desired. No intermediary file format is
+ necessary.
1.1. Overview and Preliminaries
@@ -171,10 +173,10 @@ Table of Contents
(B) = Boolean
([]N) = List of Unsigned Integers
- We use the terms *byte* and *octet* interchangeably in this document.
-
Unless specified otherwise, all multi-octet integers are big-endian.
+ We use the terms *byte* and *octet* interchangeably in this document.
+
We use the terms *Tool Assisted Speedrun*, *Tool Assisted Superplay*
and *TAS* interchangeably in this document.
@@ -184,18 +186,25 @@ Table of Contents
MOVIE_TRANSITION packet (second order packet).
String values MUST use UTF-8 encoding. As such, string values MAY
- contain any number of NUL characters and have no concept of "null
+ contain any number of NUL characters and do not make use of "null
termination". If an example of a string value is given, the example
will be between quotation marks. The quotation marks are not
included in the string. Not all content between quotations will be
string value examples, so be aware of that when continuing through
this document.
- Unsigned and signed integers can have different bit widths. For
+ Both unsigned and signed integers can have different bit widths. For
instance, an 8-bit integer can be used in one part of the
specification and a 64-bit integer can be used in another part of the
specification.
+ Variable-length integer encoding (also known as VarInt or VLQ) is not
+ used in this format. Instead, arbitrarily sized integers, like those
+ used in Section 4, are prefixed with a single octet that specifies
+ the number of octets used to contain the integer value. In most
+ cases, this is less space-efficient than VarInt encoding, but it is
+ simpler to understand and to parse.
+
Boolean values MUST be a single octet with the value of 0 for *FALSE*
or 1 for *TRUE*.
@@ -266,7 +275,7 @@ Table of Contents
In this example, the packet diagram contains enough variable boxes
to require being split into 2 sections, in order to maintain
- consistent horizontal spacing in this documentation. The packet
+ consistent horizontal spacing in this document. The packet
diagram is separated by an ellipsis (...) on the same text row as
the variable names to signify that the packet diagram is
continuing.
@@ -274,8 +283,8 @@ Table of Contents
1.2. Motivations
This file format's primary goal is to provide a comprehensive and
- replay device agnostic TAS movie controller input dump format that is
- usable for any console. Additional goals include:
+ replay device agnostic TAS input dump format that is usable for any
+ console. Additional goals include:
* No intermediary formats
@@ -342,7 +351,7 @@ Table of Contents
G_KEYLEN (Unsigned Integer) [1 octet]
*Magic Number*
- 4 octet value that MUST be [54 41 53 44](ASCII value TASD).
+ 4 octet value that MUST be [54 41 53 44] (ASCII value TASD).
*Version*
Version of the *TASD* file format. Version currently MUST be a
@@ -640,24 +649,17 @@ Table of Contents
[FE 01] - INPUT_CHUNK
Specifies a chunk of input data for the TAS when played on
- hardware. All data from INPUT_CHUNK packets are concatenated
- together in order of appearance in the *TASD* file. If the
- INPUT_CHUNK packet type is used in a TASD file, the
- PORT_CONTROLLER packet type MUST also be used at least once. If
- the INPUT_CHUNK packet type is used, the INPUT_MOMENT packet type
- SHOULD NOT be used. This packet type is OPTIONAL and a *TASD*
- file MAY contain more than 1 of this packet type. Discussed in
+ hardware. All data from INPUT_CHUNK packets for each controller
+ port are concatenated together in order of appearance in the
+ *TASD* file. This packet type is OPTIONAL and a *TASD* file MAY
+ contain more than 1 of this packet type. Discussed in
(Section 4.3.5.1).
[FE 02] - INPUT_MOMENT
Specifies a single instance of input data that is sent from the
- replay device to the console with specific timing. If the
- INPUT_MOMENT packet type is used in a TASD file, the
- PORT_CONTROLLER packet type MUST also be used at least once. If
- the INPUT_MOMENT packet type is used, the INPUT_CHUNK packet type
- SHOULD NOT be used. This packet type is OPTIONAL and a *TASD*
- file MAY contain more than 1 of this packet type. Discussed in
- (Section 4.3.5.2).
+ replay device to the console with specific timing. This packet
+ type is OPTIONAL and a *TASD* file MAY contain more than 1 of this
+ packet type. Discussed in (Section 4.3.5.2).
[FE 03] - TRANSITION
Specifies when a transition or change occurs during a TAS replay
@@ -747,7 +749,7 @@ Table of Contents
*Video Signal*
Specifies the video signal of the game console being emulated
- while dumping the TAS movie controller inputs.
+ while dumping the TAS movie's controller inputs.
4.3.1.3. GAME_TITLE Packet
@@ -1090,35 +1092,40 @@ Table of Contents
GAME_IDENTIFIER packets MUST be in the following format:
- 0 1 2 3... 3+NLEN...
- +----------+--------------+----------+==========+================+
- | Type (A) | Encoding (A) | NLEN (N) | Name (S) | Identifier (A) |
- +----------+--------------+----------+==========+================+
-
- Type (Binary Data): [1 octet]
- [01] - MD5 Hash
- [02] - SHA1 Hash
- [03] - SHA224 Hash
- [04] - SHA256 Hash
- [05] - SHA384 Hash
- [06] - SHA512 Hash
- [07] - SHA512/224 Hash
- [08] - SHA512/256 Hash
- [09] - SHA3-224 Hash
- [0A] - SHA3-256 Hash
- [0B] - SHA3-384 Hash
- [0C] - SHA3-512 Hash
- [0D] - SHAKE-128 Hash
- [0E] - SHAKE-256 Hash
- [FF] - Other
- Encoding (Binary Data): [1 octet]
- [01] - Raw Binary
- [02] - Base 16 (Case Insensitive)
- [03] - Base 32 (Case Insensitive)
- [04] - Base 64
- NLEN (Unsigned Integer) [1 octet]
- Name (String) [NLEN octets]
- Identifier (Binary Data) [PLEN - 2 octets]
+ 0 1 2 3...
+ +----------+--------------+----------+==========+
+ | Type (A) | Encoding (A) | NLEN (N) | Name (S) | ...
+ +----------+--------------+----------+==========+
+ 3+NLEN...
+ +================+
+ | Identifier (A) |
+ +================+
+
+ Type (Binary Data): [1 octet]
+ [01] - MD5 Hash
+ [02] - SHA1 Hash
+ [03] - SHA224 Hash
+ [04] - SHA256 Hash
+ [05] - SHA384 Hash
+ [06] - SHA512 Hash
+ [07] - SHA512/224 Hash
+ [08] - SHA512/256 Hash
+ [09] - SHA3-224 Hash
+ [0A] - SHA3-256 Hash
+ [0B] - SHA3-384 Hash
+ [0C] - SHA3-512 Hash
+ [0D] - SHAKE-128 Hash
+ [0E] - SHAKE-256 Hash
+ [FF] - Other
+ Encoding (Binary Data): [1 octet]
+ [01] - Raw Binary
+ [02] - Base 16 (Case Insensitive)
+ [03] - Base 32 (Case Insensitive)
+ [04] - Base 64
+ NLEN (Unsigned Integer) [1 octet]
+ Name (String) [NLEN octets]
+ Identifier (Binary Data) [PLEN - NLEN -
+ 3 octets]
*Type*
Hash, checksum, or identifier algorithm used to create the
@@ -1468,7 +1475,8 @@ Table of Contents
[01] - Frame
[02] - Cycle Count
[03] - Milliseconds
- [04] - Microseconds * 10
+ [04] - Microseconds
+ [05] - Nanoseconds
Index (Unsigned Integer) [8 octets]
Inputs (Binary Data) [PLEN - 11 octets]
@@ -1477,8 +1485,9 @@ Table of Contents
Controller port number (*Port* number MUST be *1-indexed*).
*Hold*
- Determines whether the *Input* data MUST continue to be held after
- the controller state has been read.
+ If *TRUE*, the *Input* data MUST continue to be held after the
+ controller state has been read. Otherwise if *FALSE*, the *Input*
+ data is held only until the data has been used once.
*Index Type*
Specifies timing methodology of a specific moment when *Input*
@@ -1508,6 +1517,12 @@ Table of Contents
reads the input state, or until the next INPUT_MOMENT for the same
*Port* number.
+ If an INPUT_MOMENT overlaps with input data from one or more
+ INPUT_CHUNKs, the INPUT_MOMENT's *Input* data MUST be used instead of
+ the data contained in the INPUT_CHUNKs. INPUT_CHUNK data MUST still
+ be incremented as it normally would. *Hold* MUST still behave as
+ specified.
+
4.3.5.3. TRANSITION Packet
TRANSITION packets MUST be in the following format:
@@ -1525,8 +1540,9 @@ Table of Contents
[01] - Frame
[02] - Cycle Count
[03] - Milliseconds
- [04] - Microseconds * 10
- [05] - INPUT_CHUNK Byte Index
+ [04] - Microseconds
+ [05] - Nanoseconds
+ [06] - INPUT_CHUNK Byte Index
Port (Unsigned Integer) [1 octet]
Index (Unsigned Integer) [8 octets]
Type (Binary Data): [1 octet]
@@ -1544,10 +1560,10 @@ Table of Contents
*Index*
Time or offset value to start transition. If *Index Type* is
- [05], *Index* MUST be interpreted as the *byte offset*
+ [06], *Index* MUST be interpreted as the *byte offset*
(*0-indexed*) into the concatenated input data from all
*INPUT_CHUNK* packets for the controller port specified by *Port*.
- If *Index Type* is [05], the byte offset MUST also point to the
+ If *Index Type* is [06], the byte offset MUST also point to the
first byte of an instance of controller input data (according to
the PORT_CONTROLLER format at that moment in the TAS replay.)