Key-Values File

From Equilibrium Engine Wiki
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.

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;
			}
		}
	}
}

As seen in example:

  1. Keys can both can have and not have values, have nested keys inside.
  2. Unlike JSON, keys are not unique.
  3. Multiple values are separated with spaces, no need for brackets and commas.
  4. Semicolon is used to separate key-value entries.
  5. Each section begins with { and ends with } brackets.