Simple Seablock

by Aronson

Seablock based primarily around vanilla factorio techtree with minor changes

Overhaul
a month ago
1.1 - 2.1
4.27K
Environment Fluids

b Bob's Ores: Gem issues

a month ago
(updated a month ago)

Hi again. I was also investigating the balance of gem production with Bob's Ores installed and the relevant setting enabled, and the diamond yield for the charcoal recipe does not seem to be calculated the way that you intended. The diamond-to-coal ratio is only 0.5% (instead of 1%) at default settings, but more importantly, the calculations don't actually account for the amount of coal produced nor the setting for the ratio of diamonds, and no more than 1 diamond (equal to 10%) can be produced at a time, regardless of settings.

If we look at Bob's Ores v3.0.0 in data-updates.lua line 38-44, the default 1% diamond yield for coal mining is calculated by multiplying the values from TWO settings in settings.lua: The gem chance (default: 5%, line 56) and the diamond ratio (default: 20%, line 103). For your mod to produce a similar amount and update according to both settings, you could write something like this in mod-compat\data-updates\bobores.lua, line 122+:

if settings.startup["bobmods-ores-gemsfromotherores"].value then
  local wood_to_coal = data.raw.recipe["wood-to-coal"]
  local coalAmount = 10
  local gemChance = settings.startup["bobmods-ores-gemprobability"].value
  local diamondRatio = settings.startup["bobmods-gems-diamondratio"].value
  local diamondAvgOutput = gemChance * diamondRatio * coalAmount
  if diamondAvgOutput > 0 and diamondAvgOutput <= 1 then
    wood_to_coal.results = {
      {type = "item", name = "coal", amount = coalAmount},
      {type = "item", name = "bob-diamond-ore", amount = 1, independent_probability = diamondAvgOutput}
    }
  elseif diamondAvgOutput > 1 then
    local diamond_integer = math.floor(diamondAvgOutput)
    local diamond_fraction = diamondAvgOutput - diamond_integer
    wood_to_coal.results = {
      {type = "item", name = "coal", amount = coalAmount},
      {type = "item", name = "bob-diamond-ore", amount = diamond_integer, extra_count_fraction = diamond_fraction}
    }
  end
  -- etc.
end

There should be no issues with any of the settings or properties such as amount or extra_count_fraction having a value of 0.

a month ago
(updated a month ago)

I figure that something similar ought to be done with the gems produced alongside bauxite ore and quartz from sediment in order to achieve the ratios intended by Bob's Ores:

if settings.startup["bobmods-ores-gemsfromotherores"].value then

  local gemChance     = settings.startup["bobmods-ores-gemprobability"].value
  local rubyRatio     = settings.startup["bobmods-gems-rubyratio"].value
  local sapphireRatio = settings.startup["bobmods-gems-sapphireratio"].value
  local emeraldRatio  = settings.startup["bobmods-gems-emeraldratio"].value
  local amethystRatio = settings.startup["bobmods-gems-amethystratio"].value
  local topazRatio    = settings.startup["bobmods-gems-topazratio"].value
  local diamondRatio  = settings.startup["bobmods-gems-diamondratio"].value

  -- code for coal and diamonds (with some local variables moved up above)

  if settings.startup["bobmods-ores-enablebauxite"].value then
    data.raw.recipe[getRecipeName("bauxite")].results = {
      {type = "item", name = "bob-bauxite-ore",  amount = 1},
      {type = "item", name = "bob-ruby-ore", amount = 1, independent_probability = gemChance * rubyRatio},
      {type = "item", name = "bob-sapphire-ore", amount = 1, independent_probability = gemChance * sapphireRatio},
      {type = "item", name = "bob-topaz-ore", amount = 1, independent_probability = gemChance * topazRatio}
    }
  end

  if settings.startup["bobmods-ores-enablequartz"].value then
    data.raw.recipe[getRecipeName("quartz")].results = {
      {type = "item", name = "bob-quartz",       amount = 1},
      {type = "item", name = "bob-emerald-ore", amount = 1, independent_probability = gemChance * emeraldRatio},
      {type = "item", name = "bob-amethyst-ore", amount = 1, independent_probability = gemChance * amethystRatio}
    }
  end

  -- etc.

end
a month ago

1.10.1 fixes this and now gems from other ores recipes take the ratio settings into account. This wasn't too far off with many of the default settings (emerald and amethyst are close to 0.5, for example), but your findings are correct and it's more accurate now.

Diamonds are still low with respect to the amount of coal output but that's intentional, they effectively ignore the 10x "multiplier" on coal and roll diamond for each smelting operation as though you'd mined one coal. I think that "feels" better, and also the coal recipe is likely changing soon based on your other feedback (though that one will still be a bit, it's making a pretty fundamental change to core part of the mod, so I'll need to play with it a bit to make sure it feels right).

a month ago
(updated a month ago)

All right! Yeah, they are just minor issues, and I wasn't sure about how many diamonds you actually wanted the charcoal recipe to produce. (As for possibly changing the bonus multiplier, I fully understand that you need to think about how it would impact the game before deciding on anything.)

New response