_________Voxel FAQ & Hints________
 
Site Navigation
Home
AbsCnC Battleset
Voxel units
FAQ & voxel hints
Links (Main)
AbsCnC Home
Imperial Siege Mod
XCC Utils & forum
DMZ's HVA Editor
Koen's tools
_________CONTENTS__________

What, when, why?

tools and utilities -overview

Will's original editor
DMZ's hva editor
Koen's versions of Will's second editor
palette guide
normals
normals diagram
How
Limitations

 
 
  Now do you get it? -hmmm... well, it's not going to be easy.
what, when, why?
Voxels stand for 'volume pixels', although they are often more than plain pixels. Each is a cell, and you can associate various properties too each cell. of note; a colour and a 'normal' value. -see later. A voxel model is made up of many individual voxels. Strictly speaking, voxel models are 3D graphics. However, they are far less sophisticated than the polygon based models used in most 3D games and importantly, don't utilise your graphics card.

Westwood Studios use voxel models extensively in both Tiberian Sun and RedAlert2. Emperor-Battle of Dune uses polygons so this doesn't apply to any modding of that game.

To be fair, I can't say why Westwood used voxels over polygons. It's a mystery. No-one else would. The only good thing about them is that they weren't hidden well enough and modders soon learned how to open and modify them. The only real editor programs for Voxels (that I am aware of) were written by the TS modding community specifically to allow modding of CnC games - and they are all FREE! Yipee!

tools & utilities - overview
The voxels in TS and RA2 are found in the mix files. Use XCC utilities to extract these. -see XCC hompage for tutorials on this element of modding.

Once extracted (or downloaded from a modding site) the voxel can be opened in a voxel editor and edited. Some editors allow you to create a 'new' voxel but this incures some limitations. I recommend that you start a new voxel by opening an existing one and 'clearing' it. -that's what I do.

The first serious Voxel Editor, the one that changed it all, was Will's Original Editor. (nb. Will as in AbsCnC). At the time it obviously wasn't callled 'original' as it was the only one. It is still the best -no disrespect to anyone else's efforts. It is my preferred editor, as is it Godwin's and Strategic Commander's I expect too. Take that as all the recommendation that is possible.

Tragically, Will lost the source code to the editor before all the envivaged functionality could be incorporated.

After a while, and with the advent of DMZ's hva editor (see later), Will started work on a second voxel editor intended to supersede the original and allow certian things that couldn't be done with his original editor. However, he is a busy chap and development was slow (actually lightning fast but still slow for Will's pace).

As progress on his second editor started to grind to a halt, and because the code was open source, other people took up his good work. Notably 'Plasmadroid' and lately Keon. Keon is making great headway, especially with regard to mult-section models but there is currently a long way to go.

There is another popular editor out there -VxlUtil. However, whilst it is superior in terms of multi-sectioning, it is less (a lot less) visual and accessible. It is quite hard to master and I can't tell you how -since I cannot fathom it.

Oh, before I forget, with every voxel file is an hva file. This basically lists the animations required of the voxel -although it shouldn't be confused with the locomoter which is in the INI files. The hva file must have the same name as the voxel to work. If there is no hva file and you run the voxel in the game: you crash the PC.

Most voxels don't require a complex hva. You can simply copy and rename an existing one. However, for multi-sectioned voxels, you must create a specific one. This is done using DMZ's hva editor.

Hang on! -What is a multi-sectioned voxel? Most voxels are 'simple'. That is to say that they only have one section. Examples are aircraft or tanks. Multi-sectioned voxels have several seperate voxel models within the single file. Examples are 'walking' robots were the legs move or helicopters with spinning blades. Note that tanks with turrets are (nearly always but not limited to) simple voxels! -the turrets, barrels and hull are three seperate models. each with one section -the game automatically puts them together.

Will's original editor
This is the best one to start with. In fact, unless you have ambitions on multi-section voxels, stick to it.

On the left hand side is the pallette. Both TS and RA2 use the same palette. See the palette guide for specific info. If your voxels have a pink outline, now you know why.

The toolbar has drop down menus with great functions.

The main editing window is split into four. The main three allow you to edit the voxel whilst the fourth is a constantly updating 3d view.

Hot Keys/ controls-live on them....
z = scroll one line in z-plane (axis)
Shift,z = scroll one line in oppersite direction in z-plane
y= scroll one line in y-plane
Shift,y = scroll one line in oppersite direction in y-plane
x = scroll one line in x-plane
Shift,x = scroll one line in oppersite direction in x-plane
Shift,right_mouse_click = select colour (or normal) at that point
Shift,left_mouse_click = jump to that point in affected planes (eg. z,x,y)
Left_mouse_click = place voxel of selected colour (and normal)
Right_mouse_click = delete individual voxel
f,click = flood fill (only in one plane at a time)
 

Make use of the functions under the 'tools' menu to radically reduce time. In particular, the Y_mirror function and Autonormalise functions.

The view menu allows you to view the normals and the header info. Using this, the normals can be edited by hand much the same as the colours. However, I only rarely bother editing them manually. I just use the Auto-normalise tool.

The header info is very powerful. The pop-up menu is split into three sections. The top one allows you to change the number of voxels in the model. The middle one is best left alone. The bottom section allows you to change the 'on-screen' size of the voxel. Many people get confussed with resizing but this menu makes it easy. Importantly, note that the 'on-screen' size and number of voxels are independant of each other.

...... and so endeth the first lesson.

Koen's versions of Will's second editor
I currently use version14 but these is of course always evolving. The guide may be ellaborated apon as new versions are released.

The editor is set out much as the original editor.

There are several major differences though.

1] ..... to be continued................................

normals

Mostly quoted from Will

A 'normal' is a normalised vector at right-angles to the plane of a face. This means that you work out the direction a flat thing in 3d (a triangle usually) is pointing and then reduce the precision to a series of encoded directions. Normals are very common in 3d worlds (polygon ones too).

They tell the code drawing the model which direction a triangular face of a polygon or a voxel is facing, so that it can be shaded in light properly. Indeed, in polygon models the normal of a face is useful for skipping polygons that are facing away from the screen, as we know they can't be seen anyway.

The voxel models in TS / RA2 weren't drawn as voxels originally. They were modelled in 3D Studio Max and then converted into voxel models. When the model was a series of triangular faces it was very easy to calculate the normal for a face. However, when you have just the voxels it is impossible to accurately recreate these normals, because obviously each normal represents a 'cell' that has a triangle passing through it, and that triangle could come from any direction. Voxel conversion is 'lossy' - some detail is lost. You can't accurately recreate that detail, and often it is impossible even to guess well!

TS used 36 (IIRC) distinct normal directions. These spiralled upwards from bottom to top like the peel of an orange. RA2 uses 256 normal directions, giving it enhanced shading quality. How they are encoded is a matter of conjecture, and careful observation of the various 3d models in RA2 is necessary (the zepplin is most telling). Will's opinion is that the first 36 are in exactly the same position as in TS (which would be great backwards compatibility- a quick test would be to change the normals encoding flag in a TS model to '4' so it should use RA2 normals, and see if it still looks ok in RA2). The other values from 37 upwards are then spaced between these first 36 spiralling upwards like the peel of an orange. But that is just conjecture!

If we are converting from a polygon model (as Westwood did) it is easy to calculate the normals on the polygon model and save them in the voxel. If you start with a voxel however, it is very difficult to determine the correct normal automatically.

This is how the first voxel editor did it (for TS normals):

First, determine the inside from the outside of the model.

Next, 'fire' normals from top, bottom, left, right, front and back with the appropriate values.

Finally (and this is incorrect), take all normals and average them with adjacent normals, thus smoothing it. In fact, this averaging should work better now we understand that normals spiral upwards.

One last thing, it seems that 'top' of a model is actually at a slight slant, which would suit isometric projection better.