Mage Hero Online
Mage Hero Online is a solo project that was started with two goals in mind: furthering my knowledge in Unreal Engine and Blueprint Visual Scripting, and understanding how working with online gameplay impacts the work process. To do this, I created mage characters that cast magic using an extensive spell system which would fit well in a top-down action game.
Engine – UE4
Duration – 4 Weeks
Team Size – Solo
With this project it would be possible to create a game with many different classes. There are systems implemented for:
- Damage and Healing spells, both direct and over time.
- Buffs, such as haste and damage increase.
- Debuffs, such as slow movespeed.
The players health, movement speed and attack damage are also readily available for tweaking, enabling the developer to create a game with known classes such as wizards, warlocks, priests, etc. The UI could be tweaked to handle as many players as the developer wants.
The characters in this project cast spells by combining four different colors that each have a unique attribute.
Red does damage.
Blue creates something in the world.
Yellow affects movement and position.
Green has lasting effects.
Each player has four mana charges of each color. By using these charges the player can combine the four colors and cast sixteen different spells. They also have an auto attack that is normally just a ranged attack that deals five damage. Adding a color to the auto attack will consume one mana charge and add an effect to the attack.
R = +Damage
R/R = Fireball
R/B = Firewall
R/Y = Fire Tornado
R/G = Immolate
B = +Create Small Wall
B/R = Ice Turret
B/B = Spawn Wall
B/Y = Portal Ball
B/G = Spawn Elemental
Y = +Slow
Y/R = Lightning Hook
Y/B = Steam Avatar
Y/Y = Flash
Y/G = Haste
G = +DoT
G/R = Damage Buff
G/B = Armor Up
G/Y = AoE Slow
G/G = Invurnerability
Players cast spells by expending a resource called mana. Each player has four mana of each color. Spells can be set to cost: no mana, one mana (based on the first color in the combination), or two mana (one mana for each color in the combination).
The spell system is built around combinations of color values (B/B, R/G, etc). Spells are sorted in functions to make the code more readable. To change which combinations do what we simply need to switch out one node in one of these functions. This allows fast iteration and makes it possible to create different classes using the same system.
Cooldowns are handled with the same value combination as the spell system uses. These combinations are locked away by being put in a list. After a set time the combination is removed from the list and can then be used again. The time they are to be locked for is set within the color spell functions (see Red Spells in Cast Spell Code).
The Fireball is a standard spell found in many games. When the ball hits something it damages all actors within a sphere.
Immolate is a damage over time effect. Effects like these work by spawning an actor that attaches itself to the target. The actor checks for other of its kind and removes them, effectively resetting the effect. Working this way makes it easy to attach a particle to the effect, such as burning.
This spell spawns a wall in the level, blocking both movement and projectiles. When the wall is spawned on an enemy the enemy is moved to the closest free location.