Player Statistics - UQdeco2800/2021-studio-6 GitHub Wiki
Descriptions
Alongside health the player has other statistics that will effect the mode of play. These are to be modified either as the result of being in a lower health state, in order to modify play and increase tension, or in response to upgrades made during the games checkpoints. This includes the players attack damage, defence level and movement speed.
Attack Damage
Attack damage describes the amount of damage a player will deal when attacking either ranged or melee. The player begins the game with a set ranged and melee attack damage, initially set in BaseEntityConfig and PlayerConfig, then retrieved within PlayerCombatStatsComponent through the PlayerFactory and attached to the player entity. The attack damage can be retrieved and modified within this component to allow the player to participate in combat.
Public Methods
int getBaseRangedAttack(): Returns the integer value of the players base ranged attack damage
int getRangedAttack(): Returns the integer value of the players ranged attack damage, attack damage is modified from base value depending on player health state.
- Healthy = Base Ranged Attack Value
- Wounded = 90% of Base Ranged Attack Value (rounded to the nearest integer)
- On Deaths Door = 60% of Base Ranged Attack Value (rounded to the nearest integer)
void setRangedAttack(int ranged_attack): Takes an integer value to set the base attack damage of the players ranged attack (not effected by current wound state). The input parameter ranged_attack must be greater than zero.
int getBaseAttack(): Returns the integer value of the players base melee attack damage.
int getMeleeAttack(): Returns the integer value of the players melee attack damage, attack damage is modified from base value depending on player health state.
- Healthy = Base Melee Attack Value
- Wounded = 90% of Base Melee Attack Value (rounded to the nearest integer)
- On Deaths Door = 60% of Base Melee Attack Value (rounded to the nearest integer)
void setBaseAttack(int attack): Takes an integer value to set the base attack damage of the players melee attack (not effected by current wound state). The input parameter must be greater than zero.
Design Justifications
The players ranged and melee attack damage is separated in order to ensure the player's attacks can be better balanced and that the player is encouraged to participate in melee attacks as though they are more risky (as you have to get closer to the enemies), they will deal a higher damage. Attack damage decreases as the player becomes more wounded in order to make the player feel more helpless alongside making the experience more immersive as it makes the players wounded state a more significant aspect to the player. These wound effects use a percentage based system in order to scale to player settings with higher base attacks so that the effect is universally applicable.
Defence Level
Defence level describes the level of defence the player has against enemy/environmental attacks. There are three levels of defence, which will be used as an indicator to effect the level pf damage a player takes when injured. The player begins the game with a set defence level, initially set in PlayerConfig, then retrieved within PlayerCombatStatsComponent through the PlayerFactory and attached to the player entity. The defence level can be retrieved and modified within this component, being utilised to affect damage taken by player in the class's hit function.
Public Methods
int getDefenceLevel(): Returns the integer value corresponding to the players defence level (0, 1, 2 respectively)
void setDefenceLevel(int defence): Takes an integer value to set the defence level to, this parameter value must be between 0 and 2 inclusive. Defence level reduces the amount of damage taken by the player when an enemy attacks.
- Level 0 = Take the base enemies attack damage
- Level 1 = Take one less damage than enemies attack damage
- Level 2 = Take two less damage than enemies attack damage
Design Justification
In order to give the player more variety on how to play the game, the ability to alter the damage taken when attacked was included, as it would allow players more inclined to rush into fights the flexibility to play the game as wanted. Implemented through levels in order to give an array of options to the player settings and allow more varied player options.
Ideation
Originally the player defence was to be implemented through percentage reductions in damage taken, however in order to better scale to the players health, which will be in the low tens at a maximum, this was instead implemented through fixed reduction. Therefore, the defence was able to be impactful even while the player has lower base health stats.
Movement Speed
The players movement speed describes the velocity at which the player moves across the screen while walking, it does not effect the speed of attacks. The player begins the game with a movement speed dependent on the wound state specified in PlayerConfig. The speed level is controlled in PlayerActions file through hardcoded changes to the players speed based on the current wound state, monitored and altered in response to the updateWound event.
- Healthy = A max speed of 3f for both axis's
- Wounded = A max speed of 4f for both axis's
- On Deaths Door = A max speed of 5f for both axis's
- Note that when the player is dead their speed is converted to 0f
Public Methods
Vector2 getCurrentSpeed(): returns the current max speed vector of the player (dependant on current wound state)
Design Justification
By allowing alteration to the players movement speed there can be more dynamics within play where the player must adapt to changing conditions. It will act as a method to alter the players experience by allowing different methods of play, where users more interested in outrunning enemies will have the ability to do so. By modifying the players movement speed depending on wounded state, the player experience is both balanced out (as they have essentially traded attack damage for speed) and also further emphasised through a change in experience to match the state. This is implemented through set levels to ensure a balanced and consistent experience while wounded.