Resource regen with new seed?

Replaces resource spawning system, so that the distances between resources are much bigger. Railway is needed then.

Moderators: orzelek, Dark

Post Reply
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Resource regen with new seed?

Post by FuryoftheStars »

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. :)
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

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Resource regen with new seed?

Post by FuryoftheStars »

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?
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

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Resource regen with new seed?

Post by orzelek »

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.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Resource regen with new seed?

Post by FuryoftheStars »

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

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Resource regen with new seed?

Post by orzelek »

I've added new command:

Code: Select all

/rso-seed-override [new seed number]
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.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Resource regen with new seed?

Post by FuryoftheStars »

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

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Resource regen with new seed?

Post by BlueTemplar »

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.)
BobDiggity (mod-scenario-pack)

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Resource regen with new seed?

Post by FuryoftheStars »

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?
  1. 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.
  2. 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.
I think with those included it would make this setup perfect. :)
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

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2485
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Resource regen with new seed?

Post by FuryoftheStars »

I decided to try this out and edited my copy of your mod. I changed the seedCommand function to below:

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
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 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)
:D
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

Post Reply

Return to “Resource Spawner Overhaul”