User Tools

Site Tools


Sidebar

user:smalik3:start

CollecTRIS

What is CollecTRIS?

CollecTRIS is a TETRIS-inspired game made to run on the NES1). The goal of the game is simple: collect points and try not to lose them! If you lose five points, you lose the game!

Winner of 2022 Student Expo STEM Best Use of Technology award!

How do I play?

Playing is simple, similar to actual TETRIS, a tetromino2) will be falling from the top to the bottom and you are able to move these blocks around left or right. These blocks can stack on each other. If the playfield is too filled up with blocks it will reset. Your goal is to keep collecting blue blocks using your falling block, which will gain you 1 whole point. You do not want to collect the red blocks, which will redact 1 point from you and a life! Lose all your lives and the game resets.

Walkthrough (Text)

  1. Tetromino spawns at the top of the playfield along with an additional blue block and red block.
  2. Try to collect the blue block, avoiding the red block to the best of your ability; the blue block gains one point, and the red block loses one point and one life.
  3. If the playfield becomes too full of blocks, or the blue block is piled under the other blocks, top out3) in order to reset the playfield blocks and collect the blue block.
  4. Continue the cycle from step two!

If the last life, indicated by the heart counter on the right, is gone then the game will reset.

Walkthrough (Images)

… from here you repeat the process starting at image one!

Sample Gameplay

Check out this sample gameplay plus a showcase video for CollecTRIS on YouTube!

This video not only shows off gameplay elements but walks through playing the game as well.

How do I lose?

The mechanics of losing are simple: if you collect five red blocks during your game the game will reset. As shown in the sample gameplay avoiding the red block is important, and sometimes maybe even impossible. Staying vigilant of your tetromino location to avoid hitting the red block too many times!

Pro Strategies

CollecTRIS has a couple of professional strategies that can be utilized to speed up gameplay and even help avoid the red block! Some of these strategies may be hard, while others easier.

Bottom-Corner Tuck (BCT)

When a blue block (or technically red block as well, but you would not want to collect that) is placed on the top left or right corner of another already-placed tetromino you have the chance to perform what I have coined as a bottom-corner tuck4). This move requires a near-frame-perfect right movement into the top left/right corner of another placed tetromino. Doing this will place the current tetromino into the top left/right corner of another tetromino, allowing you to skip the step of clearing the playfield (by topping out) and just collect the blue block.

If you are interested in seeing this move in action, it is performed in the sample gameplay at 04:18.

Top-Corner Tuck (TCT)

When a blue block (or technically red block as well, but you would not want to collect that) is placed on the bottom left or right corner of another already-placed tetromino you have the chance to perform what I have coined as a top-corner tuck5). This move is relatively simple, requiring you to simply move into the bottom left/right corner of another tetromino by holding down in that direction. Doing this will temporarily move the current tetromino into the bottom left/right corner of another tetromino, allowing you to skip the step of clearing the playfield (by topping out) and just collect the blue block. This move is very similar to the bottom-corner tuck, with one notable exception, this will not end up placing the current tetromino and does not require any kind of frame-perfect input.

If you are interested in seeing this move in action, it is performed in the sample gameplay at 01:48.

Underlying Game Mechanics

As with many games, there exists underlying game mechanics that actually allow the game to function as it does. While CollecTRIS may seem simple on the surface, it does a lot of work in order to make the game playable for you!

Playfield

Similar to other NES games, CollecTRIS uses a background in order to display more static graphics and sprites to display dynamic graphics. The background of CollecTRIS is simple and will be shown below. The nametable6) is what creates the background. In the case of games like TETRIS, and CollecTRIS, a lot of nametable manipulation occurs in order to store tetromino blocks when they are placed. Since the NES has a sprite limit of 64 sprites on-screen at once, it is unrealistic to have all tetromino blocks on the playfield as sprites. Rather, they begin as sprites but once placed are then put into the background.

When using emulators such as FCEUX the user has the ability to view the nametable independent of any sprites on the screen. Here are examples from both NES TETRIS and CollecTRIS where normal gameplay is occurring on the left, while the nametable is having the placed tetrominos stored in it (shown on the right). The right screen (or bottom screen if you are on mobile) is effectively showing the background, and, as you will see the tetrominos will get put into the actual background once they are placed.

Right screen animations may be slightly behind or ahead of left screen. It may appear that blocks are being placed in the background before they are placed in the actual game, but they are not, it is just delay from the left screen.

