Friday, April 29, 2011

Tetris Deconstruction

The Tetromino


To formally define the tetromino, it is an arrangement of four squares into various shapes, and each shape variation has its own distinctive color (the cosmetic attribute). 


Player Actions


Under the players control, the tetromino can rotate 90 degrees left or right, and can be accelerated downward more quickly. By rotating the tetromino, the player effectively arranges the 4 constituent blocks into different formations. So, the possible formations of the tetromino's four blocks changes with each type of block is falling.

Scoring System and Dynamics


A popular scoring system increments the player's score based on the lines that they clear by filling an entire row with tetromino blocks. Variables scaling the added score are: Number of simultaneous lines cleared (up to four), and the current level number. Typically the player is allowed to select their starting level if they desire the game to be more difficult immediately (or get higher score faster). The levels progress, regardless of starting point, when a fixed number of lines has been cleared (most commonly 10 lines). As the levels progress, the blocks fall faster, and in some versions of the game (Tetris DS, for example), the blocks don't even fall at a certain point, they just appear (but you can move them around for a few seconds on top of other blocks).


Design Practice Questions

1. What entities and resources will be in the game? Which resources are made up
of individual entities (such as a resource of airplanes consisting of individual planes
that the computer can track separately) and which are described by mass nouns
(such as water, which cannot be separated into discrete objects)?


  • Individual Entities:
    • Player, weapons, enemies, doors, save-points, respawn point, switches, platforms(moving and static), bullets
  • Broader Entities:
    • Ground(organic and non-organic), sky.

2. What unique entities will be in the game?

  • Described above.
3. Which entities will actually include other entities as part of their definition?
(Remember that an avatar may have an inventory, and an inventory contains
objects.)


  • The player has an inventory which contains references to other entities.
  • Weapon entities spawn bullet entities
  • Enemy entities can have references to Weapon entities, which in turn can spawn bullet entities.
  • Respawn entities create the Player entity at their world location.
4. What attributes describe each of the entities that you have identified? Which
attributes are numeric and which are symbolic?


  • Movable base class:
    • Position, velocity vector, graphics.
  • Item base class:
    • Respawns (true if it re-spawns in the world when re-loading room), 
  • Bullet base class (subs Movable):
    • Speed, spread, hasGravity (bullet affected by gravity)
  • Player (Movable):
    • Inventory, current spawn location, current world location, currently equipped weapon (null if none).
  • Enemy (Movable):
    • Currently equipped weapon, move pattern(s) (AI), lethal (determine if it hurts player)
  • RangedWeapon (Weapon):
    • Bullet type (class reference), rate-of-fire
  • Door:
    • Locked, open (door currently open)
  • Save-Points:
    • isActive (it's the currently selected save-point), initialSpawn(true if it is initially set as spawn, for game start), respawner (Respawn-Point class ref)
  • Respawn-Point:
    • graphic
  • Switch:
    • target (the object that the switch activates), locked, room (the room that the switch is in)
  • Platforms(Movable):
    • moving (true if it moves), nodes (the movement nodes, accepts 2 for linear motion), moveVector (the vector describing the platforms movement), speed
5. Which entities and resources will be tangible, and which will be intangible?
Will any of them change from one state to another, like the resources in Age of
Empires?


  • Tangible entities: 
    • World, platforms, doors, bullets, switch
  • Intangible entities: 
    • Weapons (after they are collected from the world)
6. What mechanics govern the relationships among the entities? Remember that
any symbolic entity requires mechanics that determine how it can get into each of
its possible states and how other entities interact with each possible state.


  • The Player changes the state of:
    • Enemies, Doors, Items (Weapons), Bullets, Save Points, Switches
  • Enemies change:
    • Player, Bullets (depending on enemy type)
  • Doors change:
    • nothing
  • Switches change:
    • Doors
  • Bullets change:
    • Player, Enemy, World, Switches (possibly), Doors (possibly)
  • Save Points change:
    • Respawn points, Player
  • Respawn Points change:
    • Player
  • Platforms change:
    • Player (add to player velocity if it moves)

7. Are there any global mechanics in the game? What mechanic governs the way
the game changes from mode to mode?


  • There is a global mechanic governing changes to individual rooms, as well as the switching in between the rooms.
8. For each entity and resource, does it come into the game world at a source, or
does it start off in a game world that does not provide a source for additional entities or resources? If it does come in at a source, what mechanics control the
production rate of the source?


  • All entities spawn at set locations (which are set in the level editor). Certain items are set to spawn every time the room is loaded, and some are not.
9. For each entity and resource, does it go out of the game world at a drain, or does
it all remain in the game world and never leave? If it does go out at a drain, what
conditions cause it to drain?


  • All entities are unloaded when the room is changed, but their states are saved for reference when that room is loaded again. 
10. What conversion processes exist in your world? What trader processes exist? Do
any feedback loops or mutual dependencies exist? What means have you provided
to break or prevent deadlocks?


  • Some enemies drop out of their idle movement loops and enter action loops based on varying conditions, usually based on the Player position. For example, one enemy type's action loop is to move directly toward the player at a greater velocity, and this is triggered if the player collides with the enemies vision cone.
11. Can your game get into a state of equilibrium, static or dynamic? Does it include
any form of decay or entropy that prevents states of equilibrium from forming?


  • No, the game is constantly in a state of inequality, since enemies will always spawn and will always impede the players progress in certain parts of the game. At any instantaneous moment, there me be a state of equilibrium (a room is loaded that has no enemies), but this is not global.
12. How do mechanics create active challenges? Do you need to establish any
mechanics to detect if a challenge has been surmounted?


  • The game's challenges will consist of various platforming elements, the avoiding of enemies, and sometimes both simultaneously. There is no need for an explicit mechanic to detect whether or not these challenges are surmounted-- the player getting farther in the world and saving their location at a save point accomplishes this implicitly.
13. How do mechanics implement actions? For each action that may arrive from the
user interface, how do the core mechanics react?


  • The player is provided a movement, shooting, action, inventory, and map interface.
  • Movement:
    • Change the players velocity after checking for collisions.
  • Shooting:
    • If the currently equipped weapon is not null, then trigger the Weapons fire method, which in turn spawns Bullet objects with the correct position and initial velocity
  • Action:
    • If the Player is next to an interactive object, then pressing the action button will cause that object to activate. 
14. For autonomous entities such as nonplayer characters, what mechanics control
their behavior? What mechanics define their AI?


  • Their actions are determined by defined movement patterns pertaining to enemy type.

No comments:

Post a Comment