Skip to content

How it works

Ishiaki edited this page Oct 21, 2026 · 2 revisions

How it works

Real Worlds is Kopernicus configs, written by scripts from published figures, and a small library for what configs cannot do. Nothing in Configs/ is written by hand: each file says which script wrote it.

The worlds

tools/realworlds/bodies.py holds each world's size, gravity, spin and prime meridian, and which stock world it takes over: Kerbin becomes Earth, the Mun the Moon, Duna Mars, Ike Phobos, Gilly Deimos, Eve Venus, Moho Mercury, Dres Ceres, Jool Jupiter, Pol Io, Vall Europa, Tylo Ganymede, Bop Callisto, Laythe Titan, Minmus Enceladus, Eeloo Pluto; Saturn, Uranus, Neptune, Triton and Charon are new. The stock worlds keep their names inside the game's files (so other mods and saves still find "Kerbin"); the player sees the real names.

The orbits

KSP cannot tilt a world: every world spins about the game's one axis. So, as Real Solar System does, the whole system is laid out against Earth's equator: Earth spins upright, and the Sun's path across its sky is tilted 23.44 degrees, which gives the seasons. elements.py turns JPL's orbits (the planets against the ecliptic, each moon against its planet's Laplace plane) into that frame, at J2000 (noon on 1 January 2000), which is the game's time nought. Every world spins about Earth's pole; the moons that face their planet are turned to face it.

Checked in the game: at time nought the Sun stood overhead within 0.1 degree of where it truly was.

The game works out a moon's period from its distance and its planet's mass alone, as if the moon weighed nothing, and the published distances are rounded: the Moon at 384,400 km went round in 27.45 days and not 27.32, and from a game begun in 2026 it stood 252 degrees from where it is in the sky; Charon, an eighth of Pluto's mass, was 6 % slow. So each moon is put at the distance that gives its real sidereal period in the game (the Moon at 383,183 km, Charon at 18,858 km): when it is there matters more than how far it is.

The air

air.py builds each atmosphere the way the reference atmospheres are built: a measured profile of temperature with height, the pressure at the ground (or at the 1 bar level of a giant), the gas's molar mass and the world's gravity, the pressure worked out by hydrostatic balance (Earth's and Venus's measured tables are used as they stand). Where each air ends is put at the same drag for every world: the height where a circular orbit meets the dynamic pressure it meets 140 km above Earth (so Titan's thin, cold air reaches 705 km, Mars's 116).

The ground

make_textures.py turns the maps (see Sources) into the game's textures with maps.swift: 16-bit heights, colour, and the light and shade of the relief for the far view. The game reads a terrain map at u = 0.25 - longitude/360 (it runs west) with its first row at the south pole; the maps are written that way, and the heights the game gives at known places are the real ones (Tibet 4,985 m, Orlando 33 m, the Mariana Trench -10,180 m). draw_textures.py draws what no map gives: Venus's ground under its clouds and its cloud tops, the bands of Saturn, Uranus and Neptune, Titan's haze, Saturn's rings from their measured radii and optical depths.

Earth's colour carries its sea in the picture's alpha, worked out from the heights: none where the ground stands at the sea's level or above, all where it lies 30 m and more below, the shore between. The far view's shine and Scatterer's sun glint read it, so the sun glints on the seas seen from space and not on the land (with no sea marked, the shine lay on all of Earth and the sun glinted on Africa).

Earth's lights at night are NASA's Black Marble 2016 (the lights of a year's cloud-free nights, seen by Suomi NPP's VIIRS), laid on the night side by Environmental Visual Enhancements' city lights. EVE reads them only as a cube of six faces named to it in a config of its own (a flat map, or a cube not named, it refuses), so make_textures.py makes its six faces as grey PNGs (EVE reads the faces' files itself, and a DDS came to it empty), 2048 pixels a side (some 5 km a pixel): each face texel's direction is worked back from EVE's own rule for its faces (cubeMap.cginc) and the map read there, its values lifted (gamma 0.6: at their own EVE showed a dim golden dust). EVE leaves the lights off where the planet's picture is all sea in its alpha, so none lie on the sea (EVE takes the picture as a scene starts, before Kopernicus has loaded it, and a missing one reads as all sea: CityLights.cs hands it the picture whenever the world has one); close up it lays a fine grain of streets from its own config pack (BoulderCo's), where that is installed.

Under the measured maps (pixels 2 to 5 km apart) the worlds without a sea get a light noise a few tens of metres high, from 3 km down to about 200 m. Earth does not: it would raise its low coasts out of the water.

The biomes

make_biomes.py makes each world's science regions from the same height and colour maps: Earth's sea by depth and its land by height and by what the Blue Marble shows growing; the Moon's maria, each named for the great mare it lies in; Mars's caps, volcanoes and basins; named features on the rest. The game reads a biome map with the same turn as a terrain map.

