User:Chris/WIP/VPPTSV: Difference between revisions
Created page for the VPPTSV format |
No edit summary |
||
Line 8: | Line 8: | ||
'''VP Propdump TSV Version 1 (VPPTSV1)''' | '''VP Propdump TSV Version 1 (VPPTSV1)''' | ||
A simple propdump format for VP. Based on the [http://en.wikipedia.org/wiki/Tab-separated_values Tab-separated values] format, the VPPTSV format is intended to be a universal format for storing the object data of worlds in VP and allowing them to be easily edited. | A simple propdump format for VP designed with flexibility and user friendliness in mind. Based on the [http://en.wikipedia.org/wiki/Tab-separated_values Tab-separated values] format, the VPPTSV format is intended to be a universal format for storing the object data of worlds in VP and allowing them to be easily edited. The format takes elements from the C++ programming language but was designed with .NET programming in mind. | ||
The format could be used to store a few builds or an entire world. It could be | Many computer programs support the TSV format, such as spreadsheet and text editor software. This can mean that for the end-user, no additional programs need to be downloaded to edit a propdump. | ||
The format could be used to store a few builds or an entire world. It could also be useful as an intermediate format when converting between different formats. By providing a textual representation of objects, it can make modification of multiple objects a much easier task, for instance if a person needs to modify each texture on an object and replace it with a different one. | |||
== File format specification == | == File format specification == | ||
Line 17: | Line 19: | ||
Each line in a VPPTSV file is an individual object, with the data values being separated by tab characters. | Each line in a VPPTSV file is an individual object, with the data values being separated by tab characters. | ||
The [http://en.wikipedia.org/wiki/Magic_number_%28programming%29 magic number] or header which must be the first line is "'''vp propdump tsv1'''". This is used to identify the file format and version.<br> | The [http://en.wikipedia.org/wiki/Magic_number_%28programming%29 magic number] or header which must be the first line is "'''vp propdump tsv1'''". This is used to identify the file format and version.<br> | ||
Programs parsing the file should ignore lines that start with a hash''' # ''' allowing for comments to be added such as the creation date and world.<br> | Programs parsing the file should ignore lines that start with a hash''' # ''' allowing for comments to be added such as the creation date and world.<br> | ||
Lines starting with "O" should also be ignored as they are most likely the optional header, which is to name each field, user friendliness, spreadsheet software. | |||
::{|class="wikitable" | ::{|class="wikitable" | ||
Line 39: | Line 42: | ||
!VPPTSV Attribute Name | !VPPTSV Attribute Name | ||
|<center>Owner</center> | |<center>Owner</center> | ||
|<center>DateTime</center> | |<center>[[#Date & Time Structure|DateTime]]</center> | ||
|<center>PositionX</center> | |<center>PositionX</center> | ||
|<center>PositionY</center> | |<center>PositionY</center> | ||
Line 72: | Line 75: | ||
Newline is replaced with '''\n''' and tab is replaced with '''\t'''<br> | Newline is replaced with '''\n''' and tab is replaced with '''\t'''<br> | ||
Note that the header version may be incremented to 1.1 if a small update is made to the specification, instead of whole numbers (float type). This must be accounted for if your program will be processing the version number. | |||
== Sample == | == Sample == | ||
TODO: better sample which displays use of \n, colour coding for the different parts of the sample, more common objects such as pp01.rwx and sign3.rwx | |||
<pre> | <pre> | ||
Line 95: | Line 100: | ||
151 13/12/2012 03:06:10 30.19992 -3.130365E-07 14.73999 0 -1 0 3.141593 0 unit04 create color white,scale 2 2 .25 | 151 13/12/2012 03:06:10 30.19992 -3.130365E-07 14.73999 0 -1 0 3.141593 0 unit04 create color white,scale 2 2 .25 | ||
</pre> | </pre> | ||
== Date & Time Structure == | |||
For the end user, most spreadsheet software should be able to understand a standard Date & Time, allowing for the ability to manipulate objects in propdumps based on their date and time, for instance only selecting objects built before a certain date or only selecting objects from a certain date. The date can be flexible and may be altered slightly by some spreadsheet software when performing simple manipulations. | |||
The DateTime string can be parsed into a [http://msdn.microsoft.com/en-us/library/system.datetime.aspx DateTime structure] when programming in a .NET language using the [http://msdn.microsoft.com/en-us/library/system.datetime.parse.aspx DateTime.Parse Method]. This method accepts many date & time formats making it very flexible, so it should understand most date and times. When using the [http://vpnet.codeplex.com/ VPNet SDK], it is easy to parse the DateTime string directly into a VpObject structure using this method. | |||
==See also== | ==See also== |
Revision as of 22:47, 7 March 2013
Under construction
VP Propdump TSV Version 1 (VPPTSV1)
A simple propdump format for VP designed with flexibility and user friendliness in mind. Based on the Tab-separated values format, the VPPTSV format is intended to be a universal format for storing the object data of worlds in VP and allowing them to be easily edited. The format takes elements from the C++ programming language but was designed with .NET programming in mind.
Many computer programs support the TSV format, such as spreadsheet and text editor software. This can mean that for the end-user, no additional programs need to be downloaded to edit a propdump.
The format could be used to store a few builds or an entire world. It could also be useful as an intermediate format when converting between different formats. By providing a textual representation of objects, it can make modification of multiple objects a much easier task, for instance if a person needs to modify each texture on an object and replace it with a different one.
File format specification
The specification is still currently a work in progress.
Each line in a VPPTSV file is an individual object, with the data values being separated by tab characters.
The magic number or header which must be the first line is "vp propdump tsv1". This is used to identify the file format and version.
Programs parsing the file should ignore lines that start with a hash # allowing for comments to be added such as the creation date and world.
Lines starting with "O" should also be ignored as they are most likely the optional header, which is to name each field, user friendliness, spreadsheet software.
SDK Attribute Name VP_OBJECT_USER_ID VP_OBJECT_TIME VP_OBJECT_X VP_OBJECT_Y VP_OBJECT_Z VP_OBJECT_ROTATION_X VP_OBJECT_ROTATION_Y VP_OBJECT_ROTATION_Z VP_OBJECT_ROTATION_ANGLE VP_OBJECT_TYPE VP_OBJECT_MODEL VP_OBJECT_DESCRIPTION VP_OBJECT_ACTION VP_OBJECT_DATA VPPTSV Attribute Name Owner DateTime PositionX PositionY PositionZ RotationX RotationY RotationZ RotationAngle ObjectType Model Description Action ObjectData C# Data Type int DateTime float float float float float float float int string string string byte[]
Newline is replaced with \n and tab is replaced with \t
Note that the header version may be incremented to 1.1 if a small update is made to the specification, instead of whole numbers (float type). This must be accounted for if your program will be processing the version number.
Sample
TODO: better sample which displays use of \n, colour coding for the different parts of the sample, more common objects such as pp01.rwx and sign3.rwx
vp propdump tsv1 # Created: 30/12/2012 08:50:43 # World: Blizzard Owner DateTime PositionX PositionY PositionZ RotationX RotationY RotationZ RotationAngle ObjectType Model Description Action ObjectData 13 27/10/2012 03:52:51 -50 0.0149999 -23.76 0 -1 0 3.141593 0 walk007h.rwx test create texture road7 13 27/10/2012 03:52:51 -49.99501 -0.4800002 -23.24999 0 1 0 0 0 wall001h.rwx create texture tan_brick 13 27/10/2012 03:52:51 -50 -9.674579E-08 -22.76 0 -1 0 3.141593 0 walk007h.rwx create texture roadas 151 13/12/2012 03:02:25 30.54992 -3.130365E-07 14.73999 0 -1 0 3.141593 0 p:w100x400,0,.5.rwx create color white 151 13/12/2012 03:02:35 30.79991 -3.130365E-07 14.73999 0 -1 0 3.141593 0 unit04 create color white,scale 2 2 .25 151 13/12/2012 03:03:44 30.49992 -3.130365E-07 14.58999 0 -1 0 1.570796 0 p:w300x400,0,.5.rwx create color white 151 13/12/2012 03:03:39 30.49992 -0.1000003 14.23999 0 -1 0 1.570796 0 unit04 create color white,scale 2 2 .25 151 13/12/2012 03:04:03 30.49992 0.2999997 14.23999 0 -1 0 1.570796 0 p:w400x100,0,.5.rwx create color white 151 13/12/2012 03:04:34 30.49992 -2.081924E-07 14.73999 -1 3.822869E-07 3.164966E-07 1.570796 0 p1rec0025b create color b,scale .5 3 151 13/12/2012 03:04:39 30.49992 1.784422E-07 14.03999 -1 3.822869E-07 3.164966E-07 1.570796 0 p1rec0025b create color b,scale .5 3 151 13/12/2012 03:05:35 30.44992 -3.130365E-07 14.73999 0 -1 0 3.141593 0 p:w100x400,0,.5.rwx create color white 151 13/12/2012 03:06:10 30.19992 -3.130365E-07 14.73999 0 -1 0 3.141593 0 unit04 create color white,scale 2 2 .25
Date & Time Structure
For the end user, most spreadsheet software should be able to understand a standard Date & Time, allowing for the ability to manipulate objects in propdumps based on their date and time, for instance only selecting objects built before a certain date or only selecting objects from a certain date. The date can be flexible and may be altered slightly by some spreadsheet software when performing simple manipulations.
The DateTime string can be parsed into a DateTime structure when programming in a .NET language using the DateTime.Parse Method. This method accepts many date & time formats making it very flexible, so it should understand most date and times. When using the VPNet SDK, it is easy to parse the DateTime string directly into a VpObject structure using this method.