mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
well, I converted Biomes to have a class instead of a series of arrays. Limited testing has been done but it works
This commit is contained in:
parent
7a06e0bdd4
commit
d9df7c2f15
10 changed files with 144 additions and 96 deletions
|
|
@ -173,7 +173,7 @@
|
|||
for (const c of cells.c[n]) {
|
||||
if (cells.h[c] < 20) continue; // ignore water cells
|
||||
const stateChangeCost = cells.state && cells.state[c] !== cells.state[n] ? 400 : 0; // trails tend to lay within the same state
|
||||
const habitedCost = Math.max(100 - biomesData.habitability[cells.biome[c]], 0); // routes tend to lay within populated areas
|
||||
const habitedCost = Math.max(100 - biomesData.biomeList[cells.biome[c]].habitability, 0); // routes tend to lay within populated areas
|
||||
const heightChangeCost = Math.abs(cells.h[c] - cells.h[n]) * 10; // routes tend to avoid elevation changes
|
||||
const cellCoast = 10 + stateChangeCost + habitedCost + heightChangeCost;
|
||||
const totalCost = p + (cells.road[c] || cells.burg[c] ? cellCoast / 3 : cellCoast);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue