Specs for quake 3 .map file format?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Specs for quake 3 .map file format?

Post 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 :)
o'dium
Posts: 11712
Joined: Sun Mar 25, 2001 8:00 am

Re: Specs for quake 3 .map file format?

Post 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...?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Specs for quake 3 .map file format?

Post by ^misantropia^ »

It's pretty self-explanatory, isn't it? The only thing you need to know is that patchDefs define Bezier curves.
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Specs for quake 3 .map file format?

Post 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).
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Specs for quake 3 .map file format?

Post by obsidian »

I forgot what the last 3 numbers are (0 7 0), but the rest are texture coordinates.

sShift tShift rotation sScale tScale
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Quack
Posts: 82
Joined: Thu Sep 07, 2006 6:56 pm

Re: Specs for quake 3 .map file format?

Post by Quack »

For the 0 7 0. I know the first 0 changes to 134217728 if a brush is detail.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Specs for quake 3 .map file format?

Post 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?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Specs for quake 3 .map file format?

Post 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).
spookmineer
Posts: 506
Joined: Fri Nov 29, 2002 8:00 am

Re: Specs for quake 3 .map file format?

Post 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]
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Specs for quake 3 .map file format?

Post 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 :)
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Specs for quake 3 .map file format?

Post 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.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Specs for quake 3 .map file format?

Post 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.
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Specs for quake 3 .map file format?

Post 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.
Anthem
Posts: 399
Joined: Wed Oct 21, 2009 12:34 am

Re: Specs for quake 3 .map file format?

Post 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.
[url=http://www.xfire.com/profile/vlnoheaven/][img]http://i105.photobucket.com/albums/m231/Lowerboy444/xfire.png[/img][/url]

[url=http://teameventhorizon.com/]Team Event -O- Horizon[/url]

[url=http://mapping.maverickservers.com/]NoGhost Map Making Competition 2 (June 2010)[/url]
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Specs for quake 3 .map file format?

Post 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 :)
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Specs for quake 3 .map file format?

Post 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.
Bliccer
Posts: 341
Joined: Thu Nov 26, 2009 4:27 pm

Re: Specs for quake 3 .map file format?

Post by Bliccer »

It is pointless, yes, since you can just press the L or M key in radiant for this info.
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Specs for quake 3 .map file format?

Post 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 :)
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Re: Specs for quake 3 .map file format?

Post 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.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Specs for quake 3 .map file format?

Post by ^misantropia^ »

If I understand you right then yes, that is correct. Just to be sure:

Code: Select all

( 96 96 0 ) ( 0 96 0 ) ( 0 0 0 )
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:

Code: Select all

( 96 96 0 ) ( 96 0 0 ) ( 0 0 0 )
Post Reply