Valve Hammer Tips and Troubleshooting

Discussion in 'Source SDK / Map developement' started by Wolv, Apr 23, 2014.

  1. Wolv
    Offline

    Wolv The Experienced
    Donator

    Joined:
    May 13, 2011
    Messages:
    2,457
    Likes Received:
    57
    [​IMG]
    Valve Hammer - Tips and Troubleshooting
    NOT FINISHED
    This is not a guide on how to use Hammer or Source SDK, this is a few helpful tips and what you can do to fix and prevent problems in your maps.


    Leaks

    The most common of all map errors are leaks, any entity that touches the void or area portal that isn't sealing the area will cause a leak, maps in hammer have to be sealed in with brushes.
    How to spot a leak
    Leaks are very easy to spot, when you compile your map (F9) and look at your log afterwards you should see this
    [​IMG]
    Its is presented underneath **** leaked **** in the format of
    (Type of entity leaked) (Coordinates of leaked entity)
    In this case
    Entity info_player_terrorist (-228.43 11.55 33.00) leaked!

    In order to fix this you want to go to Map>Load Pointfile
    [​IMG]
    Click yes on the prompt that appears and then you should see a red line pointing to the leak
    [​IMG]
    This red line is drawn from what is leaking and where it is leaking from, to fix this you have to seal the part of the map where you see the red line going through a gap from the inside to the outside of the map.
    [​IMG]
    as you see here I have extended the brush sealing the leak.






    Advanced Leaks

    Ok, you already know all this but what if the red line doesn't point to the leak and we can't find where it is?

    You can take the coordinates from Entity info_player_terrorist (-228.43 11.55 33.00) leaked! and paste them into the Go to Coordinates option under view.
    [​IMG]
    Type in the coordinates of the leaked entity and hit ok
    [​IMG]
    This will lead you to where the leak is
    [​IMG]
    Same as before, seal the the leak.

    What if Go to Coordinates tool doesn't show me what is leaking either?

    This can happen when the origin helper of one of your entities is displayed somewhere else, you will notice this if you load a pointfile and the red line points to nothing outside the map, copy and pasting a part of the map into a new map can likely cause this, an origin helper is an entity that helps other entities eg. The origin helper for func_door_rotating shows the entity the pivot to rotate around.

    The way to fix this is to find the origin helper and centre it back to its original position
    As you can see in this example, the origin helper is the little circle in the func_door_rotating entity
    [​IMG]
    If this somehow gets moved outside the map just as I've done purposely in the example below, it will cause a leak.
    [​IMG]
    When I load the pointfile for this kind of a leak you can see it points outside the map to nothing
    [​IMG]
    That's because helpers are invisible and you need to toggle them on

    Go to edit and hit Select all
    [​IMG]
    Make sure the origin helper tab [​IMG] is selected (turn it off and back on if nothing shows)
    [​IMG]
    You should now see the origin helper outside the map, to fix simply right click the helper and select Center on Entity.
    [​IMG]
    It should now move back to the center of its entity
    [​IMG]

    That's pretty much all you need to find 99% of leaks.
    In the tip section I will explain how to prevent leaks and what you shouldn't do to fix them.






    General map and compile errors


    Pressing ALT+P will show you a list of errors in your map, go through them and fix them manually, I advise you not to click the fix button.

    Note: If you have added your own options to an entity by turning off smart edit such as adding ammo to an ak47 (needed on game modes such as jailbreak where you can't buy weapons) this will appear as an error under Check map for problems, ignore this and most errors like it if you done it deliberately .
    [​IMG]
    [​IMG]

    Note: Be aware of what things in your map need fixing and what is just hammer being hammer, a quick google search could help.







    Microbrushes


    You might compile your map one day to see this

    [​IMG]
    It could also say duplicate planes or some other error, to remove these we press CTRL+SHIFT+G
    and copy and paste the brush numbers and hit ok
    [​IMG]
    This should highlight and center the camera on the microbrush, you have two options delete the brush or delete the whole object as a whole and recreate it as deleting the brush sometimes doesn't fix visual errors in your map.

    For most compiling errors it would be best to go to these sites
    http://www.interlopers.net/errors/errors.php
    https://developer.valvesoftware.com/wiki/Compile_Errors


     
    #1
    Last edited: Apr 23, 2014
    • Useful Useful x 3
    • Like Like x 1
    • Informative Informative x 1
  2. Wolv
    Offline

    Wolv The Experienced
    Donator

    Joined:
    May 13, 2011
    Messages:
    2,457
    Likes Received:
    57
    Tips and further troubleshooting

    The Carve Tool

    This tool should never be used nor the make hollow tool, it is always better to manually use the clipping and vertex tool, the only time this tool should be used is on simple block brushes but even at that its better practice to not use it.

    How to properly carve brushes using the clipping tool

    You can easily use the clipping tool wrong and it becomes just like carve, the right and wrong way is demonstrated below

    We are going to be cutting a circle out of square block in this example.


    The wrong way to do it

    I start by creating a square block and a circle, using the circle as a guide for where to clip, I select the block and I start clipping along the circle, as you can see below it is a mess and a sure way to mess up your map.
    [​IMG]
    This is just as bad or even worse than the carve tool

    The correct way
    I do the same as before but this time I carve vertically along the points of the circle
    [​IMG]
    As you can see the X shows individual brushes that have been created due to clipping
    I now select these brushes one by one and individual clip along the circle
    [​IMG]
    when its done it should look like this
    [​IMG]
    You can now delete the circle you used as a guide delete the inside of the brush
    Its much cleaner than before and this is how you should use the clipping tool to carve
    [​IMG]


    Some small ways I use the clipping tool to reduce the number of brushes in my map


    Cutting a square from a square
    [​IMG]
    This way results in more brushes, its not a big deal by far but I like to use as little amount of brushes that I can.
    You can do this and then delete the corners and you end up reducing 9 brushes to 5 with the same result anyway like below
    [​IMG]
    But I prefer and have gotten into the habit of smart clipping
    Clip on axis first (be it horizontal or vertical) and then select the middle and clip the other
    [​IMG]
    Reduced 9 brushes to 5

    When clipping complicated geometry it would be advisable to use the vertex manipulation tool to make sure all vertices are on the grid, speeds up compiling, helps with optimization and as a whole is good practice on your way to become a better mapper.

    Example of using the vertex manipulation tool in combination with the clipping tool
    Here I want to cut out a circle inside a circle but I want the width to be small so I have a ring
    [​IMG]
    I notice when I zoom in, one of the vertices is not on the grid therefore I cannot clip it
    [​IMG]
    So I use the vertex manipulation tool to snap the vertex to the grid
    [​IMG]
    The closest point will usually do as long as it looks fine and is on grid.

    Once all vertices are aligned you can now begin to clip, this is only demonstrating the two tools used together, if you want to make a ring there is a way easier, quicker and better way using the arch tool.


    Create an arch using whatever settings you like for the size of your ring, mess around with it till you get it how you like it
    [​IMG]
    [​IMG]
    Don't worry that it came out stretched, just resize it so it looks normal and then hold SHIFT and drag it down to create a copy
    [​IMG]
    Press CTRL+M to bring up transformation menu and enter in enter 180 into the Z axis box
    Note: If you accidentally pressed CTRL+N, its is the shortcut for New map, don't panic, nothing got lost, go to file and you should see your map listed, click it and reopen it.

    Your ring should be done now, if its small and not blocking sight make it a func_detail for optimization purposes, all the vertices should be aligned on grid but always double check
    [​IMG]

    Still under progress
     
    #2
    Last edited: Apr 23, 2014
    • Informative Informative x 2
    • Useful Useful x 2
    • Like Like x 1
  3. TheSleepyMuffin
    Offline

    Donator

    Joined:
    Feb 3, 2014
    Messages:
    75
    Likes Received:
    2
    Very very helpful! Cannot wait to see more :p
     
    #3
    • Like Like x 1
  4. WOLF
    Offline

    WOLF Veteran Member
    Donator

    Joined:
    Mar 16, 2011
    Messages:
    1,189
    Likes Received:
    58
    Good job Wolv! I can see these being very useful for new mappers. :) Might I offer one small suggestion though? At the top of the post you should have an 'index' of the topics covered, to save struggling people scrolling all the way through only to find out their problem isn't covered.
     
    #4
  5. Wolv
    Offline

    Wolv The Experienced
    Donator

    Joined:
    May 13, 2011
    Messages:
    2,457
    Likes Received:
    57
    Will do as soon as I cover some more stuff
     
    #5