Generate chunks closest to the player first

Issue #42 resolved
David Williams created an issue

When a volume is loaded in Cubiquity it generates the meshes for the chunks in XYZ (or ZYX?) order. It would probably make more sense to generate those nearest to the player first. There are at least two possible approaches:

  1. Traverse the octree in a different order.
  2. Sort mesh extraction tasks according to distance from the player.

Approach (1) may be better, but there is some commented out code for (2) already in place (in C++). An edge case to be aware of is that when the player is modifying the terrain, we usually want that part to be regenerated immediately (even if it is not closest to the player).

Also, in 3rd person mode, consider whether we want to generate what is closest to the camera or what is closest to the character model. Probably a user provided 'center of generation' would be most flexible. But the (eventual) LOD system should always be centred around the camera, so we might end up with two 'centers' in this sense.

Comments (1)

  1. Log in to comment