Tue 19 Feb 2013 09:57:34 AM UTC, comment #13:
> Will the committed fix need adjusting once cardinal-move-only
> roads/rivers exist?
I don't think so. The last part of the path is considered as a single move only if the move was previously possible.
|
Tue 19 Feb 2013 09:47:26 AM UTC, comment #12:
> Where this needs more consideration is the experimental ruleset.
> If the defender is on a tile that the attacker could not enter
> except via road, then totally negating the road will make the
> defender unreachable.
I don't think this applies to the current experimental ruleset; if attacker is Big Land (e.g. Cannon) and defender is e.g. on a hill, either there's no road on the hill (in which case attack is impossible) or there is one (in which case attack direction doesn't matter; pathfinding will necessarily arrange that the source tile has a road).
I don't think it's possible to set things up so that the attacker can only attack the defender from a certain direction.
However, we'd certainly like that to become possible (see for instance bug #16383). Will the committed fix need adjusting once cardinal-move-only roads/rivers exist?
|
Tue 19 Feb 2013 08:53:21 AM UTC, SVN revision 22380:
Path-finding: Consider the last move of the path as a constant single move when
attacking and entering foreigner cities to establish trade route. We would get
straighter paths on these cases.
The old behaviour (often prefering move + action) is still possible using
goto waypoints.
Reported by Silas Brill
See gna bug #20361
(Browse SVN revision 22380) |
Tue 19 Feb 2013 08:53:17 AM UTC, SVN revision 22379:
Path-finding: Consider the last move of the path as a constant single move when
attacking and entering foreigner cities to establish trade route. We would get
straighter paths on these cases.
The old behaviour (often prefering move + action) is still possible using
goto waypoints.
Reported by Silas Brill
See gna bug #20361
(Browse SVN revision 22379) |
Tue 19 Feb 2013 08:53:16 AM UTC, SVN revision 22378:
Path-finding: Consider the last move of the path as a constant single move when
attacking and entering foreigner cities to establish trade route. We would get
straighter paths on these cases.
The old behaviour (often prefering move + action) is still possible using
goto waypoints.
Reported by Silas Brill
See gna bug #20361
(Browse SVN revision 22378) |
Sun 17 Feb 2013 10:34:04 AM UTC, comment #8:
Attaching better version: consider the last move of the path as a constant single move when attacking and entering foreigner cities to establish trade route for getting straighter paths.
In the savegame example, the old behaviour is still possible using waypoints.
(file #17236)
|
Fri 15 Feb 2013 02:06:45 PM UTC, comment #7:
Attaching simplified version...
(file #17203)
|
Sun 10 Feb 2013 04:20:06 PM UTC, comment #6:
This patch should solve your problem.
(file #17180)
|
Mon 14 Jan 2013 03:29:13 PM UTC, comment #5:
That's actually pretty good. Any reasonable defender will certainly attempt to negate the road using mines, caltrops, etc. In general, we want the attacker to remain in place after the assault. The added movement point cost from having to march beside the road will further limit fast units from "shooting and scooting".
Where this needs more consideration is the experimental ruleset. If the defender is on a tile that the attacker could not enter except via road, then totally negating the road will make the defender unreachable.
|
Sun 13 Jan 2013 11:52:55 PM UTC, comment #4:
That could be done by treating the final step (onto the enemy-occupied tile) as having the same movement cost regardless of direction - basically, ignore roads and rivers on enemy-occupied tiles.
|
Sun 13 Jan 2013 10:55:32 PM UTC, comment #3:
to bring more light into it - pathfinder does not check whether targeted square is occupied, it only checks best way to that square
from my long observation, best metod to avoid failed gotot+attack is use it to go best position near unit and attack using arrow keys
as for code, there are few solution that i can think, but none of them is good enogh to solve problem
i think easiest (and best) would be if pathfinder checked if tile is occupied and if yes then goto adjacent to unit (using best route), attack and dont move further
|
Wed 12 Dec 2012 04:14:14 AM UTC, comment #2:
I just found a workaround: Using the arrow keys doesn't trigger pathfinding, so it's good for controlled single steps.
Does the pathfinding take into account whether the move is an attack or not at all? It seems as though most similar situations would be covered by the ZOC rules. In this situation, the dragoon's two-step movement wouldn't be possible if the city were not there.
|
Mon 10 Dec 2012 03:37:34 PM UTC, comment #1:
I assume the relevant difference between the Musketeer and the Dragoon is that the Musketeer only has one movement point, so the Dragoon could afford to move before attacking. The problem is, that the pathfinder is optimized to use less movement points on the route and, as you surmised, will prefer the river. The question is why doesn't the pathfinder see not moving before the attack as the optimum use of movement points?
|
Mon 10 Dec 2012 09:49:56 AM UTC, original submission:
I have a dragoon in a city on a hill, and I want to use that dragoon to attack a cannon on a diagonally adjacent hill. However, the target hill has a river, which seems to be throwing off the pathfinding.
+---------------------+---------------------+
| Hill+River (Cannon) | Plains |
| Grassland+River | Hill+City (Dragoon) |
+---------------------+---------------------+
When I try to attack the cannon, the dragoon opts to move through the Grassland+River tile, which would surely by the right move if the other hill were not occupied. However, in this case such a move results in my dragoon stepping outside the safety of the city into a relatively hard-to-defend grassland tile, and throwing one of my cities into disorder for a turn because I'm running a democracy in the civ2 ruleset.
(I also have a musketeer in that city, which is able to attack without triggering this bug, but when I do that the cannon wins the fight. I'm not sure whether that's another bug or there's some rule I'm missing that would make that make sense.)
I've attached a savegame - the city in question is "Mixcoac".
|