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

Degraine
Filter Inserter
Filter Inserter
Posts: 282
Joined: Wed Aug 13, 2014 10:49 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by Degraine »

I've traditionally had trouble finding nickel with RSO, but I generally have infinite ores switched on so it doesn't matter too much in the long run.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Nickel, cobalt and tungsten are rarest ores with bob's ores enabled. Same with DyTech and cobalt, tungsten, gems and ardite.
I added multi resource rolling to try and make sure you can find at least some of them but rng can be cruel :D

They could be added to some secondary roll lists to make small amount of them appear a bit more often. Especially if some of them are really required in larger quantities for mainstream manufacturing.
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 nickel only spawns if its enabled in the Bobores config. Else it's coming from Galena. Can't say that it was that rare, but it was quit a treck to it- Cobaltite and Sufure are also ores that must be enabled inte Bob Ores config.

I'm not sure how to define rare here, in my Dytech game i've found quit good patches of Cobalt and Ardite, but the are a long long way from home. But i've horrible lead spawns, Little patches over big Areas.
Well could be the RNG-Troll. Another thing is that Cobalt Tungsten and Ardite share the same Colour on the Map. All three are the same dark blue. Dosen't make it easy to keep treck on the Orefields, but that maybe a dytech thing?
kaldskryke
Inserter
Inserter
Posts: 27
Joined: Mon Nov 17, 2014 3:49 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by kaldskryke »

Howdy, Orzelek! Thanks for keeping this wonderful mod alive!

I have a relatively small request, which I've managed to implement for myself but I'd like to see it added to future releases.

Summary:
Change starting_area_size (in config.lua) to be valid for sizes less than 1 (ie 0.5)
OR
Change starting_area_size to refer to a number of CHUNKS instead of a number of REGIONS.

Context: I like playing with Enemies spawning relatively closeby. By default, it felt like RSO's starting area is much too large and it was too easy to start a base safely without any interaction with wildlife. I attempted to lower the starting_area_size from 1 Region to 0.5 Regions. This did not function as expected, and resulted in the "starting area" to be effectively zero.

Here's a snippet from Control.lua, function "roll_region"

Code: Select all

local r_x=floor(c_x/REGION_TILE_SIZE)
local r_y=floor(c_y/REGION_TILE_SIZE)
--don't spawn stuff in starting area
if ((abs(r_x+0.5)+abs(r_y+0.5))<=starting_area_size) then
	return false
end
As you can see, it takes the region coordinate and adds 0.5 to each axis to find the "center point" of the region when evaluating the distance from the origin. Note that for any position within the 4 Regions adjacent to the origin, this distance will always evaluate to 1. Therefore, the default starting area (with starting_area_size = 1) is actually 4 regions large, which is larger than one might expect from the name of the variable; Perhaps starting_area_size should be renamed to starting_area_radius?

My naive solution was to change the if statement to:

Code: Select all

if (((abs(c_x+(CHUNK_SIZE/2)))+abs(c_y+(CHUNK_SIZE/2)))<=starting_area_size*CHUNK_SIZE) then return false end
You can see I've gone to using the tile coordinates of chunk-midpoints, and I'm also now treating starting_area_size as a number of chunks. This works relatively well and I'm now enjoying a starting area with a radius of 4 chunks, which gives an area approximately of a single Region. However, the downside to this solution is that it nolonger scales as intended for changes in region_size. It should be fairly straightforward to go back to using regions using "starting_area_size*REGION_TILE_SIZE", but I don't know the code well enough to tell if that would have unintended results.

Note that there are multiple places in control.lua that refer to starting_area_size and they don't all use the same equation. The above is just one example.

Thanks so much for reading all this.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

I'll take a look at this.

Might add 2 starting areas - for enemy spawns and for ore spawns. To small starting area might result in problems with ore distribution in it.
It should be easy to make it work with floating point so thats not a problem - but also need to check all places in code since some stuff really needs integers.
kaldskryke
Inserter
Inserter
Posts: 27
Joined: Mon Nov 17, 2014 3:49 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by kaldskryke »

Thanks!
PiggyWhiskey
Filter Inserter
Filter Inserter
Posts: 255
Joined: Wed May 13, 2015 5:28 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by PiggyWhiskey »

Hi there, I'm loving this mod :) It's forcing me to learn a lot more about train management than I usually would have (Lots and lots of belts :D)

But I've also got a mod called Straight World https://forums.factorio.com/forum/vie ... =14&t=7191 (For the OCD inclined) and its messing with the ore generation with it.
Is it possible to add compatibility for it?

Within the starting area its all based on Straight World ore-gen, but outside of there the ores are back to normal with the RSO spread.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

PiggyWhiskey wrote:Hi there, I'm loving this mod :) It's forcing me to learn a lot more about train management than I usually would have (Lots and lots of belts :D)

But I've also got a mod called Straight World https://forums.factorio.com/forum/vie ... =14&t=7191 (For the OCD inclined) and its messing with the ore generation with it.
Is it possible to add compatibility for it?

Within the starting area its all based on Straight World ore-gen, but outside of there the ores are back to normal with the RSO spread.
Both of those mods try to take over resources generation by overriding chunk generation function. I'm not sure if they can be aligned to make them work together - it depends on ability to decide about order of event handler calls. I have no idea if we can influence that in some way. From what you are writing it seems that on start area Straight World takes over but after that RSO is executed first.
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 »

