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:

What Where
Your face pictures (open + closed eyes) shaders.pck → shaders\textures\女\ and shaders\textures\男\
Face count in the two face shaders shaders.pck → shaders\facefemale.sdr and shaders\facemale.sdr
Face lists, race split, blink rule elementclient.exe (hex edits, Step 3)
Names shown in the Face dropdown interfaces.pck → interfaces\loginui.stf

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

2. What you need

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.

Numbers Stock use After this setup
0–21 Open faces (0–13 normal skin, 14–21 Mogui) Unchanged
22–43 Closed-eye versions of 0–21 Unchanged
44–93 Emotes Unchanged
94–127 Not used Your open faces (34 slots per gender)
128–161 Not used Closed-eye versions of 94–127 (face + 34)

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:

Open face Closed-eye picture Who gets it
女94 女128 Other races
女95 女129 Other races
女96 女130 Other races
女97 女131 Mogui
女98–女127 — Filler copies, because the strip runs to 女131

About fillers

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 > 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:

Offset Original bytes Type over with
1F64B0 8B 44 24 04 83 E9 AB 82 3E 00
1EF58D 85 C0 0F 8F A0 00 00 00 E8 AE F1 3E 00 90 90 90
1EF595 68 91 01 00 00 E8 66 F1 3E 00
1F031F 8B 8E 9C 08 00 00 81 C1 91 01 00 00 E8 FC E3 3E 00 90 90 90 90 90 90 90
08E8C1 8B 95 1C 05 00 00 83 C2 16 E8 3A FF 54 00 90 90 90 90
08E8D1 8B 85 1C 05 00 00 8B 8D 5C 02 00 00 83 C0 16 E8 4A FF 54 00 8B 8D 5C 02 00 00 90 90 90 90

B. Header

At offset 000268:

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:

Starts at List Example above
5DE840 Male, Ren / Yaoh / Shenzu 03 5E 5F 60 (3 faces: 94 95 96)
5DE863 Female, Ren / Yaoh / Shenzu 03 5E 5F 60 (3 faces: 94 95 96)
5DE886 Male, Mogui 01 61 (1 face: 97)
5DE8A9 Female, Mogui 01 61 (1 face: 97)

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:

Face Hex Face Hex Face Hex Face Hex
94 5E 103 67 112 70 121 79
95 5F 104 68 113 71 122 7A
96 60 105 69 114 72 123 7B
97 61 106 6A 115 73 124 7C
98 62 107 6B 116 74 125 7D
99 63 108 6C 117 75 126 7E
100 64 109 6D 118 76 127 7F
101 65 110 6E 119 77    
102 66 111 6F 120 78    

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

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):
Line Used for Names needed (example above)
401 Male, other races 8 + 3 = 11
402 Female, other races 8 + 3 = 11
2900 Male, Mogui (new line) 8 + 1 = 9
2901 Female, Mogui (new line) 8 + 1 = 9

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.

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

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

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.

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

Game facts used:


Revision #3
Created 2026-11-26 02:52:17 UTC by Neko
Updated 2026-11-26 21:03:27 UTC by Neko