WarFrontIO / client

Real-time strategy game played in the browser
https://dev.warfront.io
MIT License
22 stars 6 forks source link

Avoid hugging territory in boat pathfinding #17

Open platz1de opened 2 months ago

platz1de commented 2 months ago

Summary

Boats should prefer routes a few pixels away from territories where applicable

Justification

Boats are (and will always be) larger than one pixel, so rendering them directly next too a landmass can look confusing. We want to avoid auch clipping where possible

Proposed Solution

The data needed to give paths along territory is already fully calculated ("distance" in territory manager), so it is enough to increase expansion cost in the pathfinding algorithms accordingly. This increase should be minor (e.g. from 1 10+ tiles from territory, to ~2 max).

We currently achieve a similar effect by giving "free-water" areas lower costs. This bonus could be removed if it provides better results

platz1de commented 1 month ago

Might also benefit from dragging border points into "deeper" water like discussed in #14