User:Chris/WIP/VPPTSV: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
Chris (talk | contribs)
Created page for the VPPTSV format
 
Chris (talk | contribs)
Rewrote parts of the article
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:


::{|class="wikitable"
'''VP Propdump TSV Version 1 (VPPTSV1)'''
|-
 
!''' Under construction '''
Propdump format for VP designed with simplicity, flexibility and user friendliness in mind. Based on the [http://en.wikipedia.org/wiki/Tab-separated_values tab-separated values] format, it is intended to be a universal format for storing the object data of worlds and enabling them to be modified. Each object is displayed on its own line, with the various parameters such as model name and location separated by tab, allowing spreadsheet editor to display these parameters in cells.
|-
 
|}
TSV and CSV files are widely supported by computer programs such as spreadsheet and text editors, making it easy to work with these propdump files.
 
== Usages ==
 
The VPPTSV format could be used to store a small group of objects or as a medium to backup a world. It could also be useful as an intermediate format when it is necessary to perform some tasks on builds in AW or VP, or when converting from AW propdumps.


'''VP Propdump TSV Version 1 (VPPTSV1)'''
It can make batch modifications to multiple objects a much quicker and more convenient task in both AW and VP, for instance if one needs to modify each texture on a a series of objects or move a build to a different location, making use of the math functions available in spreadsheet editors.


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. Compatibility with widely available spreadsheet and text editor software mean that no additional programs need to be downloaded. Many computer programs support the TSV format. This is a very flexible format which produces small file sizes and may be altered for different purposes.
As a flexible format, it is indiscriminate against the two styles of rotation available in VP: XYZ and Axis-Angle, the former being used in AW propdumps.  


The format could be used to store a few builds or an entire world. It could be used as an intermediate format when converting between different formats. By providing a text 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.  
AW propdumps can also be stored in this format.


== File format specification ==
== File format specification ==
''The specification is still currently a work in progress.''
''This specification is still a work in progress and may be subject to change.''


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>
There is an optional heading for each column which is intended to help users identify the value in each column, it should also be ignored by programs parsing the file.
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"
!SDK Attribute Name
|<center>VP_OBJECT_USER_ID</center>
|<center>VP_OBJECT_TIME</center>
|<center>VP_OBJECT_X</center>
|<center>VP_OBJECT_Y</center>
|<center>VP_OBJECT_Z</center>
|<center>VP_OBJECT_ROTATION_X</center>
|<center>VP_OBJECT_ROTATION_Y</center>
|<center>VP_OBJECT_ROTATION_Z</center>
|<center>VP_OBJECT_ROTATION_ANGLE</center>
|<center>VP_OBJECT_TYPE</center>
|<center>VP_OBJECT_MODEL</center>
|<center>VP_OBJECT_DESCRIPTION</center>
|<center>VP_OBJECT_ACTION</center>
|<center>VP_OBJECT_DATA</center>
|-
|-
!VPPTSV Attribute Name
! VP SDK Attribute !! VPPTSV Attribute !! Data Type (C#)
|<center>Owner</center>
|-
|<center>DateTime</center>
| VP_OBJECT_USER_ID || Owner || unsigned int
|<center>PositionX</center>
|-
|<center>PositionY</center>
| VP_OBJECT_TIME || DateTime || DateTime
|<center>PositionZ</center>
|-
|<center>RotationX</center>
| VP_OBJECT_X || PositionX || float
|<center>RotationY</center>
|-
|<center>RotationZ</center>
| VP_OBJECT_Y || PositionY || float
|<center>RotationAngle</center>
|-
|<center>ObjectType</center>
| VP_OBJECT_Z || PositionZ || float
|<center>Model</center>
|-
|<center>Description</center>
| VP_OBJECT_ROTATION_X || RotationX || float
|<center>Action</center>
|-
|<center>ObjectData</center>
| VP_OBJECT_ROTATION_Y || RotationY || float
|-
| VP_OBJECT_ROTATION_Z || RotationZ || float
|-
| VP_OBJECT_ROTATION_ANGLE || RotationAngle || float
|-
| VP_OBJECT_TYPE || ObjectType || unsigned int
|-
| VP_OBJECT_MODEL || Model || string
|-
|-
!C# Data Type
| VP_OBJECT_DESCRIPTION || Description || string
|<center>int</center>
|-
|<center>DateTime</center>
| VP_OBJECT_ACTION || Action || string
|<center>float</center>
|-
|<center>float</center>
| VP_OBJECT_DATA || ObjectData || byte[]
|<center>float</center>
|<center>float</center>
|<center>float</center>
|<center>float</center>
|<center>float</center>
|<center>int</center>
|<center>string</center>
|<center>string</center>
|<center>string</center>
|<center>byte[]</center>
|-
|-
|}
|}


