Wolcen: Lords of Mayhem Update #58

In the latest Kickstarter update for Wolcen: Lords of Mayhem, the developers get technical and talk at length about the targeting and input buffering subsystems they have in the game. If you like getting into the nuts and bolts of things, check out this excerpt and go from there:

Lucas here, back at the devblog writing desk ! Today, we are going to get technical with one of my latest task: improving player controls and targeting system.

Controls have been an issue of Wolcen for quite some time now with players experiencing difficulties to target enemies, complaining about the clunkiness and having the feeling the controls weren’t responsive enough. These issues are imputable to two subsystems of the controls of our game:
  • The targeting system which is responsible for detecting what is under your mouse cursor
  • The player input system which is responsible for handling all the logic when you press a key on your mouse or keyboard
Let’s talk about targeting. We started improving this a few months back with 0.4.0. First, let’s lay some basics. In order to know what is under a player mouse cursor, we use raycasts. Raycasts are special rays that go from point A to point B in straight line and give the programmer back information about every object it hit on its way from A to B. Using this, we can raycast from the mouse cursor position to the ground in order to get what you are aiming at, simple right ? … well, not so much. This indeed works when the target is under your mouse cursor. However, given that enemies are moving and are animated, this solution alone makes enemies hard to target because you must have some part of your target body exactly under your mouse cursor where we perform the raycast for the target not to be lost. Our solution to this issue has been to create a special invisible capsule, much bigger than the enemy, that can be picked up when doing a raycast. This way, you are considered to be targeting an enemy if your mouse is around the enemy, no longer only when your mouse is exactly on top of the enemy.