basic road generation added

This commit is contained in:
Grimsace
2026-02-04 14:19:18 -06:00
parent 05887fde26
commit b9173dd1f3
3 changed files with 478 additions and 46 deletions
+46 -34
View File
@@ -8,23 +8,29 @@ import (
)
type Settings struct {
Detail float64 `json:"detail"`
Roughness float64 `json:"roughness"`
Width int `json:"width"`
Height int `json:"height"`
Lakes int `json:"lakes"`
LakeSizeLower float64 `json:"lake_size_lower"`
LakeSizeUpper float64 `json:"lake_size_upper"`
MinTreeSize float64 `json:"min_tree_size"`
MaxTreeSize float64 `json:"max_tree_size"`
TreeCoverage float64 `json:"tree_coverage"`
TreeClumpiness float64 `json:"tree_clumpiness"`
Seed int64 `json:"seed"`
Rivers int `json:"rivers"`
MinRiverWidth float64 `json:"min_river_width"`
MaxRiverWidth float64 `json:"max_river_width"`
RiverCurvyness float64 `json:"river_curvyness"`
LastExportPath string `json:"last_export_path"`
Detail float64 `json:"detail"`
Roughness float64 `json:"roughness"`
Width int `json:"width"`
Height int `json:"height"`
Lakes int `json:"lakes"`
LakeSizeLower float64 `json:"lake_size_lower"`
LakeSizeUpper float64 `json:"lake_size_upper"`
MinTreeSize float64 `json:"min_tree_size"`
MaxTreeSize float64 `json:"max_tree_size"`
TreeCoverage float64 `json:"tree_coverage"`
TreeClumpiness float64 `json:"tree_clumpiness"`
Seed int64 `json:"seed"`
Rivers int `json:"rivers"`
MinRiverWidth float64 `json:"min_river_width"`
MaxRiverWidth float64 `json:"max_river_width"`
RiverCurvyness float64 `json:"river_curvyness"`
NumRoads int `json:"num_roads"`
MinRoadWidth float64 `json:"min_road_width"`
MaxRoadWidth float64 `json:"max_road_width"`
RoadExits int `json:"road_exits"`
RoadCurvyness float64 `json:"road_curvyness"`
RoadDistribution float64 `json:"road_distribution"`
LastExportPath string `json:"last_export_path"`
}
func (s *Settings) Save() error {
@@ -64,23 +70,29 @@ func LoadSettings() (*Settings, error) {
homeDir = "."
}
return &Settings{
Detail: 1,
Roughness: 0,
Width: 300,
Height: 300,
Lakes: 0,
LakeSizeLower: 1,
LakeSizeUpper: 5,
MinTreeSize: 5,
MaxTreeSize: 20,
TreeCoverage: 20,
TreeClumpiness: 50,
Seed: time.Now().UnixNano(),
Rivers: 0,
MinRiverWidth: 1,
MaxRiverWidth: 5,
RiverCurvyness: 50,
LastExportPath: homeDir,
Detail: 1,
Roughness: 0,
Width: 300,
Height: 300,
Lakes: 0,
LakeSizeLower: 1,
LakeSizeUpper: 5,
MinTreeSize: 5,
MaxTreeSize: 20,
TreeCoverage: 20,
TreeClumpiness: 50,
Seed: time.Now().UnixNano(),
Rivers: 0,
MinRiverWidth: 1,
MaxRiverWidth: 5,
RiverCurvyness: 50,
NumRoads: 100,
MinRoadWidth: 2,
MaxRoadWidth: 8,
RoadExits: 5,
RoadCurvyness: 50,
RoadDistribution: 50,
LastExportPath: homeDir,
}, nil
}
return nil, err