Hi orzelek.

I've run into a, small problem oder big problem.
While Nickel of bob ores generates without a problem, it's (at least in my opinion) al little to rare.

Either that ore the RNG-Troll had a bad day.

I've run a chart from -4096 to +4096 an all i can find are uncommen small patches of Nickelore, almost every ore tile under 1000, that aren't really worth a train.

On the Other Hand is nickel a relativ needed Metal. Invar for tier two stuff uses quit a bit. i thing if i remember correctly an other metal,
i can''t remember which of the many, uses it in its production chain and then there is the High tier nitinol Stuff.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

New version is up - I upped Nickel a bit for bob's ores and fixed the starting area issue.

I also looked into integration of Straight World mod - it could be used with RSO if it's a part of it.
I found also quite serious issue with Straight World mod itself - it makes map generator work constantly on expanding current map area. I have no idea why it would do that so I'm not adding it officially to RSO.
PiggyWhiskey
Filter Inserter
Filter Inserter
Posts: 255
Joined: Wed May 13, 2015 5:28 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by PiggyWhiskey »

orzelek wrote:New version is up - I upped Nickel a bit for bob's ores and fixed the starting area issue.

I also looked into integration of Straight World mod - it could be used with RSO if it's a part of it.
I found also quite serious issue with Straight World mod itself - it makes map generator work constantly on expanding current map area. I have no idea why it would do that so I'm not adding it officially to RSO.
Thank you for the quick response :)

So it could be worked if you merge Straight World into RSO? The straight world forum is somewhat dead, Want me to ask?

I'll x-post that information to that thread as well.
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 »

My question to this where. Is it possible that the straight-worldgen then only as a configoption works?

I can't speak for others but, with that kind of Tetrisworld i'd go nuts.

Edit: Wow almost forgot, thanks for the Nickelbuff. Now i found something worth driving for.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Takezu wrote:My question to this where. Is it possible that the straight-worldgen then only as a configoption works?

I can't speak for others but, with that kind of Tetrisworld i'd go nuts.

Edit: Wow almost forgot, thanks for the Nickelbuff. Now i found something worth driving for.
I did retest it and same thing I'm counting as bug happens also without Straight World mod. It might be hidden game behavior then that we don't see normally.

Straight world mod is already in config but it's commented out there and in require statement on top of control file. I'll drop those comments in next version. If you have trouble doing that I can release next one with it today.

Also there are different issues that arise from RSO with Straight World - some parts of ores are not getting straightened. It comes out from the fact that RSO can create ore on tiles next to generated chunk and Straight World doesn't look there. I tried to fix that but it leads to small map gen weirdness where it can redo already created parts near borders.
User avatar
Xecutor
Filter Inserter
Filter Inserter
Posts: 260
Joined: Mon Jun 23, 2014 10:15 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by Xecutor »

When you modify already generated chunk, it's quite obvious that straight world won't be able to post process it.
I don't know what happens when you modify not-yet-created chunk...

When generating new ore/resource patches you probably need to track affected chunks and call post process on them.
In theory double post processing should yield equivalent result.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Xecutor wrote:When you modify already generated chunk, it's quite obvious that straight world won't be able to post process it.
I don't know what happens when you modify not-yet-created chunk...

When generating new ore/resource patches you probably need to track affected chunks and call post process on them.
In theory double post processing should yield equivalent result.
Double processing will happen with tracking or not - I made it process chunk and area around it (expand chunk by 16 tiles for example) and that leads to quite a lot of double processing. I'd need probably to do two things to make it work nicely - separate tile from resources processing and add tracking. Maybe separate resources processing would be enough - since ore needs to be processed twice due to generation of it on tiles outside chunk.
OvermindDL1
Fast Inserter
Fast Inserter
Posts: 193
Joined: Sun Oct 05, 2014 6:12 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by OvermindDL1 »

orzelek wrote:New version is up - I upped Nickel a bit for bob's ores and fixed the starting area issue.

I also looked into integration of Straight World mod - it could be used with RSO if it's a part of it.
I found also quite serious issue with Straight World mod itself - it makes map generator work constantly on expanding current map area. I have no idea why it would do that so I'm not adding it officially to RSO.
Could perhaps just add a new shape to RSO, or fix 'square' or so to be straight-edged.
User avatar
cpy
Filter Inserter
Filter Inserter
Posts: 839
Joined: Thu Jul 31, 2014 5:34 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by cpy »

Does anyone else have freezes in multiplayer?
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 that's a funny one. Played yesterday base with RSO withou any problems ... startedthe game today rso gone from the modlist.
I didn't change anything, i didn't even touched the modfolder in the time between. RSO is still in the mod folder.

Anyone an idea what's going on?
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.11.*] Resource Spawner Overhaul

Post by orzelek »

Sorry no idea for multiplayer (I'm not sure if RSO works properly there). I noticed at some point that ores seem to be always correct in terms of determinism but there are some weird fluctuations on monster spawners sometimes and I have no idea why.

As for mod suddenly dissapearing - haven't seen that.
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 it isn't gone really. Factorio just dicided it donsen't want to load it anymore ... i'll try a fresh clean install of facto ... messed around to much with it i think.

Edit: yupp seams i messed too much. after re-installing factorio everything works as intendet again.
Locked

Return to “Resource Spawner Overhaul”