This tutorial will guide you through the basics of the mechanics for my squad combat prototype. This prototype is based of the manual squad mode for my game where you manually take control of units actions.
Select Your Team (max 4 units)
This is the unit selection area. You can click on a unit to learn more about their stats and actions. Enemies here won't fight back so test out unit compositions without any risk!
Selected Units (0/4)
Above is the info display, this displays the current units information.
Below are modifiers. Most of them just modify stats for a set duration, but certain modifiers can perform advanced abilities such as counterattacks or action/modifier nullification.
Active Modifiers
Player Team
Enemy Team
These are units.
All units have a name, HP, Stamina, and a timer. Some units can also have backline position, Mana, and Energy.
A backline unit can't be targeted most attacks and effects from the opposing team. The goal for each team is to defeat all frontline units (any non-backline unit) of the opposing team. There are some midline units able to move between the front and backlines.
A unit's HP represents how much damage it can take before being defeated. A unit can be healed after going down to 0 HP, but its hard to keep them alive afterwards
Stamina, Mana, and Energy are resources a unit can use to make certain actions. Resources will be fully explained later.
A unit's timer indicates when it can take its next action. Some units have different timer speed depending on its speed stat, having more turn frequency than others.
Combat Log
These are actions, hovering over one of them (or holding it on mobile) will show more information about the action. Some actions require targeting a unit. After performing an action, it will be logged for reference to see the history of the battle.
Note: When tag is referenced, that just means the action, unit, or modifier has the tag in its name or description.
Advanced Mechanics
These mechanics aren't as clear in normal gameplay, you don't need to read anything below this, but it still useful.
Attributes and Resources
There are 3 different attributes (Physical, Mystic, and Techno) and a resource associated with each attribute (Stamina, Mana, and Energy).
Actions tagged with a resource requires a certain amount of the resource to use the action. After using the action, that amount of the resource is used up. Actions tagged with a attribute has a cost of 0 of that resource.
A unit regains all its resources at the start of its turn, unless it used an action tagged with the corresponding attribute or resource.
All units have stamina, but not all units have mana or energy. Having more attributes generally makes a unit more powerful, but it becomes more vulnerable certain actions and effects targeting those attributes.
Stats
These are the stats that affect a unit's performance in combat. The exact calculations used for these stats will be displayed at the bottom of the page.
HP: Unit's health.
Attack: Amount of damage dealt to enemy from an attack.
Defense: Amount of damage reduced from attacks. Can reduce up to 1/10th of opponent's attack.
Accuracy: Increase chance to hit an attack. Minimum chance to hit of 15%.
Evasion: Decrease chance to get attacked.
Focus: Increase critical and debuff chance. Multiple criticals can stack.
Resist: Decrease critical and debuff chance.
Speed: Increases turn frequency.
Presence: Increases chance to get targeted, and adds onto focus and resist for debuff calculations.
Element system
Units and actions are usually tagged with one or more elemental pairs. There are 9 main elemental pairs and 4 special elemental pairs. Units without an element are rare.
Main Elements: Death/Darkness, Light/Illusion, Knowledge/Memory, Goner/Entropy, Harmonic/Change, Inertia/Cold, Radiance/Purity, Anomaly/Synthetic, and Nature/Life.
Each element has pair associated, such as Death & Darkness, Light & Illusion, etc. And each main element has an opposite, such as Life & Death, Darkness & Light, etc. (This relation is shown by the order of each element in the list)
To exploit an elemental weakness or resistance, a unit with an elemental pair must be hit by attacks tagged with the elemental pair's opposites (e.g. Death/Darkness unit hit with Nature/Life and Light/Illusion attacks). Hitting a unit with an element it already has nullifies the element for that one attack until the start of its turn.
Healing and Buffs from an opposing pair of the unit weakens the effect while using the same pair as the unit increases effectiveness.
Special Elements: Precision/Perfection, Independence/Loneliness, Passion/Hatred, and Ingenuity/Insanity.
Special Elements don't have opposites, so they don't have the usual interactions as the main elements. These elements are mostly used for synergies.
Future mechanics
These aren't implemented yet, but will be once I finish programming them.
Passive Skills
Units can have active skills (actions) and passive skills. A passive skill is a modifier that lasts the entire combat.
Unit synergy
Certain unit may have synergies when paired with other units. These synergies may range from stat modifications to new actions to completely changing the unit. Due to the small amount of units and the limitations of the current build, this isn't implemented yet.
Unit Progression
You can upgrade a unit by increasing it's level and power.
Level increases the effectiveness of the unit's skills and unlocks more skills, while Power increases the unit's base stats. Certain effects and skills can affect Level and Power. The range of Level and Power is from -127 to 128 and can't go higher or lower.
A unit gains Level xp from finishing a battle with the unit, while a unit gains Power xp from duplicates of the same unit or sacrifices. At higher star rarity, units will require a certain lower star quality unit to have its Power at least their Power level to increase it.
You can sacrifice a duplicate to increase the Power of a the same unit or a compatable higher star unit to drastically increase a units Power. When certain units reaches max Level, you can prestige them to reset its level and massively boost a higher star unit's level and power. The prestiged unit keeps all its unlocked actions.
Formulas
Roll is a random number from 1-100
To hit (accuracy doubles and auto crits at a roll of 100 and auto miss at a 1, Hit ≤ 0 is a miss):
\[Hit = 10\frac{Accuracy_{Attacker}}{Evasion_{Defender}} + Roll - 85\]
To crit (denominator can't go below 10, minimum of 1 if roll is 100):
\[Critical = \frac{Hit}{3Resist_{Defender}-Focus_{Attacker}}\]
(Multiplied by a random number between .75 to 1.25, Minimum of 10% of attack)
If Critical ≥ 1:
\[Damage_{Critical} = \text{ (Previous function, but attack and minimum multiplied by critical + 1)}\]
Debuff (debuff is applied if number is positive, auto apply on 100 and auto fail on 1, denominator can't go below 20):
\[Debuff = Roll\frac{Presence_{Attacker} + Focus_{Attacker}}{(Presence_{Defender} + 2Resist_{Defender})} - DebuffSpecificConstant\]