Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ideas for Voxelman to move it forward in a sensible direction, properties #8

@ghost

Description

Voxel Properties

Naming: States, Properties, Params

Properties/params are int, bool, enum, string variables that are manually defined for specific Voxel ids using a property_name keyword. Properties are used to define custom behavior or looks for Voxels and although are associated with an id, are actually stored per x,y,z Voxel in the VoxelChunk.

A dictionary with key params["x,y,z:property_name"] can be used to store properties in addition to the ch[] array used for Voxels.

Examples:

  • rotating block facing_enum property
  • block look property to change texture
  • buttons or switches pressed
  • furnace lit

References:
Forge Blockstates
Minecraft Wiki Block states
Minetest Wiki for register_node

Voxels can rotate

Naming: dir, direction, facing, facedir, orientation

With the implementation of properties/params above, we can now add more customization to specific Voxels. Adding a facing int property allows Voxels to specify a texture rotation. Mesher can now render the texture to follow the facing specified by the property. By default all Voxels face NORTH.

A utility class Facing stores all the facings for example Facing.NORTH, Facing.SOUTH, Facing.EAST, Facing.WEST, Facing.UP, Facing.DOWN and also allows for additional functions such as rotate(Vector3, Facing.LEFT), give a Vector3 for a facing Facing.to_vec3(Facing.NORTH) etc.

Voxels can change material/look/texture

Naming: look, texture, tex, alt, mat, material

When a voxel has a look string property defined, the mesher will use that string as the material for that specific Voxel. This parameter can be dynamically updated from Script.

Look would store only a name and not the full path. A material path can now be declared per Voxel id.

Voxels can use custom 3D meshes

A property/param called mesh defines the name of the 3D mesh that the meshes will use instead of the regular block/marching cube mesher. Such a voxel is declared as being transparent internally and is not processed by the mesher and will not mix in with the rest of regular voxel terrain.

A mesh path can now be declared per Voxel id.

I know that there is a mesh_data_tool support which appears to allow for custom meshing but perhaps built in meshes .tres meshes should also be supported by default as is simply adding a mesh into the world as is without any rotation at a specific x,y,z location. So is upt to the user to manipualte this mesh so it looks good at 1:1 scaling and correct rotation.

Conclusion

Thank you for reading and for all your contribution and work thus far. And sorry for the long post. Just wanted to be thorough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions