Other than the work in Photoshop or Gimp etc, it basically involves copying files to the correct folder and editing the
_FOHuman.fo3d file. We'll be working with the following layers :
150 # Skin (Skin tone)
155 # ArmorClothing (clothing texture)
Firstly, you'll need to make sure you have a
3D compatible SDK set up. Assuming that's all in order, the rest of this should be straightforward.
Preparation filesThe next step is working on the texture itself. You may have done this already. If not, I suggest downloading the following texture guides. These are layered PSD files, which contain overlays to show the models' edges and the subset outlines :
Base Human Male Subset / texture map1024x1024 layered PSD file, with outline, colour markers and base texture (~4.5MB)
subset map male.psd (New link 22/01/2012)Base Human female Subset / texture map1024x1024 layered PSD file, with outline, colour markers and base texture (~3.5MB)
subset map female.psd (New link 22/01/2012)I won't explain how to make the textures themselves here - that's your own creative process. However, if you're new to this it may be worth looking at some of the existing textures in the \Client\data\textures folder, and then asking questions on the
2238 3D Development forum. There is a good little community of talented and friendly people on there who should be able to help you. Of course, if one of the texturers wants to make a tutorial illustrating their personal technique, that would be very useful.
Testing a skin tone / base layerIf you've set up your
3D compatible SDK according to the previous tutorial, you should have a few currently unimplemented textures. If we look in the \Client\data\textures folder, we should find three tribal designs from user
Johnny Rust :
male_Skin_rust_shaman.jpg
male_Skin_rust_headhunter.jpg
male_Skin_rust_urban.jpg
These are skin tones for the bottom layer (150). These can be partially covered by the #armourclothing layer (155), but will always show through on areas designated in the subsets, which we will cover later. In short, this means that the bare skin (normally the head and hands) will always maintain the skin tone underneath, regardless of what colour shirt or trousers is being worn.
Looking at the _FOHuman.fo3d fileSo, this should be quite straightforward. Open up your \Client\data\art\critters\_FOHuman.fo3d file and scroll down to the skin section :
# Skin
Layer 0
Value 1 Root Texture 0 %anim%_Skin_white.jpg Texture 2 %anim%_skin_spec.tga
Value 2 Root Texture 0 %anim%_Skin_whiteTT.jpg Texture 2 %anim%_skin_spec.tga
[...]
Value 30 Root Texture 0 %anim%_Skin_lbtest.jpg Texture 2 %anim%_skin_spec.tga
A quick description of the components here :
Layer 0All the layers in the fo3d start from 150, so this corresponds to layer 150, as you will recognise from the previous
tutorial.
Value zThis is the value to use when selecting this skin via in game command.
RootCommand which merely says this goes on the base model
Texture 0This is our diffuse layer, to use the texture specified.
%anim%[...]The %anim% refers to the anim line from the model fo3d files (i.e. VbMaleStrong.fo3d and VbFemaleNormal.fo3d). If you open VbMaleStrong.fo3d, you will see it specify "anim male". As well as this selecting which animation files to use, it also refers to the texture files, so for example :
%anim%_Skin_lbtest.jpg (code from fo3d file)
male_Skin_lbtest.jpg (the file it will search for when the model is male)
female_Skin_lbtest.jpg (the file it will search for when the model is female)
When other body types are implemented, they will refer to whichever file corresponds to their animation set. If the fat man uses the "male" animations, it would look for the same file. If he has his own "malefat" animations, it would look for "malefat_Skin_lbtest.jpg".
Texture 2This is our specular layer (the shinyness, affecting highlight and shadow), and will use the texture specified, with the %anim% command working exactly as above. User
Karpov has kindly supplied us with a selection of base skin speculars.
Texture 1This is not mentioned here yet, but is currently in development by user
JohnnyBravo. This layer will be used for normal maps (super bump maps, to add extra detail for the shaders to use for highlights and shadows). When implemented, the normal map will be specified in the same manner as the other two layers.
Implementing the files into the _FOHuman.fo3d fileFrom this, we can now look at adding our three textures here. If we scroll to the bottom of the # Skin section, and add some new lines below value 30 :
Value 31 Root Texture 0 %anim%_Skin_rust_shaman.jpg Texture 2 %anim%_skin_spec.tga
Value 32 Root Texture 0 %anim%_Skin_rust_headhunter.jpg Texture 2 %anim%_skin_spec.tga
Value 33 Root Texture 0 %anim%_Skin_rust_urban.jpg Texture 2 %anim%_skin_spec.tga
Now save your _FOHuman.fo3d file. Note that currently we only have male textures, so you won't be able to test these with the female model yet.
Testing in gameIf you've gone through the previous tutorial, you will probably know how to do this already, so we will make the assumption that you have your SDK running, and you have a save game with your character ready for testing.
Run the FOnlineSingleplayer.exe
Load your saved game
Run the code ~getaccess admin password
Now follow the same parameter codes as previously :
~param x y z
x = Use 0 for this.
y = parameter number. 150-165 are our appearance parameters.
z = value of parameter y
Let's remove the hat / hair / armour / clothes (on the 3D model, it is not necessary to remove your own clothes) :
~param 0 154 -1 (hat off)
~param 0 157 -1 (hair off)
~param 0 153 -1 (armour off)
~param 0 155 -1 (clothes texture off)
Now we can try the three new skin tones :
~param 0 150 31
~param 0 150 32
~param 0 150 33
If you want, you can give him a pair of tribal trousers :
~param 0 155 28
Notice that the trousers cover the skin up, but leave the head, chest, arms and feet? That's the subsets from the clothing layer, which we will look at next.
Testing a clothing layerAgain, this is mostly text editing. We're going to be using layer 155, specified in the fo3d as :
# ArmorClothing --------------------------------------
Layer 5
Value 1 Root
Subset 4 Texture 0 Male_baseblack.tga Texture 2 no_spec.tga
Subset 3 Texture 0 %anim%_leatherpants.tga
Subset 6 Texture 0 %anim%_leatherpants.tga
Subset 7 Texture 0 %anim%_leatherpants.tga
Subset 8 Texture 0 %anim%_leatherpants.tga
Subset 10 Texture 0 %anim%_leatherpants.tga
This should all look quite familiar - the value, the root, the texture 0, the %anim% and the texture 2 all working exactly as above. The one difference here is the subsets.
SubsetsSubsets are how we control which areas to apply the clothes to, and which should be left empty for the skin to show through underneath. Assuming you took the texture guides from above, you will have seen the coloured and numbered sections of the subsets. These correspond to certain areas on the body, clarified here :
So, we can choose any of these subsets to apply the clothing texture to, based on the lines from the _FOHuman.fo3d file. If we look at subset example man below, we can also specify different textures to different subsets :
If you look at the lines on the right of the image, we have different textures applied to different subsets. In practice, this means we could take the trousers from one texture, the shirt from another texture and the shoes from another etc. The section names and colours should correspond to those in the guides we looked at earlier.
Example codeThis is probably pretty clear already, but we will try a little example. In your \Client\data\textures folder, you should have a test file for a generic yellow costume :
Armor_male_yellow_body.png
We will now add 3 variations to our _FOHuman.fo3d file. Scroll to the bottom of the # ArmorClothing section. The last layer should be 34. We're going to add a 35, 36 and 37 to it :
Value 35 Root
Subset 1 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 6 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
This one will just cover subsets 1 and 6 - a costume which you probably shouldn't wear unless you're in the circus.
Value 36 Root
Subset 1 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 3 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 4 Texture 0 Armor_%anim%_suit_clothing.jpg Texture 2 no_spec.tga
Subset 6 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 7 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 8 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
This should give us a full pair of trousers (6, 8, 3, 7), with a sleeveless vest (1). Note that we're also using the shoes (4) from the "suit clothing" texture.
Value 37 Root
Subset 0 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 1 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 3 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 6 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 7 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
Subset 8 Texture 0 Armor_%anim%_yellow_body.png Texture 2 no_spec.tga
This should give us a pair of trousers (6, 8, 3, 7), with a short sleeved shirt (0, 1). He will be wearing no shoes.
Copy the relevant lines into the _FOHuman.fo3d file and save it.
Testing in gameWe can now test these files via commands. This should be probably quite familiar to you now.
If the game is already running, you'll have to quit and restart, as currently there's no way to refresh the fo3d files and textures.
Run the FOnlineSingleplayer.exe
Load your saved game
Run the code ~getaccess admin password
Firstly, let's change to a simple skin texture, as it will make the example clearer :
~param 0 150 30
Now we can try our three new values :
~param 0 155 35
~param 0 155 36
~param 0 155 37
This should all be clear now, but just to illustrate the interaction between layers 150 and 155, let's change the skin tone underneath :
~param 0 150 4
now check the values 35 and 36 again :
That's basically it. Now we have seen and tested this, we can look at one of the potential problems.
Problematic texturesAs I'm sure you've noticed, the subsets are reliant upon the different parts of the texture stopping at specific edges. If there is to be visible skin, the seam between the skin and clothing must end at the edge of a subset. If we try to add a 3/4 length sleeve, or cut a "v neck" into the shirt, we will end up with the "skin" part of the clothing layer being used, which will ultimately end up with problems such as black skinned characters having patches of white skin. This is most problematic on some of the female textures, where a "V neck" is required to replicate the sprite correctly.
Potential solutions to this are :
- Adding some extra subsets
- Restricting some clothing to certain skin colours
- Create separate textures for different skin colours
- Adjusting the textures so all lines end at a subset edge (i.e. for a V neck shirt, we put a white vest underneath)
- Including v neck style clothing on the base skin layer (150)
- Making some of the clothing as separate 3D models
If you have any thoughts on ways to do this, please discuss them with us on the
2238 3D Development forum.
File names and formatsHopefully the naming patterns are quite clear from the previous examples. The key part is that the %anim% section can related to a male or female equivalent in the file name. For my test stuff, I have been using the format :
Clothing layers :
Armor_%anim%_[NAME]_body.[FILE FORMAT]
Skin tones :
%anim%_Skin_[NAME].[FILE FORMAT]
Texture for armours and hats :
Armor_all_[NAME].[FILE FORMAT] (note the "all" rather than %anim%, if the texture is the same for both genders)
Note that this is my personal preference, and not necessarily the "offical" naming method. Ultimately, all the files in the repository can be sorted and renamed once a standard is agreed upon, which would make locating the files much easier for future adjustments or modding.
File typesFor textures, the engine seems quite flexible and will happily use jpg, png, bmp, tga, dds. It will probably accept many other formats. My personal preference is png, but this is not necessarily the "official" file format. Again, once a standard is agreed upon, all files will later be converted as necessary. This may require a lot of testing relating to memory usage between different files types.