Page 1 of 1
Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 11:55 am
by Eraser
Does anyone know if the specifications of the quake 3 map file format are available somewhere? I need an explanation of what all the numbers mean

Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 11:57 am
by o'dium
I thought the numbers were something to do with who was a better candidate for looking after the island when Jacob died...?
Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 2:19 pm
by ^misantropia^
It's pretty self-explanatory, isn't it? The only thing you need to know is that patchDefs define Bezier curves.
Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 2:52 pm
by Eraser
Well, I get so far that I understand the coordinates and texture of a brush, but the numbers after that are a bit ambiguous:
( 960 0 -512 ) ( 408 0 -512 ) ( 408 -376 -512 ) common/trigger 0 0 0 0.500000 0.500000 0 7 0
I mean, 0 0 0 0.500000 0.500000 0 7 0 doesn't really do a good job of explaining itself
edit:
oh and the coordinates aren't exactly clear to me either. I assume they're three groups of X, Y and Z values, but what points exactly do they define? And do they define brush faces or something different? I get confused because I'm not familiar with the methods of defining shapes in 3D spaces at all and as far as I could tell, you'd need only two XYZ coordinates to define a single face of a brush (that's why I assume they're strictly speaking not brush faces).
Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 3:13 pm
by obsidian
I forgot what the last 3 numbers are (0 7 0), but the rest are texture coordinates.
sShift tShift rotation sScale tScale
Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 3:42 pm
by Quack
For the 0 7 0. I know the first 0 changes to 134217728 if a brush is detail.
Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 3:57 pm
by ^misantropia^
Right. First one is the detail flag, the other two don't do anything. I think they're remnants from Q2.
So... what are you going to do with this information?
Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 4:00 pm
by ^misantropia^
Eraser wrote:oh and the coordinates aren't exactly clear to me either. I assume they're three groups of X, Y and Z values, but what points exactly do they define? And do they define brush faces or something different? I get confused because I'm not familiar with the methods of defining shapes in 3D spaces at all and as far as I could tell, you'd need only two XYZ coordinates to define a single face of a brush (that's why I assume they're strictly speaking not brush faces).
You mean the ( 960 0 -512 ) ( 408 0 -512 ) ( 408 -376 -512 ) bit? It defines a single vertex (a triangle).
Re: Specs for quake 3 .map file format?
Posted: Tue Aug 31, 2010 7:45 pm
by spookmineer
2 coordinates define a line, you need 3 coordinates to define a flat plane.
[edit] didn't read lower bit of thread... [/edit]
Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 7:03 am
by Eraser
spookmineer wrote:2 coordinates define a line, you need 3 coordinates to define a flat plane.
Well, technically speaking I can define a rectangular shape with two coordinates quite well

Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 7:10 am
by Eraser
^misantropia^ wrote:So... what are you going to do with this information?
I was bored and wrote a bit of JavaScript that parses a .map file and stores it in an internal structure. On top of that I've built a little interface that, so far, lists all the entities in the map and when clicked, displays their properties.
It's not particularly useful, but it helped me kill some time

Right now I'm just wondering what else I could do with the data stored in the .map file other than, well, displaying the map.
I might try to use HTML5 <canvas> code to render 2D views of the map. I also had this idea of generating an item-placement-coverage-map which shows the bounding boxes of your map and gives each pixel a color that represents how close certain item types are. If it takes into account all items of that type on the map, I can calculate the distance to each of those items and more/closer items make the color brighter.
I'm not entirely sure if that's useful either, but it might give a mapper some insight in if certain locations in his map are "low" on items compared to other locations.
edit:
so far the biggest hurdle appears to be the strict security policies both IE and Firefox have on accessing local files. I'm not sure it's possible in Firefox alltogether and IE only allows sites that run in a trusted domain to use the Scripting.FileSystemObject ActiveX object.
edit2:
ah, it appears HTML5 has some functionality for this.
Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 8:55 am
by ^misantropia^
Unrelated but awesome: check out
node.js if you're into JavaScript. All the cool kids use it and I've hacked on it so you know it's good.
Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 9:15 am
by Eraser
That's pretty neat.
However, I'm only doing this in JavaScript right now because it's the only way to do this as a webapp.
I prefer to do useless doodles like this in JavaScript because it makes it very accessible for anyone who wants to take a quick peek. People are often reluctant or even suspicious towards downloading and installing executables. Server side languages (.NET or PHP) require a webserver supporting such a thing, which I don't have at my disposal right now.
Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 9:56 am
by Anthem
If by web server you mean a host, then you should look into using
DropBox as a host. You can freely host 2 GB of files and link to them after they upload. It is incredibly accessible for .html, so it may be what you need for your project.
Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 11:07 am
by Eraser
Well I do have my personal FTP space which I use but (free) hosts with ASP (.NET) or JSP are hard to come by. PHP is more common but I despise PHP

Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 1:56 pm
by Eraser
Now that I have it working using the HTML5 FileReader object, I think what I've got so far is showable.
Go to
http://tinyurl.com/q3mapreader, point it to your favorite .map file and hit Go. It'll list the entities in your map and when clicked, it displays the properties for that entity.
I really urge you to run this in Firefox (3.5/3.6) as IE will give you headaches with ActiveX security settings. That and Firefox is almost a factor 8 faster with q3dm1sample.map (39ms vs 293ms). Unfortunately Chrome doesn't know about the FileReader object.
Like I said, so far, it's all rather pointless but I've had fun making it. I'm thinking hard of more interesting features.
Re: Specs for quake 3 .map file format?
Posted: Wed Sep 01, 2010 3:18 pm
by Bliccer
It is pointless, yes, since you can just press the L or M key in radiant for this info.
Re: Specs for quake 3 .map file format?
Posted: Thu Sep 02, 2010 6:37 am
by Eraser
lol I know, that's why I wanted to know how brushes are defined so I can do some calculations based on those coordinates

Re: Specs for quake 3 .map file format?
Posted: Thu Sep 02, 2010 6:47 am
by Silicone_Milk
Actually...
It would be cool to see an "optimum route" calculator from this where you can tell the program "I'm playing Defense" or "Survival > everything else" and it can then draw a route that shows you the optimal way to go to get the items you need (ignoring less important items) and takes in to account item respawn times.
Re: Specs for quake 3 .map file format?
Posted: Tue Oct 12, 2010 8:22 pm
by ^misantropia^
If I understand you right then yes, that is correct. Just to be sure:
That defines a vertex that lies on the z plane (because z=0 in all cases). It's one half of the face, the other one being an implicit mirror copy: