Happy Saturday dear reader,
Today I will be going over the wall climbing technique used in the first Assassin’s Creed.
Assassin’s Creed is an open world stealth adventure game that takes place during the Third Crusade (1189-1192) with the main player character being Altaïr Ibn-La’Ahad or Atlair. I wont go into to much detail about what the game is and other gritty details because it is a fairy popular game (over 5 million units sold) and part of a popular franchise.
One of the core gameplay elements of the Assassin’s Creed franchise, is the ability to parkour across any in-game surface and climb any building.
My goal is to figure out how they created the wall climbing system for Altair, both his locomotion and animation.
Starting of with the gamplay trailer breakdown:
- From 0:15-0:20 – Here we can see that Altair is in fact floating above the ground showing us that they are not using Inverse Kinematics to bind the feet to the floor. This is also known as foot skating.
- 0:34-0:37 and 0:43-0:51 – Altair does not seem to be walking up the stairs like a normal person would rather it seems like he is diagonally interpolating to give the illusion that he is actually climbing the staircase. Altair is not walking up every step, he seems to be playing an animation and another force is slowly increasing Altair’s elevation making it seem that he is walking up a staircase.
- 0:53-3:00 – Wall climbing
First let’s begin with user input. Assuming the player is playing on the Xbox 360, he will be holding the ‘RT’ and ‘A’ button in order to run up a wall and begin to climb it. After this point they use the analog stick to pick a direction to climb in.
Now the only way to climb a wall is to look for different ledges to point to and then Altair will climb to that direction. Most the most part he is limited to horizontal (X axis) and vertical (Y axis) movement. For the most part there is no diagonal movement (X and Y axis) unless there are special landmark buildings where they have certain designs that can be climbed differently. For the most part there is just X and Y movement on a building.
For the normal movement locomotion, they are not doing anything special other then basic physics across the world. Altair’s movements are segregated into 2 categories
- Low Profile – Basic walking movement, the ability to blend and steal
- High Profile – The player must hold down the Right Trigger and the low profile buttons change. Atlair can now run, jump and start a wall climb as well as assassinate others and pull out his weapon. Altair can also tackle and shove people while he is running.
In this first image, we can see Altair hanging down on a ledge. To prove that they used a similar system for almost all the buildings you can see his right arm is going inside the mesh. This means that the ledges are essentially small bump mapped graphics separate from the locomotion system. If the locomotion system was parented to the mesh of the building that Altair was climbing, then he would not be going through that ledge in the picture.
The hardest part to figuring out how Ubisoft managed to code the wall climbing system is the “ledges” system. Did they use nodes that were hand placed on the buildings that indicated the ledge type? Did they physically make ledges in the mesh and had Altiar read in the the triangles to determine if it was a ledge? Was each ledge manually stuck on and treated as another object?
It took me a while to decide on one, but with a little helpful discussion with Kevin a.k.a. @Iceninja77 we were able to agree it was a mixture of nodes and separate objects. We believe that the basic buildings are plain rectangular texture mapped objects and the landmarks are just several polygons in one mesh. The level designer might have manually placed nodes on the building using their game engine to indicate where he wanted ledges. Those nodes would have different type depending on what type of ledge they wanted and what animation Altair would play to reach it.
Here we can see some of the basic types of ledges there are. There are the Purple ledges that are just pieces of geometry that pop outwards and are not connected to other ledges. The purple edges are only used as stepping stones. Then we have the Blue type of ledges that wrap around the whole building that Altair can shimmy toward the left or right on.
Each colour seen in Figure 3 is a ledge that Altair can climb on. The window pane (Blue, Green, Pink, Red) would be a special node that has sub-nodes (Sub-Ledges) in it so that it can be traversed. The normal ledge (Purple) would be another example of a ledge Altair can shimmy around.
So far we have learned:
- The only inputs are a direction given as a degree from the X-inputfrom the Xbox 360 controller. For example:
- Left = -X axis
- Right = +X axis
- Up = +Y axis
- Down = -Y axis
- Once Altair enters a wall climb he is only limited to three options and the other walking actions are locked from use
- Move in a direction – Analog Stick
- Drop – ‘B’ button
- Jump in a direction (upwards or away from the building) – ‘A’ button
- There are several basic ledge types:
- Stepping stones – Used for Altair to from to other ledges
- Shimmy Ledges – Altair can move left or right on these ledges until he finds a stepping stone to climb up, or another Shimmy Ledge. Shimmy ledges can also wrap around the whole building
- Sub-Ledge Objects – Special objects like window panes and steel grates that are a mix of Shimmy Ledges and Stepping stones.
We have a choice to pick between a key-frame animation system or a skeletal animation system. Assuming that Ubisoft has lots of motion capture data for Altair climbing from and to different ledges, a Skeletal animation system would be the better pick. Using a keyframe animation system would involve a lot more coding and a much larger animation blend tree.
Lets say that the wall climb is done in a doubly linked list, tree data structure. The root would be the the top of the tower and the children would be the start of the building. The way to traverse the tree is to give a direction from the analog stick. For example, if you initiate a wall climb by walking up to the building and grabbing the closest ledge you would start of at one of the youngest children in that tree. If you initiate a wall climb by running up the wall you would pass one child node and go to its parent.
- White is the Root node for the top of the building. This can be either a point or another flat surface like a roof where Altair is no longer locked in wall climbing mode and is free to roam in the X and Z axis
- Red/Pink are the Stepping stone ledge types
- Blue are the Shimmy ledge types
Now the basic idea here is that you would start at the bottom and work your way up. This is NOT a BST (Binary Standard Tree) so some rules of tree’s do not apply to us. So if you start at the bottom on a Stepping Stone ledge type you can traverse the tree by going upward and increasing your level to a Shimmy ledge type and Altair would play the animation from Stepping Stone to Shimmy. If Altair does not move then he would play the animation for idle on Stepping.
So the best idea is to store the animation to be played in the nodes themselves. A boolean would be changed and then that animation would play while also moving Altair to that new position.
The reason I would use a tree like this for the wall climbing is that it makes it easier for combining user input and traversing the tree. If the user inputs a negative X value and if Altair was on a Shimmy ledge he would move left until he reaches the end of that ledge or forever if the ledge wraps around the building. If the Shimmy edge has a Stepping Stone to the left of it and the user is still inputting a negative X value then Altair would climb to the stepping stone. If the user wants to climb upwards, the just input a positive Y on the analog stick and Altair will keep climbing upwards until he reaches a dead end and has to move left to right to find another ledge to climb upwards with.
This was a fairly quick overview of how the climbing system would be done. I didn’t go into detail about the linked list aspect of it because that would be more complicated. We would have to factor in several items to choose which animation to be played. Since sometimes Altair is grabbing the ledge and hanging freely, and other times where Altair is grabbing a Stepping Stone and two level’s under him there is a Shimmy ledge and his feet are held up on that ledge.
I think that having a logic tree for each building would be easier to program rather then giving the player unlimited freedom thinking that each ledge is special and there are unlimited ways of climbing each building. In reality they are just picking a random point in the matrix and depending on their inputs they are just following a predetermined path.
Thank you for reading 😀
You have just been Moose’d