Silentor / InfluenceTerrainDemo

Some experiments with zone-based terrain generation
4 stars 2 forks source link

Implement pathfinding #99

Open Silentor opened 5 years ago

Silentor commented 5 years ago

Some A* realization with combined blocks

Silentor commented 5 years ago

Ok, I've implemented simple A-star on entire map. But it quite expensive on grid. 1) Implement hierarchical path-finding: A-star on macro map cells for general path, then refine path between cells for exact way-points. 2) More path-finding visualization 3) Improve path cost calculation, take into account block inclination and material, and block-to-block inclination too! 4) Consider create NavGrid data structure to storage block movement properties and block-to-block inclination (to bypass costly calculations). Типа почти плоский, наклон к нам, наклон от нас, ступенька низкая, ступенька высокая, ...

Silentor commented 5 years ago

Highlevel pathfinding on macro level is unconvient using bare Macro.Cell. Macrocells do not store enough information to calculate movement cost for them. There are 2 ways: 1) Zone generators should provide more information on their cells, like "mountain", "plain", "swamp", "sand desert", maybe road info. 2) I need navigation map to store movement statistic for cells based on actual block analysis, like "mostly of flat grass blocks, good for walk", "mostly of rough stone block, bad for walk". Also it can cache some good paths to neighbor cells (after first Actor needs to calculate them or at the start) The idea of navmap is good, so lets switch to task #96

Silentor commented 5 years ago

Пока не удаётся выработать хорошую метрику для сильно изломанных ячеек, чтобы поиск пути реалистично избегал такие зоны.