Modding Tutorials/Xenotypes

Xenotypes offer a wide range of possibilities for modders.
== Xenotype template == 
The following is the template for assembling xenotypes from the genes in the game. Under each heading the existing genes are listed. Simply delete or comment out the genes you do not wish to include. This is best done by editing or viewing the source of this page and copy and pasting from there. Do not include the <pre> and </pre> tags
It is accurate as of the 1st of November 2022. It is originally provided by Ryflamer but has since been modified.
<?xml version="1.0" encoding="utf-8"?>
<Defs> 
	<XenotypeDef>
		<defName>xenotypedefname</defName>
		<label>ingame name</label>
		<description>A long description goes here, where you can describe the lore and whatever</description>
		<descriptionShort>A shorter description goes here</descriptionShort>
		<iconPath>UI/Icons/Xenotypes/Hussar</iconPath>
		<inheritable>true</inheritable> <!-- Can be omitted for not inheritable -->
		<nameMaker>NamerPersonDirtmole_Male</nameMaker> <!-- If omitted, the default name generator will be used. If this is used but nameMakerFemale is omitted, it will be used for both genders -->
		<nameMakerFemale>NamerPersonDirtmole_Female</nameMakerFemale>
		<chanceToUseNameMaker>1</chanceToUseNameMaker>
 <combatPowerFactor>1.5</combatPowerFactor> <!-- Can be omitted for 1x factor -->
		<genes>
			<!-- ======================================== Visual Genes ======================================== -->
			<!-- ==================== Beard ==================== -->
			<!-- Beard_Always -->
			<!-- Beard_NoBeardOnly -->
			<!-- Beard_BushyOnly -->
			<!-- ==================== Beard ==================== -->
			<!-- ==================== Bodies ==================== -->
			<!--Body_Hulk-->
			<!--Body_Thin-->
			<!--Body_Standard-->
			<!-- Body_Fat -->
			<!-- ==================== Bodies ==================== -->
			<!-- ==================== Brows ==================== -->
			<!-- Brow_Heavy -->
			<!-- ==================== Brows ==================== -->
			<!-- ==================== Ears ==================== -->
			<!-- Ears_Cat -->
			<!-- Ears_Floppy -->
			<!-- Ears_Human -->
			<!-- Ears_Pig -->
			<!-- Ears_Pointed -->
			<!-- ==================== Ears ==================== -->
			<!-- ==================== Eyes ==================== -->
			<!-- Eyes_Red -->
			<!-- Eyes_Gray -->
			<!-- ==================== Eyes ==================== -->
			<!-- ==================== Facial Overlay ==================== -->
			<!-- FacialRidges -->
			<!-- ==================== Facial Overlay ==================== -->
			<!-- ==================== Hands ==================== -->
			<!-- ElongatedFingers -->
			<!-- Hands_Human -->
			<!-- Hands_Pig -->
			<!-- ==================== Hands ==================== -->
			<!-- ==================== Hair ==================== -->
			<!-- Hair_BaldOnly-->
			<!-- Hair_ShortOnly-->
			<!-- Hair_LongOnly -->
			<!-- Hair_Grayless -->
			<!-- Hair_Pink-->
			<!-- Hair_Blonde-->
			<!-- Hair_SandyBlonde-->
			<!-- Hair_ReddishBrown-->
			<!-- Hair_DarkBrown-->
			<!-- Hair_DarkSaturatedReddish-->
			<!-- Hair_DarkReddish-->
			<!-- Hair_MidBlack-->
			<!-- Hair_DarkBlack-->
			<!-- Hair_InkBlack-->
			<!-- Hair_SnowWhite -->
			<!-- Hair_Gray -->
			<!-- Hair_LightOrange -->
			<!-- Hair_SandyBlonde -->
			<!-- Hair_LightPurple -->
			<!-- Hair_LightBlue -->
			<!-- Hair_LightTeal -->
			<!-- Hair_LightGreen -->
			<!-- Hair_BrightRed -->
			<!-- ==================== Hair ==================== -->
			<!-- ==================== Head ==================== -->
			<!-- Headbone_MiniHorns -->
			<!-- Head_Gaunt -->
			<!-- ==================== Head ==================== -->
			<!-- ==================== Horns ==================== -->
			<!-- Headbone_Human -->
			<!-- Headbone_CenterHorn -->
			<!-- Headbone_MiniHorns -->
			<!-- ==================== Horns ==================== -->
			<!-- ==================== Jaw ==================== -->
			<!-- Jaw_Baseline -->
			<!-- Jaw_Heavy -->
			<!-- ==================== Jaw ==================== -->
			<!-- ==================== Skin ==================== -->
			<!-- Furskin -->
			<!-- Skin_Blue -->
			<!-- Skin_DeepRed -->
			<!-- Skin_DeepYellow -->
			<!-- Skin_Green -->
			<!-- Skin_InkBlack -->
			<!-- Skin_LightGray -->
			<!-- Skin_Orange -->
			<!-- Skin_PaleRed -->
			<!-- Skin_PaleYellow -->
			<!-- Skin_Purple -->
			<!-- Skin_SheerWhite -->
			<!-- Skin_SlateGray -->
			<!-- Skin_Melanin1 -->
			<!-- Skin_Melanin2 -->
			<!-- Skin_Melanin3 -->
			<!-- Skin_Melanin4 -->
			<!-- Skin_Melanin5 -->
			<!-- Skin_Melanin6 -->
			<!-- Skin_Melanin7 -->
			<!-- Skin_Melanin8 -->
			<!-- Skin_Melanin9 -->
			<!-- ==================== Skin ==================== -->
			<!-- ==================== Nose ==================== -->
			<!-- Nose_Human -->
			<!-- Nose_Pig -->
			<!-- ==================== Nose ==================== -->
			<!-- ==================== Tail ==================== -->
			<!-- Tail_Furry -->
			<!-- Tail_Smooth -->
			<!-- ==================== Tail ==================== -->
			<!-- ======================================== Stat Genes ======================================== -->
			<!-- ==================== Abilities ==================== -->
			<!-- AcidSpray -->
			<!-- AnimalWarcall -->
			<!-- Bloodfeeder -->
			<!-- Coagulate -->
			<!-- FireSpew -->
			<!-- FoamSpray -->
			<!-- LongjumpLegs -->
			<!-- PiercingSpine -->
			<!-- Resurrect -->
			<!-- XenogermReimplanter -->
			<!-- ==================== Abilities ==================== -->
			<!-- ==================== Aggression ==================== -->
			<!-- Aggression_HyperAggressive -->
			<!-- Aggression_Aggressive -->
			<!-- Aggression_DeadCalm -->
			<!-- ==================== Aggression ==================== -->
			<!-- ==================== Aptitude ==================== -->
			<!-- AptitudeTerrible_Animals -->
			<!-- AptitudeTerrible_Social -->
			<!-- AptitudeTerrible_Artistic -->
			<!-- AptitudeTerrible_Mining -->
			<!-- AptitudeTerrible_Mining -->
			<!-- AptitudeTerrible_Plants -->
			<!-- AptitudePoor_Artistic -->
			<!-- AptitudePoor_Intellectual -->
			<!-- AptitudePoor_Social -->
			<!-- AptitudePoor_Shooting -->
			<!-- AptitudePoor_Cooking -->
			<!-- AptitudePoor_Cooking -->
			<!-- AptitudePoor_Plants -->
			<!-- AptitudePoor_Animals -->
			<!-- AptitudeStrong_Melee -->
			<!-- AptitudeStrong_Social -->
			<!-- AptitudeStrong_Intellectual -->
			<!-- AptitudeRemarkable_Shooting -->
			<!-- AptitudeRemarkable_Melee -->
			<!-- AptitudeRemarkable_Animals -->
			<!-- AptitudeRemarkable_Mining-->
			<!-- AptitudeRemarkable_Social -->
			<!-- ==================== Aptitude ==================== -->
			<!-- ==================== Beauty ==================== -->
			
			<!-- Beauty_VeryUgly -->
			<!-- Beauty_Ugly -->
			<!-- Beauty_Pretty -->
			<!-- Beauty_Beautiful -->
			<!-- ==================== Beauty ==================== -->
			<!-- ==================== Chemical Dependency ==================== -->
			<!-- ChemicalDependency_GoJuice -->
			<!-- ChemicalDependency_Psychite -->
			<!-- ==================== Chemical Dependency ==================== -->
			<!-- ==================== Fertility ==================== -->
			<!-- Sterile -->
			<!-- Fertile -->
			<!-- ==================== Fertility ==================== -->
			<!-- ==================== Immunity ==================== -->
			<!-- Immunity_Weak -->
			<!-- Immunity_Strong -->
			<!-- Immunity_SuperStrong -->
			<!-- ==================== Immunity ==================== -->
			<!-- ==================== Learning ==================== -->
			<!-- Learning_Slow -->
			<!-- Learning_Fast -->
			<!-- ==================== Learning ==================== -->
			<!-- ==================== Libido ==================== -->
			<<!-- li>Libido_Low-->
			<!-- Libido_High -->
			<!-- ==================== Libido ==================== -->
			<!-- ==================== Melee Damage ==================== -->
			<!-- MeleeDamage_Weak -->
			<!-- MeleeDamage_Strong -->
			<!-- ==================== Melee Damage ==================== -->
			<!-- ==================== Mood ==================== -->
			<!-- Mood_Depressive -->
			<!-- Mood_Pessimist -->
			<!-- Mood_Optimist -->
			<!-- Mood_Sanguine -->
			<!-- ==================== Mood ==================== -->
			<!-- ==================== Movement Speed ==================== -->
			<!-- MoveSpeed_Quick-->
			<!-- MoveSpeed_Slow-->
			<!-- MoveSpeed_VeryQuick -->
			<!-- ==================== Movement Speed ==================== -->
			<!-- ==================== Pain ==================== -->
			<!-- Pain_Reduced -->
			<!-- Pain_Extra-->
			<!-- ==================== Pain ==================== -->
			<!-- ==================== Psychic Ability ==================== -->
			<!-- PsychicAbility_Deaf -->
			<!-- PsychicAbility_Dull -->
			<!-- PsychicAbility_Enhanced -->
			<!-- PsychicAbility_Extreme -->
			<!-- ==================== Psychic Ability ==================== -->
			<!-- ==================== Sleep ==================== -->
			<!-- Neversleep -->
			<!-- LowSleep -->
			<!-- Sleepy -->
			<!-- VerySleepy -->
			<!-- ==================== Sleep ==================== -->
			<!-- ==================== Temperature ==================== -->
			<!-- MinTemp_SmallDecrease -->
			<!-- MinTemp_SmallIncrease -->
			<!-- MinTemp_LargeIncrease -->
			<!-- MaxTemp_SmallDecrease -->
			<!-- MaxTemp_SmallIncrease -->
			<!-- MaxTemp_LargeIncrease -->
			<!-- ==================== Temperature ==================== -->
			<!-- ==================== Toughness ==================== -->
			<!--Delicate-->
			<!-- Robust -->
			<!-- ==================== Toughness ==================== -->
			<!-- ==================== Toxic Resistance ==================== -->
			<!-- ToxicEnvironmentResistance_Partial -->
			<!-- ToxicEnvironmentResistance_Total -->
			<!-- ToxResist_Partial -->
			<!-- ToxResist_Total -->
			<!-- ==================== Toxic Resistance ==================== -->
			<!-- ==================== UV Sensitivity ==================== -->
			<!-- UVSensitivity_Intense-->
			<!-- UVSensitivity_Mild -->
			<!-- ==================== UV Sensitivity ==================== -->
			<!-- ==================== Vision ==================== -->
			<!-- DarkVision-->
			<!-- Nearsighted-->
			<!-- ==================== Vision ==================== -->
			<!-- ==================== Voice ==================== -->
			<!-- Voice_Human -->
			<!-- VoicePig -->
			<!-- VoiceRoar -->
			<!-- ==================== Voice ==================== -->
			<!-- ==================== Wound Healing ==================== -->
			<!-- WoundHealing_Fast-->
			<!-- WoundHealing_Slow -->
			<!-- WoundHealing_SuperFast -->
			<!-- ==================== Wound Healing ==================== -->
			<!-- ======================================== Unique Genes ======================================== -->
			<!-- ==================== Vampire ==================== -->
			<!-- Hemogenic -->
			<!-- HemogenDrain -->
			<!-- DiseaseFree -->
			<!-- TotalHealing -->
			<!-- Deathrest -->
			<!-- Ageless -->
			<!-- Deathless -->
			<!-- ArchiteMetabolism -->
			<!-- PerfectImmunity -->
			<!-- FireWeakness -->
			<!-- FireTerror -->
			<!-- ==================== Vampire ==================== -->
			<!-- ==================== Misc ==================== -->
			<!-- AddictionImmune_WakeUp -->
			<!-- FireResistant -->
			<!-- Inbred -->
			<!-- Instability_Mild -->
			<!-- Instability_Major -->
			<!-- KillThirst -->
			<!-- KindInstinct -->
			<!-- NakedSpeed -->
			<!-- PollutionRush -->
			<!-- PsychicBonding -->
			<!-- RobustDigestion -->
			<!-- StrongStomach -->
			<!-- Superclotting -->
			<!-- Unstoppable -->
			<!-- ViolenceDisabled -->
		</genes>
	</XenotypeDef>
</Defs>
== Adding xenotypes to generated pawns ==
Factions have their distribution of xenotypes set in their faction def at the top level by the following: 
 <xenotypeSet>
 <xenotypeChances>
 <Neanderthal MayRequire="Ludeon.RimWorld.Biotech">0.05</Neanderthal>
 <Hussar MayRequire="Ludeon.RimWorld.Biotech">0.15</Hussar>
 <Genie MayRequire="Ludeon.RimWorld.Biotech">0.10</Genie>
 </xenotypeChances>
 </xenotypeSet>
Note: The above is for a faction that is not defined by the Biotech DLC, hence the may require. This difference is irrelevant to the interpretation method chosen.
These values are then interpreted one of two ways.
First:
If the values add up to less than 1.0, then they are interpreted as percentage chances for a pawn, absent any other xenotype selections, to be that xenotype, with the remainder being the chance to be a baseliner. In the above example, as the sum of 0.05, 0.15, and 0.10 is only 0.30. As this is less than 1.0, there is a 5% chance for a pawn from that faction to be a neanderthal, a 15% chance to be a hussar, a 10% chance to be a genie, and a 70% chance to be baseliner. 
Second:
If the values exceed 1.0, then the values are instead interpreted as a weight, where the chance is equal to the value for that xenotype divided by the sum of all the weights given. If baseliners are not included as a weight, they are excluded
For example:
 <xenotypeSet>
 <xenotypeChances>
 <Neanderthal>999</Neanderthal>
 </xenotypeChances>
 </xenotypeSet>
Note: The above is for a faction that is defined by the Biotech DLC, hence the lack of may require. This difference is irrelevant to the interpretation method chosen.
Neanderthals have a (999/999)*100%, or a 100% chance to be selected.
Additional xenotypeSet definitions can be made in memes and PawnKinds. Whenever a pawn generation request is made, the generator sums the xenotype chances from the faction, the PawnKind, and each meme of the faction's primary ideoligion. The totals are then interpreted as either probabilities or weights, as described above.
For example, suppose a pawn is generated using the faction at the top of this section and a PawnKind with the following configuration:
 <xenotypeSet>
 <xenotypeChances>
 <Highmate>0.25</Highmate>
 <Genie>0.15</Genie>
 </xenotypeChances>
 </xenotypeSet>
The chances will be added together, resulting in Neaderthal=0.05, Hussar=0.15, Genie=0.25 (from adding 0.10 and 0.15), and Highmate=0.25. The total of all of these is 0.7, leaving baseliners with a chance of 0.3.
Note that a PawnKind may have <useFactionXenotypes>false</useFactionXenotypes>, which causes the faction's xenotypeSet to be ignored.
Category: Modding tutorials