Page 1 of 1
Basic wasd movement
Posted: Wed Jun 01, 2022 12:29 am
by Fracture9
I first would like to say I have 200+ hours in this game and I love it to death, but after all the time spent I have noticed a bug while playing that is a mild irritant. It has to do with basic wasd player movement. When holding down A (walking left) and I decide to go right, (while holding down A) I press D (walking right) and my player turns and walks right (This is good). BUT if i reverse this and i hold down D and i decide to turn and walk left by pressing A WHILE i hold down D, the character decides to keep going right. This issue is also true with W and S, while walking up and i decide to go down (S) while holding W, the character does not move down. on the other hand the reverse works properly like it should by moving up (W) even though i hold down S. this is a everyday occurrence
Re: Basic wasd movement
Posted: Wed Jun 01, 2022 2:58 am
by Rseding91
Thanks for the report however this isn't a bug. This is simply an unintended side effect of how the 'current direction' is calculated.
It works like this:
Code: Select all
if (moveRightActive && moveUpActive)
return Direction::NorthEast;
if (moveRightActive && moveDownActive)
return Direction::SouthEast;
if (moveLeftActive && moveDownActive)
return Direction::SouthWest;
if (moveLeftActive && moveUpActive)
return Direction::NorthWest;
if (moveUpActive)
return Direction::North;
if (moveRightActive)
return Direction::East;
if (moveDownActive)
return Direction::South;
if (moveLeftActive)
return Direction::West;
...
Simply due to 'move up' being the first check for the 4 cardinal directions when pressing up and down you move up. Due to 'move right' being before 'move left' pressing both makes you move right. We have no intention of changing the behavior; just let go of the key if you don't want to walk that way.
Re: Basic wasd movement
Posted: Wed Jun 01, 2022 11:00 pm
by Fracture9
Thank you for your help and taking your time explaining it to me I do appreciate that, I understand the process now so be it.
Thank you,
Fracture9