Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal pathfinding for PC #1830

Open
kr4ft3r opened this issue Oct 10, 2022 · 1 comment
Open

Minimal pathfinding for PC #1830

kr4ft3r opened this issue Oct 10, 2022 · 1 comment

Comments

@kr4ft3r
Copy link
Contributor

kr4ft3r commented Oct 10, 2022

It seems in some aspects the game is better optimized for gamepad/keyboard, or at least it doesn't use mouse most effectively. Sadly I never got to play Nox so I don't know how things work in there, but my Diablo instincts are rebelling.

Personally, I am not all that bugged by the hold-mb-to-move mechanics (though in the future an option to walk anywhere with a click would be nice). What causes the most discomfort for a mouse user is picking up loot (not gold, it was a great decision to make gold auto-get). My instincts always expect to be able to just click on the item and then the pathfinding kicks in that ends with picking up. Instead, I have to hold movement mb, just to move what is usually a small distance towards the loot, and then aim at the item again (as with the PC moving, the item also changes position relative to the screen center) just to pick it up.

So picking things up takes more focus than what I'm used to, as I have to aim the cursor twice. Things are made worse by these being two different kinds of mouse actions, one approximate holding, and the other a precise click. So I'd vote for one-click PC pathfinding that kicks in for picking up items only.

But of course to make this possible the pathfinding movement type for PC would have to be implemented entirely, which means the one-click movement option could be added as well. This would be a plus, as frankly having to hold the left mouse button 90% of the time gets tiresome for the index finger after a while (neither the index finger nor the mouse button are well suited for this).

In case this change gets a green light, I guess the key places to look at would be Avatar and MapCollision's pathfinding. The option should work for mouse movement only. Some checks that expect the pressing_move() (or inpt->pressing[mm_key]) is the only way for the PC to move would have to be altered. Also, the auto-walk would have to be interrupted by just about anything that happens with the PC.

@dorkster
Copy link
Collaborator

We actually did kind of have pathfinding for mouse movement at one point, but it was removed for being too awkward to use. The implementation was missing several behaviors that make Diablo's work as well as it does. If we re-introduce this, I think we should stick to Diablo's (specifically D2) as a reference. I think it's what players expect, and it's usually what gets pointed to when this gets brought up.

Key notes about D2's mouse move behavior:

  • Don't need to hold the mouse button for the player to continue moving
  • If the initial target is not an object that can be interacted with, holding the mouse button will continually update the pathfinding target
    • In this state, the player is locked to moving and can't interact with anything until the button is released
  • If the initial target is an object that can be interacted with, holding the mouse button does nothing
    • In this state, the player is locked to moving towards the initial target and can't change trajectory until the button is released
    • The player will move until they are within range to perform the requested action. E.g. melee attacks and picking up loot require the player to move in close, but ranged attacks can be performed with little to no movement

@dorkster dorkster added this to the 1.15 milestone Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants