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

Difference between revisions of "MFC serialized data"

From Creatures Wiki
Jump to navigation Jump to search
(Add CGenome)
Line 25: Line 25:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 2 bytes || persistent id
+
| uint16 || persistent id
 
|-
 
|-
| 4 bytes || 32-bit persistent id (only if 16-bit persistent id == 0x7FFF)
+
| uint32 || 32-bit persistent id (only if 16-bit persistent id == 0x7FFF)
 
|}
 
|}
  
Line 40: Line 40:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 2 bytes || schema number
+
| uint16 || schema number
 
|-
 
|-
| 2 bytes || class name length
+
| uint16 || class name length
 
|-
 
|-
 
| ...    || class name in ASCII
 
| ...    || class name in ASCII
Line 57: Line 57:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 1 byte || length
+
| uint8 || length
 
|-
 
|-
| 2 bytes || length (only if 8-bit length == 255)
+
| uint16 || length (only if 8-bit length == 255)
 
|-
 
|-
| 4 bytes || length (only if 16-bit length == 65535)
+
| uint32 || length (only if 16-bit length == 65535)
 
|-
 
|-
| length || string (ASCII-encoded in Creatures 1, CP-1252-encoded in Creatures 2)
+
| char[length] || string
 
|}
 
|}
  
Line 74: Line 74:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 1 byte || unused portion of classifier (e.g. eventno, which makes no sense here)
+
| uint8 || unused portion of classifier (e.g. eventno, which makes no sense here)
 
|-
 
|-
| 1 byte || species
+
| uint8 || species
 
|-
 
|-
| 1 byte || genus
+
| uint8 || genus
 
|-
 
|-
| 1 byte || family
+
| uint8 || family
 
|-
 
|-
| 1 byte || movement status (0 = autonomous, 1 = mousedriven, 2 = floating, 3 = invehicle, 4 = carried)
+
| uint8 || movement status (0 = autonomous, 1 = mousedriven, 2 = floating, 3 = invehicle, 4 = carried)
 
|-
 
|-
| 1 byte || ATTR
+
| uint8 || ATTR
 
|-
 
|-
| 4 bytes || limit_left
+
| uint32 || limit_left
 
|-
 
|-
| 4 bytes || limit_top
+
| uint32 || limit_top
 
|-
 
|-
| 4 bytes || limit_right
+
| uint32 || limit_right
 
|-
 
|-
| 4 bytes || limit_bottom
+
| uint32 || limit_bottom
 
|-
 
|-
 
| Object || carrier
 
| Object || carrier
 
|-
 
|-
| 1 byte || ACTV
+
| uint8 || ACTV
 
|-
 
|-
 
| CGallery || sprite
 
| CGallery || sprite
 
|-
 
|-
| 4 bytes || tick time
+
| uint32 || tick time
 
|-
 
|-
| 4 bytes || tick state
+
| uint32 || tick state
 
|-
 
|-
 
| Object || OBJP
 
| Object || OBJP
 
|-
 
|-
| 4 bytes || current sound name
+
| char[4] || current sound name
 
|-
 
|-
| 4 bytes || OBV0
+
| uint32 || OBV0
 
|-
 
|-
| 4 bytes || OBV1
+
| uint32 || OBV1
 
|-
 
|-
| 4 bytes || OBV2
+
| uint32 || OBV2
 
|-
 
|-
| 4 bytes || number of scripts
+
| uint32 || number of scripts
 
|-
 
|-
| 1 byte || scripts[0].eventno
+
| uint8 || scripts[0].eventno
 
|-
 
|-
| 1 byte || scripts[0].species
+
| uint8 || scripts[0].species
 
|-
 
|-
| 1 byte || scripts[0].genus
+
| uint8 || scripts[0].genus
 
|-
 
|-
| 1 byte || scripts[0].family
+
| uint8 || scripts[0].family
 
|-
 
|-
 
| string || scripts[0].text
 
| string || scripts[0].text
Line 139: Line 139:
 
| CGallery ||
 
| CGallery ||
 
|-
 
|-
| 1 byte || current sprite
+
| uint8 || current sprite
 
|-
 
|-
| 1 byte || image offset
+
| uint8 || image offset
 
|-
 
|-
| 4 bytes || z-order (maybe a signed integer)
+
| uint32 || z-order (maybe a signed integer)
 
|-
 
|-
| 4 bytes || x
+
| uint32 || x
 
|-
 
|-
| 4 bytes || y
+
| uint32 || y
 
|-
 
|-
| 1 byte || has animation
+
| uint8 || has animation
 
|-
 
|-
| 1 byte || animation frame (only if has animation)
+
| uint8 || animation frame (only if has animation)
 
|-
 
|-
| 32 bytes || animation string (null-padded) (only if has animation)
+
| char[32] || animation string (null-terminated) (only if has animation)
 
|}
 
|}
  
Line 164: Line 164:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || number of images
+
| uint32 || number of images
 
|-
 
|-
| 4 bytes || filename
+
| char[4] || filename
 
|-
 
|-
| 4 bytes || first sprite
+
| uint32 || first sprite
 
|-
 
|-
| 4 bytes || number of references, maybe
+
| uint32 || refcount
 
|-
 
|-
 
| CGallery || images[0].parent
 
| CGallery || images[0].parent
 
|-
 
|-
| 1 byte || images[0].status (bitfield: 0 = incache, 2 = ownmem, 4 = locked)
+
| uint8 || images[0].status (bitfield: 0 = incache, 2 = ownmem, 4 = locked)
 
|-
 
|-
| 4 bytes || images[0].width
+
| uint32 || images[0].width
 
|-
 
|-
| 4 bytes || images[0].height
+
| uint32 || images[0].height
 
|-
 
|-
| 4 bytes || images[0].offset
+
| uint32 || images[0].offset
 
|-
 
|-
 
| ... ||  
 
| ... ||  
Line 197: Line 197:
 
| MapData || world map
 
| MapData || world map
 
|-
 
|-
| 4 bytes || number of objects
+
| uint32 || number of objects
 
|-
 
|-
 
| Object || objects[0]
 
| Object || objects[0]
Line 203: Line 203:
 
| ...    ||
 
| ...    ||
 
|-
 
|-
| 4 bytes || number of sceneries
+
| uint32 || number of sceneries
 
|-
 
|-
 
| Scenery || sceneries[0]
 
| Scenery || sceneries[0]
Line 209: Line 209:
 
| ... ||
 
| ... ||
 
|-
 
|-
| 4 bytes || number of scripts
+
| uint32 || number of scripts
 
|-
 
|-
| 1 byte || scripts[0].event number
+
| uint8 || scripts[0].event number
 
|-
 
|-
| 1 byte || scripts[0].species
+
| uint8 || scripts[0].species
 
|-
 
|-
| 1 byte || scripts[0].genus
+
| uint8 || scripts[0].genus
 
|-
 
|-
| 1 byte || scripts[0].family
+
| uint8 || scripts[0].family
 
|-
 
|-
 
| string || scripts[0].text
 
| string || scripts[0].text
Line 223: Line 223:
 
| ... ||
 
| ... ||
 
|-
 
|-
| 4 bytes || scrollx maybe?
+
| uint32 || scrollx
 
|-
 
|-
| 4 bytes || scrolly maybe?
+
| uint32 || scrolly
 
|-
 
|-
| 2 bytes || currently logged norn? might be a CArchive object, hopefully NULL
+
| Creature || current norn
 
|-
 
|-
 
| string || favorite_places[0].name
 
| string || favorite_places[0].name
 
|-
 
|-
| 2 bytes || favorite_places[0].x
+
| uint16 || favorite_places[0].x
 
|-
 
|-
| 2 bytes || favorite_places[0].y
+
| uint16 || favorite_places[0].y
 
|-
 
|-
 
| ... || up through favorite_places[5], inclusive
 
| ... || up through favorite_places[5], inclusive
 
|-
 
|-
| 2 bytes || size of speech history
+
| uint16 || size of speech history
 
|-
 
|-
 
| string || speech_history[0]
 
| string || speech_history[0]
Line 243: Line 243:
 
| ... ||
 
| ... ||
 
|-
 
|-
| 4 bytes || number of macros
+
| uint32 || number of macros
 
|-
 
|-
 
| Macro || macros[0]
 
| Macro || macros[0]
Line 258: Line 258:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || unknown, always zero
+
| uint32 || unknown, always zero
 
|-
 
|-
| 4 bytes || time of day
+
| uint32 || time of day
 
|-
 
|-
 
| CGallery || background sprite
 
| CGallery || background sprite
 
|-
 
|-
| 4 bytes || number of rooms
+
| uint32 || number of rooms
 
|-
 
|-
| 4 bytes || rooms[0].left
+
| uint32 || rooms[0].left
 
|-
 
|-
| 4 bytes || rooms[0].top
+
| uint32 || rooms[0].top
 
|-
 
|-
| 4 bytes || rooms[0].right
+
| uint32 || rooms[0].right
 
|-
 
|-
| 4 bytes || rooms[0].bottom
+
| uint32 || rooms[0].bottom
 
|-
 
|-
| 4 bytes || rooms[0].type (0=Indoors, 1=Surface, 2=Undersea)
+
| uint32 || rooms[0].type (0=Indoors, 1=Surface, 2=Undersea)
 
|-
 
|-
 
| ... ||
 
| ... ||
 
|-
 
|-
| 4 bytes || groundlevel[0]
+
| uint32 || groundlevel[0]
 
|-
 
|-
 
| ...    || up through groundlevel[260], inclusive
 
| ...    || up through groundlevel[260], inclusive
 
|-
 
|-
| 1 byte || bacteria[0].state (0 = Not present, 1 = Dormant, 2 = Active)
+
| uint8 || bacteria[0].state (0 = Not present, 1 = Dormant, 2 = Active)
 
|-
 
|-
| 1 byte || bacteria[0].antigen
+
| uint8 || bacteria[0].antigen
 
|-
 
|-
| 1 byte || bacteria[0].fatal_level
+
| uint8 || bacteria[0].fatal_level
 
|-
 
|-
| 1 byte || bacteria[0].infect_level
+
| uint8 || bacteria[0].infect_level
 
|-
 
|-
| 1 byte || bacteria[0].toxin1
+
| uint8 || bacteria[0].toxin1
 
|-
 
|-
| 1 byte || bacteria[0].toxin2
+
| uint8 || bacteria[0].toxin2
 
|-
 
|-
| 1 byte || bacteria[0].toxin3
+
| uint8 || bacteria[0].toxin3
 
|-
 
|-
| 1 byte || bacteria[0].toxin4
+
| uint8 || bacteria[0].toxin4
 
|-
 
|-
 
| ... || up through bacteria[99], inclusive
 
| ... || up through bacteria[99], inclusive
Line 309: Line 309:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || destroy object afterwards
+
| uint32 || destroy object afterwards
 
|-
 
|-
| 4 bytes || INST
+
| uint32 || INST
 
|-
 
|-
| 4 bytes || text length?
+
| uint32 || text length?
 
|-
 
|-
 
| string || script
 
| string || script
 
|-
 
|-
| 4 bytes || instruction pointer
+
| uint32 || instruction pointer
 
|-
 
|-
| 4 bytes || stack[0]
+
| uint32 || stack[0]
 
|-
 
|-
 
| ... || up through stack[19], inclusive
 
| ... || up through stack[19], inclusive
 
|-
 
|-
| 4 bytes || stack pointer
+
| uint32 || stack pointer
 
|-
 
|-
| 4 bytes || vars[0]
+
| uint32 || vars[0]
 
|-
 
|-
 
| ... || up through vars[9], inclusive
 
| ... || up through vars[9], inclusive
Line 339: Line 339:
 
| Object || _IT_
 
| Object || _IT_
 
|-
 
|-
| 4 bytes || PART
+
| uint32 || PART
 
|-
 
|-
| 4 bytes || label of most recently visited subroutine
+
| char[4] || label of most recently visited subroutine
 
|-
 
|-
| 4 bytes || address of most recently visited subroutine
+
| uint32 || address of most recently visited subroutine
 
|-
 
|-
| 4 bytes || WAIT
+
| uint32 || WAIT
 
|}
 
|}
 
 
  
 
== Creatures 1 Scenery ==
 
== Creatures 1 Scenery ==
Line 371: Line 369:
 
| Entity || part
 
| Entity || part
 
|-
 
|-
| 4 bytes || z-order (should match the part's z-order)
+
| uint32 || z-order (should match the part's z-order)
 
|-
 
|-
| 3 bytes || click bhvr
+
| uint8[3] || click bhvr
 
|-
 
|-
| 1 byte || touch bhvr
+
| uint8 || touch bhvr
 
|}
 
|}
  
Line 386: Line 384:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || relx
+
| sint32 || relx
 
|-
 
|-
| 4 bytes || rely
+
| sint32 || rely
 
|-
 
|-
 
| Bubble || speech bubble
 
| Bubble || speech bubble
 
|-
 
|-
| 25 bytes || text
+
| char[25] || text (null-terminated)
 
|}
 
|}
  
Line 403: Line 401:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 1 byte || life
+
| uint8 || life
 
|-
 
|-
| 4 bytes || creator
+
| uint32 || creator
 
|-
 
|-
| 25 bytes || text (null-padded)
+
| char[25] || text (null-padded)
 
|}
 
|}
  
Line 420: Line 418:
 
| Lift ||
 
| Lift ||
 
|-
 
|-
| 1 byte || button id
+
| uint8 || button id
 
|}
 
|}
  
Line 431: Line 429:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || number of parts
+
| uint8 || number of parts
 
|-
 
|-
 
| Entity || parts[0].entity
 
| Entity || parts[0].entity
 
|-
 
|-
| 4 bytes || parts[0].x (only if parts[0] is not NULL)
+
| sint8 || parts[0].x
 
|-
 
|-
| 4 bytes || parts[0].y (only if parts[1] is not NULL)
+
| sint8 || parts[0].y
 
|-
 
|-
 
| ... ||
 
| ... ||
 
|-
 
|-
| 4 bytes (signed) || hotspots[0].left
+
| sint32 || hotspots[0].left
 
|-
 
|-
| 4 bytes (signed) || hotspots[0].top
+
| sint32 || hotspots[0].top
 
|-
 
|-
| 4 bytes (signed) || hotspots[0].right
+
| sint32 || hotspots[0].right
 
|-
 
|-
| 4 bytes (signed) || hotspots[0].bottom
+
| sint32 || hotspots[0].bottom
 
|-
 
|-
 
| ... || up through hotspots[5], inclusive
 
| ... || up through hotspots[5], inclusive
 
|-
 
|-
| 4 bytes || functions[0].hotspot
+
| uint32 || functions[0].hotspot
 
|-
 
|-
 
| ... || up through functions[5], inclusive
 
| ... || up through functions[5], inclusive
Line 464: Line 462:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes (signed) || x velocity * 256
+
| sint32 || x velocity * 256
 
|-
 
|-
| 4 bytes (signed) || y velocity * 256
+
| sint32 || y velocity * 256
 
|-
 
|-
| 4 bytes || coordx * 256
+
| sint32 || coordx * 256
 
|-
 
|-
| 4 bytes || coordy * 256
+
| sint32 || coordy * 256
 
|-
 
|-
| 4 bytes || cabin left
+
| uint32 || cabin left
 
|-
 
|-
| 4 bytes || cabin top
+
| uint32 || cabin top
 
|-
 
|-
| 4 bytes || cabin right
+
| uint32 || cabin right
 
|-
 
|-
| 4 bytes || cabin bottom
+
| uint32 || cabin bottom
 
|-
 
|-
| 4 bytes || bump
+
| uint32 || bump
 
|}
 
|}
  
Line 491: Line 489:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || number of floors
+
| uint32 || number of floors
 
|-
 
|-
| 4 bytes || next or current floor
+
| uint32 || next or current floor
 
|-
 
|-
| 4 bytes (signed) || current call button
+
| sint32 || current call button
 
|-
 
|-
| 1 byte || delay counter
+
| uint8 || delay counter
 
|-
 
|-
| 4 bytes || floors[0].y
+
| uint32 || floors[0].y
 
|-
 
|-
 
| CallButton || callbuttons[0]
 
| CallButton || callbuttons[0]
Line 514: Line 512:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 1 byte || background color
+
| uint8 || background color
 
|-
 
|-
| 1 byte || chalk color
+
| uint8 || chalk color
 
|-
 
