Compass Movements with Blend Trees

Paul Marsh
3 min readMay 5, 2021
Time Pilot 1982

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.

16 way movement
Compass Directions

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.

Animations per direction

Adding those as a standard Controller layer would look like this

Animation Controller

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.

Compass Directions params

Next up, create our Blend Tree.

Creating a new Blend Tree
CompassMovement Blend Tree State

Double-clicking the CompassMovement Blend Tree State takes you to the Blend Tree Editor

Empty Blend Tree

Now the painful bit, defining all the directions as 2D matrix.

Defining the directions
The final blend tree

Now we can supply a set of Horizontal and Vertical values and Unity will provide the correct animations.

Controlling the Blend Tree

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.

--

--