User:Chris/WIP/VPPTSV

From Virtual Paradise Wiki
< User:Chris‎ | WIP
Revision as of 23:23, 7 March 2013 by Aerizeon (talk | contribs)
Jump to navigation Jump to search
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.

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 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.


See also