The generation of the resource in map.

Place to get help with not working mods / modding interface.
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

The generation of the resource in map.

Post by Airat9000 »

Hi all! I want to modify my mod) and I want to know and please tell me how to reduce the number of spawn resources on the map.
as you can see on the map a lot of resource, I would like to reduce to 3-4 pieces and not 10 in one area)

Привет всем! хочу доработать свой мод) и хочу узнать и просьба подсказать как мне уменьшить количества спауна ресурсов на карте.
как видите на карте много ресурса, хотелось бы уменьшить до 3-4 штук а не 10 на одной местности)

Code: Select all

data:extend(
{
  {
    type = "autoplace-control",
    name = "gas-chlorine",
    richness = true,
    order = "a-c-c"
  },
  
  {
    type = "noise-layer",
    name = "gas-chlorine"
  },
  
  {
    type = "resource",
    name = "gas-chlorine",
    icon = "__gas-chlorine__/graphics/icons/fluid/gas-chlorine.png",
    flags = {"placeable-neutral"},
    category = "basic-fluid",
    order="a-c-c",
    infinite = false,
    minimum = 75000,
    normal = 75000,
    minable =
    {
      hardness = 1,
      mining_time = 5.1,
      results =
      {
        {
          type = "fluid",
          name = "gas-chlorine",
          amount_min = 3.5,
          amount_max = 3.5,
          probability = 0.50
        }
      }
    },
    collision_box = {{ -1.4, -1.4}, {1.4, 1.4}},
    selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
    autoplace =
    {
      control = "gas-chlorine",
      sharpness = 0.80,
      max_probability = 0.03,
      richness_multiplier = 150000000,
      richness_base = 150000000,
      size_control_multiplier = 0.1,
      peaks =
	  {
        {
          influence = 0.1
        },
        {
          influence = 0.075,
          starting_area_weight_optimal = 0.4,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.54,
          noise_layer = "gas-chlorine",
          noise_octaves_difference = -2.7,
          noise_persistence = 0.3
        }
      }
    },
    stage_counts = {0},
    stages =
    {
      sheet =
      {
        filename = "__gas-chlorine__/graphics/entity/gas-chlorine/gas-chlorine.png",
        priority = "extra-high",
        width = 75,
        height = 61,
        frame_count = 4,
        variation_count = 1
      }
    },
    map_color = {r=0.5, g=0.8, b=0.9},
    map_grid = false
  }
})
Attachments
2016-10-03_2-58-27.jpg
2016-10-03_2-58-27.jpg (176.4 KiB) Viewed 3116 times
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: The generation of the resource in map.

Post by Airat9000 »

:) need help??
matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: The generation of the resource in map.

Post by matjojo »

Airat9000 wrote::) need help??

Try copying the base game one's, or lowering the amounts in the peak values. It seems like those would determine that.
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: The generation of the resource in map.

Post by Airat9000 »

matjojo wrote:
Airat9000 wrote::) need help??

Try copying the base game one's, or lowering the amounts in the peak values. It seems like those would determine that.
Yes, I realized I would have more accurate information I would like to understand and how it works)

да я понял мне бы более точное информацию я хотел бы понять суть и как работает)
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: The generation of the resource in map.

Post by aubergine18 »

In the main resource prototype...

* `autoplace.sharpness` determines, for a specific patch, how spread out it is (0 = very spread out, 1 = all in one clump like ores)

* `autoplace.coverage` seems to have some effect on how frequent the patches will appear (although I'm not sure about this)

* various `richness` values determine how much resource each patch contains.

I don't really understand how the `peaks` settings work (I get the basics, but don't know what each specific setting relates to) or what the `stage_counts` setting is (something to do with `stages.sheet.variation_count`?)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: The generation of the resource in map.

Post by matjojo »

Maybe ask bob or angel, they both have mods that center around resources
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: The generation of the resource in map.

Post by Airat9000 »

boys!!! thanks in help
i am
example (my mods in more) 6 types

Code: Select all

      {
        {
          type = "fluid",
          name = "water-purified",
          amount_min = 1.5,
          amount_max = 1.5,
          probability = 1
        }
      }
    },
    collision_box = {{ -1.4, -1.4}, {1.4, 1.4}},
    selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
    autoplace =
    {
      control = "water-purified",
      sharpness = 0.30,
      max_probability = 0.03,
      richness_multiplier = 150000000,
      richness_base = 150000000,
      size_control_multiplier = 0.1,
      peaks =
	  {
        {
          influence = 0.1
        },
        {
          influence = 0.075,
          starting_area_weight_optimal = 0.4,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.24,
          noise_layer = "water-purified",
          noise_octaves_difference = -2.7,
          noise_persistence = 0.3
        }
      }
    },
I sat down and changed himself into general resources are fewer, but they are together for some reason
inf in 0.54 to 0.24 shar 0.80 to 0.30 an min max parametrs

Code: Select all

influence = 0.24,     sharpness = 0.30, 
        name = "water-purified",
          amount_min = 1.5,
          amount_max = 1.5,
Doublespin
Inserter
Inserter
Posts: 36
Joined: Thu May 21, 2015 12:46 pm
Contact:

Re: The generation of the resource in map.

Post by Doublespin »

I'm not sure if i'm correct but this is how i think some of the parameters work.

The minable properties shouldnt change the spawning.
min/max_amount: after a machine/player mines a resource you will get a number of resources between these number.
min_amount=1, max_amount=3 will give you after each mining process 1,2 or 3 ores (fluids will use point numbers?)
probability: is the probabiliry that the mining process is a success.
probability = 1/3; on average only every third mining-process will result in an item (How many items is defined by min/max_amount)

autoplace properties:
sharpness: Determines how the sharpness filter works: 1 means the filter will return only 1 or 0. 0 wouldnt change anything.
Lets start with a sin wave. This will be the input for the sharpness filter (sharpness=1)
then every value bigger than 0.5 will get transformed to 1 and every values smaller than 0.5 will transformed to 0
SO we would get a square wave:
graphs
I would exspect that resource patches would get wholes if the sharpness is too small
coverage: = 0.02, -- Cover on average 2% of surface area.

I found this in the wiki:
max_probability * sharpness_filter(sum of influences + size modifier from GUI) - random(0, random_probability_penalty)
sharpness_filter(sum of influences + size modifier from GUI) will give out numbers between 0 and 1
If sum of influences is high you will get more numbers around 1. ?And the "influence" is determined by the peaks?
max_probability:Number between 0 and 1. Probably this is the setting you want to change.
Lower values mean dirctly less resource patches. Even if the sharpness filter returns 1 there will be one more check if the ressource will be spawned.
random_probability_penalty: Number bigger than 0. This is an additional paramtere to reduce the spawn chance.
I imagine the impact like this:
high max_probability, random_probability_penalty=0 => Many resources equally distributed over the map
high max_probability, high random_probability_penalty => There will be some dense resource points on the map and some less dense
very high random_probability_penalty => no resource will spawn
Since the overall chance will decrease fast if random_probability_penalty is bigger than the double of max_probability you should avoid much bigger numbers.

sum of influences * (richness_multiplier + distance * richness_multiplier_distance_bonus) + richness_base
richness_base: determines tha base amount of a resource
richness_multiplier: this values is influenced by the "influence"
richness_multiplier_distance_bonus: this value is influenced by the "influence" and the distance to the start area
size_control_multiplier: probably the same as richness_multiplier but for the site :P

resource properties:
infinite: ?If infinite is true then the 3 following parameters are used? are they having an influence if infinite is false?
Even if infinite is true, the amount of the resource is calculated but not shown ingame
minimum: this is the minium amount of the resource. After this amount is reached through mining then there will be no further decrease
normal: Reference amount for minimum. This is how the game calculates the %.
normal = 1000, minium =100: The % shown ingame will be decreased to 10% and then will be constant
normal = 100000, minium =10000: The % shown ingame will be decreased to 10% and then will be constant but the % will decrease slower
normal and minimum are having no effect on the amount at which resource is spawned.
maximum: Im not sure. Maybe it caps the maximum aomunt at which the resource can spawn or it caps the % number

stage counts:
Copper-ore
the rows of the image represent the 8 different stages. stage_counts are the number at which the game changes the appearance of the ore tile
sheet: I think this is how the game reads out the image
frame_count = 4 number of "columns"
variation_count = 8 number of "rows"
height = 38,width = 38 the number of pixel for one copper tile
4x38=152
8x38=304
I'm not a native speaker (obviously), so I will appreciate every pm with corrections :)
Post Reply

Return to “Modding help”