Mob's Arena is a 2D, topdown, round-based, arena style game where up to four players battle to be the last one standing. It is made in the Unity Engine with C# and is fully networked via the Mirror API.
After each round of combat, players then move into a brief round of purchasing upgrades. Players use the coins they earn during the game from defeating other players, winning rounds, or world pickups. The player who wins a round earns a point, and the first to a certain amount of points is the overall winner.
One of the main features of this project is the upgrade system. These upgrades are split into 4 classes which are further split into 3 branches. Each player is limited to 1 class, which defines core stats and abilities for the player. Each class then has 3 branches of upgrades to choose from. Players may choose 3 in one branch and 2 in another for a total of 5 upgrades.
The classes vary greatly with their three upgrade branches providing further distinction, effectively becoming their own subclasses. The final upgrades in each branch are the most powerful in their effect, such as invisibility, map-wide explosions, and lifesteal effects. Some upgrades come with castable abilities, like a quick dash across the map or special spell.
The first step was to design the upgrades. While I'm not a game designer, I still enjoyed the creative process of coming up with fun upgrades. Here is a graph I made early in the design process to visualize the upgrade tree.
The next step was to implement this upgrade system. As there were many upgrades with wildly different effects, I needed the system to be very versatile. I also wanted it to be extensible enough to allow for easy modification of individual upgrades or the structure of the overall upgrade tree. The upgrade system also needed to be fully replicated on the network and be fully server server-authoritative to prevent buying upgrades that aren't purchaseable.
I started off by designing the implementation of the upgrade system on a high level using a UML diagram. Drawing out systems before I even touch an IDE is a crucial part to my technical design process. Thinking about architecture in this way usually shines some light on areas of the problem requirements that you don't have a full understanding of and allows for easier modification/improvements to your solution before you spend hours writing it.
Here is a diagram that illustrates a simplified core structure of the upgrade and ability system in Mob's Arena. One aspect of this architecture that is most evident by this diagram is strong server authority. Every action that modifies the game state, like using an ability or purchasing an upgrade, is only requested by the client. The server is free to choose whether it will fulfill that request.
I used the scene hierarchy to define the structure of the upgrade tree. Upgrades automatically find their prerequisite upgrades based on its parent in the hierarchy. This allows for very easy and quick modification as changing the tree doesn't mean manually relinking nodes together.
As mentioned before, the entire system is replicated over network and fully server-authoritative. This means everything is fully synced - all clients will become aware of other players' upgrades to allow for local client effects, like particles and sfx. The server-authoritative aspect of these systems also serves as good state validation and anti-cheat. Players will not be able to buy upgrades if they do not have enough coins or if they do not have the prerequisite upgrades. Similarly, players will not be able to cast abilities that they don't have or abilities that are on cooldown.
The result is a robust upgrade system that is versatile, extensible, and fully server-authoritative. This supports diverse upgrades from simple stat boosts to complete player overhauls and activatable abilities.