Smarter 'w'-moving
issueid=618 11-15-2011 12:55 AM
Junior Member
Number of reported issues by aquavires: 17
Smarter 'w'-moving

Code:
#####
....#
###.###
  #....
  #####
Since time is of the essence (due to chaos corruption and all), I'd be inclined to travel that bend diagonally to save 2 turns (unless there's an item in a corner; then I might take a detour to pick it up).

Currently, 'w'-walking that tunnel would make my PC step on every square. Would it be viable to make 'w'-walks handle corners more intelligently?
Issue Details
Issue Number 618
Issue Type Feature
Project ADOM II (formerly known as JADE)
Category Gameplay
Status Suggested
Priority 7
Suggested Version ADOM II 0.2.3
Implemented Version (none)
Votes for this feature 1
Votes against this feature 0
Assigned Users (none)
Tags (none)




11-16-2011 02:35 AM
Member
I'm for it, but what little programming knowledge I have tells me that making pathfinding 'more intelligent' is a hassle, if it's possible at all.

11-16-2011 06:32 AM
Senior Member
While pathfinding can be a major hassle, in this case it's fairly trivial. All it really requires is for the pathfinding algorithm to look two moves ahead, and if it is going to move to a space that it can reach in one move, then it should move there, instead. This should both address normal corners in corridors, but if there's an item in that corner, it should actually move to the item itself, since the pathfinding algorithm would have stopped there, anyway.

And since it's going to have to do the extra step, anyway, it is really just performing the check one step earlier.

11-16-2011 08:26 PM
Member
It sounds like you know more about this stuff than I do, so I'll take your word for it.

11-18-2011 03:39 AM
Junior Member
Pressing '>' or '<' takes the PC on the shortest possible path towards the stairs, so it looks like a useable framework exists in JADE already

11-18-2011 05:29 PM
Junior Member
A side-note on the pathfinding, for those interested, it seems that diagonal movement is prioritized effectively the same as straight movement. I've seen my character w-move in non-straight lines through intersections, for no reason apparent to me.

As low a priority as something like that would be, I'd be interested to see this worked on just a little.

11-19-2011 12:42 PM
Qui Qui is offline
Senior Member
A side-note on the pathfinding, for those interested, it seems that diagonal movement is prioritized effectively the same as straight movement. I've seen my character w-move in non-straight lines through intersections, for no reason apparent to me.
Actually, going diagonally is more "optimal", as you can "see" more ground while spending the same number of turns. w-move seems to take advantage of this and I think this is how it should be.

+ Reply