World Creation and Modification
Everything starts with a basic face of a cube.A face (a polygon) consists of 4 points (2), 2 triangles (1) and 4 points, used for texturing. 6 faces combined create a cube (3).
Each face may have it's own texture.
Sometimes we don't need to show all faces of blocks, only a few of them. Above you can see all possible combinations of visible faces. Red means that you can't see one or more faces.
If we count a cube with some faces shown as a block, here you can see a 16x4x16 set of blocks. The top layer is dirt with grass on top and the bottom layer is stone.
In game development, blocks usually have something like IDs or types, which store additional information about them, for example, rotation. Furthermore, a (usually) 16x16x16 set of blocks is called a chunk.
As the player travels, different chunks appear and disappear, so all the chunks around the player are loaded, but there are no loaded chunks, that are too far (because of computer limitations).
Warning: bad drawing ahead.
Player before deleting a block. |
That is it for the voxel world generation, maybe later I'll cover lighting the world in a face-based way or something.
Texture Creation
Here's a little add-on that I promised before: a guide to create simple textures. Today I'll create a very simple texture that should resemble a stone texture.Here are the steps:
Create new image |
Apply a colour (here: grey) |
Add some drawings in similar colour. |
Apply Blur. |
Apply Noise. |
Check if the texture looks good duplicated. |
Here are the pictures in the original size.
No comments:
Post a Comment