diff --git a/README.md b/README.md index ee69d2b..918c704 100644 --- a/README.md +++ b/README.md @@ -482,6 +482,18 @@ decimation will be, which means the higher it will affect the geometry. It's not - Add Farmyards - if enabled, the tool will create farmlands from the regions that are marked as farmyards in the OSM data. Those farmlands will not have fields and also will not be drawn on textures. By default, it's turned off. +- Base grass - you can select which plant will be used as a base grass on the map. + +- Plants island minimum size - when random plants are enabled, the generator will add islands of differents plants to the map and choose the random size of those island between the minimum and maximum values. This one is the minimum size of the island in meters. + +- Plants island maximum size - it's the same as above, but for the maximum size of the island in meters. + +- Plants island vertex count - the number of vertices in the island. The higher the value, the more detailed the island will be. Note, that high values will turn the smoothed island into geometric madness. + +- Plants insland rounding radius - used to round the vertices of the island. The higher the value, the more rounded the island will be. + +- Plants island percent - defines the relation between the map size and the number of islands of plants. For example, if set to 100% for map size of 2048 will be added 2048 islands of plants. + ### I3D Advanced settings - Forest density - the density of the forest in meters. The lower the value, the lower the distance between the trees, which makes the forest denser. Note, that low values will lead to enormous number of trees, which may cause the Giants Editor to crash or lead to performance issues. By default, it's set to 10. diff --git a/maps4fs/generator/grle.py b/maps4fs/generator/grle.py index 6098670..d03d623 100644 --- a/maps4fs/generator/grle.py +++ b/maps4fs/generator/grle.py @@ -427,11 +427,11 @@ def get_rounded_polygon( grass_image_copy[grass_image != 0] = base_layer_pixel_value # Add islands of plants to the base image. - island_count = self.map_size + island_count = int(self.map_size * self.map.grle_settings.plants_island_percent // 100) self.logger.debug("Adding %s islands of plants to the base image.", island_count) if self.map.grle_settings.random_plants: grass_image_copy = create_island_of_plants(grass_image_copy, island_count) - self.logger.debug("Islands of plants added to the base image.") + self.logger.info("Added %s islands of plants to the base image.", island_count) # Sligtly reduce the size of the grass_image, that we'll use as mask. kernel = np.ones((3, 3), np.uint8) diff --git a/maps4fs/generator/settings.py b/maps4fs/generator/settings.py index bc9d170..155359a 100644 --- a/maps4fs/generator/settings.py +++ b/maps4fs/generator/settings.py @@ -136,6 +136,7 @@ class GRLESettings(SettingsModel): plants_island_maximum_size: int = 200 plants_island_vertex_count: int = 30 plants_island_rounding_radius: int = 15 + plants_island_percent: int = 100 class I3DSettings(SettingsModel): diff --git a/webui/templates.py b/webui/templates.py index 95fae02..f1f72a6 100644 --- a/webui/templates.py +++ b/webui/templates.py @@ -196,6 +196,11 @@ class Settings: "Plants island rounding radius value is used to set the rounding radius of the plants. " "The higher the value, the more rounded the vertices will be. " ) + PLANTS_ISLAND_PERCENT = ( + "Plants island percent value is used to set the relation between the map size and the " + "number of islands of plants. For example, if set to 100% for map size of 2048, the number" + " of islands will be 2048." + ) # I3D Settings