|-
| 1 byte || aliascolor
+
| uint8 || aliascolor
 
|-
 
|-
| 1 byte || text x position
+
| uint8 || text x position
 
|-
 
|-
| 1 byte || text y position
+
| uint8 || text y position
 
|-
 
|-
| 4 bytes || words[0].value
+
| uint32 || words[0].value
 
|-
 
|-
| 11 bytes || words[0].text (null-padded)
+
| char[11] || words[0].text (null-terminated)
 
|-
 
|-
 
| ... || up through words[15], inclusive
 
| ... || up through words[15], inclusive
Line 560: Line 558:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || moniker
+
| char[4] || moniker
 
|-
 
|-
| 4 bytes || mother's moniker
+
| char[4] || mother's moniker
 
|-
 
|-
| 4 bytes || father's moniker
+
| char[4] || father's moniker
 
|-
 
|-
 
| string || mother's name
 
| string || mother's name
Line 584: Line 582:
 
| Limb || tail
 
| Limb || tail
 
|-
 
|-
| 1 byte || direction facing
+
| uint8 || direction facing
 
|-
 
|-
| 1 byte || downfoot (0=left 1=right)
+
| uint8 || downfoot (0=left 1=right)
 
|-
 
|-
| 4 bytes || foot x
+
| uint32 || foot x
 
|-
 
|-
| 4 bytes || foot y
+
| uint32 || foot y
 
|-
 
|-
| 4 bytes || z-order
+
| uint32 || z-order
 
|-
 
|-
 
| string || current pose
 
| string || current pose
 
|-
 
|-
| 1 byte || expression (0=normal 1=happy 2=sad)
+
| uint8 || expression (0=normal 1=happy 2=sad)
 
|-
 
|-
| 1 byte || eyes open
+
| uint8 || eyes open
 
|-
 
|-
| 1 byte || asleep
+
| uint8 || asleep
 
|-
 
|-
| 4 bytes || unconscious
+
| uint32 || unconscious
 
|-
 
|-
 
| string || poses[0]
 
| string || poses[0]
Line 616: Line 614:
 
| string || vocabulary[0].out
 
| string || vocabulary[0].out
 
|-
 
|-
| 4 bytes || vocabulary[0].strength
+
| uint32 || vocabulary[0].strength
 
|-
 
|-
 
| ... || up through vocabulary[79], inclusive (80 words? is that right?)
 
| ... || up through vocabulary[79], inclusive (80 words? is that right?)
 
|-
 
|-
| 4 bytes || remembered_objects[0].x
+
| uint32 || remembered_objects[0].x
 
|-
 
|-
| 4 bytes || remembered_objects[0].y
+
| uint32 || remembered_objects[0].y
 
|-
 
|-
 
| ... || up through remembered_objects[39], inclusive
 
| ... || up through remembered_objects[39], inclusive
 
|-
 
|-
| 1 byte || stimuli[0].significance
+
| uint8 || stimuli[0].significance
 
|-
 
|-
| 1 byte || stimuli[0].input
+
| uint8 || stimuli[0].input
 
|-
 
|-
| 1 byte || stimuli[0].intensity
+
| uint8 || stimuli[0].intensity
 
|-
 
|-
| 1 byte || stimuli[0].features (bitfield, 0=modulate 2=iprange 4=ifasleep)
+
| uint8 || stimuli[0].features (bitfield, 0=modulate 2=iprange 4=ifasleep)
 
|-
 
|-
| 1 byte || stimuli[0].chemical0
+
| uint8 || stimuli[0].chemical0
 
|-
 
|-
| 1 byte || stimuli[0].amount0
+
| uint8 || stimuli[0].amount0
 
|-
 
|-
| 1 byte || stimuli[0].chemical1
+
| uint8 || stimuli[0].chemical1
 
|-
 
|-
| 1 byte || stimuli[0].amount1
+
| uint8 || stimuli[0].amount1
 
|-
 
|-
| 1 byte || stimuli[0].chemical2
+
| uint8 || stimuli[0].chemical2
 
|-
 
|-
| 1 byte || stimuli[0].amount2
+
| uint8 || stimuli[0].amount2
 
|-
 
|-
| 1 byte || stimuli[0].chemical3
+
| uint8 || stimuli[0].chemical3
 
|-
 
|-
| 1 byte || stimuli[0].amount3
+
| uint8 || stimuli[0].amount3
 
|-
 
|-
 
| ... || up through stimuli[35], inclusive
 
| ... || up through stimuli[35], inclusive
Line 656: Line 654:
 
| Biochemistry || biochemistry
 
| Biochemistry || biochemistry
 
|-
 
|-
| 1 byte || sex
+
| uint8 || sex
 
|-
 
|-
| 1 byte || age
+
| uint8 || age
 
|-
 
|-
| 4 bytes || biological tick
+
| uint32 || biological tick
 
|-
 
|-
| 4 bytes || gamete (my moniker)
+
| char[4] || gamete (my moniker)
 
|-
 
