Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

EPIC: Player Progression

ErikOverflow edited this page Apr 4, 2019 · 13 revisions

Features


Leveling

_TODO: Rewrite documentation

TODO: Add a "LevelUp()" method to the CharacterLevel script that raises the event. Call the method from PlayerProgression. StatsSystems should subscribe to the CharacterLevel event directly rather than using GameEventListeners and external configuration (this is not a configuration that needs to be available to a designer and obfuscates the code).

Requirements **Requirements**
  1. Add Experience script player.
  2. Create enemy experience component to enemies.
  3. Configure player script to gain experience on enemy death (hint: use a GameEvent with a gameObject payload, don't couple directly!)

Player Progression has been added as a singleton instance to the player object. This method internally tracks the experience needed for the next level, and raises an event "Player Level Up" when the experience threshold is reached.

Enemy templates now have an Enemy Experience component. This component is the base experience amount that an enemy drops, and is affected by the Scale Enemy By Level stat augment (the experience amount is increased for each enemy level).

The Enemy Experience component listens for the Character Health's OnDeath event and invokes the Player Progression's GainExperience() method.

The Player Scale By Level script derives from Stat Augment and modifies Max Health and both Weapon type damages.


Currency and Upgrades (TBD)

Requirements **Requirements**
  1. Add currency tracking (Currency earned from enemies)
  2. Create functional Upgrades logic with the following basic upgradable attributes:
    1. Attack damage (Additive)
    2. Attack damage (Multiplicative)
    3. Health (Additive)
    4. Health (Multiplicative)

Basic Items (Player Inventory)

Requirements **Requirements**
  1. Add generic equippable item type (Do not differentiate between sword, shield, armor, etc.)
  2. Have equippable item augment player's stats.
  3. Add consumable "Potion" item to heal the player.

TODO: Create unique item instance types for each template, and create a contructor for each scriptable item type that maps the generic item values to unique values.

Dependencies:

  • None

Methods:

  • Equip Weapon (Moves/swaps the parameter weapon to the weapon slot)
  • Add Item to Inventory (Adds item to inventory)

Events:

  • Item Equipped (triggers re-hooking and re-applying player stat augments and templates)

Configurable Fields:

  • Item Equipped (event)

Player Inventory contains a list of Item Instances. Item Instances are a generic representation of items for saving/loading. Item is the derivable scriptable object that contains unique template values and functionality. This is derived to achieve more granular/specific item types. All derived types can be found in the folder structure Items.

Player Inventory tracks each equippable item type as a public field (i.e. Weapon). These fields are NonSerialized to prevent errors caused by the editor creating a non-null, but empty item instance when the game object's inspector is open.

Unique item types can be created by deriving from Item, or any of its child classes. There should be no need to modify any pre-existing scripts to implement a unique item extension.

Clone this wiki locally