Wednesday, 29 October 2014

Edge Detection

A small* part of our game is the ability for the player to interact with edges. Whether it be a small hop down, a big hop down or a no go. I have been working on this mechanic now that the basic movement is done. I have got it to a working stage now. There are various settings including the minimum drop distance, the distance ahead of you to check for an edge and a distance at when to interact with the edge. This gives us a lot of freedom to tweak the edge detection to our needs.

The edge detection settings along with some debugging variables.


This is a funky looking visualisation of what is going on within my edge detection. The white line infront of the edge is the initial raycast to check for an edge, then a capsule cast (red and green spheres) gets fired back inwards, the point at which its hits the object is then stored and based on this position, a sphere case (yellow) gets fired downwards to grab the top of the surface you are on. The white spheres are to check for objects blocking the edge, in which case, you would not want edge detection to happen.

Another feature of edge detection is override zones. These are trigger boxes that will override the default settings aswel as choosing a specific edge detection to happen within those areas. This give a lot more control over the edge detection, enabling us to have complete control over it.

* 1000 lines of code.

xoxox

0 comments:

Post a Comment