• Slammin' Source map tools
    138 replies, posted
https://files.facepunch.com/forum/upload/109753/20a13c29-7201-417b-9c99-f93756960374/newhammer.png Slammin' tools for Source 2013 SP and MP What is this? I wanted to create some tools that would revitalise Source (2013) modding, building on the improvements presented by other popular compile tools, such as Amckern's CST and HAVOK's HCC tools. As well tools for other games entirely, such as Tyrutils for Quake, and VHLT for Goldsrc. These tools bring along a bunch of really slammin' cool improvements, not only for the compile tools, but to Hammer itself as well. After 12 months in the making, hopefully its been worth the wait. Grab them here!!! (Installation stuff right at the bottom of the post) What's new? There's a lot to list... Spoilered features are ones I've yet to re-implement (did a massive re-factoring recently). Strikethrough features are reverted and not in the downloadable build. Common: SSE2 support Cleaned up common code Large Address Awareness Higher limits Max CPU threads bumped to 32 Hammer: BUGS: You can enter invalid values into the FOV, MSAA samples and Picmip boxes if you just exit out of options with the Windows close button MSAA affects the 2D viewports too FEATURES: Enabled Visual Styles 6.0 (window styles should now match your installed OS, rather than the default Windows 9x appearance) Entire program now uses your default system font, instead of the dated win9x standard font Revamped entire user interface, options menu is cleaner, removed obsolete options Added new graphical options to the 3D View tab, including picmip, MSAA level, etc Added an option to change the 3D viewport background colour: default is 128,128,128 50, 60, 70 makes a nice blue background Enabled the MFC restart manager - upon crash, Hammer will save your open file, automatically restart, and put you right back where you were, no lost work ever again DISABLED, doesn't work Performance upgrades - swathes of obsolete and deprecated code removed, leading to a smoother experience Removed huge amounts of deprecated icons, cursors and bitmaps Modernised large chunks of code, doesn't really affect the end user experience, but it should make you happier to know Increased the distance that vertex positions are rounded to integers to 0.01 from 0.05, this fixes some gross vertex rounding issues (or lack thereof) Ctrl+A now selects all, rather than resetting the viewport sizes Reset viewports changed to SHIFT+Q, check the toolbar keybinds ( sorry veterans! ) Say goodbye to the process window, Hammer's built in compiler now feeds compile information to a new exe, meaning no more freezes, and instant compile information on the fly. You can still use Hammer while a map is compiling New toolbar, transform tools. Same as the options available in the "tools" menu option, just brought out for ease of access Texture application window is now more concise, added X and Y buttons that randomise texture coordinates for their appropriate boxes also added a "mark" button which selects all instances of the currently selected texture in the map. Texture application window is now host to an experimental "reset" texture button, which resets the texture's scale, shift coordinates, lightmap scale and rotation to defaults, still needs some extra work to fully reset all of a texture's properties Reworked the entire right-hand UI bar to be easier to use Removed Radial Culling, it crossed me for the last time Removed Quake, Hexen 2, Quake 2 and Half-Life support Added support for func_instance_origin, set the in-editor origin point for instances (no keyvalues needed) Removed lots of ties to .wad files, make sure you have no WAD files linked to your gameconfig if you have no textures (click remove anyway to double check) Additional: Removed support for WAD files entirely Clamped framerate to 60hz from 100hz (will make this an option) Extended available automatic visgroup types The "default animation" keyvalue for dynamic props is now registered and will now automatically play in the viewport func_detail_blocker entities are displayed accurately in Hammer, with detail objects inside the entities' volume not being drawn Added "open source" and "explore to source" buttons in the texture browser, selecting a material and using either of these buttons will bring you to the material's folder or open the selected material with your default VMT file editor, doesn't work with materials packed into VPKs for obvious reasons World text support, requires worldtext material / FGD entry from CSGO Certain UI elements such as the entity report dialogue now support resizing Models no longer share animations with all other model instances present Multiple precision and accuracy fixes in general, brushes are less likely to crap up, texture coordinates are displayed correctly, etc Paste & Paste Special shortcuts now properly displayed in the edit menu New binds for group, object and solids selection modes, CTRL + W, R and T for solids, objects and groups respectively I made a bunch of other changes that I can't remember, and forgot to write down But long story short, I removed ignore groups, use the groups / objects / solids bar on the right, it's better Implemented partial "sprinkle" functionality from other Hammer versions, it may not be fully functional yet however TODO: FIX ROPE RENDERING (big oops OOPS OOPS OOPS) CMaterial::Initialize: make closer to actual game Add menu bar items to options!!! Make the automatic mouse-over selection not a thing anymore, middle click or click to select Investigate dispshore Change missing material texture from white to the checkerboard Increment button for the texture app window instead of random coords, configure from options, 25, 50, etc Nah VBSP: Features: Power of 4 displacements are properly supported now Added missing content types to csg.cpp Added -maxluxelscale, lets you limit the maximum luxel scale in your map Detail brushes now preserve their smoothing group Stripped out .map displacement parser, you can't export .map files with dispinfo, this has been obsolete for over 15 years New %compile command for VMTs, "%compileNoShadows", makes a material not recieve shadows, only direct light, this is used on water usually Translucent brushes should no longer cut visleaves if they are world brushes, please contact me if you have problems with this REVERTED, just assign transparent stuff to func_detail, turns out the engine uses the generated visleafs for sorting? Maybe I dunno, whatever Corrected formatting in some files. Any prop with $staticprop can now be a static prop (IE physics props) Increased detail sprites limit Custom lightmappedgeneric shaders are supported now (such as SDK_Lightmappedgeneric) Implemented support for func_detail_blocker Improved brush precision Leaktest is now enabled by default, command is now -noleaktest Added new command: -nodefaultcubemap, disables automatic skybox cubemap generation (necessary for 2013 SP) Added new command: -blocksize, lets you customise the size of visleaf splitting "blocks", default is every 1024 units Added new command: -visgranularity, lets you automatically place hint brushes in your map, syntax is "-visgranularity X Y Z" TODO: Added new command: -infoladder, converts all func_ladder entities to info_ladder, like the old tools did Probably other stuff I forgot about VVIS: Features: Minor code cleanup nothing idk VRAD: Features: Added new command: -ambientocclusion, adds ambient occlusion to your map (like in CSGO) To reduce the impact of this command, use -aosamples to decide how many samples you want, default is 32 Added new command: -softencosine, softens coloured lighting so it blends more accurately, not recommended for cartoony / larish maps, it will make lighting blander Added new command: -coring, scale the light threshold before a luxel is completely unlit, used to save lightmap data, default is 0.5 Added new command: -ambient, when supplied with three RGB values, will apply a constant light value to every luxel in your map (this may eat lightmap data) Added new command: -reflectivityscale, multiplier for the reflectivity of textures in your map Drastically improved displacement lightmap quality See here for details: http://blog.counter-strike.net/workshop/maps.php#displacement -staticproplighting, -staticproppolys and -textureshadows are now all enabled by default, commands have been renamed to -NoStaticPropPolys and so on Added new command: -extra, lets you scale how many extra passes you want your map to go through, default is 4, differences above this value are extremely minimal Any prop with $staticprop can now be a lit static prop (IE physics props) General stability improvements -final enables -largedispsampleradius Single-line comments can now be placed in .rad files. Corrected issues related to luxel placement on displacement surfaces, luxels will now be correctly placed, resulting in higher quality lightmaps (with no extra cost) Enabled supersampling capabilities for displacement surfaces, further increases lightmap quality, you may experience a very slightly longer compile time Stripped out some obsolete code vrad defaults to .dx90 VTX files when loading models now, falls back to dx80 files if not available Added new command: -worldtextureshadows, allows world polys to cast texture shadows, much like models can, applies only to $alphatest materials nodraw faces are ignored on these brushes Used to apply to $translucent brushes too, but this caused serious issues Transparent textures loaded by vrad are now bilinear filtered, for more accurate shadows Added light_directional support, basically multiple light_environments ( See L4D ) QoL: Vastly improved description of options when showing help. -noskyboxrecurse has been renamed to -skyboxrecurse, 3D skybox recursion is disabled by default now, that command enables it. Probably other stuff I forgot about Okay very cool, show me the action shots Hammer! Hammer is really slammin' now, it's extra cool and full of jam. https://files.facepunch.com/forum/upload/109753/82f6a867-27db-4370-9fe7-dc64617ae26d/hammer_2019-02-21_19-21-01.png I want everyone to know that the meme has been broken, Hammer is no longer a janky, dirty disgusting horrific mess As you can see in this picture, the UI has been streamlined somewhat, and is no longer more compact than our favourite streamer. https://files.facepunch.com/forum/upload/109753/1aef4b77-1421-49b8-8dfe-fb18f8e4686b/hammer_2019-02-21_19-47-32.png https://files.facepunch.com/forum/upload/109753/c9be9236-ddd9-4fef-9efc-dc5e9f709d29/hammer_2019-02-21_19-43-35.png Best to download it and see for yourself. VRad! Lighting with vrad should overall be a little better, but what you're here for are the big changes: Ambient occlusion: Enabled: https://files.facepunch.com/forum/upload/109753/b457d09e-9af0-401b-99b4-2335e9c22df7/test_misc0003.jpg Disabled: https://files.facepunch.com/forum/upload/109753/2c19b018-aba4-4810-a074-57068952c56e/test_misc0005.jpg Improved displacement lighting: Enabled: https://files.facepunch.com/forum/upload/109753/2f2406a0-b39a-4b2b-8213-b15dbde727fe/zoo_props0010009.jpg Disabled: https://files.facepunch.com/forum/upload/109753/4a738c54-9a92-4f06-97d0-9c845d96f477/zoo_props0010008.jpg Outtakes: https://files.facepunch.com/forum/upload/109753/b2f1dd3c-a2dd-4c18-a779-ec63850b3c52/test_translucentshadows0011.jpg The feature in the screenshot above is currently, and apparently totally non-functional, oops? How do I install this? Grab the appropriate version from here Just copy paste the files in the zip into your bin folder of choice. This can be the one in Source 2013 Singleplayer, or the one in Half-Life 2, or Counter-Strike: Source, or wherever. Half-Life 2, and all games in its folder are based on Source 2013 SP, so you'll want the SP tools for those games. As for Counter-Strike Source, Garry's Mod, Day of Defeat, etc. You'll want the MP tools. Example: D:\SteamLibrary\Steam\steamapps\common\GarrysMod\bin Theoretically the MP tools should work with TF2's branch, haven't tested them though. Back up the existing files if you're not sure. I NEED YOUR FEEDBACK. If a limit is too low, tell me and I'll bump it up, I don't think I've met Garry's Mod limits yet, so be aware of that. Is the AO too strong? I'll add a switch to lower the effect (which I'm probably gonna do anyway). Is this OP garbage? Tell me! Have fun!
Amazing work.
Wow. Just wow.
Very nice. How does the ambient occlusion work? Is it only for CSGO maps or is it baked into lightmaps or something?
Baked into lightmaps, works for all SDK 2013 MP/SP games
This all sounds super cool. How did you manage to make those changes to Hammer? Reverse engineering, leaked source?
"Imagine actually using Hammer to make maps" I wonder how the people of the distant past (yesterday) used to make maps.
Clean compile log, that's very neat.
Mega fart
Hey this is really cool! Thanks for sharing.
This looks super awesome, I tried installing the MP version in my Garrysmod folder and it crashes on startup, same with the SP version. It works if I throw it into the source sdk 2013 folder though. Weird. Do you plan on adding support for wine? Right now hammer works mostly perfectly except the viewports don't refresh all the way. Thanks for updating hammer though, never thought I'd see that
Looks great. Can't wait to use it. One problem. I can't use it. Keeps crashing on startup. Leaves behind a .mdmp file every time it crashes: https://www.dropbox.com/s/vcab2oxc7la0z7n/hammer_20190221_153331_1_accessviolation.mdmp?dl=0 Tried deleting gameconfig.txt and rebuilding them. Tried running as admin. Using the MP version in Garry's Mod. Nothing in Event Viewer and turning off Windows Defender doesn't help. I have no other security measures on this PC.
Been using this for the past few months now, and its 10x better than regular hammer editor gobshite
Wasn't expecting these Gmod issues, it looks like one of the recent Gmod patches broke support with 2013 MP utils. Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access. This indicates that something somewhere changed, maybe in tier0, vstdlib, materialsystem.dll, anywhere. One small change to any of those is enough to break compatibility. I don't think there's anything I can do without asking the Gmod devs about what changes they made, replicating them, and releasing a gmod specific branch,
the last update made some changes just a couple of days ago, pretty certain they were mentioned in the patchnotes
Oh hey, that annoying merge vertices dialog box is gone when you move a vertex 1 unit away from another!
Can we get the same for static-props? CS:GO added it in the same update, and it means large static props get a proper number of light samples.
Totally forgot about that, I'll take a look, might be able to implement bounce lighting for static props while I'm at it.
Being able to set your mouse sensitivity when using z would be a welcome addition.
increase farz clip plane and model view distance limit please. Sucks to manually regedit them from regedit, and having to re-regedit them when i press 1 or 2 accidentally.
It should also be said that  -ambientocclusion is a serous performance/time cost, I haven't used CS:GO's compile tools, but I assume this is true on their implementation as well.
In my experience, -ambientocclusion **QUADRUPLES** the compile time However, you can adjust its samples using -aosamples, and I found that -aosamples 16 or 24 was a good compromise, instead only doubling the compile time with little quality cost
Passing in -aosamples doesn't appear to change anything, neither does setting -threads, maybe I'm just being dumb though. @Slartibarty , was the threading-fix applied to your version of VRAD as well?
Yep, I applied that fix. There's currently a mismatch between the SP and MP versions of the tools. The SP tools have cleaner code, but are missing some of the listed features, I can get -aosamples and whatever included with the SP version tomorrow.
Yeah, I should've mentioned I was using the SP branch. I had some issues with the command line interpretation order, in default VRAD you can pass: vrad.exe -final -hdr  -lights "path\to\lights.rad" -textureshadows -StaticPropPolys -StaticPropLighting -low -game  "path\to\games\Source SDK Base 2013 Singleplayer\ep2" "path\to\map\vmf" And that works just fine (and is, infact, the forced order that VBCT uses), but with the new VRAD you have to place the VMF file first: vrad.exe "path\to\vmf" -game "path\to\games\Source SDK Base 2013 Singleplayer\ep2"  -final -hdr  -lights "path\to\lights.rad" -low -ambientocclusion -aosamples 4 -skyboxrecurse -worldtextureshadows -threads 6 or else it tries to load the vmf "-game" Normally this wouldn't be an issue, I'd just write some batch scripts to do this all for me, but I like VBCT for quick prototyping, and the new interpretation breaks that. I understand if this is a "wontfix" issue though.
These fixed up tools will also work with SFM so you can have nice map ambient occlusion to go with the ssao for models. Also, SFM hammer is probably one of the worst versions in existence so using this fixed up one is great! https://i.imgur.com/4XfcTeT.png
Fantastic job! Would there be any chance for supporting larger maps? I know it wouldn't be much use for the source engine, but it would come in super handy for my own engine. I've tried creating a brush larger than 32768 units, but it has the same issue as hammer with not being able to load the brush afterwards: https://files.facepunch.com/forum/upload/713/4c6e9847-485b-4243-94a2-ddb3492b2d0a/image.png
First I want to say this is epic, so many welcome improvements to the daunting process of source mapping. I have a couple suggestions though: Could you implement vertex precision loss prevention?, similar to hammerpatch which is what surf mappers use, because surf involves a ton of angled brushes with off-grid vertices. Right now, hammerpatch does support this version of hammer which is a deal breaker to surf mappers. Some of the improvements seen in Gocnak's hammer project (like fixed lighting preview and vertex saving, among others) might be of interest.
Can you make it more clear in the installation post that you want to replace the files in the Source Tools SDK 2013 [SP/MP] rather than the game you wish to use hammer with? Instructions were misinterpreted
Sorry, you need to Log In to post a reply to this thread.