Skip to content
zumbak04 edited this page Jan 12, 2021 · 49 revisions

In this guide, I'll describe how we add portraits. Before you start, to learn basic things, read the Portrait Modding Article. I recommend you to read only the Custom ethnicities paragraph, but you can read more if you want.

Also, it will be nice to install the Portrait Builder to see your WIP portraits in real-time.

Documentation

Before claiming a portrait, please check the following document if it's not already done or work in progress here.

  • Yes means that the particular type of portrait or gear is done.
  • No means that the particular type of portrait or gear is available for claiming.
  • Eyecolor means that a particular variation uses a regular portrait with a special eyecolor. Whether a special skin is required is up to discussion.
  • Static PH means that there's a placeholder version of a portrait implemented, but lacks additional features like hair/facial hair/armor. These should be generally prioritized for rework.
  • Static only means that there's a limited or no possibility for implementing any further customization of a particular portrait (generally for races that are mere NPC/mob races in World of Warcraft).
  • Regular means that a certain subtype of a portrait/gear is also a regular one, this designation is limited to races that always spawn with a specific being trait.
  • Uses X means that the portrait currently shares the same portrait/clothing set as another subrace in the same racial group. It might require slight rework to make them distinct from another subrace.
  • WIP means that there's a person already working on a rework of a portrait.
  • NYI means that there's might be a need for a particular type of portrait to be implemented in the future, but it requires prior work code-wise as well.
  • High Priority means that there's an immediate need for any type of portrait for a certain race, meaning that a Static PH type of portrait can be made to fill the gap until the time a fully functional portrait (if it is possible) is made.

Preparations

First, let's install the Model Viewer, a program that allows exporting WoW models. Open Warcraft-Guardians-of-Azeroth\.artist_resources\portraits, create two folders: <race name>_male and <race name>_female. If your race has only one gender or both look the same create only one folder: <race name>. In these folders, you're going to store your "assets" and information about your race.

We RECOMMEND use 800 x 600 canvas size. It's can be set in View > Set Canvas Size.

Setting and saving positions in Model Viewer

Now let's open the Model Viewer and find the model we want. Before you start cutting images, I'll try to explain why we need position.txt and light.txt located in every folder of Warcraft-Guardians-of-Azeroth\.artist_resources\portraits. These files contain model coordinates and angles for use in the WoW Model Viewer. We have these files so we can place models in the same position many times. ALWAYS CREATE THESE FILES WHEN YOU ADD PORTRAITS FOR A NEW RACE! And store these files in the folders you recently created.

First thing, NEVER ROTATE THE CAMERA! This will make the coordinates and angles useless. If you did it accidentally, just reload the model by switching to another model and back.

position.txt

The first three numbers from position.txt are model coordinates that can be used in View > Show model control > Position, X, Y, Z respectively. The last three numbers are rotation angles, they can be used in the same place, they're rX, rY, rZ respectively. We recommend turning your portrait model -65 degrees (I mean left-right, ignore up-down direction). This is the most common rotation angle we use. Your camera should be at the eye level of the model.

Click to expand

light.txt

The first three numbers from light.txt are light source coordinates that can be used in View > Show light control > Position XYZ, X, Y, Z respectively. DON'T FORGET TO CHECK OFF Relative! Otherwise, the light source won't work. The last number from light.txt is a brightness of Ambience color. Ambience COLOR MUST BE COLORLESS! To set the brightness, click on the color and select the right brightness. We recommend using gray Ambience with brightness set to 70. The light source should be on your right approximately at the level of the model’s head or higher.

Click to expand

Saving screenshots

Click to expand

After you get the right angle and lighting, let's get rid of hairs and clothes. Open View > Show model control and take a look at Geosets. Find here everything you don't want to see on a clear model: usually, it's hairs, clothes, etc. because they go to another layer.

Click to expand

Now, the model is ready for screenshots. Click File > Save Screenshot. If you want to cut features, be ready to make a few screenshots. Let's save these screenshots in the folders we created in Warcraft-Guardians-of-Azeroth\.artist_resources\portraits.

Cutting screenshots

Open in our image editor. I prefer to use GIMP and recommend you to do the same. Open the first screenshot and drag-and-drop others (if you have any) thus creating new layers.

Click to expand

It's time to cut, but before doing it, let's mark the are we're cutting. Compare the distance between the eyes and their position of your portrait to the vanilla portrait. One vanilla exemplar is located in Warcraft-Guardians-of-Azeroth\.artist_resources\portraits, the file is western_male_base_1.tga. It's done to make sure your portrait isn't too close/far and positioned right. Drag and drop the exemplar, change opacity, and resize it a bit to compare to your portraits.

Click to expand

The size of the exemplar is the area we're going to cut in all your screenshots (no matter what: hairs, faces, clothes). Let's mark it somehow by creating a giant black square on a new layer we will call borders. Now you can save this file in the folders we created in Warcraft-Guardians-of-Azeroth\.artist_resources\portraits and delete screenshots from WoW Model Viewer since we have them all in the file.

Click to expand

Select an area by clicking the borders layer, Alpha to Selection. At the top panel, click Image > Fit Canvas to Selection. Click on all the layers and press Layer to Image Size. Finally, let's resize it to the right portrait size, 152x152 in Image > Scale Image.

Click to expand

Check Snap to Canvas Edges in View at the top panel. Pick Ellipse Select (hotkey is E) and select the entire canvas, right-click on the canvas, Select > Invert. Press the key Delete to delete everything outside the circle.

Click to expand

These images are finished, so you can save them right in the mod files: Warcraft-Guardians-of-Azeroth\gfx\characters\<your race>_female/male for the future use in sprites.

Cutting hairs and clothes

The first thing I want to say: YOU DON'T NEED TO CUT HAIRS OF DIFFERENT COLORS. We will make them black and white at the end because CK2 allows to paint them any color you want.

When we know how to get basic images, let's do something more impressive. If your race has hairs or you want to put clothes on it, there's an interesting way how to cut them. So, we have our clean model (no hairs, no clothes), now, let's save another screenshot with added hairs and drag-and-drop it.

Click to expand

The only difference between these screenshots is the hair, so we can easily cut it. Move the no-hair layer at the top and select Mode Grain extract.

Click to expand

The gray area is what we need to remove to get hairs only. Pick Select by Colour Tool, check Sample merged, set Threshold to 0. Make sure you selected the yes-hair layer and press Delete.

Click to expand

Make your hairs black-and-white by clicking Colours at the top panel, Colourise, setting Saturation to 0.

Click to expand

Repeat the steps we used to save basic images: select the right area, resize it, and place it in the mod files. If you have a few hairs (clothes), place them in the same file one after another.

The written above (except making black-and-white) works fine with the clothes and headgears. Just a few tips:

  • Unlike the hairs, the clothes and headgears are limited to 12 frames in the file in this order:
    • Royal clothes 1 (for emperors)
    • Royal clothes 2 (for kings)
    • Royal clothes 3 (for kings)
    • Noble clothes 1 (for kings)
    • Noble clothes 2 (for dukes, counts)
    • Noble clothes 3 (for dukes, counts)
    • Modest clothes 1 (for courtiers)
    • Modest clothes 2 (for courtiers)
    • Modest clothes 3 (for courtiers)
    • Shady clothes (for spymasters and mages)
    • Martial clothes (for marshalls, commanders)
    • Prison clothes (for prisoners, usually we just keep them naked :3)

Final words

Now we have fine-looking sprites, how to use them explained in the Portrait Modding Article I mentioned above.