https://github.com/charlesaverill/terrasim
A SimEarth clone in OCaml using tsdl and tgls
https://github.com/charlesaverill/terrasim
opengl procedural-generation sdl2 simulation video-game
Last synced: about 2 months ago
JSON representation
A SimEarth clone in OCaml using tsdl and tgls
- Host: GitHub
- URL: https://github.com/charlesaverill/terrasim
- Owner: CharlesAverill
- License: mit
- Created: 2025-05-12T03:14:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-13T02:16:12.000Z (about 1 year ago)
- Last Synced: 2025-06-13T03:28:11.202Z (about 1 year ago)
- Topics: opengl, procedural-generation, sdl2, simulation, video-game
- Language: OCaml
- Homepage: https://charlesaverill.github.io/terrasim/
- Size: 30.2 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Roadmap: roadmap.md
Awesome Lists containing this project
README
# TerraSim

A SimEarth clone in OCaml using [tsdl](https://erratique.ch/software/tsdl) and [tgls](https://erratique.ch/software/tgls).
See [roadmap.md](https://github.com/CharlesAverill/terrasim/blob/main/roadmap.md) for progress
## Building
```bash
git clone https://github.com/CharlesAverill/terrasim.git && cd terrasim
# Dependencies
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libffi-dev libgmp-dev
git submodule update --init --recursive
opam install . --deps-only
dune build
```
To run, simply
```bash
dune exec TerraSim
```
## Controls
There are three views right now:
### Edit view (Cartesian)
| Input | Effect |
|---|---|
| Mouse move | Pan view |
| Mouse click | Run command denoted by highlighted UI button |
| `c` | Switch to Atlas view |
| `h` | Hide the UI |
### Atlas view (Cartesian)
| Input | Effect |
|---|---|
| Mouse move | Pan view |
| `c` | Switch to Globe view |
### Globe view (Orthographic)
| Input | Effect |
|---|---|
| Click and drag | Spin globe |
| `c` | Switch to Edit view |