FUN GAME SAVE FILE FORMAT VERSION 0.3 - little endian - 32-bit IEEE-754 floats - UTF-8 strings which are *not* null terminated - units are metric and 1 unit is 1 meter - quaternions are xyzw and need normalization - pids start at 1 and are monotonic, 0 is reserved for null parent VERSION CHANGES 0.3: Added root_body to identify which body drives the entity pose. Stored after body_cnt; adds 4 bytes per physics component. Zero-based body index. Empty rigs store 0. 0.2: Replaced axis_a/axis_b with frame_rot_a/frame_rot_b. Joint records increased from 85 to 93 bytes. CHUNK LABELS - ENVR - ENTT - TRFM - MODL - MTEX - MSHD - PHYS DATA RECORDS - environment record - entity record - transform component record - model component record - texture override record - shader override record - physics component record - physics body record - physics shape record - box - sphere - cylinder - capsule - convex hull - static trimesh - physics joint record FILE HEADER char[4] magic "FGSF" u16 major u16 minor CHUNK char[4] label u32 size u8[size] data ENVR f32 day_start f32 day_len ENTT u64 next_pid u32 entity_cnt repeat entity_cnt: u64 pid u32 name_len char[name_len] name TRFM u32 transform_cnt repeat transform_cnt: u64 pid u64 parent_pid f32[3] pos f32[4] rot f32[3] scale MODL u32 model_cnt repeat model_cnt: u64 entity_pid u32 key_len char[key_len] key bool(u8) draw MTEX u32 texture_override_cnt repeat texture_override_cnt: u64 entity_pid u32 material_idx u32 key_len char[key_len] texture_key MSHD u32 shader_override_cnt repeat shader_override_cnt: u64 entity_pid u32 material_idx u32 key_len char[key_len] shader_key PHYS u32 physics_cnt repeat physics_cnt: u64 pid u32 body_cnt u32 root_body body[body_cnt] u32 joint_cnt joint[joint_cnt] PHYSICS BODY f32[3] pos f32[4] rot f32 linear_damping f32 angular_damping f32 gravity_scale u8 physics_mode bool(u8) enable_sleep u32 shape_cnt shape[shape_cnt] PHYSICS SHAPE u8 tag f32[3] pos f32[4] rot f32 density f32 friction f32 restitution u32 category_bits u32 mask_bits switch tag: BOX f32[3] sz SPHERE f32 radius CYLINDER or CAPSULE f32 height f32 radius CONVEX HULL u32 points_cnt f32[points_cnt][3] points TRIMESH u32 point_cnt u32 index_cnt f32[point_cnt][3] points u32[index_cnt] indices PHYSICS JOINT u8 tag u32 body_a u32 body_b u32 flags f32[3] anchor_a f32[3] anchor_b f32[4] axis_a f32[4] axis_b f32 lower f32 upper f32 spring_hz f32 spring_damping f32 motor_speed f32 motor_force