Newline is replaced with '''\n''' and tab is replaced with '''\t'''<br>
Newline must be replaced with '''\n''' and tab must be replaced with '''\t'''<br>
The header version may be changed to 1.1 or 1b (and so on) if a small update is made to the specification.
Please be aware the header version may be incremented to 1.1 if a small update is made to the specification, instead of whole numbers. This should be accounted for if your program will be processing the version number.<br>
File extension can be .tsv or .csv


== Sample ==
== Sample ==
You can copy and paste this sample into spreadsheet software to better visualise it.


<pre>
<pre>
vp propdump tsv1
vp propdump tsv1
# Created: 30/12/2012 08:50:43
# Created: 09/03/2013 23:43:53
# World: Blizzard
# World: Blizzard


Owner DateTime PositionX PositionY PositionZ RotationX RotationY RotationZ RotationAngle ObjectType Model Description Action ObjectData
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
104 09/03/2013 22:49:39 -1.136963 8.195639E-09 0.2480469 0 1 0 0 0 tbtree003.rwx create ambient .5,diffuse .5,specular 0
13 27/10/2012 03:52:51 -49.99501 -0.4800002 -23.24999 0 1 0 0 0 wall001h.rwx create texture tan_brick
104 09/03/2013 23:13:00 -0.105957 0.005000007 -0.8530273 0 1 0 0 0 pp16w2.rwx create scale .7 .6 .6,color 0;activate move -1 0 0 wait=10
13 27/10/2012 03:52:51 -50 -9.674579E-08 -22.76 0 -1 0 3.141593 0 walk007h.rwx create texture roadas
104 09/03/2013 23:12:46 0.03393555 0.005000007 -0.8530273 0 1 0 0 0 pp16w2.rwx create scale .7 .6 .6,color 0;activate move 1 0 0 wait=10
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
104 09/03/2013 23:15:24 0.2128906 0.101 -0.001953125 0.7700768 0.3189757 0.552482 1.286658 0 pole1m02.rwx create visible no,solid no,light color=skyblue
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
104 09/03/2013 23:05:52 0.2141113 6.705522E-09 0.1479492 0 1 0 0 0 thseb1g.rwx
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
104 09/03/2013 23:14:05 0.2128906 0.301 0.0480957 0 1 0 0 0 thsed2.rwx
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
104 09/03/2013 23:11:47 0.4628906 0.301 1.148926 0 1 0 0 0 sign3.rwx Cheap Test House\nfor example purposes only create sign
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
104 09/03/2013 23:15:36 0.3640137 6.705522E-09 1.398926 0 1 0 3.141593 0 mailbox1.rwx
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
104 09/03/2013 23:15:42 0.2141113 6.705522E-09 1.148926 0 1 0 0 0 doorpic2.rwx create scale .9,solid no
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
</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, so it is advised that your program will be able to understand various DateTime formats.
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==
Line 100: Line 94:
* [[User:Chris/WIP/VPATSV|VPATSV]] Atdump specification
* [[User:Chris/WIP/VPATSV|VPATSV]] Atdump specification
* [[User:Chris/WIP/VPETSV|VPETSV]] Elevdump specification
* [[User:Chris/WIP/VPETSV|VPETSV]] Elevdump specification
==External links==
* [http://www.openoffice.org/ OpenOffice Calc] - Free open-source spreadsheet software that can edit TSV files

Latest revision as of 06:16, 12 July 2013

VP Propdump TSV Version 1 (VPPTSV1)

Propdump format for VP designed with simplicity, flexibility and user friendliness in mind. Based on the tab-separated values format, it is intended to be a universal format for storing the object data of worlds and enabling them to be modified. Each object is displayed on its own line, with the various parameters such as model name and location separated by tab, allowing spreadsheet editor to display these parameters in cells.

TSV and CSV files are widely supported by computer programs such as spreadsheet and text editors, making it easy to work with these propdump files.

Usages

The VPPTSV format could be used to store a small group of objects or as a medium to backup a world. It could also be useful as an intermediate format when it is necessary to perform some tasks on builds in AW or VP, or when converting from AW propdumps.

It can make batch modifications to multiple objects a much quicker and more convenient task in both AW and VP, for instance if one needs to modify each texture on a a series of objects or move a build to a different location, making use of the math functions available in spreadsheet editors.

As a flexible format, it is indiscriminate against the two styles of rotation available in VP: XYZ and Axis-Angle, the former being used in AW propdumps.

AW propdumps can also be stored in this format.

File format specification

This specification is still a work in progress and may be subject to change.

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.

VP SDK Attribute VPPTSV Attribute Data Type (C#)
VP_OBJECT_USER_ID Owner unsigned int
VP_OBJECT_TIME DateTime DateTime
VP_OBJECT_X PositionX float
VP_OBJECT_Y PositionY float
VP_OBJECT_Z PositionZ float
VP_OBJECT_ROTATION_X RotationX float
VP_OBJECT_ROTATION_Y RotationY float
VP_OBJECT_ROTATION_Z RotationZ float
VP_OBJECT_ROTATION_ANGLE RotationAngle float
VP_OBJECT_TYPE ObjectType unsigned int
VP_OBJECT_MODEL Model string
VP_OBJECT_DESCRIPTION Description string
VP_OBJECT_ACTION Action string
VP_OBJECT_DATA ObjectData byte[]

Newline must be replaced with \n and tab must be replaced with \t
Please be aware the header version may be incremented to 1.1 if a small update is made to the specification, instead of whole numbers. This should be accounted for if your program will be processing the version number.
File extension can be .tsv or .csv

Sample

You can copy and paste this sample into spreadsheet software to better visualise it.

vp propdump tsv1
# Created:	09/03/2013 23:43:53
# World:	Blizzard

Owner	DateTime	PositionX	PositionY	PositionZ	RotationX	RotationY	RotationZ	RotationAngle	ObjectType	Model	Description	Action	ObjectData
104	09/03/2013 22:49:39	-1.136963	8.195639E-09	0.2480469	0	1	0	0	0	tbtree003.rwx		create ambient .5,diffuse .5,specular 0
104	09/03/2013 23:13:00	-0.105957	0.005000007	-0.8530273	0	1	0	0	0	pp16w2.rwx		create scale .7 .6 .6,color 0;activate move -1 0 0 wait=10
104	09/03/2013 23:12:46	0.03393555	0.005000007	-0.8530273	0	1	0	0	0	pp16w2.rwx		create scale .7 .6 .6,color 0;activate move 1 0 0 wait=10
104	09/03/2013 23:15:24	0.2128906	0.101	-0.001953125	0.7700768	0.3189757	0.552482	1.286658	0	pole1m02.rwx		create visible no,solid no,light color=skyblue
104	09/03/2013 23:05:52	0.2141113	6.705522E-09	0.1479492	0	1	0	0	0	thseb1g.rwx		
104	09/03/2013 23:14:05	0.2128906	0.301	0.0480957	0	1	0	0	0	thsed2.rwx		
104	09/03/2013 23:11:47	0.4628906	0.301	1.148926	0	1	0	0	0	sign3.rwx	Cheap Test House\nfor example purposes only	create sign	
104	09/03/2013 23:15:36	0.3640137	6.705522E-09	1.398926	0	1	0	3.141593	0	mailbox1.rwx		
104	09/03/2013 23:15:42	0.2141113	6.705522E-09	1.148926	0	1	0	0	0	doorpic2.rwx		create scale .9,solid no

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, so it is advised that your program will be able to understand various DateTime formats.

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.


See also

External links

  • OpenOffice Calc - Free open-source spreadsheet software that can edit TSV files