1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-03 14:53:01 +02:00

* Modified the ore generation to be quadrant based with more balance towards .17

* upped minimum pollution to keep map smaller
* reduced base tech multiplier to 20
* removed pollution factor and increased time factor for enemy evolution
This commit is contained in:
TWLTriston 2019-03-27 18:17:41 -04:00
parent 9184b2940f
commit c41e296c95

View File

@ -60,7 +60,7 @@ local tree_threshold = -0.25
local tree_chance = 0.125 local tree_chance = 0.125
local start_chunks_half_size = 3 local start_chunks_half_size = 3
global.min_pollution = 500 global.min_pollution = 2500
local chunk_list = {index = 1} local chunk_list = {index = 1}
local surface local surface
@ -73,12 +73,13 @@ Global.register_init(
local s = RS.get_surface() local s = RS.get_surface()
tbl.seed = s.map_gen_settings.seed tbl.seed = s.map_gen_settings.seed
tbl.surface = s tbl.surface = s
game.difficulty_settings.technology_price_multiplier = 50 game.difficulty_settings.technology_price_multiplier = 20
game.forces.player.technologies.logistics.researched = true game.forces.player.technologies.logistics.researched = true
game.forces.player.technologies.automation.researched = true game.forces.player.technologies.automation.researched = true
game.map_settings.enemy_evolution.time_factor = 0.000002 game.map_settings.enemy_evolution.time_factor = 0.000005 -- Increased time factor
game.map_settings.enemy_evolution.destroy_factor = 0.000010 game.map_settings.enemy_evolution.destroy_factor = 0.000010
game.map_settings.enemy_evolution.pollution_factor = 0.000005 game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution
game.draw_resource_selection = false
end, end,
function(tbl) function(tbl)
local seed = tbl.seed local seed = tbl.seed
@ -103,21 +104,56 @@ local uranium_resource = b.resource(b.full_shape, 'uranium-ore', value(200, 1))
local ores = { local ores = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 60}, {resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 60},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 40}, {resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 60},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 5}, {resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 12},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 20} {resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 12}
} }
local ores_pos_x_pos_y = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 40},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 20}
}
local ores_pos_x_neg_y = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 60},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 20}
}
local ores_neg_x_pos_y = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 60},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 20}
}
local ores_neg_x_neg_y = {
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 20},
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 40}
}
local weighted_ores = b.prepare_weighted_array(ores) local weighted_ores = b.prepare_weighted_array(ores)
local weighted_ores_pos_x_pos_y = b.prepare_weighted_array(ores_pos_x_pos_y)
local weighted_ores_pos_x_neg_y = b.prepare_weighted_array(ores_pos_x_neg_y)
local weighted_ores_neg_x_pos_y = b.prepare_weighted_array(ores_neg_x_pos_y)
local weighted_ores_neg_x_neg_y = b.prepare_weighted_array(ores_neg_x_neg_y)
local total_ores = weighted_ores.total local total_ores = weighted_ores.total
local total_ores_pos_x_pos_y = weighted_ores_pos_x_pos_y.total
local total_ores_pos_x_neg_y = weighted_ores_pos_x_neg_y.total
local total_ores_neg_x_pos_y = weighted_ores_neg_x_pos_y.total
local total_ores_neg_x_neg_y = weighted_ores_neg_x_neg_y.total
local spawn_zone = b.circle(64) local spawn_zone = b.circle(64)
local ore_circle = b.circle(68) local ore_circle = b.circle(68)
local start_ores = { local start_ores = {
b.resource(ore_circle, 'iron-ore', value(125, 0)), b.resource(ore_circle, 'iron-ore', value(125, 0)),
b.resource(ore_circle, 'copper-ore', value(125, 0)),
b.resource(ore_circle, 'coal', value(125, 0)), b.resource(ore_circle, 'coal', value(125, 0)),
b.resource(ore_circle, 'copper-ore', value(125, 0)),
b.resource(ore_circle, 'stone', value(125, 0)) b.resource(ore_circle, 'stone', value(125, 0))
} }
@ -146,13 +182,41 @@ local function ore(x, y, world)
return uranium_resource(x, y, world) return uranium_resource(x, y, world)
end end
local i = math.random() * total_ores local i
local index = table.binary_search(weighted_ores, i) local index
if (index < 0) then local resource
index = bit32.bnot(index)
end
local resource = ores[index].resource if x > 0 and y > 0 then
i = math.random() * total_ores_pos_x_pos_y
index = table.binary_search(weighted_ores_pos_x_pos_y, i)
if (index < 0) then
index = bit32.bnot(index)
end
resource = ores_pos_x_pos_y[index].resource
elseif x > 0 and y < 0 then
i = math.random() * total_ores_pos_x_neg_y
index = table.binary_search(weighted_ores_pos_x_neg_y, i)
if (index < 0) then
index = bit32.bnot(index)
end
resource = ores_pos_x_neg_y[index].resource
elseif x < 0 and y > 0 then
i = math.random() * total_ores_neg_x_pos_y
index = table.binary_search(weighted_ores_neg_x_pos_y, i)
if (index < 0) then
index = bit32.bnot(index)
end
resource = ores_neg_x_pos_y[index].resource
else
i = math.random() * total_ores_neg_x_neg_y
index = table.binary_search(weighted_ores_neg_x_neg_y, i)
if (index < 0) then
index = bit32.bnot(index)
end
resource = ores_neg_x_neg_y[index].resource
end
local entity = resource(x, y, world) local entity = resource(x, y, world)
local density_x, density_y = x * density_scale, y * density_scale local density_x, density_y = x * density_scale, y * density_scale