|-
| 4 bytes || zygote (child's moniker, if pregnant)
+
| char[4] || zygote (child's moniker, if pregnant)
 
|-
 
|-
| 1 byte || dead
+
| uint8 || dead
 
|-
 
|-
| 4 bytes || age in ticks
+
| uint32 || age in ticks
 
|-
 
|-
| 4 bytes || number of instincts to be processed
+
| uint32 || number of instincts to be processed
 
|-
 
|-
| 4 bytes || dreaming
+
| uint32 || dreaming
 
|-
 
|-
 
| CInstinct || instincts[0]
 
| CInstinct || instincts[0]
Line 678: Line 676:
 
| ... ||
 
| ... ||
 
|-
 
|-
| 4 bytes || goals[0][0]
+
| uint32 || goals[0][0]
 
|-
 
|-
 
| ... || up through goals[0][16], inclusive (drives related to object)
 
| ... || up through goals[0][16], inclusive (drives related to object)
Line 690: Line 688:
 
| SimpleObject || bubbles
 
| SimpleObject || bubbles
 
|-
 
|-
| 4 bytes || status of hand before it was disregarded
+
| uint32 || status of hand before it was disregarded
 
|-
 
|-
| 4 bytes || voice_lookup_table[0][0] (NOTE: voice data is similar to [[VCE files]], but the lookup table comes first)
+
| uint32 || voice_lookup_table[0][0] (NOTE: voice data is similar to [[VCE files]], but the lookup table comes first)
 
|-
 
|-
 
| ... || up through voice_lookup_table[0][26], inclusive
 
| ... || up through voice_lookup_table[0][26], inclusive
Line 698: Line 696:
 
| ... || up through voice_lookup_table[2], inclusive
 
| ... || up through voice_lookup_table[2], inclusive
 
|-
 
|-
| 4 bytes || voices[0].name
+
| char[4] || voices[0].name
 
|-
 
|-
| 4 bytes || voices[0].delay_ticks
+
| uint32 || voices[0].delay_ticks
 
|-
 
|-
 
| ... || up through voices[31], inclusive
 
| ... || up through voices[31], inclusive
 
|-
 
|-
| 4 bytes || history_moniker
+
| char[4] || history_moniker
 
|-
 
|-
 
| string || history_name
 
| string || history_name
 
|-
 
|-
| 4 bytes || history_moms_moniker
+
| char[4] || history_moms_moniker
 
|-
 
|-
 
| string || history_moms_name
 
| string || history_moms_name
 
|-
 
|-
| 4 bytes || history_dads_moniker
+
| char[4] || history_dads_moniker
 
|-
 
|-
 
| string || history_dads_name
 
| string || history_dads_name
Line 728: Line 726:
 
| string || history_owner_email
 
| string || history_owner_email
 
|-
 
|-
| 4 bytes || history_state (0=ok 1=dead 2=exported)
+
| uint32 || history_state (0=ok 1=dead 2=exported)
 
|-
 
|-
| 4 bytes || history_gender
+
| uint32 || history_gender
 
|-
 
|-
| 4 bytes || history_age_in_seconds
+
| uint32 || history_age_in_seconds
 
|-
 
|-
 
| ? || padding
 
| ? || padding
Line 745: Line 743:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || angle
+
| uint32 || angle
 
|-
 
|-
| 4 bytes || view
+
| uint32 || view
 
|}
 
|}
  
Line 758: Line 756:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 1 byte || body_data[0][0].x
+
| uint8 || body_data[0][0].x
 
|-
 
|-
| 1 byte || body_data[0][0].y
+
| uint8 || body_data[0][0].y
 
|-
 
|-
 
| ...    || up through body_data[0][9], inclusive
 
| ...    || up through body_data[0][9], inclusive
Line 775: Line 773:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 1 byte || limbdata[0].startx
+
| uint8 || limbdata[0].startx
 
|-
 
|-
| 1 byte || limbdata[0].starty
+
| uint8 || limbdata[0].starty
 
|-
 
|-
| 1 byte || limbdata[0].endx
+
| uint8 || limbdata[0].endx
 
|-
 
|-
| 1 byte || limbdata[0].endy
+
| uint8 || limbdata[0].endy
 
|-
 
|-
 
| ... || up through limbdata[9], inclusive
 
| ... || up through limbdata[9], inclusive
Line 804: Line 802:
 
| Creature || owner
 
| Creature || owner
 
|-
 
|-
| 4 bytes || number of emitters
+
| uint32 || number of emitters
 
|-
 
|-
| 4 bytes || number of receptors
+
| uint32 || number of receptors
 
|-
 
|-
| 4 bytes || number of reactions
+
| uint32 || number of reactions
 
|-
 
|-
| 1 byte || chemicals[0].concentration
+
| uint8 || chemicals[0].concentration
 
|-
 
|-
| 1 byte || chemicals[0].decay
+
| uint8 || chemicals[0].decay
 
|-
 
|-
 
| ... || up through chemicals[255], inclusive
 
| ... || up through chemicals[255], inclusive
 
|-
 
|-
| 1 byte || emitters[0].organ
+
| uint8 || emitters[0].organ
 
|-
 
|-
| 1 byte || emitters[0].tissue
+
| uint8 || emitters[0].tissue
 
|-
 
|-
| 1 byte || emitters[0].locus
+
| uint8 || emitters[0].locus
 
|-
 
|-
| 1 byte || emitters[0].chemical
+
| uint8 || emitters[0].chemical
 
|-
 
|-
| 1 byte || emitters[0].threshold
+
| uint8 || emitters[0].threshold
 
|-
 
|-
| 1 byte || emitters[0].rate
+
| uint8 || emitters[0].rate
 
|-
 
|-
| 1 byte || emitters[0].gain
+
| uint8 || emitters[0].gain
 
|-
 
|-
| 1 byte || emitters[0].effect
+
| uint8 || emitters[0].effect
 
|-
 
|-
 
| ... ||
 
| ... ||
 
|-
 
|-
| 1 byte || receptors[0].organ
+
| uint8 || receptors[0].organ
 
|-
 
|-
| 1 byte || receptors[0].tissue
+
| uint8 || receptors[0].tissue
 
|-
 
