Visible Planets Scale

by jurgy

Adds automatic scaling to planets rendered by Visible Planets in Space based on their gravity and increases or reduces the rotation speed based on their day/night cycle duration.

Tweaks
6 days ago
2.0
10.2K
Factorio: Space Age Icon Space Age Mod
Environment

g Crash on latest version

6 days ago

768.745 Error MainLoop.cpp:1468: Exception at tick 20585492: The mod Visible Planets in Space (1.7.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event visible-planets::on_space_platform_changed_state (ID 195)
real number expected got nan.
stack traceback:
[C]: in function 'draw_sprite'
visible-planets/control_stuff/render_planets.lua:149: in function 'vp_generate_sprite_for_player'
visible-planets/control_stuff/render_planets.lua:115: in function 'vp_render_planet_on_platform'
visible-planets/control_stuff/render_planets.lua:125: in function <visible-planets/control_stuff/render_planets.lua:124>
LInk to save: https://drive.google.com/file/d/1NjgcWAYxaldex4CbVM3H0M-6RZlgn_Lo/view?usp=sharing
Loading save without this mod fixes the crash.

6 days ago
(updated 6 days ago)

Apparently this is related to Neumann V from Metal and Stars, which I'm assuming has a day/night value of 0, resulting in a divide-by-zero error in this mod. I'll confirm once home but if so then the fix would just be checking for 0 before dividing and either using a multiplier of 1 or disabling rotation for the planet depending on what you prefer.

Edit: Optionally also see https://mods.factorio.com/mod/visible-planets/discussion/696f828f6331bf81f391c348

6 days ago

Can confirm, VP-Scale is setting an infinite override:
1.103 Script @vp-scale/data-updates.lua:39: Setting planet rotation multipliers based on day/night cycle durations
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet nauvis to: 1
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet vulcanus to: 4.6666666666667
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet gleba to: 0.7
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet fulgora to: 2.3333333333333
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet aquilo to: 0.35
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet shipyard to: inf
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet nix to: 0.058333333333333
1.103 Script @vp-scale/data-updates.lua:42: Setting rotation multiplier of planet ringworld to: inf

(Also unrelated, but may be worth updating your info.json to explicitly require VP >= 1.7.0)

6 days ago
(updated 6 days ago)

Thanks for the report Meelock and thanks for checking Nauviax!

I've released an update that should fix it. Can either of you check if it works? I've written the fix entirely without opening Factorio since I'm not at home until tomorrow in the afternoon and the fix seemed easy enough but you never know (Yay for release automation).

5 days ago

Works, tysm

5 days ago

Updated to 1.4.1 but I'm still crashing when viewing a space platform that is orbiting Neumann V from metal and stars. Other planets work fine and crash doesn't happen if I disable visible planets scale.

The mod Visible Planets in Space (1.7.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event visible-planets::on_player_changed_surface (ID 59)
real number expected got nan.
stack traceback:
[C]: in function 'draw_sprite'
visible-planets/control_stuff/render_planets.lua:149: in function 'vp_generate_sprite_for_player'
visible-planets/control_stuff/render_planets.lua:133: in function 'vp_add_player_to_watched_render'
visible-planets/control_stuff/render_planets.lua:203: in function <visible-planets/control_stuff/render_planets.lua:201>

5 days ago

@ReBootYourMind, can you maybe share which mods you're running. Maybe it's caused by another mod that tweaks some value in an unexpected way. You can find a file with all the mods you're running (on Windows) by opening the file explorer and in the address bar type %appdata%, press enter, in there there should be a folder called Factorio. Then go to mods and share the content of mod-list.json. You can open the file in notepad or any other text editor. Just be sure to don't modify anything in it.

5 days ago

{
"mods":
[

{
  "name": "base",
  "enabled": true
},

{
  "name": "elevated-rails",
  "enabled": true
},

{
  "name": "quality",
  "enabled": true
},

{
  "name": "space-age",
  "enabled": true
},

{
  "name": "Accumulator-V2",
  "enabled": true
},

{
  "name": "ArmouredBiters",
  "enabled": true
},

{
  "name": "barreling-group2",
  "enabled": true
},

{
  "name": "Better_Starmap_Background",
  "enabled": true
},

{
  "name": "bioprocessing-tab",
  "enabled": true
},

{
  "name": "bplib",
  "enabled": true
},

{
  "name": "canal-excavator",
  "enabled": true
},

{
  "name": "canal-excavator-graphics",
  "enabled": true
},

{
  "name": "cargo-ships",
  "enabled": true
},

{
  "name": "cargo-ships-graphics",
  "enabled": true
},

{
  "name": "cargo_crates",
  "enabled": true
},

{
  "name": "castra",
  "enabled": true
},

{
  "name": "Cerys-Moon-of-Fulgora",
  "enabled": true
},

{
  "name": "ChangeInserterDropLane",
  "enabled": true
},

{
  "name": "Cloning-vat-building",
  "enabled": true
},

{
  "name": "Cold_biters",
  "enabled": true
},

{
  "name": "colorful_biochamber",
  "enabled": true
},

{
  "name": "common-prototypes",
  "enabled": true
},

{
  "name": "common-prototypes-graphics",
  "enabled": true
},

{
  "name": "corrundum",
  "enabled": true
},

{
  "name": "Cosmic-Social-Distancing",
  "enabled": true
},

{
  "name": "cubium",
  "enabled": true
},

{
  "name": "dea-dia-system",
  "enabled": true
},

{
  "name": "diesel_cargo_ships",
  "enabled": true
},

{
  "name": "diesel_engine",
  "enabled": true
},

{
  "name": "diesel_machines",
  "enabled": true
},

{
  "name": "elevated-pipes",
  "enabled": true
},

{
  "name": "est-tiny-storage-tank",
  "enabled": true
},

{
  "name": "Factorio-Tiberium",
  "enabled": true
},

{
  "name": "factoryplanner",
  "enabled": false
},

{
  "name": "Flare Stack",
  "enabled": true
},

{
  "name": "flib",
  "enabled": true
},

{
  "name": "FluidMustFlow",
  "enabled": true
},

{
  "name": "FusionPoweredRobots",
  "enabled": true
},

{
  "name": "helmod",
  "enabled": true
},

{
  "name": "Igrys",
  "enabled": true
},

{
  "name": "informatron",
  "enabled": true
},

{
  "name": "k2so-assets",
  "enabled": true
},

{
  "name": "Krastorio2",
  "enabled": false
},

{
  "name": "Krastorio2-spaced-out",
  "enabled": true
},

{
  "name": "Krastorio2Assets",
  "enabled": true
},

{
  "name": "Krastorio2MenuSimulations",
  "enabled": true
},

{
  "name": "kry-planet-mods-lite",
  "enabled": false
},

{
  "name": "kry_stdlib",
  "enabled": true
},

{
  "name": "lex-aircraft",
  "enabled": true
},

{
  "name": "Long_Range_Delivery_Drones",
  "enabled": false
},

{
  "name": "long_range_delivery_drones_talandar_fork",
  "enabled": true
},

{
  "name": "long_stack_inserter",
  "enabled": true
},

{
  "name": "machine-upgrades",
  "enabled": true
},

{
  "name": "maraxsis",
  "enabled": true
},

{
  "name": "matter_printer",
  "enabled": true
},

{
  "name": "metal-and-stars",
  "enabled": true
},

{
  "name": "metal-and-stars-graphics",
  "enabled": true
},

{
  "name": "metal-and-stars-graphics-2",
  "enabled": true
},

{
  "name": "minimalist-rails",
  "enabled": true
},

{
  "name": "Moshine",
  "enabled": true
},

{
  "name": "Moshine-assets",
  "enabled": true
},

{
  "name": "new-diagonal-inserter",
  "enabled": true
},

{
  "name": "nickel-rifle-mags-to-fix-castra-with-krastorio-spaced-out",
  "enabled": true
},

{
  "name": "panglia_planet",
  "enabled": true
},

{
  "name": "panglia_planet_assets",
  "enabled": true
},

{
  "name": "Paracelsin",
  "enabled": true
},

{
  "name": "Paracelsin-Graphics",
  "enabled": true
},

{
  "name": "pelagos",
  "enabled": true
},

{
  "name": "pirateship",
  "enabled": true
},

{
  "name": "PlanetsLib",
  "enabled": true
},

{
  "name": "PlanetsLibTiers",
  "enabled": true
},

{
  "name": "quality_glassware",
  "enabled": true
},

{
  "name": "Redrawn-Space-Connections",
  "enabled": true
},

{
  "name": "Robocharger-Updated",
  "enabled": true
},

{
  "name": "RocketCargoInsertion",
  "enabled": true
},

{
  "name": "rubia",
  "enabled": true
},

{
  "name": "rubia-assets",
  "enabled": true
},

{
  "name": "se-space-trains",
  "enabled": true
},

{
  "name": "secretas",
  "enabled": true
},

{
  "name": "shchierbin",
  "enabled": true
},

{
  "name": "skewer_planet_vesta",
  "enabled": true
},

{
  "name": "skewer_planet_vesta_assets",
  "enabled": true
},

{
  "name": "skewer_planet_vesta_assets_2",
  "enabled": true
},

{
  "name": "skewer_shattered_planet",
  "enabled": true
},

{
  "name": "skewer_shattered_planet_assets",
  "enabled": true
},

{
  "name": "slp-dyson-sphere-reworked",
  "enabled": false
},

{
  "name": "snouz-big-accumulator",
  "enabled": true
},

{
  "name": "snouz-big-solar-panel",
  "enabled": true
},

{
  "name": "snouz_better_asteroid_collector",
  "enabled": true
},

{
  "name": "snouz_better_substation",
  "enabled": true
},

{
  "name": "snouz_long_electric_gun_turret",
  "enabled": true
},

{
  "name": "snouz_space_platform_hull",
  "enabled": true
},

{
  "name": "SolarMatrix",
  "enabled": true
},

{
  "name": "space-exploration-graphics",
  "enabled": true
},

{
  "name": "space-exploration-graphics-4",
  "enabled": true
},

{
  "name": "SpidertronEnhancements",
  "enabled": true
},

{
  "name": "SpidertronPatrols",
  "enabled": true
},

{
  "name": "talandar_cargo_ships_tweaks",
  "enabled": true
},

{
  "name": "thinking_brain",
  "enabled": true
},

{
  "name": "Tiered-Solar-System",
  "enabled": true
},

{
  "name": "visible-planets",
  "enabled": true
},

{
  "name": "vp-scale",
  "enabled": false
}

]
}

5 days ago
(updated 5 days ago)

Log file may actually be more useful, because it'll have a line with with either "nan" or "inf" in it, along with the planet it's using that value for.

Look for something like "@__vp-scale__/data-updates.lua:42: Setting rotation multiplier of planet <somePlanetNameHere> to: <EitherNANorINF>"

(Or just post the part of the logs where "__vp-scale__/data-updates" shows up)

4 days ago
(updated 4 days ago)

@ReBootYourMind, I can't reproduce your error.

Can you reboot Factorio for me with vp-scale enabled.
Then while in the main menu open %appdata%/Factorio/factorio-current.log in any text editor.
Can you confirm vp-scale version 1.4.1 is actually loading by searching for the string Loading mod vp-scale 1.4.1
Use ctrl+f to quickly search through the document.

Then if that's the case, can you copy paste all the lines that contain __vp-scale__/data-updates.lua like Nauviax described. With your mod list it should be about 60 lines and they should be right after each other.

New response