Opening .map files in Hammer editor?

Belli

L69: Deviant Member
Jan 21, 2012
69
1
Hello there.

I tried exporting a map from Blender into the .map format, which worked just fine, but upon opening it in Hammer, it cause the following error:

BlockArray<0,0> - invalid block index.


Shouldn't Hammer be able to open the format just fine?

Also tried converting it with Nem's tool (crafty), which refuses to even start, though (despite having all the required files).


Is there any other way to either, get from Blender to hammer, or make the map file compatible?
 

Belli

L69: Deviant Member
Jan 21, 2012
69
1
I... thought that Hammer only accepted .vmf's, even with converting.

Well, at least it says "open Valve map files/autosave/Worldcraft RMF/Worldcraft Map" under the file types if you try to open something, so I'd assume it should be possible. At least for the Blender converted map files, it doesn't seem to work, though.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
World Craft? Why are you using the GLD Source world editor? RMF and MAP files were the old, now redundant formats.

My question is why you're importing FROM Blender and INTO Hammer. Usually people want to do it the other way around so they can create a model to scale and/or utilise the template.

P.S. Frozen, Hammer also accepts VMX files.
 

tyler

aa
Sep 11, 2013
5,102
4,621
A Valve Map File is a VMF. Autosaves are WMX. I don't know what a .map is. It sounds modeling specific.
 

Belli

L69: Deviant Member
Jan 21, 2012
69
1
A Valve Map File is a VMF. Autosaves are WMX. I don't know what a .map is. It sounds modeling specific.


.map is just uncompiled quake maps (plain text).

I picked this format as it's supported by blender and hammer, but it doesn't quite work.

The format doesn't really matter, I'm just looking for some way to quickly get the Blender files as hammer brushes as well.
 

Hype

L1: Registered
Jul 18, 2011
11
8
The real question is, what do you need modeled brush geometry for anyway? Could you just make/use a proper model instead or do you need "more complex" brush geometry?
 

Blade x64

Logical insanity
aa
Sep 3, 2009
239
633
Have you tried downloading the old Hammer (3.5), opening the .map file in that, then saving it as .rmf (or whatever the main map format is), then opening that in Hammer?
 

Belli

L69: Deviant Member
Jan 21, 2012
69
1
Have you tried downloading the old Hammer (3.5), opening the .map file in that, then saving it as .rmf (or whatever the main map format is), then opening that in Hammer?

Yep, that just seems to crash hammer every time.
 

lana

Currently On: ?????
aa
Sep 28, 2009
3,075
2,778
Why are you exporting from blender into hammer?
 
Feb 18, 2009
640
629
I know everyone keeps saying it, but you don't want to import anything into hammer (unless you count opening a vmf/vmx and copying the contents as importing).
If you were making some complex brush work in Blander because it's easier, there are some things you need to be aware of that mean it wont work (other than the importing issue).
1) When compiling, the vertices of each brush (and entity origins I think) must be on the hammer grid. If they aren't, they will automatically be moved to the nearest grid point.
2) Hammer is very picky about what constitutes an invalid solid. The list is endless, but the most common problem is that a face is not planar. Blender can deal with this, but hammer will freak out.

On the other hand, if you were wanting to make a model and use it in a map, you need to compile the model (there are LOADS of tutorials for that) and place it in hammer using a prop entity.
 

henke37

aa
Sep 23, 2011
2,075
515
Well, that's because the VMF format stores solids by listing their planes and not their vertexes. What an odd format.
 
Feb 18, 2009
640
629
Well, that's because the VMF format stores solids by listing their planes and not their vertexes. What an odd format.

I've had this discussion before with a friend. It's a strange way of doing it, yeah, but it's more efficient. Instead of storing data for each vertex and the normal of the face (or the normals of each vertex), only 3 vertices are needed. The face is an infinite plane defined by those 3 points and the face normal is dictated by the order the points are written. When you see a brush in hammer, the edges are the intersections of the faces of that brush and the faces and vertices are calculated after. That's pretty damn clever in my opinion.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
I have no idea why you guys think Hammer can't read RMF and MAP format (they would need it for Half-Life:Source and the like), have you never looked at the filetype dropdown on the open dialog? To add to which, it actually doesn't let you open a VMX directly, because it doesn't have them in the filetype filter (though structurally they are identical to a VMF).

MAP was the format the old quake-based compilers (qcsg, qbsp, etc) could read, and the RMF was converted to MAP before being sent to them. The RMF contained all the Worldcraft unique stuff like camera locations and object groups that the plain MAP format didn't support.


