Author Topic: Avatars / Paperdolls - Faces&Hair  (Read 5068 times)

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Avatars / Paperdolls - Faces&Hair
« on: May 25, 2020, 02:05:09 pm »
Something that has been bothering me for a while now is that i can't find any information as to how the game handles avatars and how/where they are defined - the faces you can chose/switch in the inventory screen. I'd like to remove/replace a number of them but i have no idea how and  I can't find any of the names that are associated with them either.

To clarify: I'd like to remove or skip certain faces during soldier creation so that they don't show up in the game.

Somebody please enlighten me, thanks.
« Last Edit: May 25, 2020, 03:23:15 pm by krautbernd »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #1 on: May 25, 2020, 10:32:13 pm »
I suppose you mean in OXCE?
There is hierarchy of different faces, we start at top of vanilla 8 variants (4 skin colors * 2 genders).
Image you have 64 soldiers, each one will have one of this variants, this mean you will have 8 soldiers with same face.
Then we define 16 possible faces, this cause that from this 8 soldiers half get new face, rest stay to old one version.
If we expand number possibility, this happens again half of all units get new face type.

This expansion end at around 256 possible variants (including gender versions).


How exactly engine define who gets what? By bit masks, each unit get rolled random number in range from 0 to 63, name it variant.
When engine try show some soldier graphic check if there is any "look" (for specific gender and nationality) in range 32-63,
if is any, game check if variant number match this range then this look is returned.
if there is no available in this range then game "compress" variant look to 31 values (by dropping byte value 32)
after that game check range 16-31 to see if there is any mach, if it is, it return it other wise reduce again max possible value to 15.

This go until value of variant go to zero, then we leave with only 8 possible version from original game.


One of this two descriptions should be readable enough to understand how logic work there.

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #2 on: May 25, 2020, 11:36:27 pm »
Yes, thanks for the explanation. I take it the names for the variants are hardcoded?

How does OXCE assign sprites to those values (from rulesets/extrasprites.rul)? How would I go about restricting/excluding certain avatars without having to replace all possible paper doll parts for those avatars (front/back hair, faces etc.)? Can I simply delete these from extrasprites.rul? How would that interact with missing sprites in armor definitions (since they now point to missing sprites for those avatars)?

For reference, I'm talking about modifying XCF.
« Last Edit: May 25, 2020, 11:39:49 pm by krautbernd »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #3 on: May 26, 2020, 02:22:33 am »
Yes, deleting is supported operation, is allowed to have "holes" in this system. Only drawback is increased chance for some other "face" to be used instead of removed one.

For names, I do not have time to check exactly how this values goes, but base game have only `F0-F3` and `M0-M3` base looks, if you add this variant then you can have values e.g. `M4-M7`, max something around `F127` (something like  `nationality + 4 * variant`).

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #4 on: May 26, 2020, 01:04:12 pm »
Just to clarify - can I simply delete the entries in extrasprites or do I need to delete them elsewhere (armor defintions etc.) as well?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Avatars / Paperdolls - Faces&Hair
« Reply #5 on: May 26, 2020, 02:18:05 pm »
If any faces are wrong, they should be fixed. What's the point in skipping them?

I can't see anything glaringly bad, but I guess improvements are possible.

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #6 on: May 26, 2020, 02:47:54 pm »
Not wrong per se, but some of them look kind of gnarly or silly. Examples would be M11, M14, M22, M36 or M42 and some of the female faces.

This request is down to personal preference, not to indicate that something in XCF needs to be fixed.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Avatars / Paperdolls - Faces&Hair
« Reply #7 on: May 26, 2020, 05:24:23 pm »
M11 is an interesting case, since it's vanilla TFTD. ;D

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #8 on: May 26, 2020, 05:46:45 pm »
Yeah, and he still looks more like a mall cop than somebody who should be shooting up aliens. I mean come on, xcom even has a gym now.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #9 on: May 26, 2020, 11:53:28 pm »
Just to clarify - can I simply delete the entries in extrasprites or do I need to delete them elsewhere (armor defintions etc.) as well?
This details I do not remember, possible only extra sprites should be fine.

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #10 on: May 27, 2020, 02:38:13 pm »
Okay, will try.

Another question if that's okay - how does the game determine and apply skin/hair color to soldier sprites (battlescape/animated, not inventory)? The sprite sheets only include light colored male/female sprites. Are there special color indexes used for skin/hair colors? How are these shifted for different color variants? Asking because I'm having trouble with (dark skinned) female soldiers having bright red pixels around their heads.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #11 on: May 27, 2020, 03:52:42 pm »
Another question if that's okay - how does the game determine and apply skin/hair color to soldier sprites (battlescape/animated, not inventory)?

Offline krautbernd

  • Commander
  • *****
  • Posts: 1108
    • View Profile
Re: Avatars / Paperdolls - Faces&Hair
« Reply #12 on: June 12, 2020, 04:44:21 pm »
This details I do not remember, possible only extra sprites should be fine.

As an addendum to this, for anyone running into the same problem:

armordefinitions also contain references to the sprites, these also need to be removed  :P