mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: roads generation - reduce curves on routes rendering
This commit is contained in:
parent
fc3e3b844d
commit
e427050369
5 changed files with 68 additions and 37 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import {TIME} from "config/logging";
|
||||
import {INFO, TIME} from "config/logging";
|
||||
import {getInputNumber} from "utils/nodeUtils";
|
||||
import {MAX_HEIGHT, MIN_LAND_HEIGHT} from "config/generation";
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ export function addLakesInDeepDepressions(heights: Uint8Array, neighbours: numbe
|
|||
|
||||
if (inDeepDepression) {
|
||||
currentHeights[cellId] = MIN_LAND_HEIGHT - 1;
|
||||
console.log(`ⓘ Added lake at deep depression. Cell: ${cellId}`);
|
||||
INFO && console.info(`ⓘ Added lake at deep depression. Cell: ${cellId}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import FlatQueue from "flatqueue";
|
|||
import {TIME} from "config/logging";
|
||||
import {ELEVATION, MIN_LAND_HEIGHT, ROUTES} from "config/generation";
|
||||
import {dist2} from "utils/functionUtils";
|
||||
import {drawLine} from "utils/debugUtils";
|
||||
|
||||
export function generateRoutes(
|
||||
burgs: TBurgs,
|
||||
|
|
@ -37,8 +36,6 @@ export function generateRoutes(
|
|||
const points: TPoints = featureCapitals.map(burg => [burg.x, burg.y]);
|
||||
const urquhartEdges = calculateUrquhartEdges(points);
|
||||
urquhartEdges.forEach(([fromId, toId]) => {
|
||||
drawLine(points[fromId], points[toId], {stroke: "red", strokeWidth: 0.01});
|
||||
|
||||
const start = featureCapitals[fromId].cell;
|
||||
const exit = featureCapitals[toId].cell;
|
||||
|
||||
|
|
@ -70,8 +67,6 @@ export function generateRoutes(
|
|||
const points: TPoints = featureBurgs.map(burg => [burg.x, burg.y]);
|
||||
const urquhartEdges = calculateUrquhartEdges(points);
|
||||
urquhartEdges.forEach(([fromId, toId]) => {
|
||||
drawLine(points[fromId], points[toId], {strokeWidth: 0.01});
|
||||
|
||||
const start = featureBurgs[fromId].cell;
|
||||
const exit = featureBurgs[toId].cell;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue