Resource Spawner Overhaul

by orzelek

Makes resources more sparse than base game. You will need to use trains much earlier to get resources. Game will be more difficult especially with higher enemy settings.

Tweaks
11 hours ago
0.14 - 2.1
153K
Environment

b Bob's Enemies and RSO in 2.1

3 days ago

I'm on the Bob's upkeep team, and I've been working on updating Bob's Enemies for Factorio 2.1, but there's been some odd behaviors with enemy base spawning that I can't figure out. When I don't have RSO loaded, everything works perfectly. 100% of enemy structures that are generated on chunks or by base expansion are replaced by the Bob's Enemies scripts. But when RSO is loaded, for some reason extra enemy turrets and spawners keep appearing that BE doesn't catch. It's very odd, because BE should be set up to force RSO's settings to only do vanilla enemy generation.

And it's causing some significant difficulties, because the way things are, Behemoth worms with massively buffed stats end up spawning way too early and way too close to the center of the map. Everything seemed to work fine in 2.0, so my guess is that this somehow has something to do with the changes to enemy spawning in 2.1. Most likely, the build_base_evolution_requirement parameter was covering up the issue, and now that it's gone, things have become problematic.

I see that this section here:

local function UseRSOEnemySpawning()
return settings.global["rso-biter-generation"].value or script.active_mods["bobenemies"]
end

appears to have the effect of always triggering RSO enemy generation when BE is active. When I comment out that second half of the line or change it to (not script.active_mods["bobenemies"]), the issue seems to be resolved. Is this an oversight?

I also notice that going into config.nauvis["enemy-base"] (or using a separate config file for bobenemies) and erasing the contents of the "bases" and "sub_spawns" tables will also prevent the extra spawns. So there are a couple different solutions here.

I'm really hoping you can help me out or provide some insight on this. While I have come up with a fix that works within BE, it involves doing a second pass of replacing vanilla entities with BE ones, which is not great. It's too performance heavy and has some odd results.

As always, thank you for your time in advance.

2 days ago

This kind of issue is usually caused by the fact that RSO cheats a bit and spawns enemy bases in on_chunk handler but spawning goes outside this particular chunk - in case of enemy bases with big size it can go out quite far.
There are 2 solutions that would work here:
1. Do the not change you are proposing and disable RSO enemy spawns and leave base game ones enabled. That will let you catch them properly and change their type as needed.
2. Make RSO aware of various enemy types and then use bobs enemies specific config while disabling base config when it's present. This will make RSO spawn things already set up with correct enemy types etc. I'm not sure if all the rules you need for that are handled by RSO now. One drawback I can see with this is that enemy bases might lose uniformity - they could end up as mix of enemy types since RSO pulls randomly from enemies in whole config so all enemy types in it will end up mixed together.

2 days ago
(updated 2 days ago)

Making the "not" change, or simply removing that little bit of the line, seems like the simplest and most straightforward approach. If that change could be made in the next week or so, it would be greatly appreciated.

11 hours ago

I think I found part of the problem - I have data and control check and currently they are not matching for bobs enemies. It's a simple fix so I will make them consistent and preserve the use only vanilla generation when bob's mods are present. I think that currently it was actually running both vanilla and RSO one.

11 hours ago

Fixed it and should be ok - I checked and few bases near start were normal others further out where specialized.

3 hours ago

Yep! My tests indicate that everything is working as expected too. Thank you much.

New response