# Custom Face Additions

Lets character creation offer your own extra faces, with a separate list for Mogui (grey skin) and for the other races, and makes those faces blink properly. Stock faces 1–8 keep working exactly as before.

Everything is done by hand with a hex editor.

## 1. What changes

The game only knows 94 faces per gender and lets creation pick from a fixed set of them. Four things change, and **every player needs all four**:

<table id="bkmrk-what-where-your-face"><thead><tr><th>What</th><th>Where</th></tr></thead><tbody><tr><td>Your face pictures (open + closed eyes)</td><td><code>shaders&#46;pck</code> → <code>shaders&#92;textures&#92;女&#92;</code> and <code>shaders&#92;textures&#92;男&#92;</code></td></tr><tr><td>Face count in the two face shaders</td><td><code>shaders&#46;pck</code> → <code>shaders&#92;facefemale&#46;sdr</code> and <code>shaders&#92;facemale&#46;sdr</code></td></tr><tr><td>Face lists, race split, blink rule</td><td><code>elementclient&#46;exe</code> (hex edits, Step 3)</td></tr><tr><td>Names shown in the Face dropdown</td><td><code>interfaces&#46;pck</code> → <code>interfaces&#92;loginui&#46;stf</code></td></tr></tbody></table>

> **No server files change.** The face is saved as a number, as it always was.

## 2. What you need

- **Client files:** `elementclient.exe`, `element\shaders.pck`, `element\interfaces.pck`. The exe edits are for the standard English client build. Step 3 lists the original bytes at every spot; if they don't match, your exe is a different build: stop.
- **A .pck tool** that can unpack and repack Ether Saga packages. ESO uses its own package keys (`KEY1 0xB6CD2509`, `KEY2 0x6C9FC1B5`), not the Perfect World ones.
- **A DDS editor** that can save DXT1 with mipmaps (Paint.NET, GIMP with the DDS plugin, or NVIDIA Texture Tools).
- **A hex editor** such as HxD (`winget install MHNexus.HxD`).
- **A text editor that saves UTF-16** (Notepad++, or Windows Notepad with "UTF-16 LE") for `loginui.stf`.
- **Backups** of `elementclient.exe`, `shaders.pck` and `interfaces.pck`.

## 3. How faces work

Every face is one picture in a numbered strip, and a character's face is just a number into that strip.

- **The strip:** `shaders\textures\女\女00.dds`, `女01.dds` ... for female and `男\男00.dds` ... for male, all 512x512.
- **The shader:** `shaders\facefemale.sdr` and `facemale.sdr` load the strip as one animated texture. The line `TEX_ANIMATION 0 94 0` says how many pictures to load. A face number at or above that count wraps around to an early face.
- **Blinking:** every 5 seconds the game briefly shows a closed-eye picture. Stock faces use face + 22. After the patch, custom faces (94 and up) use face + 34.
- **Emotes** use their own shared pictures (44–68, or 69–93 for Mogui), so they work with any face.
- **The 127 limit:** the face is saved as one byte, so 127 is the highest face a character can have. Closed-eye pictures can go higher, because only open faces are saved.

<table id="bkmrk-numbers-stock-use-af"><thead><tr><th>Numbers</th><th>Stock use</th><th>After this setup</th></tr></thead><tbody><tr><td>0–21</td><td>Open faces (0–13 normal skin, 14–21 Mogui)</td><td>Unchanged</td></tr><tr><td>22–43</td><td>Closed-eye versions of 0–21</td><td>Unchanged</td></tr><tr><td>44–93</td><td>Emotes</td><td>Unchanged</td></tr><tr><td>94–127</td><td>Not used</td><td>Your open faces (34 slots per gender)</td></tr><tr><td>128–161</td><td>Not used</td><td>Closed-eye versions of 94–127 (face + 34)</td></tr></tbody></table>