If you watch carefully, you will notice how certain elements that are on the left screen (actual game) are not on the right screen. As described before the right screen is solely the nametable (background), therefore any sprites that are on the screen will not display on the right screen. The nametable and playfield of both TETRIS and CollecTRIS are intertwined in that they are essentially the same thing. The playfield part of the background (nametable) is where I placed blocks, and the tetromino is limited to that playfield programmatically. This image shows the nametable used for CollecTRIS, and its playfield dimensions:

When it comes to placing the tetromino inside of the playfield section of the nametable, every three ticks the game will check for a placement to be done. The tetromino movement section of this page goes further into why every three ticks is ideal for events like these.

Movement (Tetromino)

The tetromino that the player controls has two forms of movement: sideways and downwards. Downwards movement is forced, the tetromino will always move downwards. Sideways movement is optional and is something the player must make strategic usage of in order to avoid losing any lives.

As with most NES games, and games in general, a lot of actions are dependent on the frame of the game (also called ticks). The NES does not naturally keep track of ticks, so it is up to the developer of the game to keep track of ticks in the appropriate section of their game assembly code. The movement of the tetromino piece is also tick-based, every six ticks the piece falls down one block and every four ticks the game will check for player input to move sideways. While six and four ticks may seem like a lot of time, in reality, these ticks happen so fast that the player does not notice them.

The tick layout of the game is centered around its movement, so for every three ticks the game will check if a tetromino needs to be placed into the background… for example. Why every three ticks though? Why not every four ticks? The reason is simpler when said: if the placement of a tetromino and movement check of a tetromino occur at the same time, the movement check will lag behind. The reasoning for this is because when a tetromino is placed it skips checking for any movement (tetromino is placed so it is unnecessary), this means that when the next movement check comes around it may be a tick too early or tick too late resulting in some lag from the player's perspective.

Movement Randomization (Blue/Red Blocks)

The blue and red blocks are moved every time a single one is collected. When a blue block is collected then both the blue and red blocks move. When a red block is collected then only the red block moves. How is that determined? Clearly, the movement is random, although at the start of the game the position is always the same. The game makes two seeds at random tick intervals, these two seeds are used as the starting point for randomly generating the positions for the red and blue blocks.

The seeds for randomization are based on where the tetromino is, and, the number of ticks that have currently passed by (0-255). The seeds are also created at uneven tick intervals, therefore they are essentially created randomly whenever the game pleases. These factors put together result in a fairly random placement of the blue and red blocks. As stated previously, the seeds for randomization are generated based on the placement of the tetromino. This figure shows how tetromino position effects blue/red block placement:

The position of the left-bottom block near the tetromino and the bottom-left block is what affects randomness. This means that alongside the computer-based randomization, the player also contributes towards the randomness of the blue and red block placements seen in-game!

Points/Lives

The scoring system of the game is simple, every tick the game will check if any part of the tetromino has collided with any part of the blue or red blocks. If it has, then then the points are changed accordingly. Similarly, the life counter will be changed if required as well. While running something every tick may usually be inefficient, for smaller games it will likely make little to no impact on game performance.

The score and hearts used to indicate points and lives, respectively, are made from sprites. Since the sprite limit was not even close to being met for CollecTRIS, sprites were used in lieu of nametable (background) tiles in order to make working with them easier. Every tick, the score and hearts are reflected accordingly to match the point and life counters.

2022 Student Expo STEM Award: Best Use of Technology

The CollecTRIS project is proud to have won the 2022 Student Expo STEM Best Use of Technology award! This award was received as acknowledgement of technology in an incredibly useful or productive manner.

Please check out The Baron Interviews - Interview with Creator of CollecTRIS for additional coverage about CollecTRIS from its creator.

CollecTRIS Poster:

If you would love to see more from CollecTRIS or its creator, please check out the Resources and Downloads section.

Resources and Downloads

QR Codes

Want to check out other great games made by Computer Science students?

Want a QR code that links to this page?

1)
Nintendo Entertainment System
2)
A geometric shape composed of four squares. In CollecTRIS this is the main falling block, also known as the O Tetromino.
3)
A term meaning to die in TETRIS, in the case of CollecTRIS meaning to pile up tetrominoes until the top of the playfield is reached.
4)
Tucking the falling tetromino block into the top left/right corner of another already-placed block placing the tetromino, CollecTRIS only.
5)
Tucking the falling tetromino block into the bottom left/right corner of another already-placed block, CollecTRIS only.
6)
One screen full of background characters, made up of 960 bytes, stored in NES Virtual RAM.
user/smalik3/start.txt · Last modified: 2022/05/15 04:10 by smalik3