For PROCJAM 2020, I revisited an old library I was working on last year

Controls

Planet Mode (Default)

  • W-S - Change Focus Latitude (Move North, Move South)
  • A-D - Change Longitude (Move West, Move East)
  • Z - C - Rotate Light
  • Clicking on a Cell - Enter Cell Mode

Cell Mode

  • Q-E - Change Average Rainfall of Selected Cell
  • A-D - Change Average Temperature of Selected Cell
  • LMB / RMB - Change Altitude of Selected Cell
  • LMB (on another cell) - Focus on new Cell
  • LMB (outside of planet) - Return to Planet Mode

About

A prototype of a planet generator and viewer for a space exploration and expansion game. This version generates a Triple-Chamfered Dodecahedron as the basis of the planet, and allows the user to change each cell's altitude, temperature, and moisture levels.

Procedure

To start with a polyhedron is made. Given a starting platonic solid (in this case a dodecahedron), the points are chamfered to create a Goldberg Polyhedron, and to create a new polyhedron. This process is repeated twice, which gives a planet of 642 faces (630 hexagons; twelve pentagons). Each face is given a face number and made aware of it's neighbours

Each face is then assigned a height (randomly, although 1/3 of the tiles should be ocean), a temperature (hotter towards the equator, colder towards the poles) and a moisture level (based on number of ocean level neighbours). Each cell is also assigned a swivelling value; white or black; for later UV assignments

The mesh is procedurally constructed per face; each one knows where it's "at sea level" coordinates for it's center and individual vertices should be. Each face is quadrangulated and individual mesh models for appropriate faces (flat planes, contours or cliff faces) are loaded in and trilinear interpolated to match this quad's lattice, projected from the center of the planet outwards.

Textures are assigned based on each face's vertex color and a custom texture array based shader, the red channel being moisture and the green channel being temperature. Future versions can use a 3D texture array channel to allow for ocean versions too. A smooth blend is thus established. Finally, each quad analyses it's neighbours and it's cell's swivelling value to choose one of sixteen textures on each of the texture sheets to use for tiling, to break up the visual repeating pattern (although in this version, only the template values of A-F and 1-4 are displayed rather than final textures)

Future Work

While adding final textures and ocean shaders is high on the list, the library that I've been building can distort any model built above a uniform polygon and distort it in 3d space above another, allowing for the placement of complicated buildings that work on pentagons or hexagons that don't require the model to be pre-quadrangulated.

Additionally, provision in this library has been alloted for creating toruses; allowing for Stanford Torus style space stations when combined with the above.

Credits

  • Code and Visuals by Keith Evans (@kaynSD)
  • Highly influenced by and uses elements of the polyHédronisme library, particularly the "flag" based polyhedron construction system
  • Sci-Fi Box UI Element by KodiakGraphics

Download

Download
Offline Version.zip 22 MB

Leave a comment

Log in with itch.io to leave a comment.