top of page
  • Writer's pictureDaniel Bellido Chueco

Improving the Parkour System (Part 2)


A new update on the Arma X project is here and this time it comes with a significant improvement to the Parkour System, and now our agent renamed Yair has developed the ability to climb large walls and other surfaces and perform a small variety of movements while doing it.


First of all, Yair was simply able to detect objects with a ray cast and climb on top of these objects with a certain animation depending on the height. In this way, Yair could simply climb high steps, jump on top of boxes and climb small walls to automatically position himself on top of them. This time, Yair has taken the ability to climb much further and now not just climbs but can do bouldering.



To implement such a system, the first thing to do is create climb-ledges and put a specific tag on them so that the ray cast can differentiate between climb-ledges and environment objects.


The only problem is that the implemented ray cast only detects objects in the lower area of the character's feet and this raycast shoots another one upwards when it collides with an object to calculate the height and determine if it can be climbed or not. Therefore, a series of ray casts have been implemented on top of the character so that it can detect ledges at different heights.


Once it detects edges, Yair has to jump and hang until we decide to make a new move. To do this, target matching techniques are used so that the character's animation feels realistic and his hands are well attached to the edge. While the character is hanging and preventing another movement code from being executed, a boolean (isHanging) is applied which determines whether or not the character is climbing edges.


But how do we make the character jump from one edge to another? For this, a climbing network has been implemented that allows communicating edges, and the character can only move in this network while in the hanging state.



As can be seen in the image, the edges are joined by two types of lines, green and white. The green ones indicate that this path can be transitioned in both directions while with the white ones, the character can only move in one direction. In other words, Yair will be able to move from a high edge to a lower edge but not the other way around if the previous edge is too high.


This is achieved by adding a script to each edge called a climbPoint that indicates which direction the character can move with a Vector2. This script also has a list of neighboring edges where the character can jump to or move from the current climbPoint. Therefore two types of climbPoints are needed, jumpable ones and moveable ones in case an edge has two or more climbPoints. This script also determines if the climbPoint where the character is is a point that the character can mount or not. One of the limitations of this system is that a climbPoint can only have a maximum of 4 connections when moving between climbPoints. With a Vector2 the number of directions is limited to the right (X = 1), left (X = -1), up (Y = 1), and down (Y = -1).



Once the climbing network has been set, and the character can jump to the first climbPoint, another input direction has been coded in the Climbing Controller script for when the character is in the isHanging state. This input detects in which direction the player wants to move and if there is a climbPoint in that direction it will jump or move, depending on its type, towards the neighboring climbPoint and convert the neighboring climbPoint to the current climbPoint to determine which is the new neighboring climbPoint.


What does this look like?






17 views0 comments

Recent Posts

See All

Comments


bottom of page