Key-Values File

From Equilibrium Engine Wiki
Revision as of 18:03, 31 January 2023 by Jellysoap (talk | contribs) (Created page with "Equilibrium Engine has it's own data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other serializable values). Those files used in many of the engine files, such as '''Material Files''', '''Vehicle Configuration Files''', '''Various Object Definition Files''', '''egfCa and animCa scripts.''' The data structure maybe seem similar to '''JSON''' but it's been simplified and extende...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Equilibrium Engine has it's own data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other serializable values).

Those files used in many of the engine files, such as Material Files, Vehicle Configuration Files, Various Object Definition Files, egfCa and animCa scripts.


The data structure maybe seem similar to JSON but it's been simplified and extended with useful features.

As seen in example below, keys can both can have and not have values, have nested keys inside and unlike JSON, keys are not unique.


Example:

// key and value with section
physics "slamp1"
{
    // key and value
	model 		"models/cityobjs/slamp1.egf";
	smashsound	"metal.streetlamp";

	breakForce	/* inline comment that does not break the flow of data */ 5;

    // keys without value but with nested content
	breakable
	{
		minforce 12.0;
		
		parts
		{
			part "part1"
			{
				physics lamp_part1;
				offset 0 -1.4 0;    // multiple values (array)
			}

			part "part2"
			{
				physics lamp_part2;
				offset 0 -0.1 0;
			}
		}
	}
}