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: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

I'm looking for feedback about how plenty ores are when found. And how starting area behaves since I was improving it's consistency.
How nasty rng is is also ok but that happens - I'm investigating it usually if it looks way out of hand.

As for regenerate between versions - there were so many changes that when you call regen on 1.1 after update you will get all current ores deleted and a completely new distribution placed around the map. It won't affect starting area since it's excluded from regens.

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

Well bit advancend map for that kind of gamble.

Have got Eletronics T2 and Blue since up and running and all relys heavyli on trains.
Almost everything except copper comes per cargo. Would be a pain.
But when i don'T regen there should be no difference whatsoever in the generatet portion of the map?
Hesitating a bit to update because, even if the rng was a bit harsh, the main things you need to get up and running where present
and the fairly planned out railway lays waiting to be expandet moving all that stuff again would be a pain in the ^^

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

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

I did not check upgrade of alive game - as far as I know there will be no side effects. New resource generation will be applied to stuff that will be generated after the upgrade.

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

Okay then i'll check that.

Meanwhile i've made a new map and holy crap thats a sh... ton of oil.
I suspect you didn't intend oilwells with up to 3000% Yield?
Seems there yield is multiplied at least by 10. and there are too many i mean really many found 3 - 5 fields with 5 - 9 wells
in 1024/1024 around the starting area.
Also most ore patches aren't bigg enough to fit more then 2 miners? intendet?

I'm debeating if i like the "Donuts" would be nice to have a choise to turn them of.

Well if you play with Roadworks and Bobs ores, it seems that Limestone (Roadworks) is prefered about tin.
Like last map if found enough lime to concrete the starting area many many times but tin is much harder to get,
which is in a bobs suboptimal (no tin = no blue since)(Edit: Could also be bad RNG)
Also the gems ore seems to me to rare, only found a tiny patch, not that i really used it before but that seems
a bit to rare to me. (Edit: Nevermind bad RNG spawns okay)
The other distribution looks good as far as i can tell.
Got some Nickel in the starting area.

I'Ve used the standard configs, think i'll raise the size a bit and eventually decrase the richness,
if i understand correctly that should make the patches bigger but overall less yielding?
As a sidenote: Are decimals like 1.5 valid inputs for the multipliers and whats the range to work with? (Nevermind tested works with decimals)

Edit: Holy moly, 40k Ore in one tile? but the field it'se is barly big enough to fit to miners. I don't know, it will last a while but geting this by train would take forever.
Where in the old versions it was the other way around, my train system qould be screwed over. I usually build Big (5 Cargo) Trains that hold only on one mine, this system would force me to use a lot more smaller trains (which i generally would dislike because well i live in a region wher cargo an ore trains where long, and i mean really long 40 and mor wagons) ore build the system so that i'd can have one train for multiple mines. Which isn't bad but i don't know seems to me more prone to jam up.

Edit 2: Okay i think thats major. The multiplier affects the starting area. Ramping up the size makes trains obsolet, i've got so much ore in the starting area to practically never never run out. I don't think thats how it should be. Works on the other hand beautiful outside the starting area.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by TheSAguy »

I second that on the oil :)
Image

I personal don't like the doughnut shaped resources... I was wondering if there was a way to make it optional?

bloodgiver
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun May 31, 2015 1:26 am
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by bloodgiver »

Yep, richness of deposits is way too high!
Decent in size iron patch that normally would have 1 mil ore, now has 15mil :D
Oil deposits now have 30k-50k% - insane :D

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

Thats the multiplier, seems it doesn't work quit as intendet. If i take oil as reference insteadt of two times if got ten times richness. size was almost as comically.

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

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

Hmmmmm those are strange. I haven't seen iron ore fields like that (15 mil is a lot :D).
Were they close to starting area or further out?

As for the oil - size multiplier might increase amount of wells and actual richness I need fix by changing the way it's generated I think. Since it has a total pool now and randomizes how many deposits are you might get 4 normal ones or 1 huge one. I get from feedback here that huge ones are not desired :D
30k% on oil.. how to get this one?

One thing I increased was distance to richness multiplier - it seems that it's much to high now - I might have underestimated exponential function.

As for 1 tile of ore with lots of ore in it - that probably worked by design altho I see how it would look odd. Would be good to know which resource it was but I can see rng creating thing like that.

I will check on limestone rarity and richness - might have forgotten to tweak it this round since I'm not using roadworks.

As for size multiplier working in starting area - it's consistent with richness mod. If you see resources really small after that it would mean that size in configs needs to go up or size/distance factor be increased. I can make it work only outside which might make sense after changes to starting area itself.

Also by popular request donuts will be a config option in next release :D

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

orzelek it was from every ressource a bit. the 40K one was nickel. A pacht barly big enough to fit 3 miners but a sh.. ton of ore in it.

Oil well is my record 9,5K Yield. i think i get whats going on. Your Size to richness multiplier seems to work like intendet, but with unintendet consequences.
I'Ve played around a littel bit using now 1.1 Richness and 1.05 Size.

You said exponental function? i thought the multiplier would be liniear. Which would in my opinion make more sense for a configurable variable.
Was quite suprised that increasing the Size by 2 (meaning upping it to three times), almost the wohle starting area became an ore field with enough
Ore per tile to last through a complete vanilla game... more then two times :D

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

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

There are two multipliers in there - pure size and richness multipliers and pair of distance factors. Distance factor for richness seems to be one of those I underestimated. It's set to 1.3 atm.
As for huge nickel - I can see how it could happen with proper randomness on positive and negative metaballs in ore patch creation. How to prevent it.. no concrete ideas :D I could simply cancel whole resource patch if density exceeds certain amount but that might end badly in the long run.

