[Animation Breakdown] Helltaker 2 - Part 1: Setting up the stage
Added 2020-10-06 11:10:11 +0000 UTCThis animation was so intricate that I need to go over how it works in multiple parts. So, here's part 1: Frame Actually working with this project.
Originally I started with a rough idea and worked around it. I programmed the movement and tiles way before actually setting anything else up, but with a project like this you need to be mindful of how you actually tackle it.
In this case let's talk about Flash (and in some regards HTML5).
- = [ Setting up the stage ] = -
In Flash, the less wasted frames the better. It's very easy to accrue a lot of wasted frames that you don't need to include that may impact performance, file size, or load times. In this case, it's always good to limit what information you have saved on other frames so it's not always loaded in, or not taking up space that it shouldn't.
For example, I used to to do this whenever I wanted to load new text in:

These are wasted frames.
The definition of a "wasted frame" really depends who you are, and how familiar you are with Flash (and Animate). A frame is wasted if you're not utilizing it enough.
With enough know-how you can now compress this entire 60 frame pileup into one frame by the clever use of arrays and code.
But how would you go by doing this?
Well it's actually rather easy.
- = [ Getting the most out of text ] = -

This is an exert of my Atago dialogue code. What this does is it creates an entry into the array 'cutscene01' with the following attributes:
n - Name
r - Remove
s - State
bg - Background
(BTW there's a few things wrong with the "remove" function I have, and it wildly limits the amount of characters on screen. This is something I'm going to fix over iterations)
Let's start with 'Name'. In the same external class file I have another array called 'charNames' which has all the names of the characters stored in it.

In this case, the number that is represented is the name that will pop up on screen.
Similarly, in regards to States, the number attached to the "s" is the frame that the character will stop at with the "gotoAndStop" command. This means I can cycle through different facial expressions or poses with ease.
'Remove' is fairly complicated and dodgy so I'm not going to go into it much. Simply put, it's just telling the system to add the character currently speaking to the scene. If "r" equals 2 then it will add Cerberus' sprite, and so on.
BG is also self explanatory. If BG equals anything other than "null" then gotoAndStop on whatever number is attached.
With the right inputs you can scan the array entry and work it to your will, which could compress a several thousand frame animation into just 10 or so frames.
Always be mindful of your extra loose text or frames. Flash is a fickle beast, and it can get upset if you have random items that go unused.
(Plus it's always good to clean up after the project is over and remove unnecessary items)