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

GNO files

From Creatures Wiki
Jump to navigation Jump to search

.gno files contain optional notes to accompany GEN files for new breeds.

C1/C2 File format[edit]

type description
uint16 unknown - always seems to be 2
uint16 number of genes described
GeneNote genes
??? zero-padding


type description
uint16 gene type
uint16 gene subtype
uint32 gene sequence number
uint16 description length
char[description length] description
uint16 comment length
char[comment length] comment (as RTF-formatted text)

The descriptions and comments are in Microsoft's RTF format.

C3/DS File Format[edit]

The C3/DS information on the Gameware site (linked to below) is incomplete and inaccurate. In particular there are a few places where there are a couple of extra zero bytes and the files have large amounts of zero padding as well as some additional undocumented values at the end of the file.

All multi-byte values in the file are in little endian.

A description of the file format follows:

GNO file:
  SHORT padding, always 2
  SHORT Number of SV notes that are populated
  SVNoteStruct[1801 or 3001]
  SHORT padding, always = 2
  SHORT Number of gene notes that are populated
  GeneNoteStruct[1801 or 3001]
  SHORT padding, always 0
  EncodingHint Encoding hint, presence means use 3001 for size of struct arrays rather than 1801

  SHORT Gene type
  SHORT Gene Sub-type
  SHORT Unique ID
  SHORT Rule Number
  SHORT padding, always 0
  STRING Annotations[16]
  SHORT padding, always 0
  STRING General Notes

  SHORT Gene type
  SHORT Gene Sub-type
  SHORT Unique ID
  SHORT padding, always zero
  STRING Caption
  STRING Rich Text Annotation

  SHORT Number of bytes in string
  BYTE[Number of bytes in string] Text string


The gene type and gene sub type are the same as in genome files.

The unique id is value from 0 to 255, it is shown under the "G-ID" column in the Genetics Kit. It is the combination of gene type, sub-type, and this ID that uniquely identifies a caption and attaches the caption to a specific gene in the genome.

The rule number is either 0 or 1. Zero is the initialisation rule and one is the update rule.

The sixteen annotations in an SVNoteStruct are for each of the sixteen possible instructions in an SVRule.

The GeneNoteStruct's caption is shown under the "Description" column of the Genetics Kit and names the gene.

The rich text annotation is shown with the "Notes" button on the gene editing dialog of the Genetics Kit. It is in Microsoft's RTF format. The original caption files provided with Creatures 3 only contain a single rich text annotation (for the chemical receptor gene captioned as "091 Belladonna poisoning - Receptor").

Padding and "encoding" used by Genetics Kit[edit]

Reverse engineering of the Genetics Kit indicates that when opening a caption file it reads the last ten (10) bytes of the file first. If checks for the exact sequence for the integer value "999999" (as a magic number) and does some verification of the other values. The "13" and "14" values are thought to be some kind of record size indication, the genetics kit verifies that the two values differ by one. The "2" value is thought to be the word size or file format version number.

If the values of the last ten bytes check out then the Genetics Kit reads the four bytes immediately preceding them. It is thought that this value is the array size and relates to there being enough zero padding for 3001 records, the genetics kit compares the read value to exactly "1500". At this point the Genetics Kit repositions to the beginning of the file and it either uses VBA routines to read arrays (if the Encoding-Hints match its expectations) or it falls back to reading the file record by record.

It is uncertain if this is as robust or error-free as the normal routines used to parse the file. When writing software to write a caption files this should be taken into account when considering if the padding method and undocumented bytes should be emulated or not.

Related links[edit]

External links[edit]