Is this technique for stat tracking without a database workable?
Posted
by
baptzmoffire
on Game Development
See other posts from Game Development
or by baptzmoffire
Published on 2013-09-23T18:51:19Z
Indexed on
2014/05/29
22:06 UTC
Read the original article
Hit count: 274
If I wanted to create a chess game, for iOS, that tracked both player moves (for retracing the progression of a game and for player stats), what would be the simplest route to take?
To clarify, I want to track not only the moves a player has made in a particular game, but how often that player has made that move in past games. For example I want to be able to track:
- How many times a given player has opened by moving the king pawn up two squares (e4) as white, on move number one.
- What is the percentage of time the player responds to white's e4 opening move, with moving his own king pawn to e5?
- What percentage of time does he respond by moving his queenside bishop pawn to c5?
And so on. If it's not clear, the stat tracking system should also be able to report how many times this player, as black, move his queen to h1, on move number 30.
I'm using Parse.com for my back-end as a server (BaaS) service. If I were to create a class that
- writes strings that identify move number, player color, moved piece, algebraic notation of the square (e.g. "d8") to a file, locally in the file system
- saves the file to Parse, and deletes the temporary file from file system
- upon opening the same game in my tableview (a la a "With Friends" game), download this file from Parse, parse through it and retrieve all stats/history, assign all relevant values to variables
Is this plan viable, or is there an easier way?
© Game Development or respective owner