Action Sequences: Swarm


Next installment in the series breaks down swarm, a deceptively difficult attack to program.

Everyone hates waiting for 8 enemies to attack, one by one, slowly. Swarm was designed to be as fast as a single enemy's attack, but with all 8 bees. Making them attack simultaneously is not easy given the limitations of RM action sequences. Thanks to Visustella Battle core for making it possible! The entire attack occurs within 40 frames, with a 12 frame wait to give time for all the bees to reset. That means the entire attack is 52 frames - less than one second.

Basically, all 8 movements and attacks are a single action sequence, complete with overlapping motion, damage effects, and conditional branches to check for which bees are dead. My first step, using pen and paper, I wrote out basically what you see in the table below so I could get my mind around what I wanted to happen.

Frame 0
Bee 1 moves to target

Frame 4
Bee 2 moves to target

Frame 8
Bee 3 moves to target

Frame 12
Bee 1 hits and returns to home
Bee 4 moves to target
Frame 16
Bee 2 hits and returns to home
Bee 5 moves to target
Frame 20
Bee 3 hits and returns to home
Bee 6 moves to target
. . .
...
...
Frame 40
Bee 8 hits and returns to home

Frame 52
Finish action

Take a look at the first few lines of events and you'll see I carefully labeled everything to make the process easier and more fixable in case of bugs. I used a MOVE: Jump command to with a bit of randomness inserted to make the flying feel a little more natural and varied. Math.randomInt (-200, 200) means the height of the bees jump falls somewhere between -200 (an arc below) or 200 (arc above).


Another puzzle was making sure that damage would not occur to the actors if the bee was dead. So I just made a conditional branch so the action effect and animation would not occur if the target was dead.


Overall pretty simple - just a lot of simple pieces that needed to be organized and put together. If I could change it, I would make the bees move in groups sometimes, not sequentially, as bees would not wait for their turn to attack. I'd probably do Bee 1 attack, Bee 2, 3, 4, Bee 5, 6, Bee 7, 8. Might have exaggerated the arc or made more variance for some of the bees as well, since the arc is almost imperceptible sometimes (it averages at 0 jump so that's probably why).

As always, feel free to ask any questions! I love thinking about and talking about it all, and want to see even better stuff than this from the community.

Files

Infinity Beatdown - DGJ 2021 199 MB
Apr 03, 2021

Get Infinity Beatdown

Leave a comment

Log in with itch.io to leave a comment.