Source Filmmaker

Source Filmmaker

202 ratings
The Book of Forbidden Esoteric Source Engine Knowledge
By o7v || wip and 1 collaborators
THIS IS THE SOURCE ENGINE ENCYCLOPEDIA.
I WILL TACKLE AS MANY ISSUES AS POSSIBLE, AND ADD THEM AS SUGGESTED.
This covers the most common problems that may seem intimidating to new users, and also very weird and oddly specific issues that plague only the most troubled Source Goblins.
2
4
   
Award
Favorite
Favorited
Unfavorite
DMX Corruption
This is a issue that has plagued every SFM user at least once.
Unfortunately, there are no real fixes for this.

If you are seasoned in the art, you may know that SFM keeps autosave files deep inside your usermod folder just in case of this very event!

To find those:

Navigate to: "Steam\steamapps\common\SourceFilmmaker\game\usermod\elements\sessions".

Find the DMX that doesn't work anymore in the list, and its accompanying .autosave file.

Rename the DMX to be distinct, like adding a "_old" or "_corrupt" onto the end of it.

Rename the .autosave to be a DMX (ex. "project.autosave" --> "project.dmx").

The only other way to prevent this from happening is to KEEP BACKUPS!
At the end of every session, I always save a SEPERATE DMX named "project_backup" or something. Seriously people, just make a habit out of keeping backups. It will save you HOURS of work and grief.
"No .mdl files" Error
This error is usually caused by incorrect gameinfo.txt search paths, or by some weird SFM jank that I'll explain.

CAUSE #1: INCORRECT SEARCH PATHS.

Go ahead and head over to your neighborhood usermod folder, and open the "gameinfo.txt" file.

Scroll down to the "searchpaths" section of it, and make sure you CAN FIND EVERY FOLDER LISTED IN THE SFM "game" FOLDER.


Here's what mine looks like.
Every folder listed in the "gameinfo.txt" (on the right) you can find in the SFM directory (on the left).

It should be clarified that you shouldn't add every folder to this gameinfo.txt.

ONLY FOLDERS CONTAINING MODELS AND/OR MATERIALS SHOULD BE IN THE GAMEINFO.
DO NOT JUST ADD FOLDERS BECAUSE THEY ARE MISSING.



CAUSE #2: INCORRECTLY SELECTED FOLDER

If you have a subfolder highlighted, click MDL files to unhighlight it.
If you have a weird mod folder selected, choose one that has what you're looking for, or just select all mods.
Also make sure check subfolders is checked.



CAUSE #3: YOU'RE SEARCHING
Just make sure theres no weird text in the search box.
Yes, even spaces can make it look like there are no models in the TEAM FORTRESS 2 FOLDER.
Multi-Stage TF2 Maps
I've seen a lot of confusion about how multi-stage maps work in TF2.

Let's take for example, cp_dustbowl.
Let's say you wanted to put a model on the third stage of dustbowl, but oh god!
You load it up and see that you're in the first stage, and can't find any of the other 2.

Spoiler alert, every multi-stage map is in the same map. We just teleport the players from stage to stage, because its faster and more friendly to computers to do this, instead of load a new map every time we change stages.

Here's an aerial view of cp_dustbowl, with all the stages outlined and labeled:


All multi-stage maps are built like this, please just take the camera out of bounds and go find the other stages!
Painting TF2 Items
Another common issue people have is painting TF2 cosmetics, or items in general.
You can do this a lot of ways, either using third-party programs or manually painting and overriding the textures yourself.

I prefer this method, and it is manual and entirely within SFM.

All you have to do is spawn your cosmetic item, here I'll be using the Master's Yellow Belt because it's a good representation of how easy it is to turn this Yellow into any paint color.

Do your standard and add override materials, and go ahead and show the model in the element viewer.




You'll want to open the base material of the hat (the part that gets painted) and open it up.
We're looking for $colortint_base. All TF2 hats are technically white if you want to go deep into it, they just have a color tint applied in the VMT that gives the hat its default color. Whenever you paint an item, all the paint does is change the $colortint_base value loaded in for that hat to the color of the paint.


For a list of TF2 paints and their RGB codes, see THIS wiki page.

Once you just type in the 3 RGB values into $colortint_base, the item will be painted.
It's easy.
Porting Models from GMOD
This is a thing a lot of people want to do, and it's easier than you think.

