Capture your NES Classic Tetris gameplay

NestrisChamps is an online suite of tools to capture and track your NES Classic Tetris gameplay. It supports capturing from emulators as well as from the raw video feed from your NES.

"Capturing" means reading the video frames, and extracting game information from them, such as score, lines, level, blocks in board, and piece stats.

With game data captured, a world of possibilities opens up:

  • Re-draw game data in custom layouts with pixel perfect crispness
  • Compute statistics from the gameplay (Tetris Rate, Efficiency, Droughts)
  • Record scores and game files in a database
  • Pit multiple players against each other in competition layouts with stat differentials

Getting started: 1-2 Go!

NestrisChamps is a 2-steps system.

  1. Calibrate capture
  2. Render

Once calibration is done, streaming with NestrisChamps is easy as pie! You just need to add ONE Browser Source component to OBS / SLOBS, to have the captured gameplay re-rendered, and you are ready to stream right away!

There's no manual cutting of the source video stream to do, everything is ready in just a few clicks.

So, to get started, the first you need to do is to calibrate.

Before You do that however, it is strongly recommended that, you spend time on these 2 resources.

Once you've read the doc, go and calibrate your capture here.

And once you've calibrated, pick a renderer for your Browser Source in the renderers page.

Stats! So many stats!

The NES has very little real-estate, which severely limits the space available for stats beside gameplay itself. Once game data is acquired in NestrisChamps however, it can be renderered in a large HD canvas, offering much more space for stats. In NestrisChamps, all layouts are provided to run in 720p resolution (1280x720), but custom renderers could be made in 1080p resolution or even (gasp!) 4K!

Classic layout

Das trainer layout (capturing the Das Trainer rom)

Recording and Replays

Once you have calibrated NestrisChamps, and you play while capturing is on, all your games will be captured in NestrisChamps' database. The layouts themselves may show a small portion of your high scores and personal best scores (PBs), but all your scores and games are available for your review at your personal scores page.

Games can be replayed in layouts others than the one they were captured in. And any 2 games can be pitted against each other in competition layouts.

Replays can be sped up too (because who has the time to watch replay in real time?!). To speed up a replay, use the query string

?speed=X
where X represents the speed-up factor.

Layouts

With data, the sky is the limit when it comes to redrawing gameplay. NestrisChamps comes with a variety of pre-build renderers. Additionally, it is easy to make your own layouts! Either for your personal use, or to add to NestrisChamps for everyone's benefit. Below are some examples.

Stencil layouts - extra info and warning: The stencil layouts are aligned to CTM Stencil for gameplay. A player may use NestrisChamps to record their games and produce crisp video output, while being compatible with restreamers' setups to compete against other players. NestrisChamps however does not render non-gameplay screens (menu screen, level selection, and score board). Because of that, you should always check with your restreamer game host, or competition organizers, if they are OK with using the NestrisChamps Stencil layouts for qualification, and for the competitions themselves. Competition organizers may have requirements to enter auth codes in the score board to ensure real-time authenticity. NestrisChamps does not support this at the moment.

Stencil layout (compatible with CTM Stencil!)

Stencil Plus

Simple 1p

Tomello Soulman

Champions

Plain Text

Game Hosting and Tournaments

While you can use NestrisChamps purely to capture and stream your own gameplay, one great thing about NestrisChamps is that you can connect your game stream to someone else's renderer, who acts as a game host. And of course, you can be a game host yourself!

Game hosting with NestrisChamps is incredibly easy!

  1. Set a browser source in OBS to one of NestrisChamps competition layouts, that you can find in the renderers page
  2. Control which player should be shown in the layout from the admin page
  3. Commentate on games, and let your commentating flavour earn you fame and glory!

There are a variety of competition layouts to chose from, with some examples below.

CTM

Garage 2

CTJC

Compact 2 to 4

Features and Tools

Native webcam support

In layouts that support it, webcam is automatically captured from the game capture page, and shown in the layout at the correct location and dimensions. This has several advantages:

  • Webcam feed is send directly from the capture page to the renderer for very low latency rendering! This is unlike capture from player's twitch stream, where Twitch broadcasting adds a few seconds of delay (sometimes many seconds!).
  • Game hosting is even simpler: a game host doesn't have to worry about getting player cam via other means (e.g. capturing and cutting from player stream, or using other tools like discord video calls, or OBS.ninja)
  • Layouts can have multiple modes and handle the player cams with no interraction from the game host. For example, the layout CTM-2-Matches can automatically switch between a 2-match view or single-match view and webcams feed are automatically taken care of.

Twitch Chat Integration

For layouts that support it, Twitch chats is automatically renderered into the layout.

Additionally, the capture page can be loaded with a query string

?tts=1
to activate Text-To-Speech, and chat messages will be read to the player, with one random voice assigned to each participant of the chat.

Invisible Tetris Renderer

Classic Tetris expert players can play in an invisible mode with the following Game Genie code.

OXYOUO
VNIPZN
VNTPYN

It is hard enough for expert players themselves to track the invisible field, and it is practically impossible for stream viewers to follow. NestrisChamps comes to the rescue here with a Invisible Tetris renderer! While the player plays invisible Tetris and must keep track of the board in their head. The audience to the stream get to see the "phantom" pieces in the board directly.

Counting score past maxout

NES Tetris stops counting score at 999,999. With a custom Game Genie code, it is possible to count past this (up to 1,600,000) with using a hexadecimal character as first letter (e.g. A is 1 million, B is 1.1 million, C, is 1.2 million, etc)

Folks do not necessarily have a Game Genie though. Well, NestrisChamps to the rescue for this case too! By inspecting the line clears in the game, NestrisChamps is able to add up score beyond maxout, and display it in the layouts.

As a bonus, levels in NES classic Tetris are not displayed correctly beyond level 30. NestrisChamps corrects the levels based on line clears!

Qualifier renderer

Many online events have a qualifier format, where players must qualify to determine in which bracket they will play.

Most qualifiers have the same sort of requirements: stream for a specific amount of time, track your qual score, as either the highest score you can achieve during your qual session, or average of top 2, or top 3.

NestrisChamps offers a qualifier layout. The layout is CTM-stencil-based, includes a built-in timer, and computes the qual score as the average of top X (3 by default). Native webcam is active in this layout, so players can show their webcam capture works, if that is a requirement of the tournament they are joining.

The layout tracks scores from the moment it is loaded, and the timer starts as soon as the layout loads.

The qualifier layout can be tuned with the following parameters, which can be added to the query string.

minutes=X
where X is the qualifier time (default to 120 minutes, i.e. 2 hours)
average_of=Y
where Y can be one of 1, 2, or 3 (defaults to 3)
?minutes=60&average_of=2

Backgrounds

Many of the layouts in NestrisChamps come with changeable backgrounds. It's of course possible to request NO background too, so a user may set whichever custom background they want in OBS. Still, there are some built-in backgrounds you can consider using.

Select a background by adding the following query string to the layout URL

?bg=NUM

where NUM is a number, as follows:

  1. (no background)
  2. Black background with randomly positioned tetris tiles
  3. Green NestrisChamps animated background
  4. Rainbow NestrisChamps animated background

Timer Tool

Some competitions might not allow NestrisChamps for qualifiers. For those, it is typically expected that players will stream their qualification run while being stencil-ready, and include some custom timer in their OBS stream.

It is surprisingly annoying to find a very light timer to use. Most players resort to finding a timer on the internet, and capture it with window capture in OBS. That is waaayyy heavier than it needs to be.

NestrisChamps provides a very simple timer that can be used in your OBS layout. Simply create a new Browser Source with canvas size 268x44 (you can scale its size in OBS later), and load the URL: https://nestrischamps.herokuapp.com/tools/timer/.

The timer can be customized with the following parameters:

minutes=X
where X is a integer representing the duration in minutes of the timer (defaults to 120, i.e. 2 hours)
type=Y
where Y can be one of 'up' or 'down' to indicate whether this is a count-up or count-down timer.
text_color=H
where H is the hex representation of a color for the text (defaults to black)
bg_color=H
where H is the hex representation of a color for the background (defaults to white)
?minutes=60&type=down&text_color=ffffff&bg_color=000000

Source code and documentation for the timer is available here

When running an official CTWC event, most tournaments use a common footer that cycles between multiple "slides" of information (e.g. event name, facebook page, etc.)

NestrisChamps makes available a simple footer that can be easily loaded in OBS. The footer has size 1280x32, and can thus be easily added as a standalone browser source, above many of the competition layouts, which specificaly leave a 32px strip at the bottom.

The footer can be customized with the following parameters:

event=X
where X is the name of the event (defaults to "SINGAPORE CHAMPIONSHIP 2021")
cycle_seconds=Y
where Y is an integer representing how many seconds each slide should stay before cycling (defaults to 10).
system=Z
Indicates whether this is a PAL or NTSC event (defaults to NTSC)
?cycle_seconds=15&event=Marq's%20garage%20party

Source code and documentation for the footer is available here

Native emulator support

Capture is the most critical part of NestrisChamps. Without good data in, NestrisChamps can't compute stats from gameplay accurately.

While we can't do without frame capture for a video feed from a NES, frame capture is unecessary in an emulator! Indeed game data can be read from the game itself and sent to NestrisChamps' server! This exactly what Maurice did when he created the NestrisChamps emulator connector!

If you play NES Tetris in one of FCEUX, Mesen, or BizHawk (basically emulators with support for lua scripting), then you can easily use the NestrisChamps Emulator Connector.

Because the connector runs straight in the emulator, features from the "normal" NestrisChamps capture page are obviously not available (e.g. native webcam sharing, and Twitch chat Text-To-Speech).

Free and Open Source!

NestrisChamps is Open Source Software, licenced under the MIT licence and available on github.

That means you can run your own version of NestrisChamps locally if you wish, and have your own database.

