1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Merge pull request #1217 from grilledham/danger_ore_reduce_ore

Danger ore balance changes.
This commit is contained in:
grilledham 2021-05-25 20:29:03 +01:00 committed by GitHub
commit c99eae5030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 80 additions and 45 deletions

View File

@ -1,5 +1,6 @@
local b = require 'map_gen.shared.builders'
local value = b.euclidean_value
local start_value = b.euclidean_value(24, 0)
local value = b.exponential_value(0, 0.07, 1.415)
return {
{
@ -10,13 +11,13 @@ return {
[3] = 'red-desert-2',
[4] = 'red-desert-3'
},
['start'] = value(50, 0),
['start'] = start_value,
['weight'] = 1,
['ratios'] = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.75)), weight = 15},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.75)), weight = 70},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.75)), weight = 10},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.75)), weight = 5}
{resource = b.resource(b.full_shape, 'iron-ore', value), weight = 15},
{resource = b.resource(b.full_shape, 'copper-ore', value), weight = 70},
{resource = b.resource(b.full_shape, 'stone', value), weight = 10},
{resource = b.resource(b.full_shape, 'coal', value), weight = 5}
}
},
{
@ -30,13 +31,13 @@ return {
[6] = 'dirt-6',
[7] = 'dirt-7'
},
['start'] = value(50, 0),
['start'] = start_value,
['weight'] = 1,
['ratios'] = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.75)), weight = 18},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.75)), weight = 9},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.75)), weight = 8},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.75)), weight = 65}
{resource = b.resource(b.full_shape, 'iron-ore', value), weight = 18},
{resource = b.resource(b.full_shape, 'copper-ore', value), weight = 9},
{resource = b.resource(b.full_shape, 'stone', value), weight = 8},
{resource = b.resource(b.full_shape, 'coal', value), weight = 65}
}
},
{
@ -47,13 +48,13 @@ return {
[3] = 'grass-3',
[4] = 'grass-4'
},
['start'] = value(50, 0),
['start'] = start_value,
['weight'] = 1,
['ratios'] = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.75)), weight = 75},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.75)), weight = 13},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.75)), weight = 7},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.75)), weight = 5}
{resource = b.resource(b.full_shape, 'iron-ore', value), weight = 75},
{resource = b.resource(b.full_shape, 'copper-ore', value), weight = 13},
{resource = b.resource(b.full_shape, 'stone', value), weight = 7},
{resource = b.resource(b.full_shape, 'coal', value), weight = 5}
}
},
--[[ {
@ -63,13 +64,13 @@ return {
[2] = 'sand-2',
[3] = 'sand-3'
},
['start'] = value(50, 0),
['start'] = start_value,
['weight'] = 1,
['ratios'] = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.75)), weight = 25},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.75)), weight = 10},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.75)), weight = 60},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.75)), weight = 5}
{resource = b.resource(b.full_shape, 'iron-ore', value), weight = 25},
{resource = b.resource(b.full_shape, 'copper-ore', value), weight = 10},
{resource = b.resource(b.full_shape, 'stone', value), weight = 60},
{resource = b.resource(b.full_shape, 'coal', value), weight = 5}
}
} ]]
}

View File

@ -1,17 +1,19 @@
local b = require 'map_gen.shared.builders'
local value = b.euclidean_value
local oil_shape = b.throttle_world_xy(b.full_shape, 1, 7, 1, 7)
local full_oil_shape = b.translate(b.throttle_xy(b.full_shape, 3, 6, 3, 6), -1, -1)
full_oil_shape = b.use_world_as_local(full_oil_shape)
local oil_shape = b.throttle_world_xy(b.full_shape, 1, 6, 1, 6)
return {
{
scale = 1 / 64,
threshold = 0.6,
resource = b.resource(oil_shape, 'crude-oil', value(450000, 225))
resource = b.any{b.resource(oil_shape, 'crude-oil', value(200000, 2500)), full_oil_shape}
},
{
scale = 1 / 80,
threshold = 0.68,
resource = b.resource(b.full_shape, 'uranium-ore', value(200, 1.2))
scale = 1 / 72,
threshold = 0.66,
resource = b.resource(b.full_shape, 'uranium-ore', value(200, 1.5))
}
}

View File

@ -18,7 +18,7 @@ local function spawn_builder(config)
local spawn_circle = config.spawn_shape or b.circle(64)
local spawn_tile = config.spawn_tile or 'grass-1'
local water = b.circle(16)
local water = b.circle(14)
water = b.change_tile(water, true, 'water')
water = b.any {b.rectangle(32, 4), b.rectangle(4, 32), water}
@ -66,7 +66,7 @@ return function(config)
end
local resource_patches_entity = resource_patches(x, y, world)
if resource_patches_entity ~= false then
if resource_patches_entity then
return resource_patches_entity
end