Most of the time, people want to port stuff from the workshop, and that's fine.
I'm going to be using this Pose References Pack in case you want to follow along, or have these beautiful props for yourself.

To get started, we're going to want to navigate to Garry's Mod's folder. The usual is needed:

"Steam\steamapps\common\GarrysMod"

From here, further the file path as follows:

"Steam\steamapps\common\GarrysMod\garrysmod\addons"

Once we're in this folder, you're going to see a LOT of .GMA files. These are Garry's Mod Addon files and contain everything an Addon is. To get the assets out of the .GMA file, we're going to be using a tool that ships with Garry's Mod!

NOTE: If the .GMA file does not appear in the garrysmod\addons folder, you'll have to find it under the alternate folder here:

"Steam\steamapps\workshop\content\4000"

Upon opening this folder, you're going to see a lot of spooky numbers, but don't worry! If you looked at the link for the addon above, you'll notice that it has an ID at the end. In the case of the pose ref pack, this is "2503194813", so you'll want to find that folder. Inside that folder should be the .GMA we're looking for.

Once you have found the .GMA, open a second explorer window and navigate this one to:

"Steam\steamapps\common\GarrysMod\bin"

Look for "gmad.exe" because this is what we're going to be using to decompile the .GMA.

DRAG the .GMA file onto gmad.exe.

After a small delay, you should see a folder appear wherever the GMA is located!
When you open it up, it'll have all the materials and model files you need to throw it into usermod, or wherever you prefer to keep your custom SFM content.

Ta-da!
Updating TF2 to the Modern Day (Maps, Cosmetics & More!)
As I'm sure you've figured out, the TF2 assets that come with SFM are... outdated.

We're going to update this to the modern day build, and give you all the Maps, Cosmetics, Weapons and fun stuff we're currently missing out on.

To do this, we're going to need one program: GCFScape[nemstools.github.io]
That link will automatically download the archived .ZIP file for you, so you don't have to hassle any of the waybackmachine or sketchy download buttons all over the internet.

Once you have GCFScape, extract it wherever you feel is good. Go ahead and crack open the .EXE once t's extracted, and you should see something like this:

Go ahead and follow the red outlines, and hit "File", then "Open".

Navigate to your Team Fortress 2 folder, the usual:

"Steam\steamapps\common\team fortress 2\tf"

Here you should see a long list of weird files called VPKs. These are where the entirety of TF2's assets are stored, in compressed files.

WARNING: Using GCFScape to update SFM's TF2 assets takes up a lot of space!

When you're ready, we're going to worry about 4 VPKs.
  • tf2_misc_dir.vpk
  • tf2_textures_dir.vpk
  • tf2_sound_misc_dir.vpk
  • tf2_sound_vo_english_dir.vpk
If you only want the models, maps and new stuff, you can skip out on the SOUND related ones.

Open up tf2_misc_dir.vpk first.
We're going to be taking 5 folders here:
  • maps
  • models
  • materials
  • particles
  • sound (where applicable)

Once you have them selected, right click and choose "extract".
Navigate back to SFM:
"Steamapps\common\SourceFilmmaker\game\tf"
We're putting all these folders here, because we're just manually updating SFMs TF2 installation.
Now you wait for the lengthy extraction to finish, and repeat for the VPKs you want.

ITS WORTH NOTING THAT ALTHOUGH YOU CAN SKIP THE SOUND VPKS, YOU MUST AT LEAST EXTRACT THE MISC AND TEXTURES, OTHERWISE YOU WILL EXPERIENCE ERRORS.

Go ahead and open SFM and go find that cosmetic you've been missing!
Installing Portal 2 Maps & Additional Content
To do this, we're going to need one program: GCFScape[nemstools.github.io]
That link will automatically download the archived .ZIP file for you, so you don't have to hassle any of the waybackmachine or sketchy download buttons all over the internet.

Once you have GCFScape, extract it wherever you feel is good. Go ahead and crack open the .EXE once t's extracted, and you should see something like this:

Go ahead and follow the red outlines, and hit "File", then "Open".

Navigate to your Portal 2 folder, the usual:
"Steam\steamapps\common\Portal 2\portal2"

Here you should see a long list of VPK files. If you read the TF2 section, you'll know what these are for.
Go ahead and find these VPKs:
  • pak01_dir.vpk
Once you open it in GCFScape, you're going to again, highlight and select these folders:
  • maps
  • materials
  • models
  • particles
  • sound (where applicable)

