04-01-2012, 05:49 AM
(This post was last modified: 04-01-2012, 05:54 AM by MirceaKitsune.)
Although it's April Fools, no, this isn't a joke (I'm not good at making these xD). Last night I seen a bunch of videos about the technologies coming in future game engines... such as the infamous "unlimited detail". On top were voxels with a technology called marching cubes for smoothness. This allows for destructible / constructible terrain like that of Minecraft, and even models which fall apart (realistic player damage... not that I like gore). Voxelstein is an even more useful example:
I've been wondering if / how Xonotic could have breakable voxel walls like that, even without smoothness factor. This can already be done the hard way, by placing a lot of little func_destructible brushes. But I thought of a way in which this could be done more easily, and want opinions and some help on the implementation.
It would consist of two entity types, both brushes: A func_voxel and a func_voxel_filler. The func_voxel is a single voxel, most commonly a cube textured on all sides (you can do other shapes too). The func_voxel_filler is the filling of the wall, textured with a trigger texture. When the map starts, it will be entirely filled with the func_voxel it targets. Now the func_voxel will have some keys... such as the amount of damage needed to fall off, if voxels just disappear or become physical instead, and how long fallen voxels last after being detached (debris).
Long story short, these are the steps a mapper would take to create a voxel wall:
1 - Open netRadiant and make your map as usual, but leave an empty space where the voxel wall will come.
2 - Create a small brush (most commonly a cube) and texture it on all sides with the appropriate texture. It can be placed anywhere in map bounds, since this specific entity will only be used for reference and not appear on the map.
3 - Make the little cube a func_voxel and give it a few keys such as health, and of course a targetname.
4 - Now in the area where you want your voxel wall to appear, create a large brush with the common_trigger texture. You'll want to create it as if that brush is the wall, same way you do normal surfaces.
5 - Make this brush a func_voxel_filler, and set its target to the targetname of the func_voxel. An angle key would specify how the voxel is rotated.
6 - Compile the map and open it in Xonotic. The func_voxel_filler is now filled with copies of the func_voxel. In case that's a pure cube, it will look exactly like a normal wall (probably a bit pixelated due to texture mapping).
7 - Now shoot the wall a few times, preferably with a splash damage weapon. Once each voxel takes enough damage, it will fall off and you can dig through the wall.
Here's an image showing how this would look in a final stage. Observe the entity names as well.
Now this method has several disadvantages, the greatest being performance. The smaller a voxel is, the greater the quality but at the same time, the lower the frame rate. You'll probably want your wall to be about 6 voxels thick at most, voxels representing bricks instead of pixel-sized bits. A voxel wall will also not vis (obviously) so keep this in mind. It will be the mapper's responsibility to use the feature wisely and check performance.
The tricky part is reading each spot on a virtual grid inside the filler brush, that grid consisting of the voxel's size and rotation. So no matter how it's rotated, each voxel neighbors the other one perfectly. Spawning the voxels will use a for loop. I will require some help with this formula, so if anyone knows how to do it please tell me. For getting the voxel's size, self.mins and self.maxs should work.
Please let me know what you think. If you believe this implementation has an issue, tell me what to correct or post your own idea. I want to hear suggestions and get an ok from the admins before starting this, so my work won't get lost and I won't have to beg for a merge Also wanna know who else wants this and if I'm doing it for a reason, or I'm the only one into this whole voxel thing.
I've been wondering if / how Xonotic could have breakable voxel walls like that, even without smoothness factor. This can already be done the hard way, by placing a lot of little func_destructible brushes. But I thought of a way in which this could be done more easily, and want opinions and some help on the implementation.
It would consist of two entity types, both brushes: A func_voxel and a func_voxel_filler. The func_voxel is a single voxel, most commonly a cube textured on all sides (you can do other shapes too). The func_voxel_filler is the filling of the wall, textured with a trigger texture. When the map starts, it will be entirely filled with the func_voxel it targets. Now the func_voxel will have some keys... such as the amount of damage needed to fall off, if voxels just disappear or become physical instead, and how long fallen voxels last after being detached (debris).
Long story short, these are the steps a mapper would take to create a voxel wall:
1 - Open netRadiant and make your map as usual, but leave an empty space where the voxel wall will come.
2 - Create a small brush (most commonly a cube) and texture it on all sides with the appropriate texture. It can be placed anywhere in map bounds, since this specific entity will only be used for reference and not appear on the map.
3 - Make the little cube a func_voxel and give it a few keys such as health, and of course a targetname.
4 - Now in the area where you want your voxel wall to appear, create a large brush with the common_trigger texture. You'll want to create it as if that brush is the wall, same way you do normal surfaces.
5 - Make this brush a func_voxel_filler, and set its target to the targetname of the func_voxel. An angle key would specify how the voxel is rotated.
6 - Compile the map and open it in Xonotic. The func_voxel_filler is now filled with copies of the func_voxel. In case that's a pure cube, it will look exactly like a normal wall (probably a bit pixelated due to texture mapping).
7 - Now shoot the wall a few times, preferably with a splash damage weapon. Once each voxel takes enough damage, it will fall off and you can dig through the wall.
Here's an image showing how this would look in a final stage. Observe the entity names as well.
Now this method has several disadvantages, the greatest being performance. The smaller a voxel is, the greater the quality but at the same time, the lower the frame rate. You'll probably want your wall to be about 6 voxels thick at most, voxels representing bricks instead of pixel-sized bits. A voxel wall will also not vis (obviously) so keep this in mind. It will be the mapper's responsibility to use the feature wisely and check performance.
The tricky part is reading each spot on a virtual grid inside the filler brush, that grid consisting of the voxel's size and rotation. So no matter how it's rotated, each voxel neighbors the other one perfectly. Spawning the voxels will use a for loop. I will require some help with this formula, so if anyone knows how to do it please tell me. For getting the voxel's size, self.mins and self.maxs should work.
Please let me know what you think. If you believe this implementation has an issue, tell me what to correct or post your own idea. I want to hear suggestions and get an ok from the admins before starting this, so my work won't get lost and I won't have to beg for a merge Also wanna know who else wants this and if I'm doing it for a reason, or I'm the only one into this whole voxel thing.