Stock creation offers 8 faces per race (dropdown 1–8). The patch adds entries 9 and up, from a separate list for Mogui (race 3, classes 19–24) and one for Ren, Yaoh and Shenzu.

## 4. Step 1: Prepare the face pictures

Each custom face needs two pictures: the open face at its number, and a closed-eye version at that number + 34.

1. Unpack `shaders.pck` and copy a stock face to start from, for example `女\女00.dds`. Its closed-eye version is 22 higher (`女22.dds`). Edit only inside the face; the eyes and mouth must stay where they are. Mogui faces should start from a Mogui (grey) stock face, 14–21, so the skin tone matches.
2. Save each picture as **512x512, DXT1, WITH MIPMAPS**, exactly like the stock faces.
3. Number them from 94: open faces 94, 95, 96 ... and their closed-eye pictures at 128, 129, 130 ... (open + 34).
4. **No gaps:** every number from 94 up to your highest closed-eye picture must exist. Fill unused numbers with a copy of a stock face (it is never shown).
5. **A face without a closed-eye version:** put a copy of the open face at + 34. It just won't visibly blink.

**Example with three female faces and one Mogui female face:**

<table id="bkmrk-open-face-closed-eye"><thead><tr><th>Open face</th><th>Closed-eye picture</th><th>Who gets it</th></tr></thead><tbody><tr><td><code>女94</code></td><td><code>女128</code></td><td>Other races</td></tr><tr><td><code>女95</code></td><td><code>女129</code></td><td>Other races</td></tr><tr><td><code>女96</code></td><td><code>女130</code></td><td>Other races</td></tr><tr><td><code>女97</code></td><td><code>女131</code></td><td>Mogui</td></tr><tr><td><code>女98</code>–<code>女127</code></td><td>—</td><td>Filler copies, because the strip runs to <code>女131</code></td></tr></tbody></table>

### About fillers

- **Why:** the game loads the strip as one unbroken run, from 0 up to the `.sdr` count. Closed-eye pictures start at 128, so every number between your last open face and 127 that isn't a real face needs a picture. A missing number breaks the strip and later faces can load wrong.
- **What:** a copy of any stock face (512x512 DXT1 with mipmaps). No face list points at a filler, so players never see it.
- **How many:** only up to your highest closed-eye picture. Don't add more; each picture costs about 175 KB of memory.
- **Fillers are your free slots:** a new face simply overwrites one.

> **Tip:** a filler in an obvious solid colour (same format) makes it easy to spot if a list or count is ever wrong.

## 5. Step 2: Raise the face counts

Set each shader's count to its **highest picture number + 1**, or the game never loads your faces.

1. From the unpacked `shaders.pck`, open `shaders\facefemale.sdr` and `shaders\facemale.sdr` in a text editor.
2. Find this line:
    
    ```
    TEX_ANIMATION 0 94 0
    
    ```
    
    Change `94` to the new count. In the example above (pictures up to `女131`) that is:
    
    ```
    TEX_ANIMATION 0 132 0
    
    ```
3. Save, keeping the spacing and encoding as they were.

## 6. Step 3: Patch elementclient.exe (hex editor)

Work on a **copy** of `elementclient.exe`. In HxD use **Search &gt; Go to** with a file offset, and type over bytes (Overwrite mode, never Insert). Every address below is a **file offset**.

### A. Check the six spots

Each must show the original bytes; if one doesn't, this is a different build: **stop**. Then type over them:

