Post by Naota on Jun 8, 2020 4:06:21 GMT
Hey everyone - I've been working on a game that started with this tutorial as its base, slowly incorporating all kinds of different features over the last year (a modular ability system, ballistic targeting, usable buttons and doors, inventories and trading, dropping items on ground tiles, etc). Long story short, I've wrapped back around to working on the presentation of the game, and the first thing that came to mind was what you've probably guessed: animations!
Since playing a sprite animation during a state machine state is already covered in this tutorial, the question I have is how I might expand what's there into a general system that covers the needs of my project. Has anyone worked on a system to handle more complex animation sequences for a game like this, or has any thoughts on the best way to structure one?
Specifically, these are the sorts of things I have in mind:
My thinking is I'll need a way of sequencing animation events that can be called from a variety of places - something that would interpret sequences like "Unit swings sword; wait 0.5s; spawn projectile that moves towards tile; on projectile arrival, spawn animated explosion".
This could be a state in the state machine like PerformAbilityState, but swapping to it would mean leaving the current state - which is not always ideal, as sometimes that state has data that needs to persist. Thoughts?
Since playing a sprite animation during a state machine state is already covered in this tutorial, the question I have is how I might expand what's there into a general system that covers the needs of my project. Has anyone worked on a system to handle more complex animation sequences for a game like this, or has any thoughts on the best way to structure one?
Specifically, these are the sorts of things I have in mind:
- Attacks which after playing an animation on a unit, spawn an animated effect in specific tiles.
- Attacks which after playing a unit animation, launch an object towards the target, and on impact spawn an impact effect.
- Units perform a "hit" animation on being hit by an attack.
- Units can be knocked into other tiles by attacks, or into walls/other units (think Into The Breach).
- Animated doors and platform tiles that move when a button is pressed.
- Units play animations mid-turn for simple actions: use, drop, etc.
- General "particle effects" that spawn after actions (dust, sparks, etc)
My thinking is I'll need a way of sequencing animation events that can be called from a variety of places - something that would interpret sequences like "Unit swings sword; wait 0.5s; spawn projectile that moves towards tile; on projectile arrival, spawn animated explosion".
This could be a state in the state machine like PerformAbilityState, but swapping to it would mean leaving the current state - which is not always ideal, as sometimes that state has data that needs to persist. Thoughts?