Author Topic: [Resolved] Reachable Tile Display  (Read 11233 times)

ushas

  • Hero Member
  • *****
  • Posts: 661
[Resolved] Reachable Tile Display
« on: July 25, 2017, 10:12:18 PM »
Thanks for info. Perhaps it will be ok after all.

The paths of Vigilantes -  as good as or better than in a fairly well know TBS.

Edit: Having one additional thing on mind:

Pathing around the fire (v17, v18)
Probably won't classify as a bug but it a kind of clashes when using reachable tile highlight feature, as that is governed by different rules than pathfinding. Attached image showcase how the blue area takes into account the shortest path through the fire, but the auto-path is drawn around. That means more AP spent and Ray will not have enough for attacking despite what the highlight says. -> Do changes you mentioned influence going around fire too?

I think it's a problem because players are perhaps more probable to orient by the highlight feature (the most effective + in the field of vision) in comparison to checking the AP points below or counting tiles.

From the player's perspective as well as thinking about the complexity - I would prefer if the auto-pathing always simply offers the shortest route and the decision to step into fire or on any other problematic tile is left at our consideration.
« Last Edit: August 24, 2017, 01:29:59 PM by Daithi »

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Re: [Resolved] Pathfinder
« Reply #1 on: August 10, 2017, 12:34:48 AM »
Now realized, perhaps I posted the fire problem after the bug was already closed, in that case I apologize - perhaps move it into a new one? Or was it before and being in resolved means that you had, indeed, resolved the pathing vs. highlight issue too?

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: Re: [Resolved] Pathfinder
« Reply #2 on: August 10, 2017, 12:30:21 PM »
Whoops, must have missed this one. This is working as intended - assuming most people would want to avoid fire, and can manually move through it if they want to.

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Re: [Resolved] Pathfinder
« Reply #3 on: August 11, 2017, 01:35:58 AM »
I think expressed myself poorly. Let me rephrase:
This is the same problem as in the OP, that's why was lazy to create a new thread (sorry). Only this time, if a choice to go around is intended then the bug isn't in the pathfinding itself, but in the reachable tile highlight. Assuming, you're not trying to say that lying to players is working as intended? :o

Situation above could cost Ray his life. When giving us a tile highlight, can't expect we won't orient by that. Moreover, we're lazy. Meaning, hand-holding makes it even worse, because once we get used to be safely lead around, we will less think for ourselves, thus less likely to re-check the AP.

In the attachment: Elena is being told "Insufficient AP" that she cannot reach the tile, clearly highlighted as reachable. The second one says she should have enough AP to shoot from the corner, but she won't if you click on that tile.

[opinion] On hand-holding: Fire isn't the only danger around... Assuming what is better, what people want... Well, that usually means when things are out of the assumed box, the game makes it harder or even impossible. In this instance also lessens a sense of danger. I do go around in most cases, but want to have a proper information when doing so. Non-confusing presentation >>> hand-holding. Needs to be clear, otherwise you've just exchanged two dangers of not paying attention: accidentally going through fire vs. screwing us by misinformation in other ways. [/opinion]

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: Re: [Resolved] Pathfinder
« Reply #4 on: August 11, 2017, 08:44:12 AM »
Ah, I get you. I agree it's not optimal, not sure if I can easily do something with it. Will have a look, but here's the why:

Different algorithms are used for pathfinding and displaying reachable tiles. The pathfinding algorithm is a pretty efficient implementation of A* - even so it has to do quite a lot of work to get a path. If you click on a tile, it gets 1 path. If you think about what's happening with the display - it could require the finding of 80+ paths. So instead, I used a less work intensive method of getting the data. Likely the best I can do is to mark fire tiles as not walkable and ignore them - what do you think?

ushas

  • Hero Member
  • *****
  • Posts: 661
Re: Re: [Resolved] Pathfinder
« Reply #5 on: August 14, 2017, 02:03:01 AM »
Ehh... I'd a kind of... rather make you you think that it's not worth the effort... (to go back to nice simple shortest path).

Ok, ok. That would be unprofessional...

Likely the best I can do is to mark fire tiles as not walkable and ignore them - what do you think?
I think it sounds as a good solution. Because, if I understand what it entails, it means that tiles under fire won't be highlighted in any way, thus it also clearly communicates to players that those tiles aren't considered for the pathing at all.

However, it needs to stay in tune with the path. So then if clicked on tile on fire -> mark tiles on fire as walkable? Though, not bullet-proof.

Or, alternatively, what about a shortcut to be hold, or even better, a shortcut (+button) to switch them both between two states: (1) walking around hazards (default) and (2) the simple shortest path -> letting us choose regardless a tile clicked? Uff, asking for more work. But perhaps less stress on the mouse-tracking input system, as tiles on fire are either simply ignored in case of (1), or not in case of (2)).


Different algorithms are used for pathfinding and displaying reachable tiles. The pathfinding algorithm is a pretty efficient implementation of A* - even so it has to do quite a lot of work to get a path. If you click on a tile, it gets 1 path. If you think about what's happening with the display - it could require the finding of 80+ paths. So instead, I used a less work intensive method of getting the data.
That's interesting. Vaguely thought display is more demanding, but hadn't actually considered how many combinations you need.

Probably not useful in any way: From the openxcom code I recall, they first try to calculate path using fast Bresenham algorithm and if can't find any, only then A* is used. Obviously, it only helps to optimize if Bresenham doesn't fail often. X-COM maps also have more open space compare to yours.

Noticed that the game often shows path, even when we aren't allowed to go due to insufficient AP. I understand it may be useful for future turns. Just musing how it could differ when pathing would be calculated and displayed only using tiles within AP radius.
« Last Edit: August 14, 2017, 02:17:42 AM by ushas »

Daithi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1250
Re: Reachable Tile Display
« Reply #6 on: August 24, 2017, 01:13:21 PM »
Fire tiles no longer showing in reachable tiles nor are routes through them considered.