BadgerCode / Sample-Hammer-Repository

An example project for a Hammer map for the Source Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample Hammer Project

An example GitHub project for a Hammer map.
After cloning this, fill in all of the TODO parts.


Folder structure

  • assets
    • Custom assets used by the map into this folder
      • materials, models, scripts, sound
    • Copy-paste them into the equivalent garry's mod folders, or use symbolic links
      • E.g. garrysmod/materials/mapname -> this_project/assets/materials/mapname
  • release
    • This folder is what you will publish to the workshop
  • mapname.vmf
    • This is your hammer project

How to use Git and GitHub

  1. Download GitHub desktop to manage projects using Git on your machine
  2. Sign up to GitHub to host your projects
    • Alternative- GitLab
  3. Follow the guides on how to use GitHub desktop

Making changes

  • Make your changes to the files
  • Add & commit all changed files in GitHub Desktop
  • Push the changes up to GitHub

Using a previous version of the project

  • View the History in GitHub Desktop
  • Right click on the point (commit) that you want to go back to
  • Select "Create branch from commit" to create a temporary branch
    • Give it a name E.g. temp
  • Important: If you make any changes at this point, it will be difficult to add them to the later version of the project
  • Look around the files
  • Once you want to go back, select Current branch in GitHub Desktop, and select master
    • You can right click on your temporary branch to delete it



References

  • A bullet point list of useful inspiration images/sources
  • TODO


Environment Setup

  • Link to required assets for your map
  • TODO


Tester names

  • Use this section to record the names of people who have helped test/develop your map, so you can thank them later
  • TODO


How to release your map

Build the map & pack custom content into it

  1. Rename the map source file
    • Give it the final map name
      • e.g. mapname_v1
      • TODO
    • You must do this BEFORE compiling, or things like cubemaps will be scoped to the wrong map name and may not work fully
  2. Open the map in the Garry's Mod Hammer editor
  3. Compile the map
    • Set BSP to normal
    • Set VIS to normal (optimise what is visible)
    • Set RAD to normal (lighting)
  4. Open up VIDE - https://developer.valvesoftware.com/wiki/VIDE
    • Open the "Pakfile lump editor" tool (🗺 ✏)
    • Open the map
    • Click Scan
    • Click browse
    • Find the Garry's mod directory (C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod)
    • Click scan (this may take a while)
    • Click Auto
    • Ensure that custom files are added
    • Click Apply
    • ENSURE THAT THE DECALS ARE ADDED
    • ENSURE THAT THE SOUNDSCAPE IS ADDED
      1. Make sure the soundscape has the same name as the map
        • assets/scripts/soundscapes_mapname.txt
      2. Add the soundscape
      3. MANUALLY ADD THE SOUNDSCAPE SOUND FILES
    • Click Save
  5. Copy the packed map into the garry's mod maps folder
  6. Open the map in-game and build the cubemaps
    1. sv_cheats 1
    2. building_cubemaps 1
    3. buildcubemaps
    4. mat_hdr_level 0 (to go to LDR)
    5. restart (to reload map)
    6. buildcubemaps
    7. mat_hdr_level 2 (to go back to HDR)
    8. restart
  7. Copy the bsp out of the Garry's Mod Maps folder back into the project folder
    • This version will contain both cubemaps and the packed content


Test the map

  1. Change your game settings to disable custom content
    • In the garry's mod folder, rename- download, materials, models and sound
      • Add old to the end of the name
    • Set GMod launch options to -noworkshop -noaddons
  2. Launch the game and play on your map
  3. Verify there are no missing textures/models/sounds
  4. Once happy, put your game settings back to normal
    • Rename your folders back to their original names- download, materials, models and sound
      • A new materials folder may have appeared; merge/delete it
    • Remove the launch settings -noworkshop -noaddons


Publish to the workshop

  1. Move the workshop version of the map into release/maps
  2. Add the thumbnail to release/maps/thumb/map_name.png
  3. Add a nodegraph to support NPCs
    • Add AI nodes to your map
    • Play the map in-game to re-generate the nodegraph
      • You will find it in your garry's mod folder- garrysmod/maps/graphs/mapname.ain
    • Copy this file to release/maps/graphs/map_name.ain
    • Copy this from the maps folder in your GMod folder
  4. Add a navmesh to support bots
  5. Package & release the workshop addon
  6. Change the thumbnail, title and description
    • There is an example thumbnail in this project- example-workshop-thumbnail.jpg
    • Thumbnails need to be 512x512 pixels, JPGs with "progressive" unchecked/disabled
    • You can use the GMod SDK to update your thumbnail- https://www.youtube.com/watch?v=DtX3Lu9trwE

About

An example project for a Hammer map for the Source Engine