From c9539f1127e3fe50a07c87a9420df3bcc3380cea Mon Sep 17 00:00:00 2001 From: bigbass1997 Date: Wed, 16 Apr 2025 15:48:50 -0500 Subject: Hopefully final specification changes before version 1 release. --- src/docs/draft-tasd-spec-0001.xml | 57 +++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 23 deletions(-) (limited to 'src/docs') diff --git a/src/docs/draft-tasd-spec-0001.xml b/src/docs/draft-tasd-spec-0001.xml index 5c8036e..5c184db 100644 --- a/src/docs/draft-tasd-spec-0001.xml +++ b/src/docs/draft-tasd-spec-0001.xml @@ -36,16 +36,16 @@ General Independent TAS Console Replay Research Group - 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. + The TASD file format is used for storing "Tool Assisted Speedrun" 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.
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 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-parsable and forward-compatible chunks. The format is extensible by simply defining additional keys or value types as necessary. When parsing the file, software can skip any packets whose key is unknown or unsupported. + The Tool Assisted Speedrun Dump (TASD) interchange format is a file 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-parsable and forward-compatible chunks. The format is extensible by simply defining additional keys or value types as necessary. When parsing the file, software can skip any packets whose key is unknown or unsupported. Packets of a given type can be used multiple times or completely omitted as needed. This reusability eliminates the need of a 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. + While files generated by emulator dump scripts should provide as much 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.
Overview and Preliminaries The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 when, and only when, they appear in all capitals, as shown here. @@ -60,12 +60,13 @@
  • (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. - In subsections of (), the term "in direct form" is used. That term is defined to mean a packet in a TASD file directly (first order packet) rather than a packet inside a TRANSITION or 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 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 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. + In subsections of (), the term "in direct form" is used. That term is defined to mean a packet in a TASD file directly (first order packet) rather than a packet inside a TRANSITION or 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 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. + 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 , 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.
    [N octets]
    A sequence of octets with a length of N
    @@ -130,13 +131,13 @@ +-----------+===========+]]>
      -
    • 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 diagram is separated by an ellipsis (...) on the same text row as the variable names to signify that the packet diagram is continuing.
    • +
    • 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 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.
    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: + This file format's primary goal is to provide a comprehensive and replay device agnostic TAS input dump format that is usable for any console. Additional goals include:
    • No intermediary formats
    • Forward compatibility
    • @@ -187,7 +188,7 @@
      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 value of 1, but SHOULD be incremented in future versions.
      G_KEYLEN
      @@ -381,9 +382,9 @@ Input Frame/Timing Key Descriptions
      [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 ().
      +
      Specifies a chunk of input data for the TAS when played on 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 ().
      [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 ().
      +
      Specifies a single instance of input data that is sent from the 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 ().
      [FE 03] - TRANSITION
      Specifies when a transition or change occurs during a TAS replay (example: console reset or changing of controller types). This packet type is OPTIONAL and a TASD file MAY contain more than 1 of this packet type. Discussed in ().
      [FE 04] - LAG_FRAME_CHUNK
      @@ -455,7 +456,7 @@
      Video Signal
      -
      Specifies the video signal of the game console being emulated while dumping the TAS movie controller inputs.
      +
      Specifies the video signal of the game console being emulated while dumping the TAS movie's controller inputs.
    @@ -785,10 +786,14 @@ GAME_IDENTIFIER Packet GAME_IDENTIFIER packets MUST be in the following format: + Identifier (Binary Data) [PLEN - NLEN - + 3 octets]]]>
    Type
    @@ -1131,7 +1137,8 @@ [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] ]]> @@ -1140,7 +1147,7 @@
    Port
    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 data MUST be applied.
    Index
    @@ -1152,6 +1159,7 @@
    Each INPUT_MOMENT packet contains a single instance of controller input data for a specific moment during a TAS replay. The input data's format depends on the PORT_CONTROLLER type corresponding to the Port number. Refer to for each available type. The PORT_CONTROLLER type MAY be changed using TRANSITION packets, which MAY change the interpretation of the input data. If Hold is TRUE, the controller MUST continually hold the input state until the next INPUT_MOMENT for the same Port number. If Hold is FALSE, the controller MUST hold only until the console 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.
    TRANSITION Packet @@ -1170,8 +1178,9 @@ [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] @@ -1187,7 +1196,7 @@
    Port
    Controller port number (Port number MUST be 1-indexed).
    Index
    -
    Time or offset value to start transition. If Index Type is [05], 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 first byte of an instance of controller input data (according to the PORT_CONTROLLER format at that moment in the TAS replay.)
    +
    Time or offset value to start transition. If Index Type is [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 [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.)
    Type
    Type of transition. If Type is [FF], the transition action will be interpreting a TASD packet.
    Inner Packet
    @@ -1928,6 +1937,8 @@ THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR(S) "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.