View File

@ -1,5 +1,6 @@
local Perlin = require 'map_gen.shared.perlin_noise'
local seed_provider = require 'map_gen.maps.danger_ores.modules.seed_provider'
local b = require 'map_gen.shared.builders'
local perlin_noise = Perlin.noise
@ -22,20 +23,11 @@ return function(config)
return resource(x, y, world)
end
return false
return nil
end
entities[#entities + 1] = entity_shape
end
return function(x, y, world)
for i = 1, #entities do
local e = entities[i](x, y, world)
if e ~= false then
return e
end
end
return false
end
return b.any(entities)
end

View File

@ -125,6 +125,10 @@ Event.on_init(
game.map_settings.enemy_evolution.time_factor = 0.000007 -- default 0.000004
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end
)

View File

@ -135,6 +135,10 @@ Event.on_init(
game.map_settings.enemy_evolution.time_factor = 0.000007 -- default 0.000004
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end
)

View File

@ -88,6 +88,10 @@ Event.on_init(
game.map_settings.enemy_evolution.time_factor = 0.000002 -- default 0.000004
game.map_settings.enemy_evolution.destroy_factor = 0.0009 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.0000015 -- default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end
)

View File

@ -99,6 +99,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)

View File

@ -99,6 +99,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)

View File

@ -99,6 +99,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)

View File

@ -109,6 +109,8 @@ Event.on_init(
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end
)

View File

@ -99,6 +99,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)

View File

@ -105,6 +105,8 @@ Event.on_init(
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end
)

View File

@ -98,6 +98,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)

View File

@ -130,6 +130,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.002 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)

View File

@ -104,6 +104,8 @@ Event.on_init(
game.map_settings.enemy_evolution.destroy_factor = 0.000011 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end
)

View File

@ -99,6 +99,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)

View File

@ -58,7 +58,7 @@ local resource_patches_config = require 'map_gen.maps.danger_ores.config.vanilla
local water = require 'map_gen.maps.danger_ores.modules.water'
local trees = require 'map_gen.maps.danger_ores.modules.trees'
local enemy = require 'map_gen.maps.danger_ores.modules.enemy'
local dense_patches = require 'map_gen.maps.danger_ores.modules.dense_patches'
--local dense_patches = require 'map_gen.maps.danger_ores.modules.dense_patches'
local banned_entities = require 'map_gen.maps.danger_ores.modules.banned_entities'
local allowed_entities = require 'map_gen.maps.danger_ores.config.vanilla_allowed_entities'
@ -99,6 +99,8 @@ Event.on_init(function()
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
end)
@ -118,8 +120,8 @@ local concrete_on_landfill = require 'map_gen.maps.danger_ores.modules.concrete_
concrete_on_landfill({tile = 'blue-refined-concrete'})
local config = {
spawn_shape = b.circle(64),
start_ore_shape = b.circle(68),
spawn_shape = b.circle(56),
start_ore_shape = b.circle(60),
main_ores = main_ores_config,
main_ores_shuffle_order = true,
main_ores_rotate = 30,
@ -138,7 +140,7 @@ local config = {
enemy_max_chance = 1 / 6,
enemy_scale_factor = 32,
fish_spawn_rate = 0.025,
dense_patches = dense_patches,
--dense_patches = dense_patches,
dense_patches_scale = 1 / 48,
dense_patches_threshold = 0.55,
dense_patches_multiplier = 25

View File

@ -594,6 +594,12 @@ function Builders.if_else(shape, else_shape)
end
end
function Builders.use_world_as_local(shape)
return function (_, _, world)
return shape(world.x, world.y, world)
end
end
--- Docs: https://github.com/Refactorio/RedMew/wiki/Using-the-Builders#builderslinear_grow
function Builders.linear_grow(shape, size)
return function(x, y, world)
@ -991,7 +997,7 @@ function Builders.apply_entity(shape, entity_shape)
end
local e = entity_shape(x, y, world)
if e then
if e and e ~= true then
tile = add_entity(tile, e)
end
@ -1010,7 +1016,7 @@ function Builders.apply_entities(shape, entity_shapes)
for _, es in ipairs(entity_shapes) do
local e = es(x, y, world)
if e then
if e and e ~= true then
tile = add_entity(tile, e)
end
end