Implement functionality in order to measure the 'skill' of a player. There are many factors to consider due to calculate some kind of number which represents the current skill of the player.
First approach
In Acid Snake it is possible move the snake around and/or to collect blocks. These two actions can be divided into sub-factors to calculate a proper value. We need an interface which provides seconds based calculations:
public interface PlayerTracker {
/**
* Returns the average of collected blocks per second
*/
float getBlocksPerSecond();
/**
* Returns the average of touches per second
*/
float getTouchesPerSecond();
/**
* Returns the average number of combos
*/
float getCombosPerSecond();
/**
* Returns the number of collected blocks at some point of history
*/
int getNumberOfCollectedBlocks(int history);
/**
* Returns the number of combos at a certain history
*/
int getNumberOfCombos(int history);
/**
* Returns the collected block at some point in the history
*/
EntityType getBlockOfHistory(int history);
}
By doing so it should be very easy to use the provided data to delegate information to another class which calculates a value from it (which represents the current skill). Therefore we have to consider the priority of each action, which block has been collected at a certain point of history.
Simplified, the history represents the number of collecting steps (taken by the snake) in the past. When I want the block which has been collected 10 steps before, I only need to call playerTracker.getBlockOfHistory(10)
.
Estimating the skill of the player
I would recommend a system between 0.0-1.0-xx to estimate the skill of a player. The default is 1.0 (at the beginning). If the player plays not very good, the skill goes down. If the player makes smart combinations (such as using two portals directly afterwards) or acting as fast as possible (high collecting frequency), the skill goes up.
Usage of the value
The estimated skill can be used to control for instance the spawn rate. It could be possible to spawn blocks next to each other to provide a valid combo.
The problem is that the player could leave combos on field in order to make the super epic high score by collecting them together. Therefore those kind of block chains should disappear after a number of movements.