|-
| 1 byte || receptors[0].locus
+
| uint8 || receptors[0].locus
 
|-
 
|-
| 1 byte || receptors[0].chemical
+
| uint8 || receptors[0].chemical
 
|-
 
|-
| 1 byte || receptors[0].threshold
+
| uint8 || receptors[0].threshold
 
|-
 
|-
| 1 byte || receptors[0].nominal
+
| uint8 || receptors[0].nominal
 
|-
 
|-
| 1 byte || receptors[0].gain
+
| uint8 || receptors[0].gain
 
|-
 
|-
| 1 byte || receptors[0].effect
+
| uint8 || receptors[0].effect
 
|-
 
|-
 
| ... ||
 
| ... ||
 
|-
 
|-
| 1 byte || reactions[0].reactant1_amount
+
| uint8 || reactions[0].reactant1_amount
 
|-
 
|-
| 1 byte || reactions[0].reactant1_chemical
+
| uint8 || reactions[0].reactant1_chemical
 
|-
 
|-
| 1 byte || reactions[0].reactant2_amount
+
| uint8 || reactions[0].reactant2_amount
 
|-
 
|-
| 1 byte || reactions[0].reactant2_chemical
+
| uint8 || reactions[0].reactant2_chemical
 
|-
 
|-
| 1 byte || reactions[0].rate
+
| uint8 || reactions[0].rate
 
|-
 
|-
| 1 byte || reactions[0].product1_amount
+
| uint8 || reactions[0].product1_amount
 
|-
 
|-
| 1 byte || reactions[0].product1_chemical
+
| uint8 || reactions[0].product1_chemical
 
|-
 
|-
| 1 byte || reactions[0].product2_amount
+
| uint8 || reactions[0].product2_amount
 
|-
 
|-
| 1 byte || reactions[0].product2_chemical
+
| uint8 || reactions[0].product2_chemical
 
|-
 
|-
 
| ... ||
 
| ... ||
Line 881: Line 879:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || dendrites[0].lobe_to_be_stimulated
+
| uint32 || dendrites[0].lobe_to_be_stimulated
 
|-
 
|-
| 4 bytes || dendrites[0].cell_to_be_stimulated
+
| uint32 || dendrites[0].cell_to_be_stimulated
 
|-
 
|-
 
| ... || up through dendrites[2], inclusive
 
| ... || up through dendrites[2], inclusive
 
|-
 
|-
| 4 bytes || decision to be taken (motor)
+
| uint32 || decision to be taken (motor)
 
|-
 
|-
| 4 bytes || reinforcement chemical (reinforcer)
+
| uint32 || reinforcement chemical (reinforcer)
 
|-
 
|-
| 4 bytes || reinforcement amount
+
| uint32 || reinforcement amount
 
|-
 
|-
| 4 bytes || phase
+
| uint32 || phase
 
|}
 
|}
  
Line 904: Line 902:
 
! type !! description
 
! type !! description
 
|-
 
|-
| 4 bytes || length, in bytes, of genes data
+
| uint32 || length, in bytes, of genes data
 
|-
 
|-
| 4 bytes || moniker
+
| char[4] || moniker
 
|-
 
|-
| 4 bytes || sex (1=male 2=female)
+
| uint32 || sex (1=male 2=female)
 
|-
 
|-
| 1 byte || life stage
+
| uint8 || life stage
 
|-
 
|-
 
| ... || genes data, as in [[GEN files]]
 
| ... || genes data, as in [[GEN files]]

Revision as of 00:22, 17 September 2021

MFC serialized data is used in Creatures 1 and Creatures 2 for saved worlds (.sfc files) and creatures (.exp files). Similar to CreaturesArchive data, it contains serialized objects from the game engine, essentially an on-disk representation of the internal game state. Objects are serialized using the built-in Windows MFC serialization routines.

Although the format is not fully understood, openc2e is capable of extracting enough data from SFC files to enable default worlds (or any without creatures present) to be loaded almost entirely. Its source code contains a Python script for doing this, as well as the C++ code used by the engine itself.

SFC files

SFC files (.sfc) are the world save format for Creatures 1 and Creatures 2. They contain all modifiable information about worlds - such as rooms, agents and creatures.

The default world - which the Emergency Kit and World Switcher use to reset or make a new world - is stored in Eden.sfc, and the current world in World.sfc - although you can also use different files if you're using cheats or the World Switcher. Third-party worlds come with their own SFC files.

EXP files

EXP files (.exp) are files for exported creatures in Creatures 1 and Creatures 2. EXP files include a snapshot of the chemical condition of the norn, the genetic D-DNA, the state of the norn brain and information about pregnancies. A common trick for preserving the original exp file in Creatures 1 was to open its properties and check 'read-only'. The game would not then delete the original file upon importing the creature, although it made the game hang a bit.

Common structures

MFC serialized data is a dump of binary engine data, with most objects serialized with a CArchive header.

CArchive object header

Objects serialized through CArchive start with a header which specifies whether the object is:

type description
uint16 persistent id
uint32 32-bit persistent id (only if 16-bit persistent id == 0x7FFF)

If the persistent id is 0, this is a NULL object.

If the persistent id & 0x8000 is not empty, then this is a new object using an already-seen class at persistent_id & ~0x8000.

If the persistent id is -1 (0xFFFF), then this is a new object using a new class, specified by the following:

type description
uint16 schema number
uint16 class name length
... class name in ASCII

If the persistent id is anything else, then it is a reference to an already-seen object.

New persistent ids are assigned whenever a new class is seen, and whenever a new object is seen (if both, then the new class is assigned an id first).

strings

