Effect Subfile

From SC4 Encyclopaedia

Jump to: navigation, search

This page pertains to the format of the Effect Subfile within the Savegame files. This file has Type ID 2977AA49. It can be viewed using the SC4 Savegame Explorer, but not edited. This particular subfile was decoded by RippleJet.

Contents

Description

This savegame subfile contains effects, in a similar fashion as the Prop Subfile.

Structure

DWORD	Size
DWORD	CRC
DWORD	Memory
WORD	Unknown Version?  (only seen 0x0003)
WORD	Major Version?  (only seen 0x0006)
WORD	Minor Version?  (only seen 0x0004)
WORD	Zot  (always 0x0000 for effects)
BYTE	Unknown  (only seen 0x00)
BYTE	Appearance Flag  (Appendix 2)
DWORD	0xA823821E  (always the same)
BYTE	Min Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	Min Tract Z Coordinate  (normally between 0x40 and 0x7F)
BYTE	Max Tract X Coordinate  (normally between 0x40 and 0x7F)
BYTE	Max Tract Z Coordinate  (normally between 0x40 and 0x7F)
WORD	X Tract Size? (power of 2)  (only seen 0x0002)
WORD	Z Tract Size? (power of 2)  (only seen 0x0002)
DWORD	Count of Properties  (always 0x00000000 for effects)
    SGPROP    	SaveGame Properties, repeated Count times  (Appendix 1)
DWORD	Group ID  (from the Prop Exemplar)
DWORD	Type ID  (from the Prop Exemplar)
DWORD	Instance ID  (from the Prop Exemplar)
DWORD	Instance ID  (the value given when the prop appeared)
FLOAT32	Min X Coordinate
FLOAT32	Min Y Coordinate
FLOAT32	Min Z Coordinate
FLOAT32	Max X Coordinate
FLOAT32	Max Y Coordinate
FLOAT32	Max Z Coordinate
BYTE	Orientation
BYTE	State
BYTE	Start Time (in 0.1 hours)
BYTE	Stop Time (in 0.1 hours)
BYTE	Count  (0 or 1)
    DWORD	Interval (in days)
    DWORD	Duration (in days)
    DWORD	Start Date (in Julian days)
    DWORD	End Date (in Julian days)
BYTE	Random Chance of Appearance (0-100)
BYTE	Lot Type?  (this is a guess, I haven't verified it)  (Appendix 3)
DWORD	Object ID
BYTE	Conditional Appearance  (Appendix 4)
BYTE	Flag?  (0 or 1)
BYTE	Flag?  (0 or 1)
DWORD	Count  (seen at least up to 15)
    BYTE	Unknown Effect Bytes
DWORD	Uknown  (always 0x00000000)

Appendix 1: Structure of SGPROP (SaveGame Properties)

DWORD   Property Name Value
DWORD	Property Name Value (doubled for some unknown reason)
DWORD	0x00000000
BYTE	Data Type, 01=UInt8, 02=UInt16, 03=UInt32, 07=SInt32, 08=SInt64, 09=Float32, 0B=Boolean
BYTE	KeyType, 0x00 = 0 reps, 0x80 = more than 0 reps
WORD	0x0000
DWORD	Rep Count  (this one appears only if KeyType = 0x80)
    DATA	Property Value (repeated Rep Count times, type according to Data Type)

Appendix 2: Apperance Flag (offset 0x0016)

    0x01 (00000001b) - Effect that appears in the game (if this is off, the effect has been deleted)
    0x02 (00000010b) - ? (unused)
    0x04 (00000100b) - ? (always on)
    0x08 (00001000b) - Flora (unused for effects)
    0x40 (01000000b) - Burnt (probably unused for effects)
    0x80 (10000000b) - Disabled ATC or Timed Prop (no animation)

Appendix 3: Lot Type

Only one of these can be set concurrently.

    0x00 (00000000b) - Effect that does not belong in the game (deleted)
    0x01 (00000001b) - Effect that does not belong to any lot (e.g. border connections)
    0x02 (00000010b) - Effect that belongs to a normal lot
    0x04 (00000100b) - Effect that belongs to a T21 lot

Appendix 4: Conditional Appearance, normally 0x00

Takes different values for effects made conditional in different ways:

    0x00 - Any non-conditional prop in any state
    0x05 - Requires Power to Appear and Date Timed prop, in state 1
    0x06 - Requires Power to Appear and Hour Timed prop, in state 1
    0x07 - Requires Power to Appear, in state 1
    0x0B - ? (Seen once in Riquelandia for effect 0xEA8DE9EB in state 1)
    0x0D - Date Timed prop, in state 1
    0x0E - Hour Timed prop, in state 1
    0x0F - Timed prop in state 0, or any prop with Chance < 100% in any state


Personal tools