SSBM/Latency

From SuperCombo Wiki
< SSBM
Revision as of 22:38, 3 September 2022 by JazzerThighs (talk | contribs)

The purpose of this page is to document all of the seperate sources of Visual or Audio Latency in the context of SSBM.

Latency refers to the period of time that separates the action of the player pushing buttons and tilting sticks on the controller, and the TV finally displaying the frame that reflects the player's inputs. Assuming ideal conditions, SSBM has approximately 3 to 4 frames of latency, or approximately 50ms to 64.67ms. These measurements vary slightly, but the core experience that competative SSBM players have come to accept as the standard falls within these parameters.

There are always several factors at play when Visual and Audio Latency is measured and calculated:

  • The TV Screen being used
    • Type of Screen
      • Cathode-Ray Tube (CRT) VS. Liquid-Crystal-Display (LCD) VS. LED/OLED/QLED
    • Interlaced VS. Progressive Scan
    • Make/Model of screen
  • Controllers
    • Brands
      • Nintendo-Brand VS. Non-Nintendo Brands
    • Wired or Wireless
  • Console and Hardware
    • GameCube/Wii/Personal Computer
    • I/O
      • Composite VS. Component A/V Cables
      • Wii Analog-To-Digital HDMI Adapter
      • Controller/Port Arduino Devices
      • Audio Connections, Devices, Adapters, and Drivers.

Visual Latency

Visual Latency refers specifically to the delay between a player pressing buttons on the controller, and the frame that reflects those inputs being visible (i.e. it has nothing to do with Audio).

Developer Oversights That Cause Visual Latency in SSBM

When SSBM NTSC 1.02 is played on a GameCube or a Wii, there a few different facets of the system that work in tandem to translate the inputs of the GameCube Controller to data that is displayed on the screen in distinct frames (Note: These systems are present no matter the non-console equipment used to play SSBM:

  • The Read Alarm is the protocol that interprets Controller Inputs and deems them suitable to display on the upcoming frame. The Read Alarm runs at 60Hz.
  • The SSBM Game Engine generates frames of data to be displayed. The SSBM Game Engine runs at 60HZ for the first 1000 frames of a match. Once the match reaches the 1001st frame, the SSBM Game Engine is slowed down to 59.94 Hz.
    • The SSBM Game Engine's Polling Rate is the rate at which the SSBM Game Engine checks for controller inputs, independently of the Read Alarm. The SSBM Game Engine Polls inputs at exactly double its current Clock Speed (120Hz for frames 1-1000, and 119.88Hz for frames 1001+).
  • The GameCube Display Rate is the technical limitation of the speed at which the GameCube can display frames of data. The GCN Display Rate is capped at 59.94Hz.

There exists a discrepancy between the Clock Speeds of each of these separate systems, which can be seen as oversights by the developers of SSBM; In a perfect world, all of these systems would match their Clock Speeds 1:1, however this is not the case in vanilla SSBM. These discrepancies cause two different sources of latency: The Visual Buffer Phenomenon, and the Polling Drift Phenomenon.


Visual Buffer Phenomenon

The Visual Buffer Phenomenon is the first source of latency that is a consequence of the discrepancy in Clock Speeds of the previously mentioned systems.

In a standard match of SSBM, the SSBM Game Engine produces frames of data for the GameCube to display on the Screen via its A/V Out bus. However, the rate at which the SSBM Game Engine produces frames of data is faster than the rate at which the GameCube can display them. The ratio is 60Hz:59.94Hz, or 1000:999 when converted to integers.

This can be interpreted as such:

On frame 1, the SSBM Game Engine has told the GameCube to display 1.001 frames of data.
On frame 2, the SSBM Game Engine has told the GameCube to display 2.002 frames of data.
On frame 2, the SSBM Game Engine has told the GameCube to display 3.003 frames of data.
(. . .)
On frame 999, the SSBM Game Engine has told the GameCube to display 999.999 frames of data.
On frame 1000, the SSBM Game Engine has told the GameCube to display 1001.000 frames of data. <--- DE-SYNCHRONIZED

Upon reaching frame 1000, the SSBM Game Engine has produced a whole full frame of data to be displayed by the GameCube, which is not handled cleanly; On frame 1000, the displayed frame is exactly one frame behind the SSBM Game Engine's 1001st frame, which is the actual present state of the match. This is what causes the frame of latency, or 16.67ms of latency.

It is worth noting that this discrepancy between the Clock Speeds of the SSBM Game Engine and the GameCube's Display Rate is eliminated once frame 1000 is reached; The SSBM Game Engine at this point is slowed down from 60Hz to 59.94Hz, which enables no extra latency to be introduced at this point from this specific discrepancy. However, this change in Clock Speed of the SSBM Game Engine results in a different source of latency, the Polling Drift Phenomenon.

Polling Drift Phenomenon

The Polling Drift Phenomenon is the second source of latency that is a consequence of the discrepancy in Clock Speeds of the previously mentioned systems. Specifically, after the Visual Buffer Phenomenon ends in the added singular frame of visual latency, and a change in the Clock Speed of the SSBM Game Engine, a new discrepancy emerges between the 60Hz Read Alarm and the newly capped 59.94Hz SSBM Game Engine.