Opening .map files in Hammer editor?

Discussion in 'Mapping Questions & Discussion' started by Belli, Jun 28, 2012.

  1. Belli

    Belli L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    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:


    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?
     
  2. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,901
    I... thought that Hammer only accepted .vmf's, even with converting.
     
    • Thanks Thanks x 1
  3. Belli

    Belli L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    1
    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.
     
  4. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,557
    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.
     
  5. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,031
    Positive Ratings:
    3,975
    A Valve Map File is a VMF. Autosaves are WMX. I don't know what a .map is. It sounds modeling specific.
     
  6. Belli

    Belli L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    1

    .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.
     
  7. Hype

    Hype L1: Registered

    Messages:
    11
    Positive Ratings:
    7
    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?
     
  8. Blade x64

    aa Blade x64 Logical insanity

    Messages:
    199
    Positive Ratings:
    441
    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?
     
  9. Belli

    Belli L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    1
    Yep, that just seems to crash hammer every time.
     
  10. Lancey

    aa Lancey Currently On: ?????

    Messages:
    3,076
    Positive Ratings:
    1,314
    Why are you exporting from blender into hammer?
     
  11. Mick-a-nator

    aa Mick-a-nator

    Messages:
    640
    Positive Ratings:
    314
    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.
     
  12. henke37

    aa henke37

    Messages:
    1,832
    Positive Ratings:
    420
    Well, that's because the VMF format stores solids by listing their planes and not their vertexes. What an odd format.
     
  13. Mick-a-nator

    aa Mick-a-nator

    Messages:
    640
    Positive Ratings:
    314
    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.
     
    • Thanks Thanks x 1
  14. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,901
    That's valve for ya'
     
  15. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    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.
     
  16. henke37

    aa henke37

    Messages:
    1,832
    Positive Ratings:
    420
    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.
     
  17. Godling

    Godling L2: Junior Member

    Messages:
    55
    Positive Ratings:
    8
    To be fair, this method was implemented in Worldcraft long before Valve got their hands on it.

    This method could never account for virtually infinite angles that plane could be at. Another reference point somewhere is required.

    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: Jun 29, 2012
  18. Belli

    Belli L69: Deviant Member

    Messages:
    69
    Positive Ratings:
    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.
     
  19. Mick-a-nator

    aa Mick-a-nator

    Messages:
    640
    Positive Ratings:
    314
    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.

    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.
     
  20. Godling

    Godling L2: Junior Member

    Messages:
    55
    Positive Ratings:
    8
    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.