Post by sylvanelite on Feb 19, 2019 8:57:34 GMT
Because of the request to release a prototype battle system, I'm going to outline some of the documentation around the battle system.
Note, that this is a prototype, not the full battle system. This documentation covers things the way they are at present, and not the final set of features.
This post assumes prototypers download the Unity project and run it through Unity. This should give full customisation.
Internally, the battle system uses a finite state machine:
![Battle System FSM](https://i.imgur.com/2B6MTxX.png)
This diagram roughly outlines the internal states, but is a bit outdated and it has a few errors. For most people this diagram is unimportant, it generally shows the flow of menus, but there is a layer of abstraction between this and what the player sees on the screen so it's not a 1-1 representation of how the game flows.
For people wishing to prototype, below are some places to look inside the unity project:
The scene has to be set to the battle system sandbox, otherwise you'll get the overworld instead.
![unity scene](https://i.imgur.com/UPimUOv.png)
Selecting the "Main Camera" will reveal the setup options for the battle on the side:
![camera](https://i.imgur.com/nAKn7tt.png)
![battle config](https://i.imgur.com/srHS2zt.png)
Of importance, this is where the initial battle configuration is set up. Characters and enemies can be chosen from a set list (details below), in addition there are "summons" and "stands". Summons represent unlocked Summons as they appear in GS. "Stands" represent the new AI-controlled summons. It is intended that summons are to be deprecated in favour of Stands, however they are sticking around for now as a fallback. Summons don't yet have a damage calculation, as it's clear if they do make it into the final game, the calculation will change from GS. Stands can be activated, and have costs implemented as per the summons thread, however, they have no attacks, animations, or duration as yet, so they effectively do nothing outside of checking their cost.
As an aside, the four states for Djinn are: Set, Standby, Stand, Summon. Most people would usually think of "Summon" as "Recovery" but the names I chose are just for alliteration. "Stand" seemed to fit both the concept and the naming convention, but this is an internal term only. The final game will use proper names (and have localisation).
At the moment, these battle config settings have to be set manually, there is no transition between the main game and the battle system, as they are both sandboxes at the moment.
The actual objects used in the battle are set from scritpable objects, under the folder "SylvanData". In here you'll find:
![scriptable objects](https://i.imgur.com/KtxQn1v.png)
These are fairly self explanatory.
Generally speaking, everything that can be used in battle inherits from a generic "Skill" class. Skills have a name, targeting method, power, and an animation state. Most of these options are straightforward, for example, targeting can be either an ally or enemy, and the range dictates the splash damage. The animation state is the animation that is played for the character when using the skill.
For example, to make a healing pysenergy, you can create a Psy class with a target of "Ally" type of "Healing" and set the element/power/animation to suite. Buffs can be applied to any skill, but note, aside from select Djinn, it hits the target, not the caster. So you can't deal damage to the target and buff the user in 1 skill right now. You can change the type to "effect" if you want to cast a buff with no damage, and there is a "effect go first" flag for things like barriers to jump the priority queue.
All skills can have buffs, and an arbitrary number of them, but I have not tested every combination, so it's likely to have bugs.
When choosing an animation for a skill, always choose "Summon". "Attack" should only be reserved for basic attacks, this is to do with the way basic attacks are scripted. Battle animations can be scripted with a number of events, such as rotating the screen, moving the character icon, and playing a sound effect. But this is beyond the scope of this post.
Characters look like this:
![character](https://i.imgur.com/0kDpO1W.png)
They have 8 animations, which are 4 states plus a forward facing and backward facing sprite.
Psy is an arbitrary array of their usable Pysnergy.
Djinn is an arbitrary array of their equipped Djinn. There are no checks in place at the moment, so we have to manually ensure that a particualr djinn is not assigned to a character more than once, or to multiple characters. This will cause quirky gameplay when trying to calculate summon costs.
The Weapon just needs to exist to use a basic attack. Weapons have not been fleshed out beyond this and lack criticals and unleashes, at the request of designers.
Below that is an array of initial status effects, followed by the character's base stats.
Djinn are likewise skills:
![Djinn](https://i.imgur.com/gz5VHMM.png)
Of note, Djinn also have custom code backing them to do their special effects. Djinn also don't have animations, so pressing "B" is required to skip the animation if using them in battle. The Unity name for Djinn are used to check for special effects, so don't change this.
Finally, we have status effects:
![Status Effects](https://i.imgur.com/HbzSLUU.png)
I've pre-baked the effects for Djinn. Of the stat effects, the only ones implemented are: Poison, Stat Buff/Debuff, Extra actions, and Barrier.
Finally, if you need to add anything to the project, note that the battle menu has its own set of options, distinct form the rest of the game:
![menu](https://i.imgur.com/KwtoplR.png)
To round things off, here's a list of unimplemented things that are lacking from the prototype:
- KOs and Revival are not implemented.
- Flee, Swap, Options menus are not implemented.
- Defend option's calculation
- AI only does 1 basic attack.
- Attack types are not tested fully. (e.g. Healing Psy)
- UI for menu components
- UI for HP and status effects
- Critical hits*
- Unleashes*
- Character Classes*
- Statues*: Stun, Sleep, Seal, Delusion, Taunt, Counter, No Action
- Items
-- usable items*
-- equipment*
- Sound Effects
- Summon Damage
- Stands:
-- Duration*
-- Initial Damage*
-- Subsequent Damage*
-- Final Damage*
- Elemental "effective" bonus
- Diminishing multiplier for splash damage
- Status effects that are removed "on hit" (e.g. counter)
- The new Shield status effect
- RNG is not implemented, all calcs are flat.
- special effects
* awaiting resolution of design threads to implement.
Note, that this is a prototype, not the full battle system. This documentation covers things the way they are at present, and not the final set of features.
This post assumes prototypers download the Unity project and run it through Unity. This should give full customisation.
Internally, the battle system uses a finite state machine:
![Battle System FSM](https://i.imgur.com/2B6MTxX.png)
This diagram roughly outlines the internal states, but is a bit outdated and it has a few errors. For most people this diagram is unimportant, it generally shows the flow of menus, but there is a layer of abstraction between this and what the player sees on the screen so it's not a 1-1 representation of how the game flows.
For people wishing to prototype, below are some places to look inside the unity project:
The scene has to be set to the battle system sandbox, otherwise you'll get the overworld instead.
![unity scene](https://i.imgur.com/UPimUOv.png)
Selecting the "Main Camera" will reveal the setup options for the battle on the side:
![camera](https://i.imgur.com/nAKn7tt.png)
![battle config](https://i.imgur.com/srHS2zt.png)
Of importance, this is where the initial battle configuration is set up. Characters and enemies can be chosen from a set list (details below), in addition there are "summons" and "stands". Summons represent unlocked Summons as they appear in GS. "Stands" represent the new AI-controlled summons. It is intended that summons are to be deprecated in favour of Stands, however they are sticking around for now as a fallback. Summons don't yet have a damage calculation, as it's clear if they do make it into the final game, the calculation will change from GS. Stands can be activated, and have costs implemented as per the summons thread, however, they have no attacks, animations, or duration as yet, so they effectively do nothing outside of checking their cost.
As an aside, the four states for Djinn are: Set, Standby, Stand, Summon. Most people would usually think of "Summon" as "Recovery" but the names I chose are just for alliteration. "Stand" seemed to fit both the concept and the naming convention, but this is an internal term only. The final game will use proper names (and have localisation).
At the moment, these battle config settings have to be set manually, there is no transition between the main game and the battle system, as they are both sandboxes at the moment.
The actual objects used in the battle are set from scritpable objects, under the folder "SylvanData". In here you'll find:
- Characters
- Djinn
- Status effects
- Psyenergy
- Weapons
![scriptable objects](https://i.imgur.com/KtxQn1v.png)
These are fairly self explanatory.
Generally speaking, everything that can be used in battle inherits from a generic "Skill" class. Skills have a name, targeting method, power, and an animation state. Most of these options are straightforward, for example, targeting can be either an ally or enemy, and the range dictates the splash damage. The animation state is the animation that is played for the character when using the skill.
For example, to make a healing pysenergy, you can create a Psy class with a target of "Ally" type of "Healing" and set the element/power/animation to suite. Buffs can be applied to any skill, but note, aside from select Djinn, it hits the target, not the caster. So you can't deal damage to the target and buff the user in 1 skill right now. You can change the type to "effect" if you want to cast a buff with no damage, and there is a "effect go first" flag for things like barriers to jump the priority queue.
All skills can have buffs, and an arbitrary number of them, but I have not tested every combination, so it's likely to have bugs.
When choosing an animation for a skill, always choose "Summon". "Attack" should only be reserved for basic attacks, this is to do with the way basic attacks are scripted. Battle animations can be scripted with a number of events, such as rotating the screen, moving the character icon, and playing a sound effect. But this is beyond the scope of this post.
Characters look like this:
![character](https://i.imgur.com/0kDpO1W.png)
They have 8 animations, which are 4 states plus a forward facing and backward facing sprite.
Psy is an arbitrary array of their usable Pysnergy.
Djinn is an arbitrary array of their equipped Djinn. There are no checks in place at the moment, so we have to manually ensure that a particualr djinn is not assigned to a character more than once, or to multiple characters. This will cause quirky gameplay when trying to calculate summon costs.
The Weapon just needs to exist to use a basic attack. Weapons have not been fleshed out beyond this and lack criticals and unleashes, at the request of designers.
Below that is an array of initial status effects, followed by the character's base stats.
Djinn are likewise skills:
![Djinn](https://i.imgur.com/gz5VHMM.png)
Of note, Djinn also have custom code backing them to do their special effects. Djinn also don't have animations, so pressing "B" is required to skip the animation if using them in battle. The Unity name for Djinn are used to check for special effects, so don't change this.
Finally, we have status effects:
![Status Effects](https://i.imgur.com/HbzSLUU.png)
I've pre-baked the effects for Djinn. Of the stat effects, the only ones implemented are: Poison, Stat Buff/Debuff, Extra actions, and Barrier.
Finally, if you need to add anything to the project, note that the battle menu has its own set of options, distinct form the rest of the game:
![menu](https://i.imgur.com/KwtoplR.png)
To round things off, here's a list of unimplemented things that are lacking from the prototype:
- KOs and Revival are not implemented.
- Flee, Swap, Options menus are not implemented.
- Defend option's calculation
- AI only does 1 basic attack.
- Attack types are not tested fully. (e.g. Healing Psy)
- UI for menu components
- UI for HP and status effects
- Critical hits*
- Unleashes*
- Character Classes*
- Statues*: Stun, Sleep, Seal, Delusion, Taunt, Counter, No Action
- Items
-- usable items*
-- equipment*
- Sound Effects
-- Duration*
-- Initial Damage*
-- Subsequent Damage*
-- Final Damage*
- Elemental "effective" bonus
- Diminishing multiplier for splash damage
- Status effects that are removed "on hit" (e.g. counter)
- The new Shield status effect
- RNG is not implemented, all calcs are flat.
- special effects
* awaiting resolution of design threads to implement.