Terrain Engine library for Amethyst


I’m working on a terrain engine called Gaiku that would have an amethyst implementation.

The main goals of the library are not so clear yet, just because I’m still learning about it and never worked on a project like this, but took inspiration on an Amethyst RFC.

But describing basically the project (besides of what is in the readme of the repo) is to have an implementation that works for 2D and 3D terrains, using a system similar to Amethyst assets loading, where you have different file readers implementations (gox, png, tmx, etc) and bakers (mesh generators) that would generate meshes using different algorithms (voxel, marching cubes, tiles, etc), and other systems that would help you to load/unload the chunks based on player position, and also use LOD too.

Right now the library is still immature and heavily under development so it would change a lot in the future, also what would set roadmap will be the projects that use this library, because this will evolve according to the needs of those projects, so if anyone want to tell me what they expect for this kind of library and/or give advice/critisism about it I’m open to read them.

PD: Also thanks @erlend_sh for the mention in the post

(Erlend Sogge Heggen) #2

That’s a lot of work compressed into very few words! :wink: What particular path will you be going down first? Based on what research and prior art.

Are you making a game of your own as well that you’re planning to use this in?


Well, I’ve working the mesh generation working for marching cubes and voxel, the 2D stuff didn’t touch it yet, but my idea is having something similar to load assets, where you provide a FileReader implementation that returns (for now, but I want this to return an octree with chunks as leaf) a vector of chunks, then you have the Bakers that generate the meshes for each chunk, I wanted to take this approach because having this we have the flexibility to load files on the fly and also generate the meshes on demand.

Yes, I’m planing to make a game using marching cubes with terrain modification in game.

So my short goals right now are:

  • Implement Octree (to seach chunks, later on I think the foliage and trees can be inserted here too, but not quite sure about it).
  • Add Material support (this is most likely when rendy lands on amethyst, that’s when I would start adding the amethyst implemention)
  • Foliage support (but still don’t know what’s the best way to achieve this, also the lack of proper editor is one of the obstacles, maybe one in game, also to achieve this need to have a file spec to write and save the terrain)
  • Then write some test and benchmarks

Hopefully this would be achieved in one or two months.

(Thomas Monroe Clark III) #4

Hey man, any progress on this? Searching for some good voxel mesh stuff for amethyst.

1 Like

No real progress made in the last couple of months, because I’m not having too much spare time lately. You are welcome to send pull request or fork the project if you find it useful, or if you start another repo I could add to the readme of mine a link to yours.

If you want to check the state of the project you can go to the examples run them and they will ouput a 3d model that you can preview in a 3d editor. There is a small issue with the marching cubes and goxel, where the chunks have a 1 unit spacing between them, I didn’t solve that issue yet.

(Thomas Monroe Clark III) #6

http://ngildea.blogspot.com/2014/09/dual-contouring-chunked-terrain.html might be a good place to start for the problems with the chunks and also a good resource for DC in general (so I’ve heard)


@TMcSquared thanks, because that was exactly the problem I was having. I really want to work on my library but my spare time will be limited for a couple of months.

If someone is interested in collaborate with gaiku (I can add you as a collaborator) and do whatever change in the architecture you think is better than the current one you are welcome, because the idea basically of my library is to have an input trait and a mesh generation trait where you implement your file reader and baker respectively and then develop only one library that handles the terrain.

Besides the issue I was having with the chunks, there was another that I was not able to think about (because again my knowledge about the topic is limited) and is to find a good structure to store the mesh, material, uvs, etc in a format that is still framework agnostic and fully compatible with amethyst without a lot of work involved into passing to the engine (an also I want to avoid as much overhead as possible).