n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by n9103 »

From what I gather based on posts, that 1.3 is used as an exponential on the distance from start variable?
Unless that distance is being measured in chunks or larger (regions I believe?) then you should stick to something at 1.01 or less.
If it's a linear multiplier instead, then 1.1 should be fine, but I suspect this isn't the case given the results being posted.
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: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

It's set to 1.1 on new version and it's measured in regions - region size is 7 chunks by default so it's quite big.

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

if thats the exponentioal factor, it skyrocktes like the first time.
I don't know the math behind the ore/oil placing but i do know how exponential curves look, up up and away ^^.
0.1 changes are a lot in something like this, maybe not on the first glance but the do.
Maybe the idea of going 0.01 isn't bad?

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

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

I'm not really sure how to handle that one.

Base idea was written by Dark - that you get more resource the further out you go. Scaling factor 1.03 or 1.1 doesn't change that much in ranges that are realistically used. At 10 regions out you'll get about 2.6 times the richness (thats about 2.1k tiles distance). Actual equation used is factor^distance.
Any opinions how good/bad/op or not it is?

For reference average copper near start would be around 300-700k currently (it's a bit random and depends on few things).

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

Well ... i've laid a short while ago 10 stacks of tracks to get nickel. Define me the realistic used ranges ;).

I've had maps with more then 2k rails straight of in one direction to the horizon, because i needet to.

Wouldent it be better to make it both flat out.
I mean, firstly apply the Size/richness factor, then take the result and apply the distances factor.
Like "rolled ress x Sizemodifier x Richnessmodifier = Ress1 x Distance in Regions x Distancefactor."
Or somthing like "rolled ress x Sizemodifier x Richnessmodifier = Ress1 x Distance in Regions^Distancefactor".
The latter would have an exponantial distance gain but use a flat Size/Richness modifier.

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

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

Size and richness modifiers are only applied to their modified value. They work separately until last step where it figures out total deposit amount based on area of it. Richness is only affecting total amount while size affects both potential size of field and then also gets into total amount calculation.

The distance factor is applied separately in a way you described - distance exponent is only used on distance factors and that value is multiplying richness and size respectively. It should be pretty sane right now - we'll see how much resources will be needed in 0.12 :D

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

So if i understand correctly distance times richness and distance times size?

Wouldn't that mean that it weights double?

And would a change to (0.75) times distance times Richness and (0.25) times distance times Size
not only take out the double weight but would also make the richness increase bigger as the size increase.

Sane is something everyone has an other opinon about i think, 15Million per Orefielde is insane, but im sure someone would stand up and say, but i needed 20 Million.
Thinking about that maybe the maximum should be capped somwhere but not plain capped more like a Cap times (Distance^distancefactor)
So that orepatches near start getting not to big but you can be sure somewhere out there is more reward for your effords.

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

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

There are a bit more calculations there.

In overall after merging them it would be around this (dropped multi-resource penalty to simplify a bit):

Code: Select all

size=rgen:random(r_config.size.min, r_config.size.max) * (size_distance_factor^dist)
richness = r_config.richness*(richness_distance_factor^dist)

size = math.ceil(size * global_size_mult)

minAmount = richness * math.pi * (size / 6) * (size / 6) - richness times area of circle with size / 6 radius
maxAmount = richness * math.pi * (size / 4) * (size / 4)
approxDepositAmount = rgen:random(minSize, maxSize)
Minimum ore amount from config will modify that since it's added on top of this calculation. And there are some limits on ore density.
global_richness_mult is applied at the end when resource is spawned so it doesn't affect equations. It's a bit simplified since actual resource size and size calculated here will vary (sometimes heavily as 1 tile ore spawn shown). I have a sharpness modifier that affects actual ore patch size but it's not in config currently. And it's meaning is a bit complex to explain without going into spawning details.

User avatar
Takezu
Fast Inserter
Fast Inserter
Posts: 247
Joined: Sun May 10, 2015 5:46 pm
Contact:

Re: Resource Spawner Overhaul - Discussion thread

Post by Takezu »

I'm no coder whatsoever.

But i'll try, if i red that correctly richness is simple, but the size is pretty much the excat opposite of simple.

Richness = Richness(spwan parameters) times Configfactor times distance (Distancefact^distance
[not the other way around as i thought, but it makes more sense in that way, the other way would make the increase per distance ridiculous])

Size how ever depends not only on the config factor but also on the richness of the deposit?

Another thing i don't quite understand are the fractions in minsize/maxsize, why doubled?

Or am i going total wrong here and the global.multi is the multiplier defined in the config.lua? And the others ar the set values in the generator?

math.pi is that Pi (3.14.......)?
and math.ceil thats something i don't know entirely, i must admit.

That aside, Max and min Size are calculatet values from richness math.pi and i suspect the fractioned size out of the first equation?
And they are in return the upper and lowerlimit for random roll that gives a approximate Size.
Which in the end then varys ... and i suspect this variation is seen when someones approaches the patch, the little oddity we talked about.

you're correct, quite complicated, and even more if you have no idea about lua ^^ i'll guess i should learn one or two things about it.

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

Re: Resource Spawner Overhaul - Discussion thread

Post by orzelek »

Ahh there is one misleading thing there. I fixed it now - last thing is approx amount of ore in deposit ... no idea why I called it size :D

Also writing this here and trying to explain made me realize that maybe actual radius not size should be used for last amount calculations. That would drop total ore by factor of 4 tho so would need to compensate somewhere else.

Locked

Return to “Resource Spawner Overhaul”