Upgrade System Implementation

 Author: Yashwant Patel


Problem:

For Island Defenders currently the player can only build one tower while fighting different elementals and there is only one gun which does not scale with the wave difficulty. Not only does this make the game challenging, but as the game goes on the challenge increases too much which could take the player out of flow state. This could frustrate the player and make the game boring since there is not that much agency for the player. While this doesn't break or disturb the main game loop it is a feature that could facilitate keeping the player in flow  state. Currently in order to try and keep the player in flow we have a phase in between every round where the player can build towers freely without having to worry about enemies. This upgrade system will be accessible during this phase and will help the player scale along with the enemies and waves.



Solution:

In order to solve this problem I am currently implementing an upgrade system (currently it's all backend stuff, so there isn't anything fancy in terms of UI that could be shown). This system will have three types of upgrades for the players to purchase each round. The types are offensive towers, defensive towers, and player upgrades. The player will be able to purchase one of each type upgrade each round. Each type of upgrade will have a pool of trees (data structures) that will be used to roll between. Once a tree is picked depending on the probability of the tree then an upgrade from that tree is picked depending on the situation. It might be difficult to understand with words alone, so here is some visual aid with explanations.


This is an example of an upgrade tree for a tower. The root node will be the tower, so after the tower has been unlocked then the rest of the upgrades in the tree will be accessible. In order to speed up the process of picking a upgrade and not having to traverse the tree through nodes that have already been unlocked the plan is to reparent the children of the unlocked node to the parent of the unlocked node. For example, if the tower has been unlocked and node A has been unlocked then node C and D will be added as the children of the root node and node A will be removed from the tree.


For each type of upgrade there will be multiple trees that will be rolled between. In the picture above there will be a roll between tree one and two. Tree one has a higher probability of being chosen. Let's say it was chosen then there would be a roll between child A and B given that A or B. In the case for Tree Two if Node A was unlocked then Node C would become the child of the root and Node A would be taken out. Currently it's shown as percentages, but in reality the probability is weight based, so the total weight of the nodes is taken into account when rolling the probabilities.

Hopefully the visual explanation helped with the explanation of the implementation. Currently the tree data structures with the nodes being serialized for the details panel has been implemented. Haven't been able to do much this week.

Comments

Popular posts from this blog

UI Polish

AI Navigation Problems - Yashwant Patel

Round End Cutscene Implementation