Source Filmmaker

Source Filmmaker

Not enough ratings
Hammer Editor – Tips for Fast Compiling
By [NIИ]Complication
Sometimes even best sceneries with tens of animation sets are not enough. When completely custom, build from scratch enviroment is needed – adventure with SFM SDK and Hammer editor begins.

Building the room or a simple field is quick and easy after following few tutorials. But then ambition gets bigger, the sceneries start getting more complex and more detailed. And suddenly the nightmare of all mappers appears – long ass time of compiling.
   
Award
Favorite
Favorited
Unfavorite
Func_details are your friends
When compiling of nicely detailed map is starting to take hours it may sometimes turn fun of creation into unbearable chore. But there are some actions that can speed up the process. Map can be compiled in a matter of minutes (sometimes seconds) after putting a little more effort during screwing around in Hammer. And detailed, nice enviroments can be brought into SFM almost instantly.

Time of compiling can become real problem when map details are getting more and more complex. During making first steps in building worlds one basic and very important thing can be accidentaly omitted – not every object in the map should be world geometry. What does it mean?

During building scenes for SFM poster or animation instead of actual gameplay compiling time can be reduced drastically not only by simply leaving behind unnecessary areas but also turning many brushes inside Hammer editor into func_detail entities.

Because, unlike world brushes, func_details are ommited by VVIS compiling program whole scene isn’t gutted into hundreds / thousands of visleafs – and that VVIS operation takes the most amount of time during compiling (more info on the matter can be found over Valve Developer Community Wiki)

Whole geometry behind func_detail is rendered by engine as visible. In very detailed and complex maps it may cause slight hiccups during dynamic gameplay but just ask yourself - does it matter for rendering animation/poster scenery?

Let me show simple example of a building with few windows and vertical blinds behind them.

After building walls with symmetrical holes I started putting window frame in one of them. Once finished I selected whole frame, glass material, small detail brushes and by hitting CTRL+T combined whole thing into one func_detail entity. After filling rest of the holes with copied set I went the same road with vertical blinds and once again combined all brushes into one func_detail.

---

Basically I just turned every combination of small decorative brushes adding only more complex visual look to rough world geometry into separate entity ignored by VVIS. The only calculation it will have to perform will be determing, when and how much of each floor is rendered – instead of thinking about how every piece of window frame or every single vertical blind will block the view.


Let’s sum it up. On the image below there’s simple, two floor hollow building. On the left every brush is world geometry. On the right it’s the same scene – but only basic walls are world brushes. All highlighted parts are several func_details combined from small, decorative blocks, including blinds behind windows.

---

Let’s compare times of compiling. Left side – 1 hour 42 minutes 40 seconds. Right side - 24 seconds. Yeah…


After loading both versions in SFM none front end performance difficulties were noticed. Several tests of more complicated sceneries shown that sometimes map may work a little slower, especially with multiple dynamic SFM lights – but frankly it was almost unnoticable, even on pretty old rig.
Stick to the grid
Many times copying, rotating and scaling down brushes or multiple objects selection (including those combined into func_detail) will cause corners of objects not aligning with world grid displayed in Hammer Top, Front and Left viewports. Now, grid not only helps to properly fit different parts of the world to each other but also assures that during map compiling

calculations made on brushes will go smooth and fast.

Unaligned vertices of brushes cause longer time of compiling. To make it the right way go into vertex edit mode, use keyboard “[" and "]” keys to reduce the size of the grid, select each corner and align it to the nearest axes cross point.

---

Even if keeping eye on every vertex corner of brushes may appear slightly tiresome at the beginning, after a little practice it becomes almost automatic process and gives lots of benefits. Example below shows, that keeping objects corners to the grid can be done in many different cases.

---

The hanging wooden plate could have been easily left after using rotation without vertices edition, but with huge amount of objects with corners unaligned to the grid whole map will need way more time to process.
3D skybox is blessing
Even though 2D skies painted by hand using software like Terragen[planetside.co.uk] can have big resolution and incredible amount of detail, using 3D skybox will definetly be better in terms of bringing more visual splendor to custom map. And at almost none perfomance hit during both editing and rendering. So to achieve vast, long distance vistas with animated features buidling enormous box inside Hammer is rather bad idea.

Let’s say we would like to add mountains with forrest visible at the horizon. We can use 2D skybox with painted trees – but the final effect is not only static but also not easily editable. Building huge box around map to place mountains as world geometry far away will bring big perfomance hit, not to mention distance draw issues.

But with 3D skybox we can build mountains and line of trees using low resolution textures and the look of compiled map is much better in terms of perspective and visuals.

---

Making 3D skybox is very easy – detailed steps are lined out on Valve Developer Community Wiki.

There’s also another big advantage of maps with implemented 3D skybox – I wrote about it in previous tutorial[http//planhttp]. Going with big enough 3D skybox will grant any user of the map ability to add even more details, bring in animation sets, particles or even replacing sky without map recompiling (by using for example custom skydome model). So this is definetly the way to go if map is supposed to have public release.

And that’s it! Hopefully someone will find this useful and instead of hours of compiling torture will now be able to quickly bring into SFM their own custom sceneries.

http://ofsecrets.com
http://facebook.com/ofsecrets
http://vehtam.deviantart.com
---


---


1 Comments
zzzz May 26, 2020 @ 4:14pm 
Good Job.