This is a personal project with the goal of being a general purpose game engine. I created this just as a way of better understanding programming in C++ and how to program with OpenGL. It has only ever been tested on an Nvidia graphics card and likely wont work on ATI due to differences in shader programming.
The project is written in C++ in the Eclipse IDE. You should be able to go into the Debug folder and use: make clean && make all
which should produce the binary Project_Parsec
which is the current name of this project.
See the History file for the complete history of this project.
The world now uses multiple noise layers that load and unload as needed as you move around. The system implements brownian fractal noise (simplex), perlin, ridged perlin, billow and voronoi which can all be mixed as desired and modified useing a list of functions that can be added and then executed in the order they are given. These functions include things like remapping the noise range, scaling, power, clamping values, fading and more. The noise layers also have a mode for how they are applied such as the default add mode where noise is simply added together, but there is also multiply, divide, subtract, and modulus which can allow some creative applications of the noise layers.
The terrain is currently textured with 3D textures which doesn't allow mipmapping easily so it is currently disabled. 2D Array textures are going to be tested as a replacement for automatic mipmapping. Texturing is based on 3 items; the actual altitude, a moisture noise layer, and an altitude offset noise layer. These layers are combined together with 5 3D textures that each have 6 layers for a total of 30 different textures for the terrain, although some areas use the same texture. The extreme ends of the moisture make up desert and tropical types. No special texturing it set up for underwater yet but would just be an additional 3D texture. Slope also does not affect texturing yet but also will be a simple additional 3D texture.
Terrain from up high at maximum view distance
Terrain from down low at approximate player height showing trees
Trees are currently spawned on a grid, staggering will be implemented using a random seed
Underwater is tuned to have dropoffs and then flatten back out
The GUI has also been completely rewritten using a much more complex parent-child format that allows all objects to be positioned relative to other objects. This allows much more complex and dynamic GUIs to be created. It also includes many common GUI elements such as text boxes, buttons with multiple modes, sliders, fields, tooltips, color swatches, line drawing, pie charts, combo boxes, radio/check boxes, scrolling windows and more.
Window showing checkboxes, text boxes, and sliders
Editable text area, currently not in edit mode
Editable text area in edit mode
Color swatches allow easy color manipulation
Icons which are just a special form of button
Stipple patterns can be added to window backgrounds
Combo box allows a list of items to be created with complex data attached
Pie Charts which can automatically fill unspecified area and show legend with wedge highlighting
Example skill tree created with just buttons and internal logic
There are some current flaws in the code however and some incomplete classes tied to the current world. Texturing with 3D textures is using a modified binary file that is incomplete and 3D textures can currently only be used with terrain. The terrain textures are alos all loaded through the system textures, there is no 'tileset' loader yet. Trees are drawn by loading a single tree texture int o the system as well as the old sprite system no longer loads textures since trees are added dynamically through noise. A tree tileset needs to be created as well as a flora tileset which will likely be loaded through the same system instead of the old incomplete particle system.
The GUI uses a special array of enable pointers that can be set to point to internal states or external objects. This is how the example skill tree works, however the system currently results in a massive amount of memory leaks from the pointers not being handled properly. The system needs to be redesigned but is fairly complex to do so and keep the same functionality and therefore might be abandoned. This currently causes a segfault or invalid free every time the game is exited but that is all.
Currently the world is being stored in an unordered map which became an issue when trying to use distance sorting. This was an early mistake and one solution may be to create a separate ordered array of pointers to the maps.
3D objects have been added into the loader for the map. These are files labeled by their chunk coordinates which therefore requires the chunk size to remain the same. In the end this shouldn't be an issue as the chunk size shouldn't change anyway. Bounding Volumes were fixed so they draw in the correct locations and detect in the correct locations. The sample particle system showing the cabin on fire with smoke has been adjusted to be on top of the cabin loaded by the binary file but currently particles are manually placed.
Distant Castle on the Shore
Small Cabin in the Forest
Bounding Volume Detection with Ray on Small Object
Bounding Volume Detection on Large Object
Bounding Volume Detection with Cylinder
Bounding Volume Detection with Sphere
Example Particle System showing Fire and Smoke
Trees have randomization applied to their size and position although some trees seem to be far too close together still. However the following screenshot shows a very high density forest and looks pretty good considering all trees use the same texture at the moment.
High Density Forest with Random Size and Position