<table id="bkmrk-offset-original-byte"><thead><tr><th>Offset</th><th>Original bytes</th><th>Type over with</th></tr></thead><tbody><tr><td><code>1F64B0</code></td><td><code>8B 44 24 04 83</code></td><td><code>E9 AB 82 3E 00</code></td></tr><tr><td><code>1EF58D</code></td><td><code>85 C0 0F 8F A0 00 00 00</code></td><td><code>E8 AE F1 3E 00 90 90 90</code></td></tr><tr><td><code>1EF595</code></td><td><code>68 91 01 00 00</code></td><td><code>E8 66 F1 3E 00</code></td></tr><tr><td><code>1F031F</code></td><td><code>8B 8E 9C 08 00 00 81 C1 91 01 00 00</code></td><td><code>E8 FC E3 3E 00 90 90 90 90 90 90 90</code></td></tr><tr><td><code>08E8C1</code></td><td><code>8B 95 1C 05 00 00 83 C2 16</code></td><td><code>E8 3A FF 54 00 90 90 90 90</code></td></tr><tr><td><code>08E8D1</code></td><td><code>8B 85 1C 05 00 00 8B 8D 5C 02 00 00 83 C0 16</code></td><td><code>E8 4A FF 54 00 8B 8D 5C 02 00 00 90 90 90 90</code></td></tr></tbody></table>

### B. Header

At offset `000268`:

- If it shows `C5 D1 5D 00`, change it to `00 E0 5D 00` (marks the end of the code section as code).
- If it already shows `00 E0 5D 00` (some patched clients), leave it.

### C. New code

Offsets `5DE700` to `5DE8FF` must all be `00` before you start (if not, another patch uses that space: **stop**). Type in these rows; rows not listed stay `00`:

```
5DE700: 5A B8 91 01 00 00 83 BE A0 08 00 00 03 75 05 B8
5DE710: 54 0B 00 00 50 FF E2 00 00 00 00 00 00 00 00 00
5DE720: 8B 8E 9C 08 00 00 83 BE A0 08 00 00 03 75 07 81
5DE730: C1 54 0B 00 00 C3 81 C1 91 01 00 00 C3 00 00 00
5DE740: 8B CF E8 79 14 E2 FF C3 00 00 00 00 00 00 00 00
5DE760: 8B 44 24 08 83 F8 08 7C 2E 83 E8 08 8B 91 9C 08
5DE770: 00 00 83 E2 01 83 7C 24 04 03 75 03 83 C2 02 8B
5DE780: 14 95 C0 E7 9D 00 0F B6 0A 39 C8 72 02 31 C0 0F
5DE790: B6 44 02 01 C2 08 00 8B 4C 24 04 83 F9 03 74 17
5DE7A0: 83 F8 04 7E 15 49 74 09 49 75 0F 83 C0 03 C2 08
5DE7B0: 00 83 C0 06 C2 08 00 83 C0 0E C2 08 00 8D 76 00
5DE7C0: 40 E8 9D 00 63 E8 9D 00 86 E8 9D 00 A9 E8 9D 00
5DE800: 8B 95 1C 05 00 00 83 FA 5E 7C 03 83 C2 0C 83 C2
5DE810: 16 C3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5DE820: 8B 85 1C 05 00 00 83 F8 5E 7C 03 83 C0 0C 83 C0
5DE830: 16 C3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5DE840: 03 5E 5F 60 00 00 00 00 00 00 00 00 00 00 00 00
5DE850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5DE860: 00 00 00 03 5E 5F 60 00 00 00 00 00 00 00 00 00
5DE870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5DE880: 00 00 00 00 00 00 01 61 00 00 00 00 00 00 00 00
5DE890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5DE8A0: 00 00 00 00 00 00 00 00 00 01 61 00 00 00 00 00
5DE8B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
5DE8C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

```

### D. The face lists

The rows from `5DE840` hold four lists in fixed spots, each "count, then face numbers" in hex, with room for 34 faces each:

<table id="bkmrk-starts-at-list-examp"><thead><tr><th>Starts at</th><th>List</th><th>Example above</th></tr></thead><tbody><tr><td><code>5DE840</code></td><td>Male, Ren / Yaoh / Shenzu</td><td><code>03 5E 5F 60</code> (3 faces: 94 95 96)</td></tr><tr><td><code>5DE863</code></td><td>Female, Ren / Yaoh / Shenzu</td><td><code>03 5E 5F 60</code> (3 faces: 94 95 96)</td></tr><tr><td><code>5DE886</code></td><td>Male, Mogui</td><td><code>01 61</code> (1 face: 97)</td></tr><tr><td><code>5DE8A9</code></td><td>Female, Mogui</td><td><code>01 61</code> (1 face: 97)</td></tr></tbody></table>

