Map files as XML


(nUllSkillZ) #1

Hi,

a search for XML here in the forums has had no results.

Today I’ve edited a map source file with a text editor.
The structure of a mapfile is very similar to a XML file.

Are there already programs that can convert map files to a XML file?
Is there already a definition file for Q3/W:ET XML files?

Thank you very much for your help in advance.


(valkyr) #2

Why would you want to do that?


(nUllSkillZ) #3

Not sure.
May be because it can be done.
:smiley:

Two examples for XML’s:
Long version:


<map>
  <entity>
    <entity_id></entity_id>
    <classname></classname>
    CLASSNAME_SPECIFIC_KEY_VALUE_PAIRS
    <brush>
      <brush_id></brush_id>
      <plane>
	<point>
	  <x></x>
	  <y></y>
	  <z></z>
	</point>
	...
	<texture>
	  <path></path>
	  <x_offset></x_offset>
	  <y_offset></y_offset>
	  <z_offset></z_offset>
	  <rotation_angle></rotation_angle>
	  <x_scale></x_scale>
	  <y_scale></y_scale>
	  <4></4>
	  <5></5>
	</texture>
      </plane>
    </brush>
    <patchDef2>
      <texture>
	<path></path>
	<x_offset></x_offset>
	<y_offset></y_offset>
	<z_offset></z_offset>
	<rotation_angle></rotation_angle>
	<x_scale></x_scale>
	<y_scale></y_scale>
      </texture>
      <bezier_point>
	<x></x>
	<y></y>
	<z></z>
	<u></u>
	<v></v>
      </bezier_point>
      ...
    </patchDef2>
  </entity>
</map>

Short version:


<map>
  <entity id="" classname="" CLASSNAME_SPECIFIC_KEY_VALUE_PAIRS>
    <brush id="">
      <plane>
	<point x="" y="" z="" />
	...
	<texture path="" x_offset="" y_offset="" z_offset="" rotation_angle="" x_scale="" y_scale="" 4="" 5="" />
      </plane>
    </brush>
    <patchDef2 id="">
      <texture path="" x_offset="" y_offset="" z_offset="" rotation_angle="" x_scale="" y_scale="" />
      <bezier_point x="" y="" z="" u="" v="" />
      ...
    </patchDef2>
  </entity>
</map>

Also not sure what all the information in the map files mean.
For example the last two numbers in the texture section of a brush.


(dutchmeat) #4

my spidersense tell me null is trying to do this because of cross-compatibility between mapping software. Ur not after sKetchup are you ?


(nUllSkillZ) #5

Nope.
Didn’t know that Sketchup can import XML.
But I guess someone will have a usage for the XML files.


(IndyJones) #6

perhaps online-3d preview tool. quite useless in most cases.


(ailmanki) #7

problematic is the xml specification … which one to use? or do you want to create your own?


(valkyr) #8

[QUOTE=nUllSkillZ;226847]Not sure.
May be because it can be done.
:D[/QUOTE]

All you’d end up with would be a map that takes up ~30% more space.

The idea crossed my mind too, but really… I don’t think XML tools have any features that would do anything interesting with the files that couldn’t be done without a conversion. Multiple replacement of certain entities/shaders/etc can be done with search/replace in a text editor, and for anything more complicated it’d be as easy to write a (e.g. Perl) script to work with the .map format directly without converting it first.


(dutchmeat) #9

Im positive I could make something like that, but I still can’t find a reason why you want a generated mapfile in xml.


(valkyr) #10

I decided to start a a script to do this now. Here’s a sample output so far :

http://l0x.in/XML/articles/radar_final.xml


(Cambodunum) #11

May be because it can be done.

hmpf … no hobbies? xD