aliens

Author Topic: how gender/race sprites works? [Explained]  (Read 14518 times)

Mono

  • Guest
how gender/race sprites works? [Explained]
« on: March 09, 2015, 12:53:49 am »
are the 8 head sprite the only difference between male and female?
how different race colors are made?
Is possible to have different sprite for male and female?

I ask this because of a very silly reason: I'm trying to accomplish something like pic related
(blu camo for boys and pink for girl  ;D)

Edit: changes have been introduced with openxcom_git_master_2015_03_13_0759.zip
so ignore the next Dioxine answer nr. 2 if you are using recent nightly.
« Last Edit: March 16, 2015, 11:12:15 pm by Mono »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: how gender/race sprites works?
« Reply #1 on: March 09, 2015, 01:01:31 am »
1. Yes, xcom soldier sprite has 2 torso versions, for male & female. Normal enemy sprite can also have the second "female" set of torsos but they won't be used (but they could - I'm pretty sure the female civilian now uses the second set of torsos, if it has the "0" full sprite type.
2. By a palette conversion built-in into OXcom. You cannot influence it manually by modding.
3. No.

Offline Yankes

  • Commander
  • *****
  • Posts: 3308
    • View Profile
Re: how gender/race sprites works?
« Reply #2 on: March 09, 2015, 01:16:40 am »
Race recoloring its my hack :)
Right now is done only based on race. Its compute new colors and after that it's search for some pixel color groups in sprite. If it find proper pixel it replace with new one.
Every thing is hardcoded and can't be change (only turn off).

I made patch that relaxes it a bit (this is require by TFTD, not jet included to OXC) and colors can be changes freely for any combinations of gender and race, but you would need sacrifice change of hair or face color to archive your effect.

If my patch pass, I could add in my extended version option for third color to replace, that would allow you to archive your needs.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: how gender/race sprites works?
« Reply #3 on: March 09, 2015, 01:25:18 am »
that race recolouring is fantastically awesome hack i love it.

Mono

  • Guest
Re: how gender/race sprites works?
« Reply #4 on: March 09, 2015, 01:26:31 am »
Wow Yankes, you made my day today!
I will wait for your OXE.

And thank you Dioxine for making me save time in trying!
If DIOXINE can't do it, I certainly cannot  ;)

my B plan is not needed anymore... pic related  ;D

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: how gender/race sprites works?
« Reply #5 on: March 09, 2015, 03:00:06 am »
Alternatively (and a bit more cumbersome), you could write a mod that has "female personal armor" and "male personal armor", one is pink, one is blue. And the same for the other armors, you just have to produce the right one and equip soldiers properly.

Mono

  • Guest
Re: how gender/race sprites works?
« Reply #6 on: March 09, 2015, 04:31:17 am »
thank Arthanor,
but then I will be able to wear a pink armor even to male soldiers. 
A politically correct thing. Not what I want for my mod!  >:(

(I just like to roleplay in a fascist way)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: how gender/race sprites works?
« Reply #7 on: March 09, 2015, 04:29:54 pm »
Well, just like there's nothing preventing you from wearing a dress IRL, you just chose not to (presumably :P).

All you have to do as a player is outfit your soldiers properly (granted, some of the names can be a bit unclear if you are not familiar with them). Just presenting an easier alternative than asking the developers to code more ;)

Mono

  • Guest
Re: how gender/race sprites works?
« Reply #8 on: March 15, 2015, 01:15:59 am »
I have just take a look at the pedia.
Under armor I can now change the palette. Thank Yankes!!
A third palette on OXE?! Yeah!!!! This would be super!!!!!

Code: [Select]
armors:
  - type: STR_POWER_SUIT_UC
    spriteFaceGroup: 5
    spriteFaceColor:
      - 112
      - 176
      - 112
      - 176
      - 112
      - 176
      - 112
      - 176
  - type: STR_FLYING_SUIT_UC
    spriteFaceGroup: 2
    spriteFaceColor:
      - 112
      - 176
      - 112
      - 176
      - 112
      - 176
      - 112
      - 176   
All boys sport a blue power suit, all girls a pink one. Look awful but work. Time to hack some sprite.

I will post my work when done, but don't keep your breath, i'm not a talented graphic  :P

Thank you guys ;D

below are what you get with the example ruleset
« Last Edit: March 15, 2015, 02:30:21 am by Mono »

Mono

  • Guest
Re: how gender/race sprites works?
« Reply #9 on: March 15, 2015, 02:57:57 am »
Just for fun...
Hybrids and mutants. Additional sprites are not needed anymore!  :)
Thanks again Yankes!!!

Edit:
Now If we can have alien with races and genders, we can also play with them. Change color by rank...
Sorry, I'm too greedy  ::)
Not asking for it.

Solved!
« Last Edit: March 15, 2015, 09:26:08 am by Mono »

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: how gender/race sprites works?
« Reply #10 on: March 15, 2015, 03:04:52 am »
NICE  : ) looks good i wanna . link?

Mono

  • Guest
Re: how gender/race sprites works?
« Reply #11 on: March 15, 2015, 03:12:19 am »
Is a new rule added to the nightly, under armors.
Just download the latest openxcom_git_master_2015_03_13_0759.zip

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: how gender/race sprites works?
« Reply #12 on: March 15, 2015, 03:14:31 am »
i know i have. i  wanna have what you doing  . how do you recolour the armour?

Mono

  • Guest
Re: how gender/race sprites works?
« Reply #13 on: March 15, 2015, 03:25:20 am »
I have added the code in my post above.
Just use it with a vanilla installation, if you use a mod that change the basic armors, my example code don't work unless the modded armor use the same palette of the vanilla one (at least I think)  :P

Edit: sorry, you mean as a file? here it is
« Last Edit: March 15, 2015, 04:37:57 am by Mono »

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: how gender/race sprites works?
« Reply #14 on: March 15, 2015, 03:46:02 am »
NICE . pink and blue for power armor. is only gender based i assume. what is colgroup?