In a game that I am developing, I am attempting to procedurally generate a voxel environment at the beginning of each match. A problem that I have encountered with this is that while the SetVoxelSphere(), and SetVoxelBox() functions create many voxels very efficiently, using SetVoxel() repeatedly to create variable and diverse landscapes or voxel objects is very inefficient.
It would be ideal to have an API function that could place many voxels at variable coordinates at once.
Another instance where this could prove valuable is creating voxel objects. User VictorE (stadia id "Victorious") created a Lua script tool that can take coordinates from an external program and "3D Print" voxel objects in game, but he has encountered issues with efficiency as well, having to resort to many calls of SetVoxel().
By having an efficient way to use Lua to create a diverse voxel pattern, advanced creators will have the freedom to use code to place voxels just as easily and usefully as in the editor.
My personal take on this would be a function that has two forks that work as follows:
1. entity:SetVoxelArray(voxelAsset, vector, vector, vector, vector. etc.)
- This is a simplified version that will take the defined voxelAsset and place that voxel at each argument-defined vector.
- This is a more advanced solution where a table is used to define the vector and voxelAsset, and the function would iterate through this table, placing voxels of the defined voxelAsset at each voxels relative vector.
Please sign in to leave a comment.