Subsurface - build beneath your base!

by Natha

While everyone is looking up to space, other planets and the rest of the universe, there is a whole world buried directly underneath us...

Content
23 hours ago
1.1 - 2.0
2.14K
Environment Mining

g Great improvement BUT only vanilla resources.

8 months ago

Hello,

I have been testing it. I really like the prospecting idea really awesome but. I could find about 7 patches only iron, copper and crude oil. Is this normal? I am having 35 resources with BZ and kickel and so on but I could not find any of them. I also saw a hardcoded table where only are the vanilla resources.
Could you add the posibility to add other resources that are in the map-gen settings such as aluminum, rare metals or cobaltite?

Thank you so much keep up the good work!

8 months ago

Yeah I'll add a remote interface for other mods to manipulate the autoplacers.
There is no way to "automate" it since the engine can't tell which resource is rare and therefore could be found only in depths. There have to be compatibility tables for each mod that adds resources, but nevertheless it's only possible by hardcoding. Even gameplay with multiple mods, like yours, could offer more flexible placement opportunities than just one of these mods.

I only know some BZ mods and SE. For BZ I had the idea to move titan and diamond to the underground. For SE, either (1) all resources of other planets to the underground, (2) just some like beryll, holminite, cryonite, vulcanite (the planet's primary resource) or (3) all except the primary resource. But then you can't just choose planets based on their resource patches because you simply don't see them.

Maybe you could add such tables for your mods in the same format as the vanilla one.

8 months ago

Hello again!.
An interface is great but there is a way or at least this mod gets it somewhere, bz I just installed and has all the added resources out of the box:
https://mods.factorio.com/mod/ChangeMapSettings

8 months ago
(updated 8 months ago)

here is how the resources are fetched.

/c
local zone=remote.call("space-exploration", "get_zone_from_name", {zone_name = "Nauvis"})

for _, control in pairs(game.autoplace_control_prototypes) do  
   if control.category == "resource" then     
    if zone.controls[control.name] then
      local zone_controls= zone.controls[control.name]
      game.player.print(control.name .. " " .. zone_controls.frequency .. " " .. zone_controls.richness)

    else
        game.player.print(control.name .. " " .. 0 .. " " .. 0) 
    end   
end
end

I have the mod disabled and still works.
with this you can generate any resources without an interface. I would match the richness and apply the depth.

I have Added this in the resources.lua:

function make_autoplace_controls(topname, depth)

local zone=remote.call("space-exploration", "get_zone_from_name", {zone_name = (topname:gsub("^%l", string.upper))})
res_table={}
for _, control in pairs(game.autoplace_control_prototypes) do  
   if control.category == "resource" then     
    if zone.controls[control.name] then
      local zone_controls= zone.controls[control.name]
      local freq=zone_controls.frequency
      local rich=zone_controls.size
      local siz=zone_controls.richness

if control.name=='crude-oil' or control.name=='adamo-carbon natural-gas' or control.name=='mineral-water' then
siz=siz*0.01
end
-- This is for mods added after space exploration.
if freq==0 and rich==0
then

        freq=1
        rich=1
        siz=1
    end
    -- end of exception
      local res={
        frequency = freq*(1+depth*0.2),
        size = rich*(1+depth*0.2),
        richness = siz*(1+depth*0.2)

      }

      res_table[control.name]=res;
    end   
end
end

return res_table

end

It works like wonders.

Adapt it to your needs

8 months ago

here is how the resources are fetched.

/c
local zone=remote.call("space-exploration", "get_zone_from_name", {zone_name = "Nauvis"})

for _, control in pairs(game.autoplace_control_prototypes) do  
   if control.category == "resource" then     
    if zone.controls[control.name] then
      local zone_controls= zone.controls[control.name]
      game.player.print(control.name .. " " .. zone_controls.frequency .. " " .. zone_controls.richness)

    else
        game.player.print(control.name .. " " .. 0 .. " " .. 0) 
    end   
end
end

I have the mod disabled and still works.
with this you can generate any resources without an interface. I would match the richness and apply the depth.

I have Added this in the resources.lua:

function make_autoplace_controls(topname, depth)

local zone=remote.call("space-exploration", "get_zone_from_name", {zone_name = (topname:gsub("^%l", string.upper))})
res_table={}
for _, control in pairs(game.autoplace_control_prototypes) do  
   if control.category == "resource" then     
    if zone.controls[control.name] then
      local zone_controls= zone.controls[control.name]
    local freq=zone_controls.frequency
    local rich=zone_controls.size
    local siz=zone_controls.richness

if control.name=='crude-oil' or control.name=='adamo-carbon natural-gas' or control.name=='mineral-water' then
siz=siz*0.01
end
-- This is for mods added after space exploration.
if freq==0 and rich==0
then

      freq=1
      rich=1
      siz=1
  end
  -- end of exception
    local res={
      frequency = freq*(1+depth*0.2),
      size = siz*(1+depth*0.2),
      richness = rich*(1+depth*0.2)

    }

    res_table[control.name]=res;
    end   
end
end

return res_table
end

It works like wonders.

Adapt it to your needs

8 months ago

Thats good. But since zone_controls.frequency differs from map-gen-settings frequency value, I would use the latter

8 months ago

zone_controls is matching the SE zone settings for the planets and orbits

8 months ago

Hello! I saw your changes. Very well but I would definetly change the settings for the fluid resources. They are spawning too many too close.
Add this into the resources.lua to make it balanced:
if control.name=='crude-oil' or control.name=='adamo-carbon natural-gas' or control.name=='mineral-water' then
siz=siz0.1
freq=freq
0.1
end

New response