Sunday, December 20, 2015

The Perfect Cast

(New build is up here!)

Hi! I didn't have much time to code this week, but I did have enough time to unravel one of the last mysteries to smoothing out how this game plays.

See, having solved (for the most part) the issue of getting caught in the middle of long warp-wall loops, I thought I'd move on to the next most annoying thing that happens when you play: not warping when charging at a warp wall.

See, the secret to this issue is what happens when you hit a warp wall. In old builds, a ray is cast backwards from the player in the opposite direction of movement. I liked this because it felt exact and predictable. If you're just hairs away from hitting the opposite warp wall with your raycast though, it can look like you ought to have warped:


But, as you see, that raycast is nowhere near the warp wall we want to warp to. This results in frustrating moments where you feel like you ought to have warped but you don't.

The solution is to use a different method of warping. I've thought of two options, both of which work to varying degrees:

  • Use a spherecast. Spherecasts work like "fat" raycasts, so they can be configured to be more or less forgiving as I deem fit.
  • Still cast a ray, but use the orientation of the warp wall for the direction of our ray. In other words, always cast a ray which is perpendicular to the face we hit. This results in a lot of horizontal movement at times, but in exchange you will literally never hit a warp wall and not warp to another warp wall (assuming there is a second warp wall directly across from the first...)
This build uses the second method. See how you like it.

Charging-up noise is a sound by Javier Zumer, modified by me. Used under this license.

No comments:

Post a Comment