1
votes

I'am working on a game with an low poly style. I have been searching for precedural terrain generation but there where only 3d or tile based tutorials.

INFO:

  • Langue is Java using the libGDX framework and released on android.
  • The terrain will be generated procedural while the game is running using a chunk loading system (for an infinite world).
  • The game terrain will be saved. And should be reloaded with the same terrain.
  • The Terrain can be convex (caves).

terrain

QUESTION:

  • Are there any good tutorials or libs?
  • If I use chunks to only load parts of the map some triangles vertices will contain 2 differen chunks how to manage these?
  • I have read that I shouldn't save / load a chunk to a file. But just generate the terrain using a seed. How do I tell the generator to not generate something that was removed previously?
  • What about entities save them to a file?
1

1 Answers

1
votes

A few bits of general advice I have

  • Possible vertex overlap could be accounted for by defining and saving chunks with padding to account for the maximum a vertex could go outside of its chunk. Minecraft, for example, never had this problem because cubes line up very nicely. You could consider changing the geometry you're using. For example: define the world as cubes, and then apply an effect to move all vertices pseudo-randomly and thus hide that you're generating using cubes.
  • I would generate all terrain using a seed instead of saving and loading from a file except for in chunks where something has been removed. Those chunks will need to be saved. You could overwrite seed chunks with these.
  • Just like you said in your question, handle entities by: saving them to a .properties file or something. I would using a LinkedList<> or array[] with an abstract parent class to keep track of them in-game.

Some videos about procedural generation in general:

This is all pretty abstract information, but I didn't want to leave this without any response. Hopefully someone with more experience in the particular area can give you more practical insight.