(yes im using the TF2 image again, I don't currently have portal 2 installed)
Go ahead and right click to extract, and here we have 2 options.

IF YOU HAVE THE PORTAL 2 SFM DLC INSTALLED
Extract to:
"Steam\steamapps\common\SourceFilmmaker\game\portal2"
You're done, and can see all the maps, assets and more in SFM.

IF YOU DONT HAVE THE PORTAL 2 SFM DLC INSTALLED
Make a folder in SFMs directory, and call it anything except the following:
  • portal2
  • portal2_dlc1
  • portal2_dlc2
Extract to the folder you made.
Open SFM, but open the SDK.
Hit "Create New Mod or Add Existing Mod", and type the name of the folder you created.
It should add it as a folder to search for assets. To verify that it has been added, go to your usermod folder and find gameinfo.txt.
Look in the "SearchPaths" section, and if you do not see your folder, add it under the format of:
SearchPaths { Game folder }
And you should be good to go.
Installing Left 4 Dead 2 Maps & Additional Content
Repeat the previous steps as stated in TF2 and Portal 2, but for Left 4 Dead 2.

If you seriously have issues, or if L4D2 is that different, let me know and I'll flesh this section out.
Properly Exporting Movies
Okay, there is discourse here but hear me out.

Using QUICKTIME or SFMs built in method of exporting into a VIDEO format SUCKS BALLS.
Even if you install quicktime and render a MP4, the contrast, brightness and colors look all weird and it honestly makes me nauseous.

Please, export all movies or animations as IMAGE SEQUENCES.

Either look up a guide on how to use blender to put together those images, or ask me to fill this section out with a tutorial using blender or sony vegas or premiere.
Why Does SFM Keep Crashing?
Okay, it's time to talk about the BUILT IN MEMORY LIMIT.


THIS NUMBER IS YOUR LIFE.
The more models you have in a scene, the higher the memory usage.
The more keyframes, scenes, moving parts, the higher the memory usage.
Particles, decals, models, lights, all increase memory usage.

The MOMENT this number crosses 4GB (4,000mb) you will crash.
In my experience, it can sometimes be even lower.
I've personally had SFM crash as low as 2.3GB (2,300mb) usage.

A big part of lowering this memory usage is the MODEL BROWSER.

Everytime you click on a model in this menu, the PREVIEW (outlined in red) gets stored in the cache. This cache contributes to the MEMORY LIMIT. The more models you click on, the higher the memory usage.


My best advice is to just know what you're looking for. The fewer model previews you have to see, the better. Sometimes if I notice my memory usage is approaching the upper 2500-2700 range, I'll just save, make a backup, and reopen the project in an effort to kind of clear out the cache and memory.

Oh, and if the memory turns red, you're in danger of crashing. You're getting close to the memory limit, and you better tread lightly.


Update: 2024
A good way to prevent the memory from overflowing is to panic save your file, really spam CTRL + S, and go to File > Recent > yoursession.dmx.
Reloading the session like this will usually cause the memory to drop down to 1,000mb ~ 1,300mb.
Importing & Creating Custom Sounds
We're going to be focusing on turning existing sounds into SFM compatible ones, or making your own sounds work in SFM.

SFM supports all types of audio extensions! But if you've ever loaded a MP3 from your usermod folder, you'll notice you can't actually hear it play in the clip editor. Why?

SFM (and the source engine) only support a very very specific type of audio file. WAV files with a project rate of 44100Hz.

We're going to be using Audacity to accomplish this task. Grab Audacity HERE[www.fosshub.com] at the official site.
Again, clicking that link will immediately download the ZIP file to your computer, skipping any possible confusion about download buttons or what version you may need.

After extracting audacity to wherever you choose, you'll open it and be greeted with this:



Go ahead and change the project rate in the bottom left to 44100 Hz, and we're on our way.
Head over to "File", "Import' and then "Audio..." and select whatever sound bite you'll want to bring into SFM.


Once it's open you'll want to hit CTRL+A to select all the sound currently in the project file, and go to export it as a WAV.
You can now throw this WAV file anywhere where SFM can see it (i use usermods sound folder) and load it into the clip editor, and you should be able to hear it with no issue!
Locating Already Existing VTF & VMF Files
This section is fairly easy. If you want to know where in the world a texture file is for a model you already have, you may be scratching your head.

Go ahead and load up the model whose VTF you want to find.
Do the same as when you want to paint a hat, and add override materials and open the model in the element viewer.



Go ahead and open up the material you want to find the path for, and look down on the right side.

To find this scattergun texture, I would navigate to:

"Steam\steamapps\common\SourceFilmmaker\game\tf\materials\models\weapons\w_scattergun"
We go to TF because thats the folder I picked it out of in the model browser.
If I found this scattergun model off the workshop, it might look a little different:
"Steam\steamapps\common\SourceFilmmaker\game\workshop\materials\models\weapons\w_scattergun"

Just remember that the path you see in the element viewers ASSUMES the materials folder is before whatever it lists.
Although the screenshot shows

"models\weapons\w_scattergun"
The REAL path is
"materials\models\weapons\w_scattergun"

Thats all.
Scaling Jigglebones
This is something you can't actually do.
I lied.

But if you've ever tried scaling up the root transform of a model that HAS jigglebones (to make somebody taller or smaller) you'll see that the jigglebones shrink and expand and do a bunch of weird stuff that creates nightmare creatures.

To work around this, you'll want to bake the procedural bones. This does mean that you will lose the procedural jiggle effect of these bones, but its necessary if you want to be able to scale a model that has jigglebones.

To do this:

Right click the model, and go to "Utilities" and then "Bake Procedural Bones".

Pretty simple, and now you should be able to scale that model as you want freely.

This also solves the weirdly specific issue where I am apparently the only human being on planet earth to experience it. If you SCALE A BONE that is CONTROLLED by a jigglebone, it seemingly works. Although the catch is that if you hit CTRL+Z, the jigglebone scales down by a factor of .5x and retains this size no matter what?
I honestly don't know. Weirdest bug of my life, but you can bake procedural bones if you ever have a weird as hell issue like this.
SFM Map Has Broken Lights
Ok, time for some Hammer fun.

Whenever you are making a map for SFM in Hammer, you may compile it and open in SFM to see that it is completely fullbright. This is not good, obviously.

For a SFM Map to be lit properly, 2 conditions have to be met:

#1. HDR MUST BE ENABLED
When compiling your map, you must compile it with HDR.
If you're using the normal settings, its this tick box:

If you're using the expert settings, make sure to select an HDR compile in the dropdown:


#2. THERE HAS TO BE AT LEAST 1 LIGHT IN THE MAP
Yes. Even if it has a brightness of .000001, there has to be AT LEAST one light.
Seriously just throw a black light with a brightness of 1 somewhere in the map and the lighting will work fine.

Your map should be lit just fine now.
Removing Map Lighting
This part is fairly simple.
You found a map you like but, like me, you are a scenebuild goblin and must have custom lighting because map lighting is yucky.

One of my favorite tools, the Light Deleter[sfmlab.com] is here to help!
Basically, once extracted you want to use it just like gmad.exe in the section about porting GMOD models.
Just find the BSP you want to remove lights from, and drag it on top of the light deleter.

With a bit of delay, you should see a version of the map titled [mapname]_nolights.bsp pop up in the folder right next to the original BSP.


ALTERNATIVE WAY TO CHANGE LIGHTING
Most people in the hammer community may frown at this. I don't know, because I stopped interacting with other human beings when I crossed 1,200 hours in hammer.

This method requires knowledge of how hammer works, but if useful for creating that custom map lighting you may desire.

This LINK[github.com] downloads BSPsrc. This program decompiles compiled BSP maps into VMF files for use with hammer. Once you have this extracted, go ahead and run it (run the .JAR file).

Here, you can hit the ADD button to add a BSP file to decompile.

Once you add it, just hit decompile, save the VMF and open it with the relevant hammer installation. Use your external knowledge to remove, change and shift around the lighting to whatever makes you sleep at night.
Customizing Particles & Getting to Know Basics
This is something that can be very annoying to deal with, especially if you want a fire particle that fits your needs. Most in the game are modestly sized or just too small for sick posters.

Here, I'm going to show how you can customize every particle in the engine as you wish.

Now, here's a window not many people know exists. If you use hammer, you might be familiar with the Particle Editor. For those that don't use degenerate programs, it's this window:

At first glance it looks outdated, cringe and hard to use. You would be right!

Whenever you open a .PCF, you're going to see a lot of windows that are way too small for a modern day monitor. I'll explain these one by one:


#1. PARTICLE SYSTEM DEFINITIONS
Basically, the .PCF folder is a particle system. This means that when I chose "explosion.pcf" is contains every explosion particle in Team Fortress 2. This window displays all of those particles. You can see the birthday explosions, smoke, flash, debris and all the different explosions and their parts here in a list.

#2. ENGINE VIEWPORT
This is running an outdated 2007 version of TF2 just in case you need to run around and see what your particle looks like using this tiny viewport that probably wont help you at all.

#3. PARTICLE PROPERTIES
This is mainly where we'll be working. This shows the particle as raw as it can be. It's all the properties, sliders, numbers and other things that make it look like how it does in SFM.

#4. PREVIEW
This shows you a nice preview of what the particle currently looks like in a void. You can toggle bounding boxes and just get a nice view of what this thing will look like. Use right click to zoom in and out of the preview, middle click to pan, and left click to orbit.

I'll cover how to do a couple basic things with particles in this section.

To begin following along, you're going to want to create a particle system in your SFM session.
I'm going to be using a particle under Team Fortress 2's "explosion.pcf". Specifically "Explosion_MA_Dustup"

Once you have your particle spawned in, right click it and hit "Instance".

Then you'll want to right click it a second time, and hit edit on the particle system listed that matches the name of the one you spawned in.


This particle editor looks slightly different, but its just windows #3 and #4 from the last editor.


A) SCALE AND SIZE
To control the scale of the particle, you'll want to look over left and find the "Initializer" section of the particle controls. Find "Radius Random" under that section, and if it isn't there you can right click "Initializer" and add it from the menu that opens up.

Here we'll be looking at "radius_max" and "radius_min" as these control the lower and upper bounds for the particle size to be randomized in.
A "radius_min" of 2 means the smallest a particle can be is 2 in size.
A "radius_max" of 5 means the biggest a particle can be is 5 in size.
The particles will generate a random size between 2 and 5.
Fairly simple, just adjust the min and max higher or lower depending on the size you want.

B) SPAWNING AREA
All particles are spawned either inside the bounds of a sphere or a box, randomly. They can only spawn within the volume of that sphere or box.
To control this box, head back to the "Initializer" section, and look for either "Position Within Box Random", or "Position Within Sphere Random".

For the box, it determines the MAXIMUM largest box the particles can spawn inside, and the MINIMUM size box the particles can spawn inside.
For the sphere, it controls the size of the inner and outer sphere. Basically the same principle but circle shaped.

C) COLOR
Go ahead and go back to "Initializer" and right click it. Hit "Add..." and add a "Color Random" from the list.

Here, you're going to want to look at the first 2 options.
They take an RGB value, and I'm not really sure how they randomize. If it's color1 OR color2 or if it picks from the range inbetween them, I don't know.
But it works.

Pretty sure the particle I picked doesn't even support color changes, but who cares.

For more information on particles, and a more in-depth experience I highly reccomend THIS GUIDE by SnowDrift.
8 Comments
Lumpymushroom 9 Aug, 2021 @ 1:50pm 
Use/Download Virtual Dub to put together image sequences. It exports them as Avis put is much faster than using blender.
NorthPolar 2 Aug, 2021 @ 1:18pm 
This is really well made! I do hope you continue with this guide :D
☭ lennin a hand Cowcannon☭ 22 Jul, 2021 @ 11:48am 
on the scaling giggle bones you can just run with them on then at the end bake them to get the jiggle and the correct scale
Tesyl! 10 Jul, 2021 @ 10:15pm 
Another thing on the memory limit in sfm: if you reload all of your materials, you can clear sfm's cache of materials you aren't using from the models you loaded in the model spawner.
To do this, open a console window, and enter "mat_reloadallmaterials"
Sfm will hang up for about a minute, and when you click in a viewport afterwards, you'll notice the memory amount dropped a bit.
This is often enough to bring you out of red number territory. If your memory number is red, give this a shot.
Save right afterwards too.
Doing this will save you time of having to close, reopen, and reload your project, and keep your work efforts flowing!
There's nothing worse than a crash killing your mojo!
Hoarder Robinson 18 Jun, 2021 @ 2:00pm 
Incredible
Arthur Morgan 14 Jun, 2021 @ 7:36am 
very helpful
EphemeralG0d 12 Jun, 2021 @ 4:04am 
You put a lot of effort into this guide, damn! Nice work :)
Anyar 8 Jun, 2021 @ 11:36am 
This is pretty helpful stuff. Definitely useful for people who know SFM basics and want to get more advanced.