TL;DR

No changelog yesterday because I had a weekend off for a game launch. Overhauled all the movement code.

This week…

  • Overhauled the movement system (in engine)
  • Overhauled character controller to support “freerunning”
  • Added the start of a sticky cover system

Under The Hood

Character Control Systems

The control of characters is split across two separate systems:

  1. In-Engine support for characters basic physical movement (finding support for foot placement, navigating up and down vertical steps, managing the size and shape of the character as pose changes etc)
  2. Mods can use this system to build a variety of character controllers which respond to player input

I have implemented some fairly generic base character controllers in a project which can be used by other mods to implement specific character movement systems. To be honest I’m a little unhappy with this situation - I would prefer the in-engine character controller stuff to be moved out into a plugin so that modders can write entirely new movement modes but the whole character controller is very deeply integrated into the physics engine and it’s not practical to pull it apart right now.

Freerunning

Once I had overhauled in the in-engine controller this was actually quite simple to implement - when the character is in freerun mode the vertical step height (i.e. the height which a character can step up when they encounter a vertical obstacle) is increased to roughly the height of the character. All I need to do to finish this off (which I won’t do for a while due to lack of a suitable animation) is couple it with a climbing animation which triggers when a very large vertical step is encountered.

Sticky Cover

The sticky cover system was slightly harder to implement. When the player presses [Find Cover Key] a ray is projected out from the camera to find what they are looking at, several more rays are then projected out to find out if there is a suitable flat surface to stand on below the point and that the ceiling is high enough above to point. If the position is found to be a suitable cover position then the AI pathfinding system will take over and move the character into the cover just as if it were an NPC. Of course, the part that’s missing from all of this is the pathfinding and NPC bit - I have no support for NPCs yet and so the cover system will remain half implemented until then!