Basic wasd movement

Bugs that are actually features.
Fracture9
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jun 01, 2022 12:24 am
Contact:

Basic wasd movement

Post 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
Rseding91
Factorio Staff
Factorio Staff
Posts: 14360
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Basic wasd movement

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Fracture9
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jun 01, 2022 12:24 am
Contact:

Re: Basic wasd movement

Post 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
Post Reply

Return to “Not a bug”