-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to save scene as "slim TXML" #776
Comments
Good work on describing the situation clearly. This would indeed be a nice win. If you want newlines and indentation you can just run a XML indentation tool of your choise on the file (eg. there is a sublime package for this). I think omitting attributes that have default values should be made a new default. Yes I said it :) I see no point in writing the default values, no matter what the situation is. Here is my thinking, please leave a counter argument if you can think of one.
For the rest like omitting comp/attribute names we could have Edit: Now thinking of it the whitespace might be tricky to remove after the fact without knowing stuff. It could be made a |
For completeness / just for info, here's the same as 'normal xml' / xml3d style xml <!DOCTYPE Scene>
<scene>
<entity id="1">
<placeable>
<transform value="-66.6853561,43.672966,-41.3164825,-12.0000153,-126.599899,0,1,1,1" />
</placeable>
<name>
<name value="FreeLookCameraSpawnPos"/>
</name>
</entity>
</scene> 260 chars so not an awful lot of less than Stinkfist's example but somewhat less anyhow. And more human readable. Obviously not as explicit machine readable as there are no component, attribute etc tags. A even more kind of normal xml would be: <!DOCTYPE Scene>
<scene>
<entity id="1">
<placeable transform="-66.6853561,43.672966,-41.3164825,-12.0000153,-126.599899,0,1,1,1" />
<name name="FreeLookCameraSpawnPos"/>
</entity>
</scene> That's down to 213 chars and very readable. Actually xml3d is more like this than the first example. XML already itself has the |
There are different tradeoffs involved, the question is mainly what do you want to give up:
@Stinkfist0's suggestion is fine for something that will only be processed by machines, and it retains compatibility. Saving default-valued attributes could be pretty much removed from everywhere without loss. |
If we do something to this, i would also suggest that we set a version from now on, eg. |
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:
EDIT: 8. option to omit line endings also as suggested by @jonnenauha
A single entity example scene
consisting of 985 characters (CRLF line endings) would become
which is 301 characters, 30.56 % of the original TXML.
The text was updated successfully, but these errors were encountered: