Git Product home page Git Product logo

terrain-gen's Introduction

alt text

athena

athena is a civilization builder game in pre-alpha stage.

Currently it is mostly still a terrain generator and visualizer.

I use other bits of code to help with some tricky math stuff - I cite them in comments where I use them.

Compilation

Type "make" to compile. To run, type "./athena".

Controls:

Key Function
q quit
b blur heightmap
u decreases heightmap by 1
i increases heightmap by 1
n set normal map
j set wind map (needs normal map)
m run moisture engine (needs wind map and normal map)
r rain!
w run water
e if water is running, allow erosion.
arrows moves around terrain
shift increases heightmap movement / shifting speed
s attempt to save colormap and heightmap

Documentation

Requires: cmake, sdl2, sdl2_image, sdl2_ttf, glm

Classes and their functions

  • TrData - handles importing the data for different entity types and formulas. Currently doesn't handle maps and stuff (I don't have much Map or Game IO right now), but it might later.
  • TrECS - handles the main Entity Component System pattern for game entities. I don't really use the "System" part of the ECS design pattern right now, but I probably will later.
  • TrGUI - handles the GUI system. Currently does not use ECS, but it probably will later.
  • TrMap - handles rendering and simulating the map data, such as rain, shadow mapping, ray tracing, day/night cycle, erosion, and more.
  • TrRenderLoop - handles the updating and rendering, depending on what "state" of the game you're in - different TrRenderLoop's handles the main menu, the main game, and transitions.
  • TrUtils - holds a bunch of generic helper functions.

External includes

  • fast-cpp-csv-parser - currently used in parsing the data files. I think I might make my own later with c++'s regex system.
  • fft - runs a fast fourier transform based ocean wave simulation. I use it for bump-mapping water.

Refer to this document for some details about how this works: https://docs.google.com/document/d/1xySCdTcphTbBVFzzvw51X8ISexEsv2MM4zNanQW6Hbc/edit?usp=sharing

terrain-gen's People

Contributors

gothack avatar vjiaoblack avatar wft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

wft clort81

terrain-gen's Issues

Bad Code

There's unregulated TODOs everywhere, and variable naming etc. isn't super great...
Should the TrGame instructor have all the SDL init code /within/ it, or should the SDL init code be separate?

Good (or at least consistent) code style is vital for the efficient continuation of any software development project, so let's fix it.

Create UI system

I really don't want to use an external framework /just/ for this, so I'll have to create a decent UI system.

That may require some basic screen-space physics or collision testing for now, but we'll see!

Improve README

The main image is from early in development. It looks way nicer now! This should totally reflect that.

A gif displaying the water sim might be nice too!

Instructions that are current might also look good.

Create a kernel-based sampling system

Since we're working with pixels, mostly, it has been fine so far to just use a pixel grid for everything - color, height, water level...

But if we are to move towards more advanced rendering or simulation techniques, we need to have a consistent way to index into the data (instead of just copy-pasting bilinear interpolation everywhere). Drawing inspiration from CMSC 23710 @ UChicago, I can create a system that uses preset kernels to index into the data and generate estimates of data values at non-integer coordinates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.