User Tools

Site Tools



Voxels definitions are stored in the voxels/ directory. Each file ends in .voxels and can override another one ( vanilla/core voxels are loaded first, then your mods so they can override vanilla ones ). The .voxels files use the NamedWithProperties file format.

Voxel definition blocks begin by the 'voxel' tag, and you are supposed to assign them an ID after stating their name. Voxel definitions can be overwritten by mods, be careful.

Example from chunkstories-core

# ChunkStories
# Voxel definition format 0.4

voxel air
	solid: false
	opaque: false

voxel grass
	textures: '~', 'dirt', '~side', '~side', '~side', '~side'

voxel dirt

voxel leaves
	opaque: false
	selfOpaque: false
	affectedByWind: true

voxel snow
	customClass: io.xol.chunkstories.voxel.core.Voxel8Steps
	opaque: false
	selfOpaque: true
	model: 'steps.m0'

voxel water
	selfOpaque: true
	solid: false
	opaque: false
	liquid: true

voxel glowing
	emitting: 15

voxel soil
	opaque: false
	selfOpaque: true
	model: 'steps.m6'
	collisionBox: (0.0, 0.0, 0.0, 1.0, 0.875, 1.0)

Built-in configurable properties

These properties are resolved by when reading your definition, using those you can tweak the behavior of the voxel without resorting to writing a custom class.

  • solid : Is this voxel solid in the physics engine sense
  • opaque : Is this voxel 'full' and so blocks lights and cull neighbours ?
  • selfOpaque : If this voxel is not “opaque”, does it connects with others voxels of the same type ? (ie glass or water)
  • liquid : Used for physics engine and rendering passes, does this voxel has the properties of a liquid ?
  • material : Defines the Material used by this voxel type
  • emitting : 0-15, how much light does it emmits
  • model : Said block model name and optional subtype ( See Custom block models ))
  • texture : Sets the texture used by this voxel, by default it just looks for the voxel name instead. For more information check out the page on Voxel textures.
  • textures : Define each side's texture independently, in order LFRBTB
  • collisionBox : Defines the collision box for this voxel. To have voxels with more than one collision box, you have to use a custom class.
  • customClass: If provided, the game will try to use a custom class for this voxel.
  • billboard : Not recommanded. Special option, makes the block's normal always face you.

The voxels/textures folder

Contains textures for the voxels. Accessed by their name in the code/.voxels files. The normal/ folder contain the normal-mapped versions of the textures, if not provided the game uses a flat default normal map. The meta.txt contains informations about the scale and whatnot of the textures :

texture smoothstone
	textureScale: 2

texture sand2
	textureScale: 4

The voxels textures in those folders are merged in a texture atlas before usage.

voxels_format.txt · Last modified: 2018/01/25 12:19 by gobrosse