From ea8db55dc48a374063f10ac1c3c1615fb538943c Mon Sep 17 00:00:00 2001 From: tech kaczynski Date: Tue, 22 Sep 2026 23:05:52 +1000 Subject: added fun game save file spec 'fgsf_spec.txt' and fixed compile/ccproc build scripts. --- fgsf_spec.txt | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 fgsf_spec.txt (limited to 'fgsf_spec.txt') diff --git a/fgsf_spec.txt b/fgsf_spec.txt new file mode 100644 index 0000000..ce302ce --- /dev/null +++ b/fgsf_spec.txt @@ -0,0 +1,134 @@ +FUN GAME SAVE FILE FORMAT VERSION 0.1 + - 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 + +CHUNK LABELS + - ENTT + - TRFM + - MODL + - PHYS + +DATA RECORDS + - entity record + - transform component record + - model component 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 + +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 + +PHYS + u32 physics_cnt + + repeat physics_cnt: + u64 pid + u32 body_cnt + 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[3] axis_a + f32[3] axis_b + f32 lower + f32 upper + f32 spring_hz + f32 spring_damping + f32 motor_speed + f32 motor_force -- cgit v1.2.3