New Movement System

April 19, 2018

The reason why there is a 'new' movement system is that what the system saw doing and the GUI feedback didn't match up, and I opted to change the way the movement worked instead of the way it is displayed (Mostly to keep the GUI simple). Also it didn't work when the player didn't point at the ground, adding to the confusion. During playtests it seemed that players "kind of but not really" understood what they were doing.

The way the old system worked was that the active character would walk to the point you indicated using the NavMeshAgent. However is was difficult to get the GUI to work, as it would need to indicate the path the character would take. Instead the new system works more like a joystick, or rather, an elastic band: By dragging their finger across the screen the player now pulls the character in that direction.

In the back-end it is still the same NavMeshAgent, but instead of going to the touched position it gets the point on the screen that the player touches and calculates the angle relative to the payer's position on the screen. Then is applies that able from the player's position outwards, where behind the player, relative to the camera, is 0°. This approximates the angle well enough that the player can control the characters movement direction.

The projected direction then checks for collision and if nothing is between the player and 2 units is places the destination at 2 meters away. If not, it places the destination at the closest collision. Doing the collision check was required, compared to a set constant, because of two reasons:

  • Hungry's movement speed was too fast for 1 unit and she would reach the destination and stop, messing up the animation and making it look all wonky.

  • The cabin's interior was too cramped for 2 units, making most of the direction invalid paths and not moving the characters at all.

By dynamically changing this distance variable I am able to solve both issues.

 

The next issue, though, is for it to work the character needs to be on screen, and that isn't always the case. I solve this by first checking if the character is on screen; If so, use the new Circle system. If not, use the old system.

 

 

 

Share on Facebook
Share on Twitter
Please reload

Uitgelichte berichten

I'm busy working on my blog posts. Watch this space!

Please reload

Recente berichten

October 26, 2018

October 25, 2018

October 23, 2018

May 30, 2018

Please reload

Archief
Please reload

Zoeken op tags

I'm busy working on my blog posts. Watch this space!

Please reload

Volg ons
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square