PreludeMatchismo: Alexander Hsu

Introduction

PreludeMatchismo is a 2-player card matching game and also a sequencer. Players compete with each other by by matching musical cards. The player who matches most pair of musical cards wins the game. Every pair of muscial cards matched unlocks a part of the sequencer. By matching all cards correctly, players will successfully unlock the full background music. The number of taps on each card is being tracked and when it goes to 0, not only the players lose the opportuniy to match that card, it introduces a dead card into the game, since it cannot be matched anymore. Of course, the player who last tapped on the card will receive a penalty!

Game Screen

Motivation

The idea was originally done by Jia Wen Li and I asked her permission to use it since I already have a previous project with card game logic. She used chords from Bach's prelude and the game was simple but awesome!

Challenges

  • 2-Player Game: the game was originally designed for one person. I had to come up with rules that will make it fun and competitive for 2 players.
  • Network Game: this is the first time for me doing anything across devices. I didn't know what to do at first and my original network interaction design was way too complicated that messed up all my game logic. I redesigned everything to make the connections minimal and now everything works out fine.
  • Audio limits: There were many limits for me to make the sequencer. I have everything somehow working in the end but the process was tedious.
  • Audio-Animation synchronization: Since I am using pure UIKit for my game, there were many limitations regarding the animation and audio especially when there can be multiple threads running in the background.

Interlude Video: Music256B Pizza Section

System Design

  • Game: Everything in the game was written such as all the player has to do is to touch a card and everything else would be taken for. The game consists of a deck of cards with every two cards having a distinct sound.
  • Network: Instead of mapping all the cards to the network, I only care about which card was touched. When a touch event is updated, both player's device will "touch that card" and all the other game logic will be handled locally. This is all implemented using FireBase iOS SDK.
  • Sequencer: The timing of the sequencer is not crucial in this game. It is ok to start the 2nd audio file a little later. Therefore I've decided just to use a recursive function with completion handlers to handle the sequencing. Every 1.71s it will call the same function again with the counter advanced.
  • Music: There are 36 audio files (16 for sequencing, 16 for cards, 4 for background). At the start of the game, the sequencer will be looping the 4 background files. When a player touches a card, the corresponding sound file will be played. When a pair of cards is being matched, it unlocks a part of the sequencer and replaces that part with the fuller audio file. Credits goes to my awesome friend Fang Yi Lin. I asked her to make me a Prelude-like fast-paced music and I really liked the results!

Design Choice

The background music can be rather distracting so I turned the volume down a lot. It is turned down further when a player is listening to a card. Also I started out with 32 cards(16 sounds * 2) but it was WAY TOO DIFFICULT. So I changed it to 16 cards(8 sounds * 2). But the game is implemented with reuseability in mind and by changing a global constant I can make the game back to the WAY TOO DIFFICULT 32-card mode.