- 
                Notifications
    You must be signed in to change notification settings 
- Fork 69
Open
Labels
Description
Writing down an idea we discussed with @jonnenauha some weeks ago. Adding a possibility to save the scene in a slimmer format could had its advantages from time to time.
Opportunities for saving space when writing TXML:
- omit default values of sync property (true) both for entities and components (for entities alternatively the sync value could be deducted from the entity ID),
- omit component type names,
- omit attributes with default values,
- omit types of static attributes,
- omit attribute names,
- no indentation, and
- write booleans as "1" and "0" instead of true and false.
 EDIT: 8. option to omit line endings also as suggested by @jonnenauha
A single entity example scene
<!DOCTYPE Scene>
<scene>
 <entity id="1" sync="true">
  <component typeId="20" type="Placeable" sync="true">
   <attribute value="-66.6853561,43.672966,-41.3164825,-12.0000153,-126.599899,0,1,1,1" type="Transform" id="transform" name="Transform"/>
   <attribute value="false" type="bool" id="drawDebug" name="Show bounding box"/>
   <attribute value="true" type="bool" id="visible" name="Visible"/>
   <attribute value="1" type="int" id="selectionLayer" name="Selection layer"/>
   <attribute value="" type="EntityReference" id="parentRef" name="Parent entity ref"/>
   <attribute value="" type="string" id="parentBone" name="Parent bone name"/>
  </component>
  <component typeId="26" type="Name" sync="true">
   <attribute value="FreeLookCameraSpawnPos" type="string" id="name" name="Name"/>
   <attribute value="" type="string" id="description" name="Description"/>
   <attribute value="" type="string" id="group" name="Group"/>
  </component>
 </entity>
</scene>consisting of 985 characters (CRLF line endings) would become
<!DOCTYPE Scene>
<scene>
<entity id="1">
<component typeId="20">
<attribute value="-66.6853561,43.672966,-41.3164825,-12.0000153,-126.599899,0,1,1,1" id="transform"/>
</component>
<component typeId="26">
<attribute value="FreeLookCameraSpawnPos" id="name"/>
</component>
</entity>
</scene>which is 301 characters, 30.56 % of the original TXML.