Resource Spawner Overhaul - Old discussion thread

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

Moderators: orzelek, Dark

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

Resource Spawner Overhaul - Old discussion thread

Post by orzelek »

I'm starting new thread to help with maintenance of the mod.
Original mod author is Dark - kudos to him for all the complex logic inside :)

Original thread with info about mod and instructions: https://forums.factorio.com/forum/vie ... =14&t=4761
Functionality described there should be working. I'm currently maintaining the mod.

Releases and changelog moved to own thread.
Last edited by orzelek on Wed May 27, 2015 9:34 pm, edited 2 times in total.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by TheSAguy »

Hey Orzelek,

Thanks for keeping this updated!

When I change the "Global Richness Muli" to less than 1, like 0.9 most of my resources all go to a value of 50. It seems to have the same effect for anything less than 1. Can it not go less than one?

Image

Thanks.
Ailure
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat Apr 11, 2015 3:30 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by Ailure »

Thinking about starting a new game with RSO. So what is fun settings to try out for someone who want it more spread out so trains have a more of a purpose? :) Also what's the advantage of letting RSO control the alien spawns compared to vanilla?
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Added new version with fix for the richness multiplier breaking resource amounts (Strange case of game.createentity reacting to floating point amount value by creating 50 unit resource).

Default configuration should be enough to get some trains going.

Enemy spawner control gives 2 benefits:
  • it makes enemy bases more scarce - it's easier to actually scout for resources
  • there is a bit of enemy base gradation - depending on distance from center turrets will get gradually from small to large ones
Currently override spawn option drops both normal enemy and resource spawns so you need it enabled.
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by n9103 »

PTW
Glad to see RSO's being revived/maintained for more recent versions. :)

Suggestion: Offer downloads of previous versions, particularly when updating to support a new version.
Not particularly applicable yet, since it's only been a few minor bugfix versions recently released, but last time I checked this wasn't a common habit for most Factorio mods.
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

I'm not planning any significant changes to the mod so there is no need to leave older version because of that.

Only reason I changed required version to 11 in title is that I didn't test it on earlier one. I think that json file might still have 10 in it.
When we get 12 and others if anything breaks compatibility I'll leave older version for sure. Updates will be done only on latest one.
Klop1324
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed May 20, 2015 8:11 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by Klop1324 »

I've tried retroactively regenning my world, and it doesnt appear to work, should it be working?

i used this command: remote.call("RSO", "regenerate")
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

I admit I did not dare to enter that area yet.
I did not check if it works - it would seem that it doesn't then. I can try to look into it but no promises.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Klop1324 wrote:I've tried retroactively regenning my world, and it doesnt appear to work, should it be working?

i used this command: remote.call("RSO", "regenerate")
I did a quick test.
On new game I rolled 2k by 2k area and then triggered the regenerate command.
Game was thinking for long time and resources were regenerated.

I used then the re-roll version:

Code: Select all

/c remote.call("RSO", "regenerate", true)
It redid resources again this time in different configuration.

Additional note - minimap and map will not update to reflect new resources/bases till scanned by radar or walked through.

Can you give me a bit more details about conditions in which it's not working for you?

To clarify a bit:
- it won't touch starting area (on default settings it's about -112, -112 to 112, 112 rectangle)
- regenerate without true as parameter will try to reproduce original resource configuration (it should be perfect actually due to determinism), launched with true it will create new seed and recreate all resources and biter bases with new layout
Trev_lite
Inserter
Inserter
Posts: 43
Joined: Sat Mar 28, 2015 9:20 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by Trev_lite »

i'm playing with endless resources mod and my oil wells in the starting area are around 3-4k%. when i play with finite resources they are around 300-600% so i do not think this is normal.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Trev_lite wrote:i'm playing with endless resources mod and my oil wells in the starting area are around 3-4k%. when i play with finite resources they are around 300-600% so i do not think this is normal.
That might be endless resources mod effect. If it modifies certain value in oil resource (namely the normal parameter) the percentage displayed will be different for resource while actual amount under it will remain the same.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by TheSAguy »

Morning Orzelek,

First off, thanks for all the comments already in the code, they are much appreciated!

I’m trying to understand some of the settings a little better and was hoping you could help me out.
I’d like to understand the interaction of “override_normal_spawn” and “override_type”
So per the notes, if override_normal_spawn = true, then only RSO will be sued for Spawns. Does that mean “override_type” will have not affect?

There are four combinations:

Setting 1:

Code: Select all

override_normal_spawn = true
override_type = 'full'
Assumption: With this setting all resource spawns, including aliens will be handled by RSO?


Setting 2:

Code: Select all

override_normal_spawn = true
override_type = 'partially'
Assumption: Since override_normal_spawn = true, I’m assuming override_type will have no affect?

Setting 3:

Code: Select all

override_normal_spawn = false
override_type = 'full'
Assumption: Don’t know what happens here, since the first statement says RSO and Vanilla spawns are used, but the second statement says no game spawns allowed.

