[0.9+, Modding] Multiple Results for resource, overwhelm bug

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

[0.9+, Modding] Multiple Results for resource, overwhelm bug

Post by AlexPhoenix »

finded here: https://forums.factorio.com/forum/vie ... 375#p20375
for my tests i moddify CopperOre resource as follow:

Code: Select all

  {
    type = "resource",
    name = "copper-ore",
    icon = "__base__/graphics/icons/copper-ore.png",
    flags = {"placeable-neutral"},
    order="a-b-a",
    minable =
    {
		hardness = 0.5,
		mining_time = 10,
		results =
		{
			{
				name = "copper-ore",
				amount_min = 0,
				amount_max = 1,
				probability =0.1
			},
			{
				name = "iron-ore",
				amount_min = 0,
				amount_max = 1,
				probability = 0.1
			},
			{
				name = "coal",
          		amount_min = 0,
          		amount_max = 1,
          		probability = 0.1
        	}
        }
    },
    collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
    selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
    autoplace =
    {
      control = "copper-ore",
      sharpness = 1,
      richness_multiplier = 13000,
      richness_base = 350,
      size_control_multiplier = 0.06,
      peaks = {
        {
          influence = 0.2,
          starting_area_weight_optimal = 0,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.65,
          noise_layer = "copper-ore",
          noise_octaves_difference = -1.9,
          noise_persistence = 0.3,
          starting_area_weight_optimal = 0,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.3,
          starting_area_weight_optimal = 1,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = 0.55,
          noise_layer = "copper-ore",
          noise_octaves_difference = -2.3,
          noise_persistence = 0.4,
          starting_area_weight_optimal = 1,
          starting_area_weight_range = 0,
          starting_area_weight_max_range = 2,
        },
        {
          influence = -0.2,
          max_influence = 0,
          noise_layer = "iron-ore",
          noise_octaves_difference = -2.3,
          noise_persistence = 0.45,
        },
        {
          influence = -0.2,
          max_influence = 0,
          noise_layer = "coal",
          noise_octaves_difference = -2.3,
          noise_persistence = 0.45,
        },
        {
          influence = -0.2,
          max_influence = 0,
          noise_layer = "stone",
          noise_octaves_difference = -3,
          noise_persistence = 0.45,
        },
      },
    },
    stage_counts = {1000, 600, 400, 200, 100, 50, 20, 1},
    stages = { filename = "__base__/graphics/entity/copper-ore/copper-ore.png",
      priority = "extra-high",
      frame_width = 38,
      frame_height = 38,
      frame_count = 4,
      direction_count = 8
    },
    map_color = {r=0.803, g=0.388, b=0.215}
  }
infinity or not doesnt matter.

At game happens next:
1)drill mine and mine for some time(near 10 times it mines before input)
2)then it output visually one item(but random from list) on ground(not in chest if any)
3)if there is a belt then you will see long tail of items from this "one item".
Show
if you place chest on then it will be filled in tick.
Show
i cannot determine count of mined ore, if was full iron chest and my inventory, but "one item" doesnt ended.

so, this must be resolved at sometime:)

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.9+, Modding] Multiple Results for resource, overwhelm

Post by slpwnd »

Thanks for the report. This is a funny bug. It will be fixed for the 0.9.3. The problem is actually that your amount_min is 0 and amount_max is 1. That doesn't make sense because items can't be fractional and minimum should always be at least 1. So amount_min 1, amount_max 10 makes good sense for example. In your case, the amount of resource would be 0 which internally overflew to infinity :)

User avatar
AlexPhoenix
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Feb 18, 2014 7:48 am
Contact:

Re: [0.9+, Modding] Multiple Results for resource, overwhelm

Post by AlexPhoenix »

slpwnd wrote:Thanks for the report. This is a funny bug. It will be fixed for the 0.9.3. The problem is actually that your amount_min is 0 and amount_max is 1. That doesn't make sense because items can't be fractional and minimum should always be at least 1. So amount_min 1, amount_max 10 makes good sense for example. In your case, the amount of resource would be 0 which internally overflew to infinity :)
funny thing, thank you.

slay_mithos
Fast Inserter
Fast Inserter
Posts: 204
Joined: Tue Feb 25, 2014 7:22 am
Contact:

Re: [0.9+, Modding] Multiple Results for resource, overwhelm

Post by slay_mithos »

Now, the only thing is to figure out a way to use this system for always getting one and only one result from the multiple results.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.9+, Modding] Multiple Results for resource, overwhelm

Post by kovarex »

slay_mithos wrote:Now, the only thing is to figure out a way to use this system for always getting one and only one result from the multiple results.
This would have to be programmed as special mode.

Post Reply

Return to “Resolved Problems and Bugs”