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
Binary file added map_gen/data/.map_previews/danger_ore_joker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map_gen/data/.map_previews/fox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map_gen/data/.source_images/club.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map_gen/data/.source_images/diamond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map_gen/data/.source_images/fox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map_gen/data/.source_images/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map_gen/data/.source_images/spade.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,061 changes: 1,061 additions & 0 deletions map_gen/data/presets/fox.lua

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions map_gen/data/presets/poker_club.lua

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions map_gen/data/presets/poker_diamond.lua

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions map_gen/data/presets/poker_heart.lua

Large diffs are not rendered by default.

518 changes: 518 additions & 0 deletions map_gen/data/presets/poker_spade.lua

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions map_gen/maps/danger_ores/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,21 @@ return [[
- [DO:Gridlocked] Added DO/Gridlocked preset
- [DO:Expanse] Updated DO/Expanse to 2.0
- [DO:Safety] Updated DO/Safety to 2.0

2026-02-18:
- [DO] Added 1x1 loaders
- [DO] Added ore radioactivity
- [DO] Added reskins for advanced factory (thanks Kirazy)
- [DO] Added vibrant colors to entities with player color masks
- [DO] Added technology milestones
- [DO] Added Deep-house chest
- [DO] Turn OFF always day mode
- [DO] Rebalanced solar energy production and rocket recipes
- [DO] Rebalanced increased copper consumption early game
- [DO] Removed 1x2 loaders
- [DO] Removed Memory unit mod
- [DO] Removed ore stack changes
- [DO] Removed robots cost multipliers
- [DO:JK] Added DO/Joker preset
- [DO:JK] Added biters drop resources
]]
66 changes: 66 additions & 0 deletions map_gen/maps/danger_ores/config/joker_outer_area.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
local b = require 'map_gen.shared.builders'
local rad = math.rad

local ore_density_rail = b.euclidean_value(-150, 0.35)
local ore_density_block = b.exponential_value(-550, 0.07, 1.45)

local rail_grid
do
local width = 6 * 32
local height = 4 * 32
local station_length = 40
local spawn_position = { x = 18, y = 18 }
local l = math.sqrt(width ^ 2 + height ^ 2) - 32 * math.tan(height / width)

local station = b.any {
b.rectangle(station_length, 14),
b.translate(b.square_diamond(14), station_length / 2, 0), -- these just make it pretty
b.translate(b.square_diamond(14), station_length / -2, 0), -- these just make it pretty
}

rail_grid = b.add(
b.subtract(b.rectangle(width, height), b.rotate(b.rectangle(l), rad(45))),
b.subtract(b.rectangle(width, height), b.rectangle(width - 6, height - 6))
)

rail_grid = b.any {
rail_grid,
b.translate(b.rotate(station, rad(90)), -width / 2, 0),
b.translate(b.rotate(station, rad(90)), width / 2, 0),
}

rail_grid = b.any {
rail_grid,
b.translate(rail_grid, width / 2, height),
b.translate(rail_grid, -width / 2, height),
}

rail_grid = b.single_pattern_overlap(rail_grid, width, 2 * height)
rail_grid = b.translate(rail_grid, 1 - spawn_position.x, 1 - spawn_position.y)
rail_grid = b.rotate(rail_grid, rad(90)) -- makes it look like playing cards rather than bricks
end

return {
{
name = 'coal',
tiles = { 'landfill' },
start = 1,
weight = 1,
ratios = {
{ resource = b.resource(rail_grid, 'coal', ore_density_rail), weight = 1 },
{ resource = b.resource(rail_grid, 'stone', ore_density_rail), weight = 1 },
},
},
{
name = 'iron-ore',
tiles = { 'nuclear-ground' },
start = 1,
weight = 1,
ratios = {
{ resource = b.resource(b.invert(rail_grid), 'iron-ore', ore_density_block), weight = 9 },
{ resource = b.resource(b.invert(rail_grid), 'copper-ore', ore_density_block), weight = 7 },
{ resource = b.resource(b.invert(rail_grid), 'coal', ore_density_block), weight = 4 },
{ resource = b.resource(b.invert(rail_grid), 'stone', ore_density_block), weight = 1 },
},
},
}
92 changes: 92 additions & 0 deletions map_gen/maps/danger_ores/config/joker_starter_area.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
local b = require 'map_gen.shared.builders'

