Foundry | Real Time Entity Editing in the Source Engine

Many of you may have heard of the mysterious engine tool “Foundry”. You’d see references to it in hammer and Faceposer, little things like “update in engine” with no clear explanation of what it is.

From what we determined, foundry was a tool that allowed you to edit your maps in hammer and it’d edit them inside the engine in real time. The only time we’d seen a DLL of it was in the 2007 engine tool load with the old SFM. We had foundry.dll yet it did nothing as we couldn’t load it. The VDC has a small amount of info from what people originally figured out.

Gentlemen, today I bring you a revelation. We’ve had foundry for a long time, sitting right under our noses. During one of my many sessions of dicking around with SFM , I discovered something. “hammer_dll.dll”, the DLL that hammer uses has a hidden secret to it. The DLL contains Foundry. It appears that it got merged into the hammer DLL at some point which would explain why “foundry.dll” hasn’t been seen since 2007.

Depending on the branch of the engine, you have to load this through various methods. Since Left4Dead2, there has been a console command “toolload” which you can use to load it. Put “hammer_dll.dll” into your bin/tools directory and then load it like that. You have to run the game with the -foundrymode launch parameter when using foundry or it’ll close on you. Older branches may have a txt document named either “enginetools.txt” or “sdkenginetools.txt” that you need to put the dll path into to load.

Now, Foundry doesn’t appear to work on most branches of the engine. I have tested it on both the Left 4 Dead 2 branch and the SFM branch. The L4D2 branch crashes when you load the map, but the SFM branch appears to load fine.

This is what my map originally looked like straight out of hammer.

https://dl.dropboxusercontent.com/u/42169829/ShareX/2013-12/Team_Fortress_2_2013-12-18_21-34-53.png[/t]

Once I had that I compiled it with that single light and loaded foundry up.

After that I started adding entities inside of hammer and this is what happened.
[t]https://dl.dropboxusercontent.com/u/42169829/ShareX/2013-12/Team_Fortress_2_2013-12-18_21-36-27.png[/t]
[t]https://dl.dropboxusercontent.com/u/42169829/ShareX/2013-12/Team_Fortress_2_2013-12-18_21-43-54.png[/t]

So then I tried decals.
[t]https://dl.dropboxusercontent.com/u/42169829/ShareX/2013-12/Team_Fortress_2_2013-12-18_21-49-18.png[/t]

Some overlays and make a selection with the brush tool while I’m at it
[t]https://dl.dropboxusercontent.com/u/42169829/ShareX/2013-12/Team_Fortress_2_2013-12-18_21-54-53.png[/t]

And finally my masterpiece was done
[t]https://dl.dropboxusercontent.com/u/42169829/ShareX/2013-12/2013-12-18_22-07-34.png

Now I had only compiled my map a single time at this stage, the initial compile was just the basic box and a single light so I could see and SFM wouldn’t freak out for missing HDR. I had filled my map with random entities without a recompile, heresy!

It’d probably be extremely helpful for testing IO on say triggers. There’s a button to get the most recent entities from Hammer and then load from a quicksave right in foundry, so you could quicksave before the trigger, test your trigger, edit the IO, click that button and be able to test the new settings right away without needing a recompile.

Anyways I hope some of you mappers can find this useful. I’ll be experimenting with it more to see what else I can do with it, but I thought I’d make a post to tell you guys about it so you could start messing with it. There’s a lot to this and absolutely no documentation so it’s going to take some work to fully figure out

Notes:
I will attempt to update this whenever someone confirms something.

Confirmed working engine branches:
-SFM

Supposedly working engine branches:
-ASW

Crashing engine branches
-L4D2

TBD engine branches:
-L4D
-Portal 2
-CSGO
-Source 2013

Untestable branches:
-Dota 2 (No hammer?)

You MUST launch the game with the -foundrymode launch parameter when going into Foundry mode or else it will close on you the moment you try and load Foundry.

Foundry is not “foundry.dll” It is within “hammer_dll.dll”

Awesome find!

Nice find! Now how long before Valve realizes the mistake and patches it out like they did last time and with the initial accidental SFM tool leak :frowning:

yeah, but this is not a leak. Its a feature that was never used so its very unlikely that they will patch it out.

Hope this means Source2’s iteration of Hammer is moving to a truly in-engine mapping tool so you can go straight from building the map to playtesting it with a single click.

My guess is this is another “Oh yeah we thought we told you” situation. It appears that this has been here for a few years so my guess is they shipped it without telling us about it. That’s happened so many times it’s amazing.

I’ve done multiple Google+ Hangouts with Bay Raitt (main guy behind SFM) for assistance on getting HWM heads working. During the process we discovered that they hadn’t shipped two of the tools needed for it. I have a recording of him saying that say he could have sworn they had shipped both of the tools before he had left Valve (which was 5 months before this happened).

Valve has a tendency to release things and not tell us, or think they’ve released something when they actually haven’t.

This is a great find! Can’t wait to test it!

Appears that Portal 2 crashes on map load.

Most excellent beans.

Most excellent indeed.

This just shows how disorganized Valve actually are.They really need to get their shit together.

Yeah, there’s some documentation that’s really lacking, also the forge/hammer integration also allowed you to update props positions post spawn physics, so instead of all the props suddenly dropping into their places when the map loaded, it saves the locations.

Well map_edit’s been around for awhile for settling prop_physics

Of course l4d2 crashes when foundry is used…L4D2 has the most unstable version of source I have ever seen.