type description
uint8 length
uint16 length (only if 8-bit length == 255)
uint32 length (only if 16-bit length == 65535)
char[length] string

Creatures 1 Object

Parent class of other objects, and appears as the first part of their data. CArchive serialized:

type description
uint8 unused portion of classifier (e.g. eventno, which makes no sense here)
uint8 species
uint8 genus
uint8 family
uint8 movement status (0 = autonomous, 1 = mousedriven, 2 = floating, 3 = invehicle, 4 = carried)
uint8 ATTR
uint32 limit_left
uint32 limit_top
uint32 limit_right
uint32 limit_bottom
Object carrier
uint8 ACTV
CGallery sprite
uint32 tick time
uint32 tick state
Object OBJP
char[4] current sound name
uint32 OBV0
uint32 OBV1
uint32 OBV2
uint32 number of scripts
uint8 scripts[0].eventno
uint8 scripts[0].species
uint8 scripts[0].genus
uint8 scripts[0].family
string scripts[0].text
...

Creatures 1 Entity

An object part, CArchive serialized:

type description
CGallery
uint8 current sprite
uint8 image offset
uint32 z-order (maybe a signed integer)
uint32 x
uint32 y
uint8 has animation
uint8 animation frame (only if has animation)
char[32] animation string (null-terminated) (only if has animation)

Creatures 1 CGallery

CArchive serialized:

type description
uint32 number of images
char[4] filename
uint32 first sprite
uint32 refcount
CGallery images[0].parent
uint8 images[0].status (bitfield: 0 = incache, 2 = ownmem, 4 = locked)
uint32 images[0].width
uint32 images[0].height
uint32 images[0].offset
...

SFC structures

Creatures 1 SFC file

All CArchive objects in a Creatures 1 SFC file have a schema number of 1.

type description
MapData world map
uint32 number of objects
Object objects[0]
...
uint32 number of sceneries
Scenery sceneries[0]
...
uint32 number of scripts
uint8 scripts[0].event number
uint8 scripts[0].species
uint8 scripts[0].genus
uint8 scripts[0].family
string scripts[0].text
...
uint32 scrollx
uint32 scrolly
Creature current norn
string favorite_places[0].name
uint16 favorite_places[0].x
uint16 favorite_places[0].y
... up through favorite_places[5], inclusive
uint16 size of speech history
string speech_history[0]
...
uint32 number of macros
Macro macros[0]
...

Creatures 1 MapData

CArchive serialized:

type description
uint32 unknown, always zero
uint32 time of day
CGallery background sprite
uint32 number of rooms
uint32 rooms[0].left
uint32 rooms[0].top
uint32 rooms[0].right
uint32 rooms[0].bottom
uint32 rooms[0].type (0=Indoors, 1=Surface, 2=Undersea)
...
uint32 groundlevel[0]
... up through groundlevel[260], inclusive
uint8 bacteria[0].state (0 = Not present, 1 = Dormant, 2 = Active)
uint8 bacteria[0].antigen
uint8 bacteria[0].fatal_level
uint8 bacteria[0].infect_level
uint8 bacteria[0].toxin1
uint8 bacteria[0].toxin2
uint8 bacteria[0].toxin3
uint8 bacteria[0].toxin4
... up through bacteria[99], inclusive

Creatures 1 Macro

Currently running scripts, CArchive serialized:

type description
uint32 destroy object afterwards
uint32 INST
uint32 text length?
string script
uint32 instruction pointer
uint32 stack[0]
... up through stack[19], inclusive
uint32 stack pointer
uint32 vars[0]
... up through vars[9], inclusive
Object OWNR
Object FROM
Object EXEC
Object TARG
Object _IT_
uint32 PART
char[4] label of most recently visited subroutine
uint32 address of most recently visited subroutine
uint32 WAIT

Creatures 1 Scenery

Subclass of Object:

type description
Entity part

Creatures 1 SimpleObject

Subclass of Object:

