Monday, March 3, 2014

Mountain Climber Dev Log 02: Climbing picks

I've posted a new build of the Mountain Climber game. Check it out:

The main changes in this build are the additions of the climbing pick model and animations.

Implementing the climbing pick animations turned out to be more interesting than I'd expected. I decided to animate the swing via code rather than animating them by hand, mostly because I wanted to say I'd lerped quaternions. Once I got a simple state machine implemented for the climbing pick (with states like "swinging", "pinned", "withdrawing", etc.), most of my time was spent tweaking the hard-coded positions and rotations for each state and the timing for transitioning between them. 

In order for the player to actually see the animation, I needed to add a time delay between when the player clicks the mouse and when the pick becomes pinned to the wall (the "swing time"). I also added a delay between when the player releases the mouse and when the pick becomes ready to use again (the "withdraw time").

Because the pick swing was no longer instantaneous, a new case was introduced where the player could miss a swing if they'd clicked the mouse when the pick was within range of a surface and then quickly moved the mouse away before the animation finished.

To handle this, I added an "overswing" state with an animation of the pick swinging downwards. When the swinging animation finishes, I check to see if the pick has a valid surface in range. If it does, I attach the pick to the surface based on the geometry's normal and the angle from the player. If there is no valid surface in range, I switch to the overswing state. A nice bonus is that it covers the case where the player swings the pick in mid air with no extra effort on my part. 

The animation delays also prevent a degenerative tactic that I'd found in earlier builds where you could click rapidly to easily scale a vertical surface. See if you can get the exploit to work in the build I posted earlier. I want the player to be able to scale a sheer surface, but I want it to feel taxing and dangerous. Let me know in the comments how you think the climbing feels in the latest build.

My next task is to overhaul the terrain generation. I might be saying goodbye to the cubic voxels...

No comments:

Post a Comment