The library

  • The calendar: the clock shows the real date in UTC (the leap seconds since 2000 taken off); days of 24 hours and years of 365 days, whatever the game's own "Kerbin time" setting says. A new game (its clock under ten minutes on and none of the player's craft out) is set to today's date and time, so the planets and moons stand where they do in the real sky.
  • The space centre's place (Centre.cs): Kopernicus places the space centre, and flattens its ground, once, as the worlds are made at the game's start, from the home world's SpaceCenter node. Earth.cfg puts it at Cape Canaveral's LC-39A; Configs/SpaceCentre.cfg, read after it, moves it to Tokyo (the reclaimed land at Haneda, on Tokyo Bay: flat, a few metres above the sea, the bay and then the Pacific to the east for launches). A place chosen on the mod's page (Cape Canaveral, Baikonur, Vandenberg, Kourou, Tanegashima, Jiuquan, Wenchang, Sriharikota, Starbase, Plesetsk, Mahia) is written as a patch of its own, Chosen/SpaceCentre.cfg, read last of all and kept across the mod's updates, with the flat laid at the ground's height there: it is taken at the next start. The page says which place is in use: the one the worlds were made with at this start. Tried: Cape Canaveral chosen, and at the next start the space centre stood at LC-39A (28.6084 N, 80.6043 W, the pad on ground 2.8 m up).
  • Launch sites (Sites.cs): Making History's sites are made from the expansion's own files as the worlds are set up, after Kopernicus has read its configs, so configs cannot move them; the library does, at the main menu. Each site goes to a real one (Woomera's Launch Area 5, Baikonur's Gagarin's Start and Yubileyniy runway turned to its 06/24, Kourou's ELA-3, Mahia's LC-1A, Vandenberg's SLC-4E, Plesetsk's Site 43), the buildings round it keeping their distance and bearing in metres as on Kerbin; the tracking dish beside Woomerang goes to Island Lagoon (Deep Space Station 41), and the five far ground stations' dishes to Goldstone, Madrid, Canberra, Malargüe and Usuda; the names are set in the game's own word list. The game places such a thing once and never again, and a pad that rests on the ground by a ray only when the camera comes near; so each is made to be placed anew, and one the game leaves at its old place is placed by the library as the game would place it from afar (asking the game's own placing from the space centre moved the world's origin and wrote back numbers that threw buildings thousands of kilometres off). Glacier Lake's tower, tank and huts hang from a holder the game leaves at the planet's centre: it stays there. The configs take Kerbin's landmarks off Earth (the old space centre on its plateau rising out of the Pacific, the pyramids, the monoliths, the anniversary pieces, the UFO) and flatten the ground under the pads at Mahia and Vandenberg.
  • Flattened ground (GroundFix.cs): the game's flattened and laid-in ground keeps its centre as a direction made of single-precision numbers, whose length comes out a hundred-millionth or so off one; the angle to the ground near the centre then comes out as none at all or as a kilometre. On Kerbin that blind spot hid under the flattened ground's own size; on Earth it is a kilometre and more, and Mahia's flat was not there at all. Each is given its centre again in double precision as it is set up.
  • Time warp on rails to 10,000,000 times, and each world's warp heights made for those rates.
  • Far pictures on a Mac: KSPTextureLoader (which Kopernicus loads every texture through) puts a compressed texture into a home-made asset bundle and has Unity stream its pixels from the file; on a Mac that fails and the texture is left black (every world drew black). Off Windows, Real Worlds sends such textures the direct way.
  • Jupiter: Jool's far body carries the game's own pieces that swap its material for Jool's (its green clouds); they are taken off and Jupiter drawn plainly, as the other giants are.
  • Old saves: a save played with Real Worlds is marked; loading one with craft and no mark keeps a copy of it as it was (persistent (before Real Worlds).sfs beside it) and says that its craft were made for the stock worlds, once.

With other mods

Where Scatterer is installed, Real Worlds sets its skies for Earth (Bruneton's clear-sky figures), Mars (dust), Venus (a near-grey haze over its pale cloud tops) and Titan (orange haze), takes Jupiter off its list, takes the seas off Venus and Titan, and sets each world's eclipses to its real moons. Where EVE is installed, its stock clouds for Eve, Laythe and Jool (purple, white, green) and Kerbin's city lights are taken off.

Where Natural Weather 0.5.0 or later is installed, each real world gets its own weather (Configs/Weather.cfg, its NATURAL_WEATHER_CLIMATE nodes; before, each had the weather of the stock world whose place it takes): Venus one deck of cloud over the whole world from 48 to 70 km and nothing under it, the air at the ground nearly still and 100 m/s at the cloud tops; Titan a few per cent of cloud at most, a storm now and then, fog in the mornings, the air at the ground barely moving; Mars no low cloud, only thin ice cloud high up, a little fog, its dust as Duna's. Earth keeps Kerbin's weather.

Earth's sky seen from far off (since 2026-10-20): Scatterer's light scattered over the planet is drawn at the exposure StockScattererConfigs set for Kerbin's small sky; at Earth's size it laid a lilac-white veil over the whole planet from space. The exposure is Kerbin's up to 60 km and falls to a third of it by 300 km: from 15,000 km the seas are a deep blue and the land its own colours under a thin haze. Venus's blue is taken out more strongly and lower down (round 30 km), so that its sky from the ground is yellow.

Clone this wiki locally