Resource regen with new seed?
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Resource regen with new seed?
Hey, so the commands in the top pinned announcement thread concerning regening resources doesn't appear to work with the new seed option. I found an old thread from back when 0.17 apparently first dropped and there was a comment in there about how that feature had been removed.
Any chances of getting it back? Or if it was, can you point me to any documentation on it (which I'm obviously not finding atm)?
I've had a couple map seeds so far where I absolutely loved the terrain layout, but the resource spawns just sucked balls. I had one even where after running the chart command in a 2048 radius it only revealed 4 resource patches... 2 stone, 1 uranium, and the other I think was the deep oil from Cargo Ships mod. I would've loved a command on those maps that would have wiped what was spawned and retried with a new seed.
Any chances of getting it back? Or if it was, can you point me to any documentation on it (which I'm obviously not finding atm)?
I've had a couple map seeds so far where I absolutely loved the terrain layout, but the resource spawns just sucked balls. I had one even where after running the chart command in a 2048 radius it only revealed 4 resource patches... 2 stone, 1 uranium, and the other I think was the deep oil from Cargo Ships mod. I would've loved a command on those maps that would have wiped what was spawned and retried with a new seed.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Resource regen with new seed?
Oh, should probably add in here that if this feature is restored, the ability to export the used seed and then import/manually specify it in the regen command would be ideal.
So, because of my play style (relaxed, take my time, resources spread far out to force using of trains, but still with biters and allow them to expand), I tend to look for maps that have easily defensible starting areas. However, due to some of them having crap spawns for resources, I'll first load up the map, run the chart command for a wide area (anywhere from 2048 to 4096 radius) and see what the resource layout looks like. Ideally, if the ability to regen resources with a new seed was reintroduced, if I found a map that I liked the terrain layout but hated the resource spawn, I'd regen the resources with a new seed until it looked at least doable. But then I'd want a way to export this seed so that I could then restart the map without everything already charted and revealed and then just change the seed right away to the one I liked. Oh... maybe if this seed was just simply saved to and taken from a global setting? Wouldn't even need to run the regen command on restarting the map then, right?
So, because of my play style (relaxed, take my time, resources spread far out to force using of trains, but still with biters and allow them to expand), I tend to look for maps that have easily defensible starting areas. However, due to some of them having crap spawns for resources, I'll first load up the map, run the chart command for a wide area (anywhere from 2048 to 4096 radius) and see what the resource layout looks like. Ideally, if the ability to regen resources with a new seed was reintroduced, if I found a map that I liked the terrain layout but hated the resource spawn, I'd regen the resources with a new seed until it looked at least doable. But then I'd want a way to export this seed so that I could then restart the map without everything already charted and revealed and then just change the seed right away to the one I liked. Oh... maybe if this seed was just simply saved to and taken from a global setting? Wouldn't even need to run the regen command on restarting the map then, right?
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Re: Resource regen with new seed?
It seems that new seed option was lost on one of upgrades.
When it worked it caused new seed to be randomly generated and I think I could get that back to working state easily.
Entering new seed might get a bit tricky since there is a second parameter to regenerate now and I'd need to do something like passing seed as 0 does nothing.
When it worked it caused new seed to be randomly generated and I think I could get that back to working state easily.
Entering new seed might get a bit tricky since there is a second parameter to regenerate now and I'd need to do something like passing seed as 0 does nothing.
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Resource regen with new seed?
Ok. If it's something you are willing to look into and get working, that'd be great. If not, I understand.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Re: Resource regen with new seed?
I've added new command:
You can use it to give RSO any number as a seed and it will use it for subsequent generation.
I've also updated instructions thread with actual /rso-* commands that should be used now.
Code: Select all
/rso-seed-override [new seed number]
I've also updated instructions thread with actual /rso-* commands that should be used now.
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Resource regen with new seed?
Thanks! I'll give this a try next opportunity I get!
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
- BlueTemplar
- Smart Inserter
- Posts: 2817
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Resource regen with new seed?
Damn, now this is something that I could have used before, thanks a lot !
(Changing resource map/RSO settings a bit prior to regenerating kind of worked too.)
(Changing resource map/RSO settings a bit prior to regenerating kind of worked too.)
BobDiggity (mod-scenario-pack)
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Resource regen with new seed?
Hi orzelek,
Just had some time to try this out. It does work, though is a bit cumbersome (for me) at the moment.
2 additional requests to this if you could?
Just had some time to try this out. It does work, though is a bit cumbersome (for me) at the moment.
2 additional requests to this if you could?
- For /rso-override-seed, allow a parameter that will cause RSO to generate its own seed without the need of the player to manually input one. EX: a parameter of -1 will cause it to run a "math.random(0,2147483647)" (or whatever the max actually is. You mention a little over 2,000,000,000, but I've seen over 4,000,000,000 get generated by the game when clicking the random seed button) and then use that result as the new seed.
- Somehow allow the player to see the seed that is being used for resource generation. Either via the /rso-override-seed command automatically printing to console the seed used, or via a separate command, something like /rso-export-seed, doing the same.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Resource regen with new seed?
I decided to try this out and edited my copy of your mod. I changed the seedCommand function to below:
This seemed to work well. As I was using it, though, I started thinking to myself how much easier it'd be if I could just run 1 command vs 3....
Code: Select all
function seedCommand(parameters)
global.mapSeedOverride = nil
if parameters and parameters.parameter then
local seed = tonumber(parameters.parameter)
if seed < 0 then
seed = math.random(0,4294967295)
end
game.player.print("RSO new seed: " .. seed)
global.mapSeedOverride = seed
end
end
Code: Select all
function regenNewSeedCommand(parameters)
local parameter = nil
clearCommand(parameters)
if parameters and parameters.parameter then
parameter = parameters.parameter
end
parameters.parameter = -1
seedCommand(parameters)
parameters.parameter = parameter
regenerateCommand(parameters)
end
[...]
commands.add_command("rso-regen-with-new-seed", "", regenNewSeedCommand)
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics