Customizing NPC Heads - voxraygames/worldbuilding GitHub Wiki
NPC heads can be built from components. Each of the components is currently stored in "mats/npcs/heads/multi_npc_heads.vox".
Currently the following components can be customized:
head
shapeeyebags
eyeliner
(side of eyes)eyeshadow
(above eye)mouth
beard
mustache
earrings
hair
glasses
hat
Customizing a head in the editor
Click the "Customize" button in the NPC property editor, under the "head" tree node. The head may change slightly, since the customization system tries to keep the heads more consistent than the previous system.
The palette can be chosen for the following components: hair
, eye
, skin
, hat
, earring
, and glasses
. The skin color and sometimes the hat color will also be used for body parts, for consistency.
Each component can be chosen from the combo boxes. Only head
and hair
are required.
Creating a new component
Each of these components can be added as a submodel in the "multi_npc_heads.vox" file. You must give the submodel a name with the correct prefix, head_
, eyebrows_
, etc. See the existing components for some examples. If you've properly named and added a component, it will automatically be found by the editor.
Make sure you put the new component near the other components of that type, it affects they way MagicaVoxel renders.
When creating a new component, try to use the smallest size possible that is a multiple of 9 in each dimension, e.g. 18x18x18 or 18x27x18, etc.
Sometimes when adding a component, it will look like it won't render properly in MagicaVoxel -- you'll see z-fighting like this:
In that case, try hitting the "Render" mode button in the upper-left. It will give you a better indication whether it will render properly in game.
Choosing colors for a component
Each component can use any color in the palette, but keep in mind that these palettes can be chosen arbitrarily by the level designer. In general, most components only use only the colors from its specified palette region: hair
, eye
, skin
, hat
, earring
, glasses
.
You can use the "flag" button in the palette view to help you see which colors you are using for your component:
It will place a dot over the colors used:
If you find that a component is using the wrong palette entry, you can use the paint bucket tool to change all of the colors for that component:
Creating a new palette
All palette files are in "mats/npcs/heads/palettes". You can create a new one using the same prefix as in MagicaVoxel, e.g. "hair_blonde.pal.vox" or "skin_light_purple.pal.vox".
To make a new palette, it's easiest if you copy one of the existing ones and modify it (or use "Save As" from MagicaVoxel). They are specified as MagicaVoxel files without any models in them. When you've properly added a new palette file, it will automatically show up in the editor.
Make sure the "Outline" view is empty!
Notice that the palette is completely empty except for one region: you should only change these colors! You can use all 16 colors, but make sure that they match the same palette entries as used in the other components. As an example, these are the colors from the "hat_black_red.pal.vox" palette. The black gradient on the left is the primary color of the hat. The red gradient on the right is typically used for an accent color (e.g. a band). The brown color in the middle is another color that is only used for a few hats.
Currently this is a bit haphazard, sorry! We can safely clean it up later, but it will require changing all palettes and all components to match!
Creating non-head NPC parts
Sometimes you can see skin/clothing that needs to match between the head and other parts of the NPC. As a result, all NPC parts must obey the same palette rules as the head! For now, we don't allow customization of these other parts, so you just need to make sure that any colors that are not shared with the head are using a different part of the palette. As an example, here is an arm that shows skin:
See that the palette below mostly matches the palette entries for the head too. But you can also place additional colors that are not needed for the head outside of that area, if needed. We may improve this in the future.