Welcome to the Creatures Wiki! Log in and join the community.

GEN files

From Creatures Wiki
(Redirected from GEN)
Jump to navigation Jump to search

.gen files contain the genetic information for new breeds as well as individual creatures, identified by the moniker.

Format[edit]

C2 and newer genome files start with the three characters dna, followed by the (textual) number representing the genome file version - '2' for Creatures 2, and '3' for the Creatures Evolution Engine.

The main part of the file (which C1-era files start with immediately) consists of any number of genes, which consist of the four characters gene, a gene header and gene data, which differs depending on the contents of the header. There is more information about the differing formats of genes in the gene types category.

When all the genes have occurred, there is then an end-of-file marker consisting of the four characters gend.

All numbers in the file are in little-endian form unless otherwise specified.

type description
char[4] file magic (only in version 2/3 genomes. dna2 = version 2, dna3 = version 3)
Gene Header first gene header
Gene Data first gene data, depends on gene type
... gene headers and data for rest of genes
char[4] file end marker, gend

Gene header[edit]

A gene header starts with the marker gene (to distinguish from the file end marker gend), followed by two 8-bit integers representing the gene type and the gene subtype.

There are then another four 8-bit integers, representing the gene identifier (for reference by GNO files), the generation number of the gene, the age at which the gene should be switched on, and the gene flags.

In version 2/3 genomes, there's then an 8-bit mutability weighting value, and in version 3 genomes, an 8-bit variant value, used in Creatures Village to turn on different genes for different species without needing separate genome files for each species.

type description
char[4] marker gene
uint8 gene type (0=brain 1=biochemistry 2=creature)
uint8 gene sub-type
uint8 gene id (for use with Genetics Kit)
uint8 generation
uint8 switchontime
uint8 flags
uint8 mutability weighting value (only in version 2 genomes)
uint8 variant (only in version 3 genomes)

Genes[edit]

Each gene has a different data format. Each file version contains similar genes, but some things may be different. The below information may not be correct for all versions.

Brain Lobe (type 0 0)[edit]

Version 1[edit]

type description
uint8 x
uint8 y
uint8 width
uint8 height
uint8 perceptible
uint8 cell_threshold
uint8 cell_leakage
uint8 cell_reststate
uint8 cell_attenuation
uint8[8] cell_staterule
uint8 cell_flags
DendriteType d0_type
DendriteType d1_type

DendriteType:

type description
uint8 source
uint8 min
uint8 max
uint8 spread
uint8 fanout
uint8 minltw
uint8 maxltw
uint8 minstrength
uint8 maxstrength
uint8 migration
uint8 relaxsuscept
uint8 relaxstw
uint8 ltwgainrate
uint8 gainevery
uint8[8] gainrule
uint8 loseevery
uint8[8] loserule
uint8[8] susceptrule
uint8[8] reinforcerule

Version 3[edit]

type description
char[4] lobe id
uint16be updatetime
uint16be x
uint16be y
uint8 width
uint8 height
uint8 red
uint8 green
uint8 blue
uint8 WTA
uint8 tissue
uint8 initrulealways
uint8[7] padding, usually all 0s
uint8[48] initrule
uint8[48] updaterule

Brain Organ (type 0 1)[edit]

Exists in version 3.

type description
uint8 clockrate
uint8 damagerate
uint8 lifeforce
uint8 biotickstart
uint8 atpdamagecoefficient


Brain Tract (type 0 2)[edit]

Exists in version 3.

type description
uint16be updatetime
char[4] srclobe
uint16be srclobe_lowerbound
uint16be srclobe_upperbound
uint16be srclobe_numconnections
char[4] destlobe
uint16be destlobe_lowerbound
uint16be destlobe_upperbound
uint16be destlobe_numconnections
uint8 migrates
uint8 num_random_connections
uint8 srcvar
uint8 destvar
uint8 initrulealways
uint8[5] padding, usually all 0s
uint8[48] initrule
uint8[48] updaterule


Biochemistry Receptor (type 1 0)[edit]

type description
uint8 organ
uint8 tissue
uint8 locus
uint8 chemical
uint8 threshold
uint8 nominal
uint8 gain
uint8 flags

Biochemistry Emitter (type 1 1)[edit]

type description
uint8 organ
uint8 tissue
uint8 locus
uint8 chemical
uint8 threshold
uint8 rate
uint8 gain
uint8 flags

Biochemistry Reaction (type 1 2)[edit]

type description
uint8 r1_amount
uint8 r1_chem
uint8 r2_amount
uint8 r2_chem
uint8 p1_amount
uint8 p1_chem
uint8 p2_amount
uint8 p2_chem
uint8 rate

Biochemistry Halflives (type 1 3)[edit]

type description
uint8[256] chemical half-lives

Biochemistry Initial Concentration (type 1 4)[edit]

type description
uint8 chemical
uint8 amount

Biochemistry Neuroemitter (type 1 5)[edit]

Exists in version 3.

type description
uint8 lobe0
uint8 neuron0
uint8 lobe1
uint8 neuron1
uint8 lobe2
uint8 neuron2
uint8 rate
uint8 chem0
uint8 amount0
uint8 chem1
uint8 amount1
uint8 chem2
uint8 amount2
uint8 chem3
uint8 amount3


Creature Stimulus (type 2 0)[edit]

type description
uint8 stimulus
uint8 significance
uint8 input
uint8 intensity
uint8 features
uint8 chemical0
uint8 amount0
uint8 chemical1
uint8 amount1
uint8 chemical2
uint8 amount2
uint8 chemical3
uint8 amount3

Creature Genus (type 2 1)[edit]

type description
uint8 genus
char[?] mom's moniker (4 bytes in version 1, 32 bytes in version 3)
char[?] dad's moniker (4 bytes in version 1, 32 bytes in version 3)

Creature Appearance (type 2 2)[edit]

type description
uint8 body part
uint8 variant
uint8 species (only in versions 2+)

Creature Pose (type 2 3)[edit]

type description
uint8 pose number
char[?] pose string (15 bytes in versions 1 and 2, 16 bytes in version 3)

Creature Gait (type 2 4)[edit]

type description
uint8 gait number
uint8[8] pose sequence

Creature Instinct (type 2 5)[edit]

type description
uint8 lobe0
uint8 cell0
uint8 lobe1
uint8 cell1
uint8 lobe2
uint8 cell2
uint8 action
uint8 reinforcement_chemical
uint8 reinforcement_amount

Creature Pigment (type 2 6)[edit]

type description
uint8 pigment
uint8 amount

Creature Pigment Bleed (type 2 7)[edit]

Exists in version 3.

type description
uint8 rotation
uint8 swap

Creature Facial Expression (type 2 8)[edit]

Exists in version 3.

type description
uint8 expression
uint8 padding, always zero
uint8 weight
uint8 drive0
uint8 amount0
uint8 drive1
uint8 amount1
uint8 drive2
uint8 amount2
uint8 drive3
uint8 amount3

Organ (type 3 0)[edit]

Only exists in versions 2 and 3.

type description
uint8 clockrate
uint8 damagerate
uint8 lifeforce
uint8 biotickstart
uint8 atpdamagecoefficient


Related links[edit]

External links[edit]