Visible Planets in Space

by Nauviax

Render the local planet behind platforms when in orbit. Now with parallax, rotation, and mod support!

Tweaks
11 days ago
2.0
92.3K
Factorio: Space Age Icon Space Age Mod
Environment

g Not all moons are visible

11 days ago
(updated 11 days ago)

Hi again, Nauviax!
I noticed, that not all moon-planets are visible for some of the parent planets, for example Vesta:


Is this possible to catch from PlanetsLib and fix?
For that exact scenario I used mod Better Planets

11 days ago

Could you provide a log file? Visible planets should log reasons for skipping certain planets/moons, assuming the moon is set up correctly in planets-lib. (planet.orbit.parent)

Depending on how better-planets is setting up moons, it may also be worth adding visible-planets as an optional dependency to resolve load order issues.

11 days ago
(updated 11 days ago)

I see that it's adding them in the log, but not visualizing in the game. Making visible planets as dependency not fixed the issue.
Vesta related log:

  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:24: Overriding scale for vesta to 1
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for vesta
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:74: Adding PlanetsLib compat for vesta with moon corruption
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:74: Adding PlanetsLib compat for vesta with moon hexalith
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:74: Adding PlanetsLib compat for vesta with moon mickora
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:74: Adding PlanetsLib compat for vesta with moon nekohaven
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:74: Adding PlanetsLib compat for vesta with moon quadromire
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for hexalith
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:58: Adding PlanetsLib compat for moon hexalith orbiting vesta
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:24: Overriding scale for ithurice to 1.1447142425533
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:24: Overriding scale for mickora to 1
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for mickora
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:58: Adding PlanetsLib compat for moon mickora orbiting vesta
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:24: Overriding scale for nekohaven to 1.2599210498949
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for nekohaven
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:58: Adding PlanetsLib compat for moon nekohaven orbiting vesta
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:24: Overriding scale for quadromire to 1
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for quadromire
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:58: Adding PlanetsLib compat for moon quadromire orbiting vesta

For example, for Vulcanus 2 new moons Zzhora and Froodara, works correctly:

Vulcanus moons log looks the same:

  15.989 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for vulcanus
  15.989 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:74: Adding PlanetsLib compat for vulcanus with moon froodara
  15.989 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:74: Adding PlanetsLib compat for vulcanus with moon zzhora
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for zzhora
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:58: Adding PlanetsLib compat for moon zzhora orbiting vulcanus
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:24: Overriding scale for rubia to 0.62144650119077
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:24: Overriding scale for froodara to 0.96548938460563
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:37: Adding visible-planets for froodara
  15.990 Script @__visible-planets__/data_stuff/sprite_prototypes.lua:58: Adding PlanetsLib compat for moon froodara orbiting vulcanus

I'm thinking, maybe they just overlaps each other in one position? Is it possible?

11 days ago
(updated 11 days ago)

After a bit of testing, I can confirm all the renders are being overlapped. Turns out the formula I used was just bad and broke at 3 moons.
1.6.0 will contain a fix, and some setting changes for better positioning.

https://imgur.com/a/7Qb4dcy
Default is still even spacing

Side note: How do you embed images I've forgotten and can't figure it out aaa

11 days ago
(updated 11 days ago)

It works perfect, thanks!!!
About screenshots, I use this format:
![vulcanus](https://i.imgur.com/eAUwBU2.jpeg)

11 days ago

I'm also wondering if it's possible to render moons based on their positions relative to the parent planet?
For example, the planet Zzhora should appear closer because its orbital distance is smaller than Froodara's.
The angle should match the one used that planet rotates around its parent.

11 days ago

It’s a neat idea, but it’d have to wait until I have more time as I’m really only prioritising bug fixes at the moment. You’re more than welcome to take a shot at it and open a pr, or you can edit the distances in the sprite prototypes in your own mod’s final-fixes by editing the shift values of each layer.

10 days ago

I don’t want to spam the discussions, so I’ll ask about another possible feature here instead:
Is it possible for your mod to make planets and moons rotate independently of each other?
Right now, a planet or moon seems to rotate together with its parent body (or other planets), which looks a bit weird.

10 days ago

Almost certainly not, the sprite is built in the prototype stage so I can’t animate them separately at runtime. (I’m 95% sure anyway)

PlanetsLib support was really just a bonus feature for the mod, and I don’t plan on reworking it to make it fancier than it’s current state.

I’m afraid outside of very simple feature requests, you may need to look into making PRs for the mod if you want some of these implemented.

10 days ago

I think it would be possible by implementing reverse rotation to the moons (or to the parent), so it will look like planet stay still, no?

10 days ago

Again, the moons and planets are the same sprite at runtime. Afaik, they can not be rotated separately as-is.

You will need to open a PR if you want this feature, I don’t currently have the free time to rework planetslib support to allow this.

10 days ago

(Also please keep feature requests outside of bug reports)

New response