“Link All Together” – Linktile 2D game programming Guanhua Xie CS 491B Fall 2008
Introduction to the Game A puzzle game similar to “Mahjong” in China. Match and eliminate the tiles on board. Easy to learn but hard to stop from playing.
Rule of the Game Match and link the pairs of the same tiles under time limitations. The path for the pair elimination should take no more than two turns.
Layout of the Game Blue : Valid Match Red: Invalid Match
Deadlock Situation
Motivation Interesting game to implement. Find efficient algorithm to determine the valid match for the two selected tiles and detect deadlock situation. Design online two user competition mode for this game.
Technology Used Programming Language Development Tool Java 2 Standard Edition 5.0 Development Tool Eclipse
System Component User Visible User Invisible Single user mode Main Menu Control Panel Game Board Two user online competition mode User Invisible Algorithm to determine the valid match Algorithm to detect the deadlock
Algorithm for deadlock detection Brutal force search (Last quarter) Inefficiency. Keep a list of eliminable pairs of tiles Remove and add tile pair after each elimination. Check the size of the list. More time efficient.
Extra Features Different tile representation. Game sound and music. Path display.
Online two user competition mode Simple server Accepts two clients to form a session Each session is a thread Client Graphical User interface Pass the user input to the server Receive game status from the server
Transition between each round of the game
Gain from the project A functional version of the single user mode and a working version of online competition mode of the game. Learn techniques like java sound, networking programming. Experiences with developing a project. Learn the technique writing and presentation.
Algorithm for Valid Match Trivial Case Two tiles are not the same. (Reject) Two same tiles are adjacent to each other. (Accept) One of the two tiles are surrounded by other tiles in four directions. (Reject)
Algorithm for Valid Match Generic Situation Composed of at most three sub-paths. Find the range of two tiles can freely move in its column or row (Reject if the two ranges do not intersect). Find a free horizontal or vertical path in the intersection of the two ranges(Reject if no such path exist).