type description
Entity part
uint32 z-order (should match the part's z-order)
uint8[3] click bhvr
uint8 touch bhvr

Creatures 1 PointerTool

Subclass of SimpleObject:

type description
sint32 relx
sint32 rely
Bubble speech bubble
char[25] text (null-terminated)

Creatures 1 Bubble

Subclass of SimpleObject:

type description
uint8 life
uint32 creator
char[25] text (null-padded)

Creatures 1 CallButton

Subclass of SimpleObject:

type description
Lift
uint8 button id

Creatures 1 CompoundObject

Subclass of Object:

type description
uint8 number of parts
Entity parts[0].entity
sint8 parts[0].x
sint8 parts[0].y
...
sint32 hotspots[0].left
sint32 hotspots[0].top
sint32 hotspots[0].right
sint32 hotspots[0].bottom
... up through hotspots[5], inclusive
uint32 functions[0].hotspot
... up through functions[5], inclusive

Creatures 1 Vehicle

Subclass of CompoundObject:

type description
sint32 x velocity * 256
sint32 y velocity * 256
sint32 coordx * 256
sint32 coordy * 256
uint32 cabin left
uint32 cabin top
uint32 cabin right
uint32 cabin bottom
uint32 bump

Creatures 1 Lift

Subclass of Vehicle:

type description
uint32 number of floors
uint32 next or current floor
sint32 current call button
uint8 delay counter
uint32 floors[0].y
CallButton callbuttons[0]
... repeats up through floors[7] and callbuttons[7], inclusive

Creatures 1 Blackboard

Subclass of CompoundObject:

type description
uint8 background color
uint8 chalk color
uint8 aliascolor
uint8 text x position
uint8 text y position
uint32 words[0].value
char[11] words[0].text (null-terminated)
... up through words[15], inclusive

Creatures 1 Creature

Subclass of Object. Same as in EXP files.

EXP structures

Creatures 1 EXP file

All CArchive objects in a Creatures 1 EXP file have a schema number of 1.

type description
Creature exported creature
CGenome genome
CGenome child genome (e.g. the zygote) (only if pregnant)

Creatures 1 Creature

Subclass of Object:

type description
char[4] moniker
char[4] mother's moniker
char[4] father's moniker
string mother's name
string father's name
Body body
Limb head
Limb left thigh
Limb right thigh
Limb left arm
Limb right arm
Limb tail
uint8 direction facing
uint8 downfoot (0=left 1=right)
uint32 foot x
uint32 foot y
uint32 z-order
string current pose
uint8 expression (0=normal 1=happy 2=sad)
uint8 eyes open
uint8 asleep
uint32 unconscious
string poses[0]
... up through poses[99], inclusive
string gait_animations[0]
... up through gain_animations[7], inclusive
string vocabulary[0].in
string vocabulary[0].out
uint32 vocabulary[0].strength
... up through vocabulary[79], inclusive (80 words? is that right?)
uint32 remembered_objects[0].x
uint32 remembered_objects[0].y
... up through remembered_objects[39], inclusive
uint8 stimuli[0].significance
uint8 stimuli[0].input
uint8 stimuli[0].intensity
uint8 stimuli[0].features (bitfield, 0=modulate 2=iprange 4=ifasleep)
uint8 stimuli[0].chemical0
uint8 stimuli[0].amount0
uint8 stimuli[0].chemical1
uint8 stimuli[0].amount1
uint8 stimuli[0].chemical2
uint8 stimuli[0].amount2
uint8 stimuli[0].chemical3
uint8 stimuli[0].amount3
... up through stimuli[35], inclusive
Brain brain
Biochemistry biochemistry
uint8 sex
uint8 age
uint32 biological tick
char[4] gamete (my moniker)
char[4] zygote (child's moniker, if pregnant)
uint8 dead
uint32 age in ticks
uint32 number of instincts to be processed
uint32 dreaming
CInstinct instincts[0]
...
uint32 goals[0][0]
... up through goals[0][16], inclusive (drives related to object)
... up through goals[39], inclusive (up to 40 remembered objects)
SimpleObject zzzz
SimpleObject stars
SimpleObject bubbles
uint32 status of hand before it was disregarded
uint32 voice_lookup_table[0][0] (NOTE: voice data is similar to VCE files, but the lookup table comes first)
... up through voice_lookup_table[0][26], inclusive
... up through voice_lookup_table[2], inclusive
char[4] voices[0].name
uint32 voices[0].delay_ticks
... up through voices[31], inclusive
char[4] history_moniker
string history_name
char[4] history_moms_moniker
string history_moms_name
char[4] history_dads_moniker
string history_dads_name
string history_birthday
string history_birthplace
string history_owner_name
string history_owner_phone
string history_owner_address
string history_owner_email
uint32 history_state (0=ok 1=dead 2=exported)
uint32 history_gender
uint32 history_age_in_seconds
? padding

Creatures 1 BodyPart

Subclass of Entity:

type description
uint32 angle
uint32 view

Creatures 1 Body

Subclass of BodyPart:

type description
uint8 body_data[0][0].x
uint8 body_data[0][0].y
... up through body_data[0][9], inclusive
... up through body_data[5], inclusive

Creatures 1 Limb

Subclass of BodyPart:

type description
uint8 limbdata[0].startx
uint8 limbdata[0].starty
uint8 limbdata[0].endx
uint8 limbdata[0].endy
... up through limbdata[9], inclusive
Limb next limb

Creatures 1 CBrain

CArchive serialized:

Editnorn.png This stub could use more information.

Creatures 1 CBiochemistry

CArchive serialized:

type description
Creature owner
uint32 number of emitters
uint32 number of receptors
uint32 number of reactions
uint8 chemicals[0].concentration
uint8 chemicals[0].decay
... up through chemicals[255], inclusive
uint8 emitters[0].organ
uint8 emitters[0].tissue
uint8 emitters[0].locus
uint8 emitters[0].chemical
uint8 emitters[0].threshold
uint8 emitters[0].rate
uint8 emitters[0].gain
uint8 emitters[0].effect
...
uint8 receptors[0].organ
uint8 receptors[0].tissue
uint8 receptors[0].locus
uint8 receptors[0].chemical
uint8 receptors[0].threshold
uint8 receptors[0].nominal
uint8 receptors[0].gain
uint8 receptors[0].effect
...
uint8 reactions[0].reactant1_amount
uint8 reactions[0].reactant1_chemical
uint8 reactions[0].reactant2_amount
uint8 reactions[0].reactant2_chemical
uint8 reactions[0].rate
uint8 reactions[0].product1_amount
uint8 reactions[0].product1_chemical
uint8 reactions[0].product2_amount
uint8 reactions[0].product2_chemical
...

Creatures 1 CInstinct

CArchive serialized:

type description
uint32 dendrites[0].lobe_to_be_stimulated
uint32 dendrites[0].cell_to_be_stimulated
... up through dendrites[2], inclusive
uint32 decision to be taken (motor)
uint32 reinforcement chemical (reinforcer)
uint32 reinforcement amount
uint32 phase

Creatures 1 CGenome

CArchive serialized:

type description
uint32 length, in bytes, of genes data
char[4] moniker
uint32 sex (1=male 2=female)
uint8 life stage
... genes data, as in GEN files

External links