OpenMiner icon indicating copy to clipboard operation
OpenMiner copied to clipboard

Sky Lua API

Open Unarelith opened this issue 5 years ago • 1 comments

Those informations should be defined in Lua

  • [x] Sky color
  • [x] Fog color
  • [ ] Stars (amount, size, brightness)
  • [ ] Celestial objects: moon, sun, planets (size, speed, angle, texture, brightness, ...)
  • [ ] Possibility to change the sky in-game (see below)

For example:

mod:sky {
    id = "overworld",

    color = {
        day = {128, 255, 200},
        night = {28, 127, 50},
    },

    fog_color {
        day = {128, 255, 200},
        night = {28, 127, 50},
    },

    stars = {
        amount = 1000,
        size = 2,
        brightness = 1, -- ranges from 0 to 1
    },

    objects = {
        sun = {
            size = 20,
            speed = 1, -- 1 would be day length
            angle = 0, -- 0 would be default moon/sun plan
            texture = "sun.png",
            brightness = 1,
        }
    }
}

~~When dimensions will be implemented, they will use this API to know which sky to render.~~ Done.

It should also be possible to change sky informations in-game. This could lead to more possibilities regarding sky, for example, it could be possible to change the sky when:

  • Block is placed/removed
  • Specific mob spaws
  • Specific weather event occurs

Unarelith avatar Mar 05 '20 15:03 Unarelith

Close-proximity stars, or "Suns". Example: Sun A does 48h rotations and Sun B does 24h rotations. When it's just Sun A, there's 65% light level on the surface, 80% for Sun B and 95% for both.

LordDeatHunter avatar Jul 14 '20 19:07 LordDeatHunter