Quake .map exporter for Blender3D

Does Quake .map exporter for Blender exist? It would be nice to be able to design and export levels directly from Blender to .map format, istead of using separate level editor.
Can somebody write one please?

Have somebody heard about such expoerter?
Can somebody code it please?

I search the same script. :smiley:

To export a .bsp
Or export a .map (compatible with Quark better)

Plis! Someone help us!

There ya go :smiley:

http://www.garagegames.com/blogs/43612/11288

haven’t tried it. But it’s there. Couple of scripts.
I wish Cambo (ideasman42) would get interested in fixing it :stuck_out_tongue:
This way we could do maps for Quake-based engineas and for Torque3D in Blender \o/

if sombody supplies a Blend + Map and the script in it. Ill see if I can get it working.
maybe we can get it stable and release in 2.43/2.5

dont realy have an interest in this script personaly, but if others can help with the footwork, Id be happy helping out.

cambo,
Thank you! I will make .blend file and map file! Quake community will appreciate it alot!

EDIT: Would it help if I also provide .map file format specs and UI mockup for exporter and options?

omg!
I try this in my home.

:D:D:D:D:D:D

cambo,
here is tech. specs of .map format:

http://www.gamers.org/dEngine/quake/QDP/qmapspec.html
http://collective.valve-erc.com/index.php?go=map_format
http://www.gamers.org/dEngine/quake/spec/quake-spec32.html

Here is .blend file in 1:20 scale (model of Quake player is in 1:20 scale), exported .map file with Blender exporter (I took it from the link I posted above) and correct .map file that I re-created in GTKRadiant (can be opened in GTKRadiant and QuArK):

Blend:
http://www.filesend.net/download.php?f=6b9de13d5bffa5d157e9fa53f8224343

Blend2map result (.map file):
http://www.filesend.net/download.php?f=10a51a5054deb3627fa11747bba61dc5

GTKRadiant .map file:
http://www.filesend.net/download.php?f=4d2507aba34d611c3570d84b911f4d45

Btw, GTKRadiant is Open Source Application so I think there is alot of stuff can be found in it’s source. Maybe not. I don’t know :o
Sorry Cambo, I haven’t come up with UI, neither with functionality (“flagging” brushes, exporting lights and entities, etc.). Let’s first get working .map file out of Blender!
Again, thanks alot and we all appreciate your time!

Map is a funny format, the whole levels made of cubes pretty much…

Heres an exporter that exports mesh cubes as map brushes and lights.

Im not sure how people intend to use a .MAP exporter, but it could be extended to support all the map features.

Another thing- is exporting an arbitary mesh - where each face is a “brush” it would tend not to make an efficient BSP, but could be cool for flexible level design. where- any-mesh-is-a-level

Id be interested to see people post on how they’d like a .MAP exporter to work, would you do all the level design in Blender. or export a mesh as a map and then edit in QuarK?


see new script below

not sure about Quark
but with GTKradient it’s as follows(from memory excuse any mistakes)
at the moment you can do the following,
1)model in blender>
2)export via .ase or .3ds or .md3
3)import into gtkradiant,
4)leak test/optimise/tweak etc
5)using gtkrad as a front end for qmap2build to compile as BSP

the main problem with the above is you must uv map you model in blender first, and gtkrad will treat it as one object, not as a brush so all the nice and easy texturing in gtkrad wont work, using the above you can create the whole level in blender, uvmaped and export into gtkrad and then blockout all the structural brushes/player clips and other brush attributes that you need for a functional map/bsp. Athough it sounds like extra work it is probably the best way to ensure an optimised level, structural brushes vs detail brush/objects.

Zenitor, so what could a .map exporter offer that direct ase/3ds would not?
So Far - indervidual brushes are better then 1 object.

quote - “the main problem with the above is you must uv map you model in blender”

I intent to export UV maps from Blender so this wouldnt change, how else would you export maps? - or do you mean that youd rather not map in Blender at all and map all the brushes in gtkRadient?

any other advantages?

I was thinking of a way to do an entire level in Blender- including all the quake nodes, would this be usefull? or is it better to do that in another app?

Zenitor,
Building level out of brushes will help with r_speed. (higher fps)
Plus compiler (q3map or q3map2) is optimized for brushes.
Also pipeline is huge (export, optimization, compilation, etc.).
I hope we will endup with Cambo (if he still will be interested :wink: ) with exporter that export boxes as brushes, meshes as .obj and map models as .md3 (working exporter exist already). This way all you have to do is to compile .map file witj q3map2 and get working .bsp file.

Cambo,
There are folks who against using Blender as level editor as well :smiley: I just have had discussion in #darkplaces on IRC and soem folks for using Blender as complete toolset for creating game content, some against it because they use 3DS MAX, GTKRadiant and other stuff instead of Blender.

EDIT: In Blender we can use array to create alot of architectural detailes out of boxes in short period of time. We can’t do that neither in QuArK nor in GTKr.
Also since level would be completely in Blender, it will be much quicker and easier to do machinima and in-game cinematics.
Another advantage - you can render level and see approximately how it will look like in game (or OpenGL preview with lights and textures).

EDIT #2: Also you can sketch level on paper, backdrop it in Blender and model.

The point is that pipeline will be short and alot of artists will love making levels in Blender. Those folks who disagree, there is QuArK and GTKRadiant :wink:
Also I think if folks can use Blender for level design also, it will become more popular!

Cambo: I was pointing out the existing problem, the only way to get models from blender is a uvmapped .ase/.md3/.3ds which are only detail brushes with no way of assigning other brush values to them, so you need to create “brushes” in gtk or quark which is slow and painful.

Your .map exporter as it stands is a huge help, now if you can include .ase, .md3 or .3ds export as motorsep asks, exporting all within one .map file this would indeed be excellent. This alone would be fantastic, and is number 1 priority.

I was thinking that once the modelling was completed in blender, and exported in .map form the rest is very easy to do in gtkrad, placement of quake entities, changing entity values, leak testing with visual feed back displayed in gtkrad…(that red arrow pointing to hole etc)
This would be nice if it could be done in blender but a secondary issue, I really do appreciate the work you have done and wasn’t sure how far you wanted to push this script…:slight_smile:

Cambo: I think you were looking at the quake .map specs? not the newer quake3 map specs?
with quake3 a brush(six sides) can be assigned with the chaulk shader on 5 sides and a texture on the 6th, with only the 6th being calculated in game… also you have “curve brushes”, “end caps” etc that are not cubes… but are brushes… so you can create an optimised level without using cubes in quake3… sry I didn’t think of that sooner, hence the confusion, in quake 3 it should be possible to create realitively complex geometry in blender and call it a brush which would allow other attribute to be applied in entity editors… the old quake1 doesn’t have this funtionality, dealing mostly with cubes… man I’m an idiot, motorsep is correct but so was I… talking about different quake versions. Problem is both engines have been modded and support normal mapping etc and are mighty fine to use… and both gpl’d.

Zenitor,
You are right. There are some new stuff in Quake 3 .map format, but basically it’s the same as in Quake1. And since Cambo haven’t worked with Quake engines, we are going to take one step at a time.
Brush is a brush, no matter what Quake engine is it for. It’s is compiler who clip faces of the brush that have “caulk” texture. So it doesn’t make any difference in geometry in .map file. You can apply “caulk” texture to faces that have to be clipped in Blender and when you will compile your .map file, q3map2 will clip it off :slight_smile:

You know guys what I have noticed? People who doesn’t like Blender (because of it’s GUI and lack of exporting scripts for various game formats) hates an idea of having Blender as modeling and level design tool for games :confused:
Isn’t it weird?

Update, Python 2.4 only.
now multiple cubes are extracted from 1 mesh so you can use the array modifier for eg - to make a series of brushes.

Invisible faces are exported as “common/caulk” so they are ignored by the compiler.

Any node should be exportable now from empties. you just have to assign the came property “classname” and give it a meaningfull value and all other props will be written in the map syntax for that node.

see a later post.

Quake3 specific:

here is an example of a simple mesh patch(in .map format)
The equivalent of a blender plane subdivided 1 time, ie 9 verts/4 faces,

// entity 0
{
“classname” “worldspawn”
// brush 0
{
patchDef2
{
NULL
( 3 3 0 0 0 )
(
( ( 32 0 0 0 0 ) ( 32 0 32 0 -1 ) ( 32 0 64 0 -2 ) )
( ( 32 32 0 1 0 ) ( 32 32 32 1 -1 ) ( 32 32 64 1 -2 ) )
( ( 32 64 0 2 0 ) ( 32 64 32 2 -1 ) ( 32 64 64 2 -2 ) )
)
}
}
}

