Saturday 23 June 2007

I’ve been promising a tutorial on how to flag custom skins using SimPE to make them inheritable according to the game’s genetics system. Before I offer that, however, I think it will make more sense if I first explain a bit how the genetics system actually works.

This will be the first of three non-​​authoritative articles on the subject:

  1. Genetic inheritance in The Sims
  2. Making custom content inheritable
  3. Modifying a Sim’s genes

Hair Color Genetics

Default Genetics

As in real life, some hair colors are dominant and some recessive, and each born-​​in-​​game Sim gets one hair color gene from each parent. Only one of these is “expressed”, meaning that it is the actual color of the Sim’s hair. A Sim created in Create-​​A-​​Sim (not using the pacifier) will have both genes be the same, both being the hair color you choose for him.

A Sim who gets a dominant hair color gene from one parent and a recessive gene from the other will always have hair of the dominant color. However, he may pass on the recessive color gene to some of his children, who may then express it, depending on their other parent’s genes.

The game considers there to be five hair colors: black, brown, blond, red, and “custom”. Black and brown are dominant, and blond and red are recessive. Let’s disregard custom hair for the moment.

For an example of how children’s hair color is assigned, suppose Alred’s son David married Liadan. David has a dominant black hair gene from his father and a recessive blond gene from Hetty. Liadan has a black hair gene from her mother and a recessive red gene from her father.

 David
 Blackblond
LiadanBlackBlack/​BlackBlack/​blond
redBlack/​redred/​blond

The game chooses one gene from each parent with 50% probability, giving the four possible combinations shown above. However, since black hair genes will always dominate over blond or red, there is a greater than 50% chance that their child will actually be born with black hair. In fact, their children would have a 75% chance of having black hair, because black/​black, black/​blond, and black/​red are all expressed as black.

In the last box, we see that their children have a 25% chance of getting the red/​blond combination. Whenever a Sim gets two recessive (or two dominant) genes, the game rolls the dice again to pick which one will be expressed, with a 50% probability of either. So if 25% of their kids would have red/​blond genes, and half of them would be red and the other half blond, they have an actual probably of 75% black, 12.5% red, and 12.5% blond.

As another example, consider King Sigefrith and Queen Eadgith. Sigefrith has a black hair gene from his father and a brown gene from his mother.

Eadie has a brown gene from her father and a blond gene from her mother. You may protest that Leofric has black hair, but like Sigefrith he also has a “hidden” brown gene from one of his parents, and this is the one that was passed on to Eadie. Her mother Lady Eadgith has two blond genes.

Here are the probabilities for their children:

 Sigefrith
 BlackBrown
EadgithBrownBlack/​BrownBrown/​Brown
blondBlack/​blondBrown/​blond

You can see that all of their children will have either black or brown hair, but (probabilistically) half of them will have a recessive blond gene that may show up in their grandchildren.

They have had three children so far, and in fact Drage has black/​brown with black being expressed; and Stephan and Catherine both had brown/​brown.

Now, in terms of the game, what determines whether a given hair is black, brown, etc., is simply the color bin to which it is assigned. If you download custom hair that is already binned appropriately, then its color will already be inheritable according to the game’s genetics system.

Custom Genetics

Hair in the “custom” bin is trickier. Custom-​​binned hair is super-​​dominant, even more than black or brown. But how does the game know what to do if, for example, a baby boy is born who has a father with normal black hair and a mother with custom hair? He can’t be assigned the female hair, for obvious reasons. My observations seem to indicate that custom hair is handled as follows:

For Baby Boys:

  • Male Custom M + Female Custom F = Male Custom M
  • Male Custom M + Non-​​Custom Color C = Male Custom M
  • Female Custom F + Non-​​Custom Color C = Non-​​Custom Color C
For Baby Girls:

  • Male Custom M + Female Custom F = Female Custom F
  • Male Custom M + Non-​​Custom Color C = Non-​​Custom Color C
  • Female Custom F + Non-​​Custom Color C = Female Custom F

In summary, I believe that a child who inherits a custom hair gene from a parent of the same gender will always express that custom hair. If anyone can point me to information from someone who has actually experimented with this, though, I would love to read it.

Eye Color Genetics

Default Genetics

There are five default eye colors in the game: brown, dark blue, blue, green, and gray. In the game, brown and dark blue are considered dominant; and blue, green, and gray are recessive.

For example, let’s consider Cat and Paul. Cat has brown eye genes from both of her parents, though they are different colors of brown, which we will call Brown 1 and Brown 2. (Flann has the other color of brown.)

