Skip to content
/ planetry Public

Planetry is a simple app for gravitational simulations of objects in space

Notifications You must be signed in to change notification settings

szll/planetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

planetry logo

Planetry

Build Status Coverage Status Go Report Card

ATTENTION: this project is totally WORK IN PROGRESS

Planetry is a simple app for gravitational simulations of objects in space. You can specify the objects or bodys by your own. A scripting system allows you to check for specific events.

For example: you simulate the solar system with the sun and all its planets and add a second star that passes through the solar system. A simple script, written in Lua, can check on each simulation step, when or if Earth moves outside of the habitable zone. If the event occurs it can pause the simulation and display additional information.

planetry

Installation

External Dependencies

This project needs SDL2 and Lua 5.1 as requirements which have to be installed first.

Mac

First install the requirements via homebrew: brew install dep sdl2 [email protected]

Linux (tested on Ubuntu)

Just type: ./install-dependencies-linux.sh. This may take some time as SDL gets build from source within the script.

Windows

Todo ... I would be more than happy to get help here :D

Golang dependencies and building

The golang dependencies are managed via dep. To get the dependencies type: dep ensure

To build the executable type: go build

Usage

After the executable was build, you can start the simulation by typing:

./planetry

NOTE: Planetry loads all the files in testdata/. Later you can create projects and load these, but currently if you want to change something in the simulation, just alter the files in testdata/.

Feel free to add more Lua scripts or edit testdata/system.json.

On runtime, you can use:

  • y to zoom out,
  • x to zoom in,
  • s to speed up,
  • a to slow down,
  • SPACE to pause/unpause

Describing the simulated scene

See docs/SCENE.md.

Lua scripting

See docs/SCRIPTING.md.

Roadmap

As you may noticed: this project is in a really early stage of development. Here's the stuff that has to be done next:

  • Attach camera to object (v1)
  • Draw bodies in their real size; not just pixels (v1)
  • Scripts per scene description (v2)
  • Draw grid (v2)
  • Alter speed (v2)
  • Create project by command (v2)
  • Live time / event script support like on pause, on start up, ...
  • Collision
  • Runtime memory functions for scripting
  • 3D rendering

Know Issues

  • Window appears but no objects were drawn. After switching to MacOS Mojave I had to update the go dependencies as well as SDL on the system.