Make "Center on opponent's moves" really center on its move

Currently (3.3.2) the “Center on opponent’s move” feature does not really center on the moved unit. Rather it makes sure the hex where the unit is moved to is visible in the player’s screen. In the situation where the move occurred outside of the area the player was seeing before the opponent move, this results in observing the opponent’s move on one of the edges of the new visible area of the map.

This feature will be more effective if the opponents move is placed at the center.

Technically this should be feasible and might have been overlooked when this feature was initially developed.

There is already some code to recenter the map on a right click (see VASSAL.build.module.map.MapCenterer)

I certainly like that idea. Claudio you could make your first PR!

There’s the question of whether “the old behavior” should remain as a preference. Personally I think no, but I don’t know if there’s some use case that more closely depends on the current implementation.

And I suppose there could be some heuristic like “if already within the center 1/9 of the screen, don’t recenter”. Just something to think about.

Brian

Sounds good, I know this problem, sometimes I replay the log and it “centers” on the moved piece but I have to scroll the map some more to see where the piece originally came from so I can evaluate whether the move was legit.

I believe this works the way it does because if the piece is already on-screen, it can be jarring for the map to jump just to center it. I’m not saying it’s not worth trying, but this is something where you might find after using it a bit that you actually prefer the old way.

I think just some slightly better heuristics are in order. In games like e.g. Civ2 we didn’t force-center if your piece was already mostly on screen, but if we DID recenter we fully centered on the piece, rather than moving only enough to get it “just barely on screen” (and then you don’t necessarily have the context around it).