Catan, Paul, and Flann.

Paul has a blue gene from Osh and a green gene from Sora.

 Paul
 bluegreen
CatBrown 1Brown 1/​blueBrown 1/​green
Brown 2Brown 2/​blueBrown 2/​green

All of their children will be either Brown/​blue or Brown/​green, which means that all of their children will have brown eyes. But some of them will have Brown 1 and some Brown 2, meaning that Cat may have children with eyes of a different shade of brown from hers. Hooray for variety! And some of their grandchildren might have blue or green eyes, depending on whom their children marry.

Now for the details. Sims eye genetics are slightly more complicated than simple dominant/​recessive genes. The game has 4 ratings for the dominance of eyes: 1 — dominant, 2 — recessive, 3 — very recessive, 4 — super-​​duper recessive. (Terminology mine.) To my knowledge, the default eyes are rated either 1 or 2, though I believe I read somewhere that gray may be rated 3.

I have not tested 3 or 4 extensively, but I believe they behave as one would expect. For example, violet eyes in my game are rated 3, making them more recessive than blue. Just as a Brown/​blue child will always have brown eyes, the only way you are going to see a Sim with violet eyes is if she gets a violet (or other 3-​​rated) gene from both parents. Even blue/​violet should show up as blue 100% of the time. (Sorry, Gwynn.)

Custom Genetics

There is also a fifth rating, 0, which is the value given by default to custom eyes. Custom eyes are considered even more dominant than brown, which means that if you make a Sim with custom violet eyes you just downloaded, then all children they have with a Sim who has any of the default colors will have violet eyes. (Good news for Gwynn, bad news for realism.) A child who gets two different custom eye genes will have a 50% chance of expressing either one.

Because eyes are the same for males and females, we don’t have the gender-​​related problem with custom eyes as we do with custom hair, above.

Skin Color Genetics

Default Genetics

The game comes with four default skin tones: Light, Tan, Olive, and Dark. A Sim who has a Light-​​skinned parent and a Dark-​​skinned parent may be born with skin of any of the four colors. As with eyes and hair, in his DNA he will have both the skin he is assigned as well as a “recessive” skin color he may pass on to the next generation. However, this does not reveal how the skin color is determined behind the scenes, as it is more complicated than simple dominant/​recessive genetics.

The default skins are each assigned a number between 0 and 1, where smaller numbers are lighter. The actual values are 0.1 (Light), 0.3 (Tan), 0.6 (Olive), and 0.9 (Dark). When it is time to assign a skin to a child, I believe the game takes a skin gene from each parent and gets the numbers from these. It then runs an algorithm incorporating some randomness to pick a value somewhere between the two numbers (or possibly slightly to the left of the lighter or slightly to the right of the darker, for otherwise they would tend to converge over the generations). Then the skin whose value is closest to the calculated value is assigned to the baby.

For example, if we have a Light (0.1) gene from the father and an Olive (0.6) gene from the mother, we might get a value like 0.41. The closest skin color value to 0.41 is 0.3, so the child would have Tan skin.

Custom Genetics

Custom skins are all rated 0 by default. The value 0 is treated as being special, and the random-​​skin-​​selecting algorithm is not applied. Effectively these skins are super-​​dominant: a child with a 0-​​rated skin gene from one of his parents will always have skin of that color. Once again, if he gets a different custom skin from each parent, each will have a 50% probability of being expressed.

But we can take advantage of this numeric rating system (and SimPE) to assign a “darkness” rating to custom skins. Then they will be inheritable according to the regular algorithm.

For example, Enayla’s Sweet Fall skin appears to be somewhat darker than Tan but still lighter than Olive, so I rated it 0.4. Then, in the example above, the child who had a skin value of 0.41 would be assigned the Sweet Fall instead of Tan, since 0.4 is closer to 0.41 than 0.3.

The more skins you have, the more variety you will get among your Sims’ children. In fact, unlike with hair and eyes, a child may be assigned a skin color that no one in his family has ever had. However, if you have rated them well, it will still be of an appropriate shade.

Coming up next

The step-​​by-​​step guide to making your custom skin, eye, and hair packages inheritable will be the subject of the next article, but I hope this one was interesting to some of you in the meantime.

The only pictures of shirtless elves I have at the moment are of Imin, so I will spare you that sight and leave you with some cuuuuuuuute instead. Enjoy him while he lasts… the old man will be aging up to Teen in less than a year from now. *sniff*

The old man.