The Inner Core


Sister mod for the outer rim, collecting a few inner planets

Content
6 days ago
2.1
82
Planets Environment Manufacturing Power

b Cycle in technology tree detected with Corrundum and Better Asteroid Belt

9 days ago
(updated 9 days ago)

Hi there

So I got this:

Failed to load mods: Cycle in technology tree detected.

planet-discovery-corrundum
-> sulfate-processing-2
-> calcium-sulfate
-> blue-rocket
-> space-discovery-asteroid-belt
-> planet-discovery-corrundum

I've looked at this for a few hours with AI trying to understand what's happening here.

Corrundum and Corrundum Acid basically say the Belt depends on blue rocket which depends on discover corrundum (I have the details from where that happens in the files and stages if you need them, but I guess you know these), so Corrundum wants to stay near the sun.

I posted this here since The Inner Core is your inner planet pack, though the blue rocket depending on Belt prerequisite lives in Corrundum Acid.

But whoever modifies planet distances (I have Redrawn-Space-Connections, redrawn-space-compat-fixes, and Better-Planets installed, and maybe other mods mess with distance, too, I don't know), pushes Corrundum beyond the inner belt bound (which might happen because Belt apparently applies some sort of buffer, probably to create space for all the planets, of which I have a LOT installed):

 221.212 Loading mod kry-asteroid-belt 1.0.15 (data-final-fixes.lua)
 221.213 Script @__kry-asteroid-belt__/lib/asteroid-belt.lua:85: This 'planet: corrundum' falls within an asteroid belt. Shifted to nearest outer edge.

Now, Corrundum is too far out, and Belt says that you first have to research Belt and THEN you can research Corrundum (discovery corrundum is now suddenly dependent on discovery of belt). Which leads to the tech cycle.

I'm not sure if I can make myself clear, and it's probably very hard to reproduce; I didn't want to go into the black magic of all the redrawing and shifting stuff since I fear that they depend on the very specific (planet) mods you have installed, and I don't know of a way how I can easily isolate the issue with Corrundum.

Does this help you, can I provide more information?

As a quick hack I set Corrundum's distance directly in the mod's zip, originally it's 20, but the tech cycle appeared when I set it to 10 and even when I set it to 3. Clearly, I have no idea what's going on with messing with the distance, so... maybe you have an idea how to fix this or to introduce compatibility? :-)

Thanks for your modding work!

Edit: for reference: https://mods.factorio.com/mod/kry-asteroid-belt/discussion/6b0213a72777574afff9e84f

Edit 2: one more data point, as a last thing, I added logging in Belt's lib/asteroid-belt lua in their function clear_belt:
- the distance of the inner and outer belt is 27.5 and 32.5, respectively
- in data updates stage, corrundum's distance is 20, orientation = 0
- => NO log line "Shifted to nearest outer edge" for Corrundrum
- in data final though, corrundrum's distance is 35, orientation = 0.458...
- => and now, this is logged: "This 'planet: corrundum' falls within an asteroid belt. Shifted to nearest outer edge."
- after that, its distance is 35.2, orientation = 0.458..., and the tech prereq is added

8 days ago

Send me a save that has your modlist, can not reproduce it.

7 days ago
(updated 7 days ago)

(I'll post this here but will report to Better-Planets and corrundum-the-acid-planet because I think if there's a fix they would have to look at it - although it can be fixed by mod settings, though I don't know if that would have side effects)

Ok I think I got it. This is the minimal mod list I have found to provoke the error:
- base (because space-age)
- elevated-rails (because space-age)
- recycler (because space-age)
- space-age (because planets)
- AsphaltRoadsPatched (because corrundum-the-acid-planet - in fact mandatory even though listed as only recommended)
- Better-Planets
- Better_Starmap_Background (because kry-asteroid-belt)
- corrundum (because corrundum-the-acid-planet)
- corrundum-the-acid-planet
- fdsl (because corrundum-the-acid-planet)
- kry-asteroid-belt
- kry_stdlib (because kry-asteroid-belt)
- PlanetsLib (because kry-asteroid-belt)

so basically it's only these three and their dependencies:
- corrundum-the-acid-planet
- kry-asteroid-belt
- Better-Planets

And the reason, I found out, is way simpler than I thought - it's the default settings for planets in Better-Planets/config.lua#117:
{name="corrundum", mod="corrundum", radius=35, angle=195},

This shifts corrundum away from the originally defined distance of 20 (in corrundum https://github.com/ZacharyDK/Corrundum/blob/77d22bfbb34e3cdea0d1c043d933baed0b82bcda/corrundum/prototypes/planet/planet.lua#L17)
(I believe distance and radius are used interchangeably here)

corrundum:
- sets planet-discovery-corrundum as prereq to calcium-sulfate

corrundum-the-acid-planet:
- sets calcium-sulfate as prereq to blue-rocket

with kry-asteroid-belt:
- corrundum-the-acid-planet sets blue-rocket as prereq to space-discovery-asteroid-belt (in data-final-fixes.lua#L2 https://github.com/ZacharyDK/Corrundum/blob/77d22bfbb34e3cdea0d1c043d933baed0b82bcda/corrundum/prototypes/technology.lua#L368)

so: space-discovery-asteroid-belt needs blue-rocket needs calcium-sulfate needs planet-discovery-corrundum - all good

BUT, with Better-Planets:
- Better-Planets moves corrundum to distance 35 by default setting as shown above
- kry-asteroid-belt notices that with that distance, corrundum is beyond the belt, and thus applies its logic that the belt has to be researched before corrundum, so sets space-discovery-asteroid-belt as prereq to planet-discovery-corrundum (in lib/asteroid-belt.lua:lock_discoveries())

and now it's dead: planet-discovery-corrundum needs space-discovery-asteroid-belt needs blue-rocket needs calcium-sulfate needs planet-discovery-corrundum - boom.

So I think either
- Better-Planets changes the distance default from 35 to maybe back to 20, or
- corrundum-the-acid-planet doesn't set blue-rocket as prereq to space-discovery-asteroid-belt, or
- the user changes the Better-Planets mod settings manually from 35 to 20 (it's a setting accessible in the GUI)

But that of course doesn't address how corrundum "wants" to be treated, whether if it's ok for all those mods that it's an inner planet, or if this breaks something subtle the way down.

thanks for coming to my TED talk, and sorry to bother you! :-)

New response