triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.32k stars 392 forks source link

Improve Sub Pathfinding to Consider Destroyers #6114

Open limo49 opened 4 years ago

limo49 commented 4 years ago

Engine Version: 1.9.0.0.13066 Map Name: World War II Global 1940 2nd Edition Map Version: 4.0

TripleA says "Not all units have enough movement"

The sub should ignore the UK cruiser in 94 and attack the UK transport in 91.

test.zip

panther2 commented 4 years ago

Addition: In order to make this move work correctly, you need to perform it as follows:

limo49 commented 4 years ago

Ok it works Thanks

Maybe it should work even moving one step at a time...

panther2 commented 4 years ago

Maybe it should work even moving one step at a time...

Actually it would work that way, but in this special case TripleA for any reason chooses to move through SZ 93 (instead of 94) which is not possible as there is a French destroyer blocking the move.

That's an issue of "strange movement/wayfinding".

beelee1 commented 4 years ago

@limo49 @panther2 so all good here ? probably can be closed ?

panther2 commented 4 years ago

@beelee1

I think I provided a workaround for situations like this. In general the reported issue is valid. So is the wayfinding problematic, too.

limo49 commented 4 years ago

So is the wayfinding problematic, too.

Please note that I'm not trying to move the sub directly from 95 to 91 (I see the proposed path blocked by the French destroyer). I'm moving it one sea zone at time from 95 to 94, then to 92 and finally 91.

So the first case has a wayfinding problem, while the second blocks the movement.

Cernelius commented 4 years ago

Maybe it should work even moving one step at a time...

Actually it would work that way, but in this special case TripleA for any reason chooses to move through SZ 93 (instead of 94) which is not possible as there is a French destroyer blocking the move.

That's an issue of "strange movement/wayfinding".

@panther2 Did you test the savegame he/she provided? To me it doesn't work one step at a time: the sub is blocked right at the first step (in sea zone 94 sea zone).

panther2 commented 4 years ago

@Cernelius Yes, I did. That's what I said. Acutally we have two issues here: One is the block, we all experience, and the second is that - when trying to do it in a single step - TripleA for any reasons chooses a path through SZ 93 instead of SZ94. Only when choosing the waypoint through SZ94 manually (as stated here: https://github.com/triplea-game/triplea/issues/6114#issuecomment-606094540) it works as it should.

@limo49 Yes, that is why I addressed both issues: block and wayfinding.

Cernelius commented 4 years ago

I guess the block is a problem and smarter wayfinding is a feature request, though one could argue that if you can go directly from A to D through B and C, you should really do so, instead of needlessly splitting the movement into two or three actions (also keeps history cleaner), shouldn't you?

If you are playing on board, an someone moves from A to B, then takes his hand off, then moves the same unit from B to C, then takes his hand off, then moves the same unit from C to D, wouldn't you ask him why the hell didn't he simply move directly from A to D (and just telling the path, if relevant for retreat)?

panther2 commented 4 years ago

Not going to argue too much abiut bug or feature request, but in the given case, I would consider the path through SZ 93 as being incorrect, while the path through SZ 94 is the only correct one.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. If there is something that can be done to resolve this issue, please add a comment indicating what that would be and this issue will be re-opened. If there are multiple items that can be completed independently, we encourage you to use the "reference in new issue" option next to any outstanding comment so that we may divide and conquer.