Just wanted to lend some further explanation to the problematic pathfinding for units chasing routers. I've done quite a lot of router chasing tonight, and have noticed something: the problem always occurs when the unit being chased has become spread out for some reason. Often a few of its men failed to break away from combat right away, or got hung up on the city gate while fleeing, but whatever the reason, men being separate from the main clump of the unit is the cause of the trouble. Every time the unit being chased had good grouping, the chasers rode right through the middle of it and wiped them out.
Noting this behavior, I began holding the shift key down when I had a unit selected that was chasing routers. For those of you not familiar with this, it displays a red pin on the map that shows you exactly what point your unit is heading for. I noticed that units that were spread out typically had a pin nowhere near any of the men in the group: one man far away often made the pin appear in the space between him and the rest of the unit, which was always where my horsemen would ride to. From this I deduce that the game uses the "center" of the unit for all pathfinding in combat: basically, the average position of the men in the unit is considered to be the point the unit is at.
The problem, then, has nothing to do with pathfinding or unit cohesion of the chasing unit, but rather has to do with the cohesion of the fleeing unit. Because routers are allowed to flee in complete chaos with no formation at all, the center of the unit (as calculated by the game) goes wild, and often leads the chasers to a place where no actual men of the unit are. Needless to say, this looks completely dumb, and has been the subject of much stress to some Orgers.
What then can be done about it? The first (though likely least nice) solution is to simply enforce some sort of ordered formation on routers. This would be totally effective, however it would kinda lose the effect of routers running for their lives in, well, disorder. Perhaps semi-orderly formations could be used for routers, to preserve the feel while making sure not to leave those problematic stragglers behind.
Likely better is to change the formula for finding the center of a unit. The problem would likely drop off the radar if some substantial portion of outliers would be ignored when considering the center of the unit: that is, if we're ignoring 25% as outliers, the 1/4 of the unit that is the most average distance from other soldiers would no longer count toward finding the center. This would essentially treat the clumped men as a unit and ignore the few that are quite far away, meaning the chasers would hunt down the most significant portion of the group they're chasing, and do so totally effectively. There can still be trouble, though, if the rogue portion of the group is more than the chosen outlier percentage: they would again tug on the center.
Another possibility would be to set a threshold distance a man can be from the others to be considered. Using the median distance from a given man to every other, it should be simple to lop off any above a reasonable level, and thus arrive at a much tighter calculated unit center for pathfinding purposes. I recommended using the median because it neatly classifies a man as part of the bunch or one of the rogues, since his median distance from other men will be high if most are far from him, and low if most are nearby. So since the median will be much more polar than an average, it is IMO the best choice for dealing with this problem, and should result in very good unit center calculations that are not influenced at all by nonconformists.
As far as I can see, removing outliers by either method would not substantially affect anything in normal circumstances: units in good order should generally continue to have their center calculated very near where it was the old way, while either should show significant benefit in chasing routers. I of course don't know the particulars of the situation... but I do hope my comments on the matter are some use, provided the devs haven't already fixed it (a change could be in the new 1.2 build already for all I know).
Bookmarks