basic building generation

This commit is contained in:
Grimsace
2026-02-05 15:11:55 -06:00
parent 0793ba6ade
commit 84d6e99201
4 changed files with 331 additions and 66 deletions
+56 -46
View File
@@ -8,29 +8,34 @@ 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"`
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"`
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"`
NumBuildings int `json:"num_buildings"`
MinBuildingSize float64 `json:"min_building_size"`
MaxBuildingSize float64 `json:"max_building_size"`
BuildingDistribution float64 `json:"building_distribution"`
BuildingShape string `json:"building_shape"`
LastExportPath string `json:"last_export_path"`
}
func (s *Settings) Save() error {
@@ -70,29 +75,34 @@ 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,
NumRoads: 100,
MinRoadWidth: 2,
MaxRoadWidth: 8,
RoadExits: 5,
RoadCurvyness: 50,
RoadDistribution: 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,
NumBuildings: 200,
MinBuildingSize: 10,
MaxBuildingSize: 30,
BuildingDistribution: 20,
BuildingShape: "squares",
LastExportPath: homeDir,
}, nil
}
return nil, err