flareteam / flare-engine

Free/Libre Action Roleplaying Engine (engine only)
http://flarerpg.org/
GNU General Public License v3.0
1.1k stars 186 forks source link

Minimal pathfinding for PC #1830

Open kr4ft3r opened 1 year ago

kr4ft3r commented 1 year ago

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 commented 1 year ago

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: