Mapping Resources
Since this wiki focuses on Garry's Mod-specific content and mapping is a more general topic, we have compiled a list of useful and relevant resources for up-and-coming mappers to dig into since much of this knowledge has become rather obscure due to its old age.
Some of the information you will encounter on this page dates back to the Quake era of the Source engine. As you may know, the Source engine - and by extension, Garry's Mod - traces its roots, directly or indirectly, to the Quake engine. As such, the following conceptual information can still be useful for those trying to understand the modern-day Source engine.
All of the following links lead to external sites. Use caution.
Mapping Articles
Will2k Collection
Will2k is an older mapper who doesn't appear to be active anymore, but has left behind some invaluable documentation on just about everything about the Source engine through his journey to optimize it. You can find his own roadmap of what to follow here:
- Will2k Source Engine Optimization Roadmap Some links lead to Gamebanana pages which have a .pdf download at the bottom.
Binary Space Partitioning (BSP)
Binary Space Partitioning is what the Source engine uses to describe information about levels. During a map compile, one of the compilers will recursively subdivide a space into sets of convex shapes (called leaves), which will either be entirely solid or entirely empty, and then stores these subdivisions in memory as a tree.
Every plane that splits an area will create 2 new nodes in this tree, one representing the front and the other representing backside of the split area. The backside of this area will be the first node and the front side will be the second. This subdivision is done recursively until every area is solid or empty.
BSP is most notably important for two areas of the Source engine: PVS and collision.
Relevant Resources
- Matt Ramblings: BSP Trees: The Magic Behind Collision Detection in Quake
- Will2k Man vs Engine
- Valve Developer Community page on Binary Space Partitioning
- Valve Developer Community page on the .bsp file format
- Flipcode Quake 2 BSP File Format This covers how BSP is implemented in code but could potentially be useful to some
Potentially Visible Set (PVS)
As mentioned above, the Source engine uses BSP data to calculate its visibility. Each time the area is subdivided into a convex shape this shape is now called a "leaf". Each leaf then has a set of triangles associated with it, which will render if that leaf can be seen. This is determined by the "Precomputed Visibility List" for the players current leaf.
During compilation, each leaf uses an algorithm to trace what it can see through "portals" (where each of these leaves touch) to other leaves and then associates them with that leaf into the "Potentially Visible Set". This means that as the player moves from leaf to leaf, the engine only needs to worry about rendering what's in the PVS and leave the rest unrendered, thus saving on performance.
Relevant Resources
- Matt Ramblings: Quake's PVS: A hidden gem of rendering optimization
- Will2k: Demystifying Source Engine Visleaves
- Will2k: Source Engine PVS - A Closer Look
- Valve Developer Community page on PVS
Optimizing Source Levels
The techniques used for optimizing Source maps include a few different practices. First and foremost, there is level layout and design, which should occur before launching Hammer. Source is best at rendering indoor environments, whereas in large open areas that don't have many things blocking visibility Source really starts showing its age. However, that does not mean such levels are impossible, as with modern hardware these large open environments can be ran well enough.
Many of the below resources target multiple areas of optimization. Links listed under "layout" for example can as well include good tips for placing hint brushes.
Relevant Resources: Layout
- Will2k: Optimizing An Open Map in Source Engine
- Rick_D: Making Agency, the popular CS:GO map
- FMPONE: Making a Map: CS_Museum
Relevant Resources: Hint Brushes
- Will2k: Hints about Hints - Practical guide on hint brushes placement
- MangyCarface: Optimization in Source: A Practical Demonstration
- Valve Developer Community page on hint brushes
Relevant Resources: Area Portals
Relevant Resources: Occluders
Relevant Resources: Visclusters
Relevant Resources: Lighting
- leplubodeslapin: Source Lighting Technical Analysis: Part One
- leplubodeslapin: Source Lighting Technical Analysis: Part Two
- Matt Ramblings: Shedding light on Quake I and II lightmapping
- Source lighting is based on this technology until Source SDK 2018
Relevant Resources: Optimizations
- Will2k: Comparative fps study in Source Engine Optimization System
- Will2k: Displacement Vs. Func_detail - A comparative fps study
- Will2k: Source FPS Cost of Cheap and Expensive Assets
- Will2k: Common Misconceptions in Source Engine Optimization
- Valve Developer Community article on visibility optimization
Resource Banks
This section directs you to the homepages of other mapping-centered communities.
Interlopers.net - Links to the tutorials form section of the webpage where many old useful articles can still be found
MapCore Level Design Help Files - Mapcore as a whole is a good mapping community, however I wanted to link directly to this post as itself links to MANY very useful mapping articles
PHILIPK.NET - Very old website in near pure HTML. Navigate using the images. This website has useful information about the creation of materials and modular sets.
Nodraw.net - The tutorials are from 2010, but the website is listed due to having articles on niche topics that aren't covered elsewhere.
Valve Developer Community - Valve's official developer wiki that covers pretty much everything from GoldSrc to Source 2. There are lots of tutorials available there, but their quality and age may vary.
Garry's Mod
Rust
Steamworks
Wiki Help