Compass Movements with Blend Trees
My current challenge is how the 1982 arcade game Time Pilot implemented its movement. The first part of this challenge is to implement its 16-way compass sprites.
Each direction has a two frame flicker book animation to make it appear that the propeller is turning. With the above sprite sheet sliced I painstakingly created an animation per direction.
Adding those as a standard Controller layer would look like this
At this point I could create a large number of transitions, e.g. IsNorth, is IsNorthEast, etc. This would create a massive spider web of transitions that would be hard to maintain. This is where Blend Trees come the rescue. Before I create a new Blend Tree I need to have 2 parameters, Horizontal and Vertical, each from -1 to +1. This will represent the compass directions. I.e. (0,1) would be North.
Next up, create our Blend Tree.
Double-clicking the CompassMovement Blend Tree State takes you to the Blend Tree Editor
Now the painful bit, defining all the directions as 2D matrix.
Now we can supply a set of Horizontal and Vertical values and Unity will provide the correct animations.
There we have it, Time Pilot planes can now be animated. I can see Blend Trees being really helpful with arcade games, as many of them used 16-way joystick movement so this technique should be repeatable.
Next up, experiments in that, “keep the player central” movement.