Put your own lists here: first byte = how many faces, then the face numbers in hex, in dropdown order (first = dropdown entry 9).

**Face numbers in hex:**

<table id="bkmrk-face-hex-face-hex-fa"><thead><tr><th>Face</th><th>Hex</th><th>Face</th><th>Hex</th><th>Face</th><th>Hex</th><th>Face</th><th>Hex</th></tr></thead><tbody><tr><td>94</td><td><code>5E</code></td><td>103</td><td><code>67</code></td><td>112</td><td><code>70</code></td><td>121</td><td><code>79</code></td></tr><tr><td>95</td><td><code>5F</code></td><td>104</td><td><code>68</code></td><td>113</td><td><code>71</code></td><td>122</td><td><code>7A</code></td></tr><tr><td>96</td><td><code>60</code></td><td>105</td><td><code>69</code></td><td>114</td><td><code>72</code></td><td>123</td><td><code>7B</code></td></tr><tr><td>97</td><td><code>61</code></td><td>106</td><td><code>6A</code></td><td>115</td><td><code>73</code></td><td>124</td><td><code>7C</code></td></tr><tr><td>98</td><td><code>62</code></td><td>107</td><td><code>6B</code></td><td>116</td><td><code>74</code></td><td>125</td><td><code>7D</code></td></tr><tr><td>99</td><td><code>63</code></td><td>108</td><td><code>6C</code></td><td>117</td><td><code>75</code></td><td>126</td><td><code>7E</code></td></tr><tr><td>100</td><td><code>64</code></td><td>109</td><td><code>6D</code></td><td>118</td><td><code>76</code></td><td>127</td><td><code>7F</code></td></tr><tr><td>101</td><td><code>65</code></td><td>110</td><td><code>6E</code></td><td>119</td><td><code>77</code></td><td> </td><td> </td></tr><tr><td>102</td><td><code>66</code></td><td>111</td><td><code>6F</code></td><td>120</td><td><code>78</code></td><td> </td><td> </td></tr></tbody></table>

**Count in hex:** 1 = `01`, 2 = `02` ... 9 = `09`, 10 = `0A`, 11 = `0B`, 12 = `0C`, 13 = `0D`, 14 = `0E`, 15 = `0F`, 16 = `10`, 17 = `11`, 18 = `12`, 19 = `13`, 20 = `14` ... 34 = `22`.

> **Warning:** Never leave a list at `00` (empty): give it at least one face.

### E. Save

Save, then rename the copy to `elementclient.exe` (keep your backup). The file size must be exactly the same as before.

### What these edits do

- **Face choice:** dropdown entries 1–8 work as stock. Entry 9 and up give the faces from your lists, picked by gender and by Mogui or not.
- **Separate Mogui names:** the Face dropdown reads Mogui names from `loginui.stf` lines 2900 (male) and 2901 (female) instead of 401/402.
- **List refresh:** the face list is rebuilt each time a class is picked, so switching between Mogui and another race shows the right list.
- **Blink rule:** custom faces (94+) blink to face + 34; stock faces still use + 22.

## 7. Step 4: Add the face names

The dropdown shows one entry per name, so each list needs exactly **8 + (number of custom faces in that list)** names.