The online version of NestrisChamps is owned and operated by yobi9 (Find him on discord, twitch, github).

NestrisChamps' Philosophy

NestrisChamps sometimes gets feedback that it's hard to use. Calibration is not auto-magically good. The auto calibration is working in most cases, but fine-tuning should always be performed. This section explains the philosophy of NestrisChamps.

NestrisChamps for individuals

NestrisChamps first and foremost is meant for individual players. There's nothing to install locally to use NestrisChamps, and while the complexity of setup is a little high initially, it is a one time investment to get valuable features and benefits:

NestrisChamps for restreamers

Classic Restreaming

Classic restreaming is the way matches are typically restreamed now. Restreaming is done based on video streams. Players must stream as video, restreamers capture the video streams, slice them up and restream them by moving bits around in a coherent side by side view.

With video based restreaming, there is a low setup complexity for individual players. The only requirement is for them to stream aligned to stencil. There is however rather a lot of complexity for the game host's restreaming setup.

The Game host must slice, cut, and shift portions of the player streams, to assemble the side-by-side view. All items need to be perfectly aligned by hand. And because player's stencil alignment is not always perfect, there can be some visible mis-alignments in the result, even if the restreamer's sliced zones are themselves perfectly positionned.

Beyond the setup complexity for the restreamer, video based restreaming has several disadvantages:

Trade-Offs

Unlike classical restreaming, which puts a higher burden of work on the restreamer than on the players, NestrisChamps puts the bulk of the work squarely onto players. Players are the ones who need to spend the effort to setup and calibrate properly. As mentioned above, doing so is meant to be worthwhile for them individually, so they may benefit from the features and tracking NestrisChamps offers.

For a restreamer to host 2 players who have already setup NestrisChamps for capture, using NestrisChamps is dead easy. The game host sets up the competition layout renderer in their OBS, and once players connect to the game host's room, their gameplay and comparative stats would "just work".

Doing that specifically addresses the issues with classical restreaming:

Additionally, classical restreamers need to slice the player video feed from the stencil area. That, or they may require a separate video feed with something else like vdo.ninja. Doing that requires coordination between the game host and the players, and the game host must set up the video ares correctly in their OBS setup. Not so with NestrisChamps. Since NestrisChamps capture player cams natively, the video stream is already positionned in the layout with zero effort from the game host.

Maturity of the technology

NestrisChamps works with data. Accurate score differential can only be achieved if the data streams of both players are clean and correct.

Sadly, not all video capture devices are equal, and players use whatever they have. Video capture and processing software are both mature technologies. OBS can handle pretty much any video input device. For a restreamer, that means the final look of the stream may not be consistent, and may not have comparative stats, but it's unlikely to "not work", or display invalid data.

NestrisChamps on the other hand needs to do more than just capture the video input. It needs to process it, and understand what is in it. This makes it dependent on the quality of the capture itself. Some video capture devices just cannot output a clear or bright enough video stream, which makes it impossible to get clean data from it (causing much frustration to the player who is trying to calibrate).

Still, this is the trade off NestrisChamps makes. If you want to use NestrisChamps' features for yourself, then eventually make sure you have a good capture setup.

Good Capture Setup

One major problem with analogue AV and video capture devices is power loss. The NES video output is meant to be consumed by the TV, where it'll display a clear image.

When doing AV capture with a simple AV Y-splitter cable, the video output power is split between the TV and the capture device, making them both receive a much darker image than intended. This is not too big of a problem for raw capture, and OBS provides some filter to brighten the image again. Not so for NestrisChamps (so far anyway). Because of that, depending on the NES output, and the quality of the capture device, the input is sometimes just too dark for NestrisChamps to use, and it is impossible to produce a clean data stream from it.

There are several ways to work around that. One might be to use the NES RF output for the TV, and the AV output for the capture device only. Doing that ensures that the AV signal's is not split and there's no power loss.

Another method might be to use a powered splitter, with which the NES video output is amplified to be delivered in full to both the TV and the video capture device. In both cases, since the signal received by the capture device will be of good quality (i.e. not too dark), NestrisChamps will have an easier time processing it.

Future improvements

One might say that if NestrisChamps "competes" with systems for which the quality of the output signal is not an issue, then it is on NestrisChamps' court to make itself work in the same conditions. That's a fair criticism.

And That may happen! NestrisChamps is open source, and used actively by a number of people, some of whom are very technical. It is possible that eventually NestrisChamps will have an "magical" capture calibration wizard, and a way to work on low quality input, with some image correction and smart detection. Sadly there's no ETA for those. NestrisChamps is still the work of one person (me!), and NestrisChamps works great for me, so while I try to address issues and make NestrisChamps more robust, it takes time to make progress, time I have unfortunately rather little of. Because of that, for the moment NestrisChamps is a tool that requires users to spend an initial effort to setup. But once you get past that initial time/effort investment, using NestrisChamps is very easy, and supporting competitions is a nice bonus that would just work.