Create - Editing and importing

Almost all assets used in Teardown was modeled in the free voxel editor MagicaVoxel. MagicaVoxel can be downloaded here. Teardown have been tested with models created in MagicaVoxel up to version 0.99.6.2.

This documentation covers MagicaVoxel 0.99.6.2. 

While we can't teach you how to use MagicaVoxel, there are a few concepts and some tips on how to create assets that work well with Teardown.  

The palette 

In MagicaVoxel the palette is made up of 255 indexed colors. This means each color slot has a index number according to its position in the palette. These indices are used in Teardown to decide what material any individual voxel is made of. 

Observe that the actual color (whether its green, blue, white, or any other color) doesn't matter. Only the position in the palette is important from a material perspective.
For example, the color at index 9 is always grass, no matter what actual color it is. 

You can see what index a particular color position has by hovering over it. The index will be shown in the console at the bottom of the screen.

To assist with materials, we are providing a MagicaVoxel file which has the palette annotated with the material names next to the colors.
The palette can be downloaded here

If you can't see the material names when you open the file, click the little arrow button at the top of the palette (marked with a red outline in the image above). 

Object BASICS in MagicaVoxel

When you open MagicaVoxel, you are in the edit mode. You can see this because the editing tools are visible to the left of the 3D window in the center. If you press the TAB key, the view is switched to the scene mode, which you can see as it now shows 8 layers named 0 -7 to the left of the 3D window.

In edit mode you can make changes to the currently selected object with the various tools.

In scene mode you can create, delete and move objects around. New objects are created with the plus button at the top of the window.

Each individual object can be a maximum of 256 * 256 * 256 voxels in size. But you can create more objects to make bigger levels.

For performance reasons we recommend that you don't use objects at the maximum size, as it might cause stutters in the game.

Objects of half that size in all axis (128 * 128 * 128) are generally OK. Very big but flat objects are also OK., i.e., 256 * 256 * 10.

Empty space in objects

Objects with a lot of empty space should be divided into several objects. This helps the engine avoid spending time traversing empty space inside objects. The tree to the right is separated into two objects. One for the crown, and one for the trunk. Thereby eliminating unnecessary empty space around the trunk.

Another good example is a house. A house should never be built in one single object. Instead walls and floors should be divided into thinner objects.

In this image, the house to the left is divided into four separate objects, which is the correct way to do it. In the house to the right all walls are built in one single object, creating a lot of unnecessary empty space.

Building assets the right way can greatly impact the performance of your levels positively. 

The floor grid

Each Create level has a thin static box at the bottom of the world. This box is there to make sure your level doesn't fall through the world. 

In MagicaVoxel the position of this world is represented by the gray grid in the 3D window. Make sure that your level is connected down to this grid, but not under it.

In MagicaVoxel you can make sure an object is resting on the grid by selecting it and pressing the G key. 

Object order

By clicking the "Show Scene Outline" button (marked with a red outline in the image to the right). This shows all the objects in your scene with the most recently created at the top.

This is important, because the order in which objects are created matters to how they are imported in the game. Newer objects that overlap older objects replace the voxels in the older object when imported. 

An example:
Lets say we have two objects; one is a brick wall and the other is a wood wall. These two objects intersect with each other in the scene.

When imported into the game the voxels of the brick wall (which is newer/topmost in the hierarchy) will replace the voxels of the wood wall where they intersect. 

The only way to change object order in the hierarchy is to cut (CTRL-X) and then paste (CTRL-V) it. This retains the objects position in the scene, but moves it to the top of the hierarchy. It is now the newest object in the scene.

Spawn location

The player spawns at the highest point in the center of the level. Try moving your creation around in MagicaVoxel to find a good position for your level.

SAVING and loading A LEVEL

Once you have made something in MagicaVoxel that you would like to see in the game, you simply overwrite the existing .vox file in the respective Create scene folder.

The file locations for the Create .vox files are:
"[install folder]/create/basic/basic.vox"
"[install folder]/create/island/island.vox"
"[install folder]/create/castle/castle.vox"
"[install folder]/create/vehicle/ground.vox"
"[install folder]/create/custom/custom.vox"

Once you have saved the file, open the game, go to the Create menu and click on the level which file you just saved over.

Previous page:
Create - Introduction Next
Next page:
Best practices