As for the problem at hand, my first guess was to try what Blade suggested (MAP>RMF>VMF), but if that's not working perhaps there is something wrong with Blender's exporter. You might try making a basic (one/two brushes) map in Worldcraft and then saving as a MAP and inspecting the file alongside the blender one, so see if there is any obvious structural difference.
 

henke37

aa
Sep 23, 2011
2,075
515
I've had this discussion before with a friend. It's a strange way of doing it, yeah, but it's more efficient. Instead of storing data for each vertex and the normal of the face (or the normals of each vertex), only 3 vertices are needed. The face is an infinite plane defined by those 3 points and the face normal is dictated by the order the points are written. When you see a brush in hammer, the edges are the intersections of the faces of that brush and the faces and vertices are calculated after. That's pretty damn clever in my opinion.

If a plane is defined in traditional abcd notation you need four numbers to store it. The normal is built into the definition.

If a rectangular polygon is defined with verticies then you need four verticies, each of three numbers. The normal can be computed based on the order of the vertices.

If polygons share vertices then you can store a list of vertices and just store indexes into that list instead.

A cube needs six planes, so 4*6=24 numbers. A cube needs 8 unique vertices + 4*6 vertice indexes=8*3+4*6=48 numbers. So yes, a cube would be smaller using planes here.

But level geometry isn't freestanding cubes, at least not when you actually play the level.
 

Godling

L2: Junior Member
Oct 26, 2007
55
14
Well, that's because the VMF format stores solids by listing their planes and not their vertexes. What an odd format.

That's valve for ya'

To be fair, this method was implemented in Worldcraft long before Valve got their hands on it.

...and the face normal is dictated by the order the points are written.
This method could never account for virtually infinite angles that plane could be at. Another reference point somewhere is required.

If a plane is defined in traditional abcd notation you need four numbers to store it. The normal is built into the definition.
The 3 co-ordinate plane method obtains it's 4th reference point from the center point of the brush, thus removing the need for a 4th co-ordinate on every plane associated with that brush.

The plane itself is defined as being perpendicular to the line connecting the point and the center of the brush.
 
Last edited:

Belli

L69: Deviant Member
Jan 21, 2012
69
1
Nevermind guys, I'll do the brushes in Hammer again. Blender would be more convenient, but oh well, I guess it'll work fine enough in Hammer either.
 
Feb 18, 2009
640
629
Godling said:
This method could never account for virtually infinite angles that plane could be at. Another reference point somewhere is required.
Huh?
I'm assuming you mean the normals (bacuase 3 points will always define a single plane), and still that's not strictly true. I mean yeah, the face normal could be at any angle, but hammer doesn't need it to be defined as any. Finding a vector perpendicular to the plane is, mathematically, dead easy. If you're thinking of smoothing groups, then again, definition of the normals is not needed in the vmf, but is instead (I assume. not studied vbsp) calculated when compiling. X is smoothed with Y, therefore average face normals of X and Y.

Some stuff about cubes...
Actually, the vmf method only needs 6 vertices to be stored, but yeah, they have to be repeated (3 per face, with some duplication). I see what you're saying with indexing vertices, but how much space would that actually save, and how much longer would it take for hammer to load and find the vertex data in this huge list?

I'm not saying vmf is the way all storage of 3D objects has to be stored, there are pros and cons as with everything, but it's just a neat, elegant way of doing it. Although, I wish the documentation was a little clearer.
 

Godling

L2: Junior Member
Oct 26, 2007
55
14
Huh?
I'm assuming you mean the normals (bacuase 3 points will always define a single plane), and still that's not strictly true. I mean yeah, the face normal could be at any angle, but hammer doesn't need it to be defined as any. Finding a vector perpendicular to the plane is, mathematically, dead easy. If you're thinking of smoothing groups, then again, definition of the normals is not needed in the vmf, but is instead (I assume. not studied vbsp) calculated when compiling. X is smoothed with Y, therefore average face normals of X and Y.
Sorry Mick, I totally misread your post and thought the 3 points you mentioned were referring to a single point defined by 3 values of x,y and z.

Additionally, I also got confused, given my lengthy time away from Hammer (it's been over 10 years), and wanted to say your explanation of the 3 points defining a plane is correct.

I'm trying to get back into editing but like I said, it's been awhile since I've last used Hammer and it's obviously gonna take me a bit longer to get back into the swing of things and to remember it all.