NULL
( 3 3 0 0 0 )
3x3 mesh, last 3 digits are mesh grid coordinates, not world related
( ( 32 0 0 0 0 ) world coordinates xyz, last 2 are mesh grid coordinates in relation to origin, which appears to be left bottom corner,
( ( 32 0 0 0 0 ) ( 32 0 32 0 -1 ) ( 32 0 64 0 -2 ) ) column 1 bottom to top (then rows left to right)
( ( 32 32 0 1 0 ) ( 32 32 32 1 -1 ) ( 32 32 64 1 -2 ) )
column 2 bottom to top
( ( 32 64 0 2 0 ) ( 32 64 32 2 -1 ) ( 32 64 64 2 -2 ) )
column 3 bottom to top
looks like it lays out the mesh using the last 2 digits in each bracket and uses the first 3 digits as world coordinates for those verts
A 5x5 mesh would be

// entity 0
{
“classname” “worldspawn”
// brush 0
{
patchDef2
{
NULL
( 5 5 0 0 0 )
(
( ( 0 0 36 0 0 ) ( 0 16 36 0 -0.5 ) ( 0 32 36 0 -1 ) ( 0 48 36 0 -1.5 ) ( 0 64 36 0 -2 ) )
( ( 16 0 36 0.5 0 ) ( 16 16 36 0.5 -0.5 ) ( 16 32 36 0.5 -1 ) ( 16 48 36 0.5 -1.5 ) ( 16 64 36 0.5 -2 ) )
( ( 32 0 36 1 0 ) ( 32 16 36 1 -0.5 ) ( 32 32 36 1 -1 ) ( 32 48 36 1 -1.5 ) ( 32 64 36 1 -2 ) )
( ( 48 0 36 1.5 0 ) ( 48 16 36 1.5 -0.5 ) ( 48 32 36 1.5 -1 ) ( 48 48 36 1.5 -1.5 ) ( 48 64 36 1.5 -2 ) )
( ( 64 0 36 2 0 ) ( 64 16 36 2 -0.5 ) ( 64 32 36 2 -1 ) ( 64 48 36 2 -1.5 ) ( 64 64 36 2 -2 ) )
)
}
}
}
This is specific to quake3, if it is possible to add the ability to export blender planes to the above definition it would be very handy, allowing the creation of complex maps entirely within blender. patchDef2 allows curves/cylinders all mesh shapes
ie a cylinder 3 verts high with 8 columns of verts(the 9th having the same coordinates as the first)

// entity 0
{
“classname” “worldspawn”
// brush 0
{
patchDef2
{
NULL
( 9 3 0 0 0 )
(
( ( -128 -96 0 0 0 ) ( -128 -96 32 0 -1 ) ( -128 -96 64 0 -2 ) )
( ( -128 -128 0 1 0 ) ( -128 -128 32 1 -1 ) ( -128 -128 64 1 -2 ) )
( ( -96 -128 0 2 0 ) ( -96 -128 32 2 -1 ) ( -96 -128 64 2 -2 ) )
( ( -64 -128 0 3 0 ) ( -64 -128 32 3 -1 ) ( -64 -128 64 3 -2 ) )
( ( -64 -96 0 4 0 ) ( -64 -96 32 4 -1 ) ( -64 -96 64 4 -2 ) )
( ( -64 -64 0 5 0 ) ( -64 -64 32 5 -1 ) ( -64 -64 64 5 -2 ) )
( ( -96 -64 0 6 0 ) ( -96 -64 32 6 -1 ) ( -96 -64 64 6 -2 ) )
( ( -128 -64 0 7 0 ) ( -128 -64 32 7 -1 ) ( -128 -64 64 7 -2 ) )
( ( -128 -96 0 8 0 ) ( -128 -96 32 8 -1 ) ( -128 -96 64 8 -2 ) )
)
}
}
}

zenitor, would a subsurfed mesh grid be okay for this? - both nurbs patch or subsurf mesh are possible.
Iv tested and they give similar results, tho not exactly.

it could check for any subsurf mesh being an even grid and export those as patches.

Just a straightout mesh object is all that is needed, no subsurfing.
basical this should be a way to turn any blender mesh object into a brush, with out having to adhere to the cube-brush 1990 map constraints.

The image below was made in gtkradiant as patch meshes which falls under the patchDef2 as above, if we can do the same in blender we can then do some very nice maps. curved hallways where standard textures can be easily applied and lined-up with other structures
http://www.magesskulls5.ndo.co.uk/images/tutorials/columns/pillar.jpg

Cant find any docs on patchDef2, though one reference was to patchDef2 mentioned beziers.