Repair Service Created for Sony Online Entertainment as part of DC Universe Online

Click tiles to slide. CTRL+click to rotate them. Connect power from source tile to bordering receptacles.

Form

CLASSIFICATION //

Flash, web-based

Format:

Flash SWF

Deployment:

Deployed on Sony's server as part of Secret Identity game suite. Implements Sony's "IGame" interface for use as external asset loaded into Sony's Flash game container.

Components:

  • Preloader SWF
  • Game SWF
  • 4 XML configuration files: configuration, game, levels, language
  • 22 MP3 audio files
  • 3 PNG background art files
  • 9 SWF tiles and effects artwork files

Language:

ActionScript 2.0

Size:

2081 KB, excluding runtime-loaded assets

Function

CLASSIFICATION //

game, puzzle, pathfinding

Theme:

The task of disarming bomb circuitry. Ties into "Secret Identity" espionage theme. A "power source" in the middle of the board transmits energy to all bordering "receptacles".

Behavior:

Modeled after the puzzle game, Pipe Mania. The goal is to form a path from the starting point to each endpoint by rotating and sliding the board's pieces into an arrangement that connects the starting point to one or more endpoints. The starting point spawns at randomized locations near the board's center. The endpoints spawn at randomized locations around the board's perimeter. There are five types of pieces. Four of them permit movement along the shapes of their figures, which look like the characters "L", "T", "|", and "+". The other type, known as the "block" piece, prevents movement in all directions.

Configurable game features (defined in XML configuration files loaded at runtime)

  • Aesthetic theme, which functions like a skin over the game; includes graphics and audio. (3 made in total)
  • Board shape– diamond, triangle, rectangle, or square
  • Size of board
  • Row and column count (only applies to rectangular boards)
  • Size of pieces
  • Number of pieces on board
  • Population of each piece type, as percentage, on board
  • Level difficulty (a combination of other properties)
  • Whether receptacles stay full, once filled.

Specific gameplay constraints

  • The empty space always starts along an edge
  • Receptacles must be at least 3 spaces away from each other.
  • The power source tile can never be along an edge.
  • Block tiles can never start adjacent to the power source or a receptacle’s connecting edge.
  • Tiles must be mixed up enough that the game cannot be won in less than approximately 6 turns.

Design features

  • Tiles can be rotated 90° clockwise or slid into a single empty space.
  • There is always one space on the board without a tile for sliding tiles around.
  • There can be block tiles tiles with no path. These cannot be slid.

Scoring system and behavior

Score is based on number of tiles used to make paths to each receptacle plus a small bonus for using as few turns as possible. The player's moves, along with certain characteristics of the game board's state, are recorded throughout each round. At each round's end, configurable point values are attributed to those statistics. Those points are tallied to produce the round's score. Also at each round's end, game result data is dispatched to hosting application via generic program output.

Gameplay aspects affecting score

  • Number of tiles in path to a receptacle
  • Difficulty level chosen
  • Filling a receptacle
  • Filling a multiple receptacles simultaneously
  • Filling a tile
  • Manipulating a tile

Controls

Pieces slide or rotate when clicked. When CTRL accompanies mouse click, pieces rotate; otherwise, they slide into an adjacent empty space.

Mechanics:

Project source code

42 classes were written for this project, organized into 8 packages -- "ui", "audio", "board", "deco", "hud", "loading", "notice", and "tiles".

CASA Lib ActionScript 2.0 library

A mature ActionScript 2.0 toolkit with classes for common Flash application building. Some of the classes used from the library include:

  • Interval - Feature-rich timer object
  • FontManager - Works around ActionScript 2.0's limited font-handling
  • MovieClipUtil - Extra MovieClip behaviors and convenient method for attaching MovieClips

Delegate v1.0.2 by Steve Webster of Dynamicflash

Workaround for the common lost scope problem that shows up in many ActionScript 2.0 applications due to the way event handlers work. This class used heavily and vital to keeping objects decoupled in an ActionScript 2.0 application.

Pathfinding

The board's pieces are generated in a way that starts out with a path made from the center to the endpoints, and then jumbles the comprised tiles so the configured number of moves are required for the path to be aligned. The pathfinding aspect of the game was the hardest coding task, aside from debugging. I re-wrote this several times to optimize performance and readability.

ActionScript 3.0 Emulation

Utilities were written to assist in the creation of decoupled ActionScript 2.0 code that played nicely with behavioral onstage MovieClips, e.g.:

  • TimelineUtils.addEventHandlerWhenInstanceAvailable() - Searches for an onstage instance and adds an event handler when the instance is found. This is necessary for onstage instances that don't exist on certain frames, e.g. instances that aren't created until after frame 1.
  • CallbackMovieClip - Runs a callback function when it's been loaded to let the client know that it's on the timeline and fully initialized.
  • MCDispatcher - Subclass of MovieClip that implements EventDispatcherInterface to work with EventDispatcher service.

Animations

  • Winning board glow effect is programmatically drawn and animated using GlowFilter and Tween objects.

Decoupled UI

When one of the game designers put the kibosh the game's UI, I commented out 1 line of code and the work was done.

XML-Configurable Settings: Board Shape

Game boards are different for each level. They're defined by values given in separate level-specific XML files. The program uses these values to draw game pieces within a grid of the appropriate shape and size, with the desired frequency of certain piece types.

Purpose:

Supplemental content for much larger MMORPG, DC Universe Online. Created as minigame to be played within Sony's online game site, "Secret Identity". Players would log into this site while away from their consoles to play minigames that unlock aspects of the larger MMO.

Requirements:

  • Art assets easily swappable
  • Important gameplay variables easily manipulable to facilitate gameplay tweaks by game designers
  • Level creation parameters easily manipulable so level designers could create levels
  • Text dynamic to support multiple languages
  • Efficient memory management to run smoothly within Flash container

Creation

CLASSIFICATION //

powerhouse-animation, team-project

Completion Date:

2009-11

Duration:

~4 months

Collaborators:

  • 1 developer wrote ~15% of codebase to hand off a rough prototype of the game before I was hired
  • 1 game designer
  • 1 graphic artist
  • 1 audio engineer

Process:

Our Studio

We had a team of 3 programmers at Powerhouse Animation. We were each working on different games to be completed for DCUO. We were working on a few other projects, as well, switching back and forth.

Working with SOE, out-of-house

  • Met weekly milestones defined by Sony.
  • Communicated with game designers directly via Sony's online client communication forum site. They had very specific, often-changing guidelines, for which we agreeably made changes or provided explanations of infeasibility. We wrote our programs to accommodate predicted changes by decoupling those aspects from the design.
  • Visited Sony game designers in-person for weekly meetings towards the project's end.

Tools:

FlashDevelop, Adobe Flash Professional CS4, Adobe Photoshop CS2, Sony Sound Forge 8.0

Challenges:

  • Jumped aboard the project in rough prototyping phase. Original author was new to OOP and codebase was confusing, non-explanatory, and uncommented. Program had buggy implementation of interactive game pieces, but pathfinding wasn't implemented and UI/HUD features were not in place. I ended up refactoring most of the existing code.
  • My first project at Powerhouse Animation, conforming to company procedures and conventions. Helped other programmers figure out and decide on conventions.
  • I was not very familiar with ActionScript 2.0. Learned of many nuances and quirks.
  • Graphic artist didn't immediately understand the functional constraints of some artwork, so explanation was needed. Also, some of the artwork that was produced used Flash's drawing tools in an unorthodox way that produced mysterious bugs.
  • Pathfinding concepts were relatively new to me. Found myself doing a lot of mental work to reach a comprehensive understanding of my code. Used A* as basis for invented pathfinding algorithm, which was tailored to this game and less CPU intensive.
  • External font loading is kind of a hack in ActionScript 2.0, but I eventually got it working thanks to the help of a few tutorials.

Research:

  • Pathfinding algorithms such as A*
  • Memory profiling
  • Solidified understanding of object-oriented design principles
  • AS2 quirks
  • Delegate.as
  • Flash authoring tool quirks