-
Notifications
You must be signed in to change notification settings - Fork 0
Instant Effect Simplification
A deliberate choice has been made to make effects, e.g. an attack on a cooldown, occur immediately once that cooldown elapses, even if it involves an animation that takes some time to resolve.
A Tower attack is a straightforward example: the Tower has an animation which looks like it takes a frame or two to reach the point where a projectile would launch. In actual fact however, the projectile is created immediately when that animation begins. The animation is made in such a way that there's a very small amount of time (e.g. one or two frames) which can be hand-waved as "reasonable enough".
But why do this instead of actually lining up the timing properly? Because it simplifies interruption cases. There are currently three ways that an action can visually be interrupted: 1) death/destruction/merging into another Stone; 2) becoming stunned; 3) and a Stone being merged or unmerged causing its visuals to be reloaded at a different size. If we wanted to delay the actual effect (e.g. the creation of the projectile) when 2) or 3) occurred, we'd need to fiddle with the animator to get things to freeze and continue playing back nicely and perhaps pause all cooldowns while stunned. The animator is especially challenging in case 3) because a different merge size will use different animators / states, etc..
This is all do-able of course, however considering the scope of the project, I opted for the simplicity of not worrying about the visual state. Now we can just stop animations or use a dedicated stun animation and move on, without having to consider the impact of interruption on every new mechanic that's created.
One challenge this instant effect approach brings on is making animations that "look right" when the effect occurs immediately. Considering standard reaction time, you've probably got ~0.3 seconds of time to animate the unit to look like it did what just happened, which sometimes isn't enough.
A way to deal with this could be by "inverting" the animation, so to speak. e.g. for the Hammer Tower in #5 you could have it so the Tower appears armed and ready to attack all the time. The attack animation would then immediately drop to attack once the cooldown elapses, and end by raising again in preparation for the next attack - opposite of what's typical.
Depending on how interruption affects the animation state, this could end up looking a little glitchy in some cases (e.g. if the Hammer drops and is interrupted on its way up, it might suddenly teleport up later?).
Overall, I find that interruptions are likely to produce visual glitches in either case (unless a lot of time is spent on solving the problem), and that this simplification is valuable.