local mine_speed = 0.5 / 10 -- 0.5 ore/s per electric mining drill
local low = 60 * 60 * 4 * mine_speed -- 4h
local medium = 60 * 60 * 24 * mine_speed -- 24h

local low_value = b.exponential_value(low, 0.07, 1.45)
local medium_value = b.exponential_value(medium, 0.07, 1.45)

return {
{
name = 'copper-ore',
tiles = {
[1] = 'red-desert-0',
[2] = 'red-desert-1',
[3] = 'red-desert-2',
[4] = 'red-desert-3'
},
start = 1,
weight = 1,
ratios = {
{resource = b.resource(b.full_shape, 'iron-ore', medium_value), weight = 15},
{resource = b.resource(b.full_shape, 'copper-ore', medium_value), weight = 70},
{resource = b.resource(b.full_shape, 'stone', medium_value), weight = 10},
{resource = b.resource(b.full_shape, 'coal', medium_value), weight = 5}
}
},
{
name = 'coal',
tiles = {
[1] = 'dirt-1',
[2] = 'dirt-2',
[3] = 'dirt-3',
[4] = 'dirt-4',
[5] = 'dirt-5',
[6] = 'dirt-6',
[7] = 'dirt-7'
},
start = 1,
weight = 1,
ratios = {
{resource = b.resource(b.full_shape, 'iron-ore', low_value), weight = 18},
{resource = b.resource(b.full_shape, 'copper-ore', low_value), weight = 9},
{resource = b.resource(b.full_shape, 'stone', low_value), weight = 8},
{resource = b.resource(b.full_shape, 'coal', low_value), weight = 65}
}
},
{
name = 'iron-ore',
tiles = {
[1] = 'grass-1',
[2] = 'grass-2',
[3] = 'grass-3',
[4] = 'grass-4'
},
start = 1,
weight = 1,
ratios = {
{resource = b.resource(b.full_shape, 'iron-ore', medium_value), weight = 75},
{resource = b.resource(b.full_shape, 'copper-ore', medium_value), weight = 13},
{resource = b.resource(b.full_shape, 'stone', medium_value), weight = 7},
{resource = b.resource(b.full_shape, 'coal', medium_value), weight = 5}
}
},
{
name = 'stone',
tiles = {
[1] = 'sand-1',
[2] = 'sand-2',
[3] = 'sand-3'
},
start = 1,
weight = 1,
ratios = {
{resource = b.resource(b.full_shape, 'iron-ore', medium_value), weight = 25},
{resource = b.resource(b.full_shape, 'copper-ore', medium_value), weight = 10},
{resource = b.resource(b.full_shape, 'stone', medium_value), weight = 60},
{resource = b.resource(b.full_shape, 'coal', medium_value), weight = 5}
}
},
{
name = 'uranium-ore',
start = 1,
weight = 1,
ratios = {
{
resource = b.resource(b.full_shape, 'uranium-ore', function() return 1e6 end),
weight = 1
},
}
}
}
8 changes: 7 additions & 1 deletion map_gen/maps/danger_ores/configuration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ return {
prevent_quality_mining = {
enabled = true,
},
radioactivity = {
enabled = true,
},
rocket_launched = {
enabled = true,
win_satellite_count = 1000,
Expand All @@ -84,7 +87,7 @@ return {
draw_resource_selection = false,
technology_price_multiplier = 25,
manual_mining_speed_modifier = 1,
always_day = true,
always_day = false,
peaceful_mode = true,
enemy_evolution = {
enabled = true,
Expand Down Expand Up @@ -128,6 +131,7 @@ return {
enemy_factor = 10 / (768 * 32),
enemy_max_chance = 1 / 6,
enemy_scale_factor = 32,
enemy_starting_radius = 64,
-- Additional parameters
ore_width = nil,
spawn_tile = nil,
Expand All @@ -138,6 +142,8 @@ return {
main_ores_start_ore_offset = nil,
main_ore_resource_patches_config = nil,
spawner_names = nil,
spawn_builder = nil,
tile_builder = nil,
tree_names = nil,
},
}
3 changes: 2 additions & 1 deletion map_gen/maps/danger_ores/modules/enemy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ return function(config)
local max_chance = config.enemy_max_chance or 1 / 6
local scale_factor = config.enemy_scale_factor or 32
local seed = config.enemy_seed or seed_provider()
local starting_radius = config.enemy_starting_radius or 64

local sf = 1 / scale_factor
local m = 1 / 768
Expand All @@ -28,7 +29,7 @@ return function(config)

local d = sqrt(world.x * world.x + world.y * world.y)

if d < 64 then
if d < starting_radius then
return nil
end

Expand Down
10 changes: 6 additions & 4 deletions map_gen/maps/danger_ores/modules/map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local default_ore_builder = require 'map_gen.maps.danger_ores.modules.ore_builde
local perlin_noise = Perlin.noise
local floor = math.floor

local function spawn_builder(config)
local function default_spawn_builder(config)
local spawn_circle = config.spawn_shape or b.circle(64)
local spawn_tile = config.spawn_tile or 'grass-1'
local spawn_water_tile = config.spawn_water_tile or 'water'
Expand All @@ -25,7 +25,7 @@ local function spawn_builder(config)
return b.change_map_gen_collision_tile(start, 'water_tile', spawn_tile)
end

local function tile_builder_factory(config)
local function default_tile_builder(config)
local tile_builder_scale = config.tile_builder_scale or (1 / 64)
local seed = seed_provider()

Expand All @@ -51,14 +51,16 @@ end

return function(config)
local ore_builder = config.ore_builder or default_ore_builder
local spawn_builder = config.spawn_builder or default_spawn_builder
local tile_builder = config.tile_builder or default_tile_builder
local map
Global.register_init({}, function(tbl)
tbl.seed = RS.get_surface().map_gen_settings.seed
tbl.random = game.create_random_generator(tbl.seed)
end, function(tbl)
local spawn_shape = spawn_builder(config)
local water_shape = (config.water or empty_builder)(config)
local tile_builder = tile_builder_factory(config)
local tile_shape = tile_builder(config)
local trees_shape = (config.trees or no_op)(config)
local enemy_shape = (config.enemy or no_op)(config)
local fish_spawn_rate = config.fish_spawn_rate
Expand All @@ -74,7 +76,7 @@ return function(config)

local random_gen = tbl.random
random_gen.re_seed(tbl.seed)
map = main_ores_builder(tile_builder, ore_builder(ore_builder_config), spawn_shape, water_shape, random_gen)
map = main_ores_builder(tile_shape, ore_builder(ore_builder_config), spawn_shape, water_shape, random_gen)

if enemy_shape then
map = b.apply_entity(map, enemy_shape)
Expand Down
1 change: 1 addition & 0 deletions map_gen/maps/danger_ores/modules/map_poll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ local maps = {
{ name = 'danger-ore-hub-spiral', display_name = 'Hub-spiral (with void)', mod_pack = mod_packs.danger_ore_normal },
--{ name = 'danger-ore-industrial-revolution-3', display_name = 'Industrial Revolution 3 (default)', mod_pack = mod_packs.danger_ore_ir3 },
--{ name = 'danger-ore-industrial-revolution-3-grid-factory', display_name = 'Industrial Revolution 3 Grid Factory (squares)', mod_pack = mod_packs.danger_ore_ir3 },
{ name = 'danger-ore-joker', display_name = 'Joker (4 suits start)', mod_pack = mod_packs.danger_ore_normal },
{ name = 'danger-ore-krastorio2', display_name = 'Krastorio2 (landfill)', mod_pack = mod_packs.danger_ore_krastorio2 },
{ name = 'danger-ore-landfill', display_name = 'Landfill (all tiles)', mod_pack = mod_packs.danger_ore_normal },
{ name = 'danger-ore-lazy-one', display_name = 'Lazy One (no handcraft)', mod_pack = mod_packs.danger_ore_normal },
Expand Down
Loading