User Tools

Site Tools


climbing

This is an old revision of the document!


Climbing


The climbing mechanic and related functionality allows characters to traverse tiles vertically. This provides a simple way to create things like ladders or ropes for your game!

Setting Up Climbable Tiles

To demonstrate, let's assume that you'd like to create a ladder to reach the roof of a building. The first thing you'll need to do is create a tile for your ladder (or ladder segment if using multiple linked together). These must be tiles, and not objects, as they will be placed into the map vertically and linked with other tiles, acting as a surface for characters to traverse.

Once placed, select each ladder tile while in “Edit” mode and enable the “Climbable” setting from the Entity Properties panel. Until a climbable tile has been linked to other tiles, its marker icon will show as a “ladder” with greyed out arrows as shown below.

Next, if you have multiple ladder segments, you'll need to connect all of them together into a series. To do so, select an adjacent pair of ladder tiles, then right-click on one of them and select “Climb” from the “Navigation/Interaction” submenu. The marker icons will update to indicate if a particular climbable tile is connected to another tile above or below it by displaying the corresponding arrow as green instead of grey.

In order for a character to be able to mount/dismount the ladder, you'll also need to connect the top and bottom of it to adjacent tiles. These will determine where the character can grab onto the ladder from as well as where they will step when dismounting the ladder. To do so, select both the top tile of the ladder and an adjacent roof tile. Then right-click on one of them and select “Climb” from the “Navigation/Interaction” submenu, similar to the previous step. Do the same for the bottom ladder tile and an adjacent ground tile.

Note that the tiles adjacent to the top and bottom of the ladder now have special marker icons to indicate that they are mount/dismount locations for characters.

This will get the basic climbing functionality working, but to create the proper appearance of the character climbing the ladder, you'll also need to define an animation, set up some attach points, and slow down the character as they move up and down the ladder.

Character Animation and Speed

When climbing a ladder or other climbable tile, the “climb” animation will be triggered (if defined for the character). The first frame of the animation will display when initially grabbing on, and the full animation will be played while moving up and down.

You'll most likely want to slow down the character's movement speed to make the climbing look more natural. To do so, you can simply adjust the speed multiplier setting for the climbable tile from the Model Properties panel in the Voxel Editor. For the example ladder, I set the speed multiplier to 0.3.

Character Positioning

In order for characters to be properly aligned with the ladder while climbing it, you'll need to define an attach point named “climb” for both the character and the climbable tile. If these are not defined, the character will just be centered on the tile. For the character, the “climb” attach point should be added to the first frame of its “climb” animation. This attach point will be used for initial positioning on the climbable tile, and then from there the character will just be moved up and down.

In the example below, the attach points have been added to the character's left hand and to the left side of the ladder's top rung. Since the ladder is positioned at the back (north) side of the tile boundaries, its “climb” attach point has been rotated 180 degrees around the z-axis so that characters will properly face the ladder while climbing it.

Game Controls

In-game, pressing the “C” key from a mount/dismount location will cause the player character to grab onto the adjacent climbable tile. While grabbed on, holding the “Up” and “Down” arrow keys will move the character up and down until the top or bottom is reached, at which point the character will dismount.

Since any connected climbable tiles are integrated into your game's navigation, the player character will automatically consider them as paths when using mouse controls to move around the map. A climbable tile can also be clicked on to move the player character directly to it, for example to climb up to a specific ladder segment.

Known Issues

  • When using only a single tile for a ladder or other climbable structure, the character's climbing animation will never play. This is due to the fact that the character “snaps” onto the ladder when grabbing it and then instantly “snaps” again when dismounting onto the adjacent tile at the other end.
climbing.1619554339.txt.gz · Last modified: 2021/04/27 13:12 by justin