Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions map_gen/maps/frontier/modules/restart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,11 @@ function Restart.print_endgame_statistics()
end

local total_ore = 0
local ore_totals_message = '('
local surface_stats = game.forces.player.get_item_production_statistics(Public.surface())
for ore_name in pairs(ore_products) do
local count = game.forces.player.get_item_production_statistics(Public.surface().name).get_input_count(ore_name)
total_ore = total_ore + count
ore_totals_message = ore_totals_message..ore_name:gsub( '-ore', '')..': '..format_number(count, true)..', '
total_ore = total_ore + (surface_stats.get_input_count(ore_name) or 0)
end
ore_totals_message = ore_totals_message:sub(1, -3)..')' -- remove the last ', ' and add a bracket
statistics.ore_totals_value = format_number(total_ore, true)
statistics.ore_totals_breakdown = ore_totals_message
end

local statistics_message = {
Expand All @@ -569,7 +565,6 @@ function Restart.print_endgame_statistics()
'Map time: '..statistics.time_string,
'Total entities built: '..statistics.entities_built,
'Total ore mined: '..statistics.ore_totals_value,
statistics.ore_totals_breakdown,
'Total ore resources exhausted: '..statistics.resources_exhausted,
'Players: '..statistics.total_players,
'Rockets launched: '..statistics.rockets_launched,
Expand Down
72 changes: 48 additions & 24 deletions map_gen/maps/frontier/modules/terrain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ local math = require 'utils.math'
local MGSP = require 'resources.map_gen_settings'
local Noise = require 'map_gen.shared.simplex_noise'
local Queue = require 'utils.queue'
local RS = require 'map_gen.shared.redmew_surface'
local Public = require 'map_gen.maps.frontier.shared.core'
local math_abs = math.abs
local math_ceil = math.ceil
Expand All @@ -18,14 +17,14 @@ local q_pop = Queue.pop
local simplex = Noise.d2

local autoplace_controls = {
['coal'] = { frequency = 1.3, richness = 0.7, size = 0.80 },
['copper-ore'] = { frequency = 1.4, richness = 0.7, size = 0.85 },
['crude-oil'] = { frequency = 1, richness = 0.9, size = 0.95 },
['enemy-base'] = { frequency = 6, richness = 0.6, size = 4 },
['iron-ore'] = { frequency = 1.6, richness = 0.8, size = 1.15 },
['stone'] = { frequency = 1, richness = 0.6, size = 0.65 },
['trees'] = { frequency = 1, richness = 0.6, size = 1.2 },
['uranium-ore'] = { frequency = 0.5, richness = 0.6, size = 0.6 },
['coal'] = { frequency = 1.3, richness = 0.7, size = 0.80 },
['copper-ore'] = { frequency = 1.4, richness = 0.7, size = 0.85 },
['crude-oil'] = { frequency = 1.7, richness = 2.4, size = 1.25 },
['enemy-base'] = { frequency = 6, richness = 0.6, size = 4 },
['iron-ore'] = { frequency = 1.6, richness = 0.8, size = 1.15 },
['stone'] = { frequency = 1, richness = 0.6, size = 0.65 },
['trees'] = { frequency = 1, richness = 0.6, size = 1.2 },
['uranium-ore'] = { frequency = 0.5, richness = 0.6, size = 0.6 },
}
local blacklisted_resources = {
['uranium-ore'] = true,
Expand Down Expand Up @@ -69,23 +68,48 @@ if script.active_mods['zombiesextended-core'] then
blacklisted_resources['vibranium-ore'] = true
end

RS.set_map_gen_settings({
{
autoplace_controls = autoplace_controls,
cliff_settings = { name = 'cliff', cliff_elevation_0 = 20, cliff_elevation_interval = 40, richness = 0.8 },
height = Public.get().height * 32,
property_expression_names = {
['control-setting:aux:frequency:multiplier'] = '1.333333',
['control-setting:moisture:bias'] = '-0.250000',
['control-setting:moisture:frequency:multiplier'] = '3.000000',
},
starting_area = 3,
},
MGSP.water_none,
})

local Terrain = {}

function Terrain.set_map_gen_settings()
local surface = Public.surface()
local mgs = table.deepcopy(surface.map_gen_settings)

mgs.starting_area = 3
mgs.height = Public.get().height * 32
mgs.cliff_settings = {
name = 'cliff',
control = 'nauvis_cliff',
cliff_elevation_0 = 20,
cliff_elevation_interval = 40,
richness = 0.8,
cliff_smoothing = 0,
}
-- Biome
for k, v in pairs({
['control:aux:frequency'] = '1.333333',
['control:moisture:bias'] = '-0.250000',
['control:moisture:frequency'] = '3.000000',
}) do
mgs.property_expression_names[k] = v
end

-- Water none
mgs.autoplace_settings = mgs.autoplace_settings or {}
mgs.autoplace_settings.tile = mgs.autoplace_settings.tile or {}
mgs.autoplace_settings.tile.settings = mgs.autoplace_settings.tile.settings or {}
for k, v in pairs(MGSP.water_none.autoplace_settings.tile.settings) do
mgs.autoplace_settings.tile.settings[k] = v
end

-- Ores
mgs.autoplace_controls = mgs.autoplace_controls or {}
for k, v in pairs(autoplace_controls) do
mgs.autoplace_controls[k] = v
end

surface.map_gen_settings = mgs
end

function Terrain.get_map()
local map
local this = Public.get()
Expand Down
1 change: 1 addition & 0 deletions map_gen/maps/frontier/scenario.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ local function on_game_started()
Public.reset()
Restart.announce_new_map()
Restart.apply_modifiers()
Terrain.set_map_gen_settings()
Terrain.reveal_spawn_area()
Terrain.queue_reveal_map()
RocketSilo.init_silo()
Expand Down
Loading