Suddenly, I'm working on making a planet. Again.
The first attempt was based on an article I read about a R.O.A.M.-based level-of-detail algorithm. I focused so much on the data structures that I never got to the graphics, and so I lost interest.
The second attempt was to take a square grid, stretch and fold it into an octahedron and tesselate it into a sphere. Though I managed to create an undistorted heightmap with continents, when I got to erosion I decided that distortion is too complicated.
The third attempt was to create a Minecraft-like flat world of cubes that wrap around at the edges, instead of being infinite. At the time I was planning on adding "seamless" space travel. I spent a lot of time working on finding a transformation that would allow the planet to be flat when you are close, but round when you are flying through space. All the possible transformations had the flaw that the space-space had a two-to-one mapping to the planet-space; I.e, when you take off from a planet you end up in two locations in space. What a mess!
In this new attempt, the fourth, the planet will be round and made up of voxels, using a technique called dual-contouring to allow diagonal and curved shapes. The same technique was used by Miguel Cepero in his Voxel Farm engine, which is a component of the ForgeLight Engine being used in the EverQuest Next games.
My plan of action for Phase 1:
The first attempt was based on an article I read about a R.O.A.M.-based level-of-detail algorithm. I focused so much on the data structures that I never got to the graphics, and so I lost interest.
The second attempt was to take a square grid, stretch and fold it into an octahedron and tesselate it into a sphere. Though I managed to create an undistorted heightmap with continents, when I got to erosion I decided that distortion is too complicated.
The third attempt was to create a Minecraft-like flat world of cubes that wrap around at the edges, instead of being infinite. At the time I was planning on adding "seamless" space travel. I spent a lot of time working on finding a transformation that would allow the planet to be flat when you are close, but round when you are flying through space. All the possible transformations had the flaw that the space-space had a two-to-one mapping to the planet-space; I.e, when you take off from a planet you end up in two locations in space. What a mess!
In this new attempt, the fourth, the planet will be round and made up of voxels, using a technique called dual-contouring to allow diagonal and curved shapes. The same technique was used by Miguel Cepero in his Voxel Farm engine, which is a component of the ForgeLight Engine being used in the EverQuest Next games.
My plan of action for Phase 1:
- Get the basic framework up and running, so that I can debug right from the beginning.
- Make a spherical mesh with reasonably evenly distributed vertices/nodes. Each node represents a cuboid zone of voxels (a.k.a. a chunk). Each edge represents a connection between adjacent zones.
- Implement large-scale emulation and simulation procedures to generate the zone generation parameters. E.g. continents, plate tectonics, water erosion, formation of rivers, lakes and oceans, temperature, prevailing winds, rainfall, and seasonal effects.
- Serialization and deserialization of the zone generation parameter mesh.
- Implement generation of zone voxel data from parameters using emulation and simulation of small-scale processes. This is only triggered when the camera comes close enough to the zone.
- Alteration of the voxels. E.g. digging, building, explosions, eruptions, fluids.
- Serialization of differences between the current zone voxel data and the procedural voxel data.
- Automatic loading and unloading of zones.
- Phase 2: Fancy graphics.
No comments:
Post a Comment