Setting 4:

Code: Select all

override_normal_spawn = false
override_type = 'partially'
Assumption: Here I’m assuming just Vanilla is used, no RSO?



Appreciate the feedback.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

It seems that currently only override matters. If you set override to false then standard generation for both ores and biters stays enabled. That means that whatever mod creates will be added to that.

Partial generation is no longer supported at all - all standard resource generation gets disabled with override flag.

Also to be clear - RSO generation is always added. You can drop biters specifically with disable_RSO_biter_spawning - this would mean you will end up with no biters at all with override option enabled.

I think that those options should be removed probably - thats my personal opinion tho. I don't see point in using RSO with standard generation enabled and asking user to set resources to none on map gen settings. It might be useful for some people I guess?
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by TheSAguy »

My next question is regarding “absolute_resource_chance=0.60” & “allotment=90”

I’m assuming “absolute_resource_chance” is a global value and ALL resources (not Aliens) will be affected by this. The chance of the resource showing up is 60%
But is that then multiplied by “allotment” for each resource. So if iron has an allotment of 90, the chance of it showing up on a region will be 60% * 90% = 54%?


Multi Resources: Once the initial resource has spawned, this is the chance of other resources appearing with the initial resource. In the Iron Example, there is a 50% chance of it triggering and if triggered, the following resources could appear and the chance of them happening:
Iron 2%
Copper 4%
Coal 4%
Stone 4%

And if one of them appears/spawn, the size and richness will be the initial resource * “multi_resource_richness_factor=0.60” and the size will be initial resource * “multi_resource_size_factor=0.40” from the config.lua file.

Iron Example
A value that does not seem to work is “min_amount=350”. Unless this is divided by something else, I have resource piles much smaller than 350.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by TheSAguy »

In my current game, some of my resource fields seem very big.

Here is a map of my game. I’ve highlighted some extremely large resource fields.
MAP
The red circles are zinc fields. This is the setup for Zinc:
Zinc Settings
Why would those fields be so large?

I’m assuming if I want smaller fields, but just I have to drastically reduce the max setting?
Is there anything else that affects the size of the field?

The “Richness_distance_factor=1.030” should only affect the richness not size.

Thanks.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

You are right about absolute_resource_chance - it's an actual value rolled against to check if anything generated in given region. If there is a lot of ores (using many mods etc) it can make more rolls per region with reduced chances ( -0.2 per roll up to 3 rolls total).

Allotments work in completely different way - they are really hard to translate into actual chance directly since it depends on total sum of allotments for all ores.
Allotment is treated as a weight - all allotments are summed up and value is rolled in range from 0 to total. Table with those ranges is preserved for each ore - ore which allotment was hit will be spawned.

In the end chance to spawn given ore is equal to it's allotment/total of all allotments.

For multispawn the chance given there is also absolute and when it gets hit it will spawn. Allotments work exactly as for main spawn but are chosen from the small list given in multi_resource section. Any resource generated will have it's size and richness multiplied by those two factors (multi_resource_richness_factor and multi_resource_size_factor). Additionally there is a chance that more then one of them gets to appear and multi_resource_chance_diminish determines chances for that. It uses exponential diminishing base on amount of resources already spawned in given region.

min_amount is not used directly - it can be divided by 3 from what I can see due to way that resources spawn. It gets dispersed between 3 groups of spawned resources - details about that are known to original author (Dark) mostly :)


As for those big fields - there is a certain amount of complex code around generation of actual resource field. To figure out what leads to such big field some debug would be needed. I think that it might get its richness more distributed then around larger area. Figuring out details of that would require lots of time on debug/analysis or original authors help :D
User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by Takezu »

Somethin i might have missed. Lost sight in the old thread.
Does RSO works with Bob Ore's?
I mean will it generate Nickel when Galena only gives lead and Nickel Ore is enabled?
Or in generell will it spawn the Ores at all and/or is there something i should look out for?
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Takezu wrote:Somethin i might have missed. Lost sight in the old thread.
Does RSO works with Bob Ore's?
I mean will it generate Nickel when Galena only gives lead and Nickel Ore is enabled?
Or in generell will it spawn the Ores at all and/or is there something i should look out for?
I'm not sure about Nickel - I think that option wasn't added. All other ores for bob's mods and DyTech are working properly.
If you start up the game with RSO it will print out errors for 1st player now if some ores are present but not supported. Post them here and I'll add them.
User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by Takezu »

Well I've found none missing ore so far. Didn't get an error and after two quick new maps
with forced exploration and Regeneration call i've found all "additional", well configurable, Ores.
Nickel, Sulfure, Cobaltiet all there.
And a horde of biters and spitters :|
not even a chance to get a Rail to the next Iron, but well i guess can't have it all. ^^
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by SHiRKiT »

Congrats on continuing the original mod. I wish only the best to you. Thanks for doing this for the community.
Locked

Return to “Resource Spawner Overhaul”