Spaceblock


Who wants to go planetside? It's dirty and disgusting, doesn't support engineer life, and has an unpleasant smell. Why not instead grow the factory from orbit?

Mod packs
a day ago
2.0
985
Factorio: Space Age Icon Space Age Mod
Planets Environment

b IMPORTANT Asteroid spawning solution

2 days ago
(updated 2 days ago)

After some tinkering I came up with this ratio. Due to the fact it is adding asteroids to the pool instead of replacing existing asteroids any amount of extra asteroids does increse difficulty but there is no better way since reducing vanilla asteroids would introduce a risk of resource shortages.

local planet = data.raw["planet"]["nauvis"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "orbital-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.01, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

local planet = data.raw["planet"]["vulcanus"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "rocky-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-rocky-asteroid",
probability = 0.025, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

planet = data.raw["planet"]["fulgora"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "scrap-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-scrap-asteroid",
probability = 0.025, -- tweak spawn frequency relative to others
speed = 0.5, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

planet = data.raw["planet"]["gleba"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "alien-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-alien-asteroid",
probability = 0.025, -- tweak spawn frequency relative to others
speed = 0.5, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

planet = data.raw["planet"]["aquilo"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "fluorite-asteroid-chunk",
probability = 0.001, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-fluorite-asteroid",
probability = 0.005, -- tweak spawn frequency relative to others
speed = 0.5, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "big-fluorite-asteroid",
probability = 0.002, -- tweak spawn frequency relative to others
speed = 0.5, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

[deleted message]
[deleted message]
[deleted message]
2 days ago

Oh just ignore later messages I have no idea how to properly edit messages not to mention delete them. Sorry for the mess ;)

2 days ago

After some tinkering I came up with this ratio. Due to the fact it is adding asteroids to the pool instead of replacing existing asteroids any amount of extra asteroids does increse difficulty but there is no better way since reducing vanilla asteroids would introduce a risk of resource shortages.

Edit: Further corrected values (I still find new asteroids excessive ond suggest a further /2 probability reducton as well as angle reduction for non-chunks) I leave fine tuning properties to others to increase sample size.

local planet = data.raw["planet"]["nauvis"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "orbital-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.01, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

local planet = data.raw["planet"]["vulcanus"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "rocky-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-rocky-asteroid",
probability = 0.025, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

planet = data.raw["planet"]["fulgora"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "scrap-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-scrap-asteroid",
probability = 0.025, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

planet = data.raw["planet"]["gleba"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "alien-asteroid-chunk",
probability = 0.01, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-alien-asteroid",
probability = 0.025, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

planet = data.raw["planet"]["aquilo"]
if planet then
planet.asteroid_spawn_definitions = planet.asteroid_spawn_definitions or {}
table.insert(planet.asteroid_spawn_definitions, {
type = "asteroid-chunk", -- keep as-is
asteroid = "fluorite-asteroid-chunk",
probability = 0.001, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "medium-fluorite-asteroid",
probability = 0.005, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
table.insert(planet.asteroid_spawn_definitions, {
type = "entity", -- keep as-is
asteroid = "big-fluorite-asteroid",
probability = 0.002, -- tweak spawn frequency relative to others
speed = 0.05, -- optional: orbital drift
angle_when_stopped = 1.0, -- optional
})
end

2 days ago

Oh god I have no idea how to edit messages, this thread is such a mess. Could you please sanitise it so it is more readable?

Deleted the human errors, can't do anything for readability, since... code :P

a day ago

Oh don't worry about it editing messages on the forum is a bit of a struggle for me. Only the lates message with code is important. You could also just wipe this thread since you got the code already and it will be archived inside the mod itself.

I'll have to find and reverte your changes to resistances but over all everything seem to work. Asteroid speed is fine, I did update angles to reflect vanilla asteroids but as mentioned I think there may be too many asteroids spawning, that being said I fly at 200km/h so I'd say 20% spawn reduction would be the most I'd do.

Yeah it seems a little high. But bugfixing called for an immediate release :P

a day ago

Oh don't worry if someone complains you can halve it then or just do it in the next update I struggle the most with finding ratios for Aquilo but most importantly planetary asteroids start spawning too fast maybe giving them more of a Logistic function esque curve would be a good idea or possibly maxing out pefore reaching the planet (peak about 1/4 from source) that way you could have lower spawns on stationary orbit and when begining the journey to the planet while incresing mid journey rates.

Sidenote I have no idea how to aply functions to spawnrates and don't know where to ask for advice.

New response