1. Unpack `interfaces.pck` and open `interfaces\loginui.stf`. It is UTF-16 LE with a BOM; keep it that way.
2. Each line is a number, a Tab, then the names in quotes, separated by Tabs. Add names to the end of lines 401 and 402, and add the new lines 2900 and 2901 (they don't exist in a stock file):

<table id="bkmrk-line-used-for-names-"><thead><tr><th>Line</th><th>Used for</th><th>Names needed (example above)</th></tr></thead><tbody><tr><td>401</td><td>Male, other races</td><td>8 + 3 = 11</td></tr><tr><td>402</td><td>Female, other races</td><td>8 + 3 = 11</td></tr><tr><td>2900</td><td>Male, Mogui (new line)</td><td>8 + 1 = 9</td></tr><tr><td>2901</td><td>Female, Mogui (new line)</td><td>8 + 1 = 9</td></tr></tbody></table>

For 2900 and 2901, copy the 8 stock names from 401 and 402, then add yours. Example line (`<TAB>` = one Tab character):

```
2901<TAB>"Female face 1<TAB>Female face 2<TAB>...<TAB>Female face 8<TAB>Female face 9"

```

## 8. Step 5: Pack and hand out

1. Put your pictures and the two `.sdr` files into the unpacked shaders folder, and `loginui.stf` into the unpacked interfaces folder.
2. Repack `shaders.pck` and `interfaces.pck` from the **full** unpacked folders. Then check the new pack is not smaller than the original and that everything still works (see section 11).
3. Give players the new `elementclient.exe`, `shaders.pck` and `interfaces.pck` together, through your launcher or patcher if you have one. Update any hashes your launcher checks.

> **Note:** Many Angelica clients also read loose files before the `.pck` copy, for example `element\shaders\textures\女\女94.dds`. Test this on your client before relying on it.

## 9. Adding more faces later

1. Pick the next free open-face number (94–127). Make the open picture there and its closed-eye picture at number + 34. If the new numbers go past your current highest picture, fill any gap with copies.
2. Raise `TEX_ANIMATION` in that gender's `.sdr` to (highest picture + 1).
3. In the patched exe, add the number to the right list (Step 3 D): raise that list's count byte by one and type the face number after the last one.
4. Add one more name to the matching `loginui.stf` line (401, 402, 2900 or 2901).
5. Repack (see Step 5) and hand out all changed files again.

**Swapping a face for a better version** only needs steps 1 and 5: replace the picture (and its + 34 closed-eye picture) under the same number.

**To remove a face from creation,** take its number out of the list (lower the count, close the gap) and remove one name.

> **Warning:** Keep the picture in the strip: existing characters may still use it.

## 10. Testing

Test on a throwaway character before handing anything out.

- \[ \] A non-Mogui class shows Face 1–8 plus your extra names, and each one previews the right face.
- \[ \] A Mogui class shows its own shorter list with grey faces.
- \[ \] Switching between a Mogui and a non-Mogui class updates the list straight away.
- \[ \] Each custom face blinks (watch the preview for about 10 seconds).
- \[ \] Emotes still work on a custom face.
- \[ \] Hair, ear and gear previews still change normally.
- \[ \] After creating the character and logging back in, the face is still the custom one.
- \[ \] A second player on another PC sees the custom face too.

## 11. What can go wrong (and how to fix it)

<table id="bkmrk-problem-cause-fix-a-"><thead><tr><th>Problem</th><th>Cause</th><th>Fix</th></tr></thead><tbody><tr><td>A custom choice shows a stock face</td><td>The <code>&#46;sdr</code> count is too low, so the number wraps around</td><td>Raise <code>TEX&#95;ANIMATION</code> to highest picture + 1</td></tr><tr><td>It shows a filler or old picture</td><td>The new picture didn't replace the old one inside the <code>&#46;pck</code> (some pack tools add a second entry with the same name and the game reads the old one)</td><td>Rebuild the <code>&#46;pck</code> from a clean, full unpacked folder</td></tr><tr><td>Hair stops changing, or other models/textures look broken, after repacking <code>shaders&#46;pck</code></td><td>The pack tool damaged or dropped files during the repack</td><td>Start again from your **original** <code>shaders&#46;pck</code> and add only the face pictures and the two <code>&#46;sdr</code> files. Compare file counts/sizes with the original.</td></tr><tr><td>Extra dropdown entries all show the same face</td><td>More names in <code>loginui&#46;stf</code> than faces in that list</td><td>Names must be 8 + list length</td></tr><tr><td>Faces you added don't appear in the dropdown</td><td>Too few names in <code>loginui&#46;stf</code>, or the patched exe isn't the one running</td><td>Add the missing names, or check which exe is running</td></tr><tr><td>Mogui face list is empty</td><td>Lines 2900/2901 are missing from <code>loginui&#46;stf</code></td><td>Add them</td></tr><tr><td>Nothing changed at all</td><td>The game is still running the old exe</td><td>Make sure the edited copy is named <code>elementclient&#46;exe</code> and sits in the folder the game starts from. Check your launcher doesn't restore its own copy (<code>certutil &#45;hashfile elementclient&#46;exe MD5</code> shows whether the file changed).</td></tr><tr><td>Face blinks into another face, or flickers</td><td>Closed-eye picture missing or not at + 34</td><td>Put it at face + 34 (or a copy of the open face)</td></tr><tr><td>Face looks grainy at a distance, or garbled</td><td>Wrong DDS format or no mipmaps</td><td>Re-save as DXT1, 512x512, with mipmaps</td></tr><tr><td>Face skin doesn't match the body</td><td>A Mogui face made from a normal-skin face, or the other way round</td><td>Start Mogui faces from stock faces 14–21, others from 0–13</td></tr><tr><td>Face resets to a stock face after relog</td><td>The server limits face numbers</td><td>Needs a server-side fix (<code>gamedbd</code> / <code>gdeliveryd</code>)</td></tr><tr><td>Other players see a blank or wrong face (or crash) near your character</td><td>They don't have the new <code>shaders&#46;pck</code></td><td>Everyone must update; never roll the pack back once characters use custom faces</td></tr><tr><td>The original bytes in Step 3 don't match, or <code>5DE700</code>–<code>5DE8FF</code> isn't empty</td><td>Your exe is a different build, or another patch uses the same space</td><td>Don't force it</td></tr><tr><td>The game crashes on the creation screen after the exe edits</td><td>A byte was mistyped, or inserted instead of overwritten (the file size must not change)</td><td>Go back to your backup and redo Step 3</td></tr></tbody></table>

> **Mogui characters show random, changing gear on the creation screen?** That is a separate bug in the stock client, not caused by the faces, but you will notice it while testing Mogui faces. It is a one-byte fix, written up in "Fix for Random Mogui Gear in Character Creation." It can be done before or after the face edits; the two don't overlap.

## 12. Reference: how the new code works

Memory address = file offset + `0x400000`.

<table id="bkmrk-address-what-it-does"><thead><tr><th>Address</th><th>What it does</th></tr></thead><tbody><tr><td><code>0x9DE700</code></td><td>First-fill name line (401, or 2900 for Mogui)</td></tr><tr><td><code>0x9DE720</code></td><td>Gender-change name line (401/402, or 2900/2901 for Mogui)</td></tr><tr><td><code>0x9DE740</code></td><td>Clear the face list on every class pick</td></tr><tr><td><code>0x9DE760</code></td><td>Face lookup (stock dropdown 1–8 logic kept as it was)</td></tr><tr><td><code>0x9DE7C0</code></td><td>Pointers to the four face lists</td></tr><tr><td><code>0x9DE800</code></td><td>Blink frame (+22 stock, +34 custom)</td></tr><tr><td><code>0x9DE820</code></td><td>The same for the second face shader</td></tr><tr><td><code>0x9DE840</code></td><td>The four face lists</td></tr></tbody></table>

**Game facts used:**

- The creation dialog keeps gender at offset `0x89C` (0 male, 1 female) and race at `0x8A0` (0 Ren, 1 Yaoh, 2 Shenzu, 3 Mogui).
- Classes 19–24 are Mogui.
- A player's face number is at offset `0x51C`.