Author Topic: [Resolved] Pathfinder  (Read 5515 times)

ushas

  • Hero Member
  • *****
  • Posts: 661
[Resolved] Pathfinder
« on: July 13, 2017, 11:44:25 PM »
(v17, linux, DowntownPark2)

Issues with pathfinding.

See attached picture. The path is drawn with one more tile to step on than the shortest path needed. The arrows indicate the proper path. The game says "Insufficient AP" and doesn't let me go to the farthest tile. I tried then to undergo the shortest path manually and was able to reach the spot. So highlighted tiles display radius correctly.
« Last Edit: July 25, 2017, 02:42:42 PM by Daithi »

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Pathfinder
« Reply #1 on: July 14, 2017, 12:02:48 AM »
Practically the same situation with Elena, DowntownGraveyard1 map, see attached picture.
Seems like there is a problem to go diagonally between units.

Edit: Forgot to mention, this is also an issue for shorter paths, so added another image to showcase situation where it will offer you the path withing the blue radius - costing one more AP than needed. Again I've tried to go step-by-step to check.

For the record, it doesn't have problem to draw the path diagonally between units when I click just one tile left.
« Last Edit: July 14, 2017, 01:26:34 AM by ushas »

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: Pathfinder
« Reply #2 on: July 14, 2017, 09:33:17 AM »
Yay, pathfinding bugs. :/

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: [Fix Req] Pathfinder
« Reply #3 on: July 16, 2017, 11:55:10 PM »
Is it... difficult to fix?

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: [Fix Req] Pathfinder
« Reply #4 on: July 17, 2017, 08:05:07 AM »
I think the problem might relate to code I used to smooth the path. The pathfinding system is fairly complex... lot of potential for bugs and harder to work with because haven't touched it in months... will see what can be done with it.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: [Fix Req] Pathfinder
« Reply #5 on: July 19, 2017, 05:16:25 PM »
Ok. I suppose it's not critical right now, but will try to stress the pathing anyway, in case there are any other issues. So you can then deal with them all at once.

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: [Fix Req] Pathfinder
« Reply #6 on: July 19, 2017, 05:50:15 PM »
Yeah, it's not a good thing to tamper with just before releasing a version. Think am relatively close with V18 now. Will look at it first thing in V19. If it is the path smoothing code, and from looking at how the path is formed, there's a good chance it is, it could be disabled and checked. The problem with no smoothing is that with equal move point cost for orth/diag, paths tend to go all over the place and don't favour straight lines.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: [Fix Req] Pathfinder
« Reply #7 on: July 19, 2017, 07:41:20 PM »
Ooh so I need to hurry up with reporting for v19. Good luck with the build!
Hm, noted some strange routes, but as it usually doesn't change the number of tiles needed haven't deemed important.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: [Fix Req] Pathfinder
« Reply #8 on: July 19, 2017, 09:27:34 PM »
Pathfinder issue #2: SuburbsGraveyard1 gates
Not sure where lies the issue (pathing or the map). So far have seen this only on the map SuburbsGraveyard1 and around the gate entry: no diagonal movement allowed (see attached image). The pillars are a full-cover. The area had a gate initially, removed by a skill check - perhaps originates from that?


Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: [Fix Req] Pathfinder
« Reply #9 on: July 20, 2017, 08:56:45 AM »
Should be enough info here to locate the bug  :) Yeah, it doesn't seem to happen very often, but it would be nice to get it to work correctly in all cases. Incidentally, I've also seen this happening on a fairly well know TBS.

On the graveyard issue, it could be caused by removing the gate. Will investigate the main issue and see if fixing that solves the problem.

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: [Fix Req] Pathfinder
« Reply #10 on: July 25, 2017, 02:42:18 PM »
I've modified pathfinding code and tested a number of the scenarios you found. All are finding the shortest path now, will test more close to V19 release. Paths seem a little less jagged now. I'd agree on strange routes, probably not a good use of time, if there's no functional difference. Also fixed issue with gates - it was as you suspected. Code was restoring orthagonal connections between tiles and not the diagonal ones. You don't miss much!