Oh My God, Source 2 Is Actually Real – And A Sneak Peek At The New Hammer Editor? [UPDATED]

[UPDATE 3: Facepunch member J*Rod has created an insightful and very informative explanation of how Source 2 might work, based on what we've seen in the leaked code. If you can't read code (or as I like to call it, hieroglyphs), then this is your lucky day.

[UPDATE 2: LambdaGen fan 3rrorVirus has made this hilarious little video about this whole Source 2 debacle - check it out!]

[UPDATE: Facepunch member DevinWatson has compiled a full list of just about every single Source 2 reference in the SFM files. Take a look!]

Yeah, it gets better. Waaay better.

Only half a day after suspicious references to HL2: EP3 and “Source 2″ were found inside the Source Filmmaker code, more evidence pointing towards the existence of a new next-gen game engine being developed by Valve, has been found in the SFM code.

This discovery comes to us via our brothers in arms over at ValveTime, who by looking through the file: “SourceFilmmaker/game/sdktools/python/global/lib/site-packages/vproj/vproj.py“, found a number of rather shocking new references to the aforementioned Source 2 (you can find a full pastebin of the file’s contents here).

They seem to now firmly solidify this hypothesis. In fact, I’d say the only thing we need at this point is a press release from Valve, because judging from this new code, the existence of Source 2… is clear as day.

I’m going to read off… well, just about all of the code segments, so as to provide the fullest amount of context (I’ve also left them in their original format, which means you’ll need to scroll left and right to read everything in there). Parts of great interest will be outlined in bold. To any programmers reading this: this is gonna be your lucky day.

Starting from line 1053:

def getDefaultToolsDir( self, engine=None ):
		'''
		Try to determine the default tools path.
		'''
		try:
			if not engine:
				engine = self.getEngine()
			if  ( engine in ( ENGINE.SOURCE2, ENGINE.HYBRID, ENGINE.SFM ) ):
				return Path( self.getGame() + r'\sdktools' )
			else:
				# First try using location of vproj
				exeTools = Path( sys.executable ).up( 2 ) + 'tools'
				if os.path.exists( exeTools ):
					return Path( exeTools )

Starting from line 1385:

def getEngine( self ):
		'''
		Return an str with the current engine version.
		If key doesn't doesn't exist, assume 'Source', otherwise invalid -- assume next-gen 'Source 2'.
		'''
		try:
			eng = unicode( self.getChunk().Engine.value )
			if eng not in ENGINE.ALL_ENGINES:
				return ENGINE.SOURCE2
			return eng
		except ( AttributeError, ValueError ):
			try:
				# HACK: check vproject for 'source2' or 'hybrid' and guess the engine.
				projDir = str.lower( self.getProjectDir() )
				if 'source2' in projDir:
					return ENGINE.SOURCE2
				elif ( 'hybrid' in projDir ) or ( 'l4d2port' in projDir ):
					return ENGINE.HYBRID
				else:
					return ENGINE.SOURCE
			except AttributeError:
				return ENGINE.SOURCE

Starting from line 1407:

def setEngine( self, version=ENGINE.SOURCE ):
		'''
		Set the engine version for the project, i.e. 'Source 2'
		'''
		try:
			self.getChunk().Engine.value = version
			self.engine = version
		except AttributeError:
			c = Chunk( 'Engine', version )
			self.getChunk().append( c )

Starting from line 1483:

		engine = self.getEngine()
		if ( engine == ENGINE.SOURCE2 ):
			configGameInfo = self.getProjectDir() + r'\gameInfo.gi'
		else:
			configGameInfo = self.getProjectDir() + r'\GameInfo.txt'

Starting from line 1508:

if engine in ENGINE.SOURCE2_FAMILY:
			requiredFiles = [ game + r'\bin\{0}\tier0.dll'.format( platform ),
			                  game + r'\platform\Resource\platform_english.txt',
			                  game + r'\sdktools\perl\bin\perl.exe',
			                  game + r'\sdktools\python\{0}\{1}\python.exe'.format( PY_VERSION, platform ) ]
			requiredLocsToSync = [ game + r'\bin\{0}'.format( platform ),
			                       game + r'\platform',
			                       game + r'\sdktools',
			                       game + r'\sdktools' ]

Now let’s take another quick dip in another script file: “SourceFilmmaker\game\sdktools\python\global\lib\site-packages\vproj\constants.py“, for yet another couple of extremely revealing references:

class ENGINE( object ):
”’
Known engine names
”’
SOURCE = ‘Source’
SOURCE2 = ‘Source 2′
SFM = ‘SFM’
HYBRID = ‘Hybrid’
ALL = ‘All’
SOURCE_FAMILY = ( SOURCE, SFM )
SOURCE2_FAMILY = ( SOURCE2, HYBRID )
ALL_ENGINES = ( SOURCE,
SOURCE2,
SFM,
HYBRID
)

This one’s very intriguing:

ENGINE_SOURCE = [ r'%VGAME%\bin',

r'%VGAME%\sdktools\bin',

r'%VGAME%\sdktools\perl\bin',

r'%VGAME%\sdktools\perl\site\bin',

r'%VGAME%\..\src\devtools\bin',

r'%VGAME%\..\src\devtools\perforce',

r'%VTOOLS%\bin' ] #make sure the tools path comes last in the PATH – branch specific paths should take precendence.

ENGINE_SOURCE2 = [ r'%VTOOLS%\python\{0}\%VPLATFORM%'.format( PY_VERSION ),

r'%VTOOLS%\python\global\lib\site-packages',

r'%VTOOLS%\python\global\Scripts',

r'%VGAME%\bin\%VPLATFORM%',

r'%VGAME%\bin',

r'%VTOOLS%\bin\%VPLATFORM%',

r'%VTOOLS%\bin',

r'%VTOOLS%\perl\bin',

r'%VTOOLS%\perl\site\bin',

r'%VGAME%\..\src\devtools\bin\%VPLATFORM%',

r'%VGAME%\..\src\devtools\bin',

r'%VGAME%\..\src\devtools\perforce' ]

ENGINE_HYBRID = ENGINE_SOURCE2

Meanwhile, back on Facepunch, community member GameDev stumbled upon these never-before-seen interface icons in SFM’s Hammer folder:

Also, in the “SourceFilmmaker/game/platform/tools” folder, just two folder paths up from these UI icons, there’s a file called: “source_2_stylized.qss”. Inside, it starts off with the words: “Default stylesheet for Source2 Tools UI“.

There’s plenty more in all the aforementioned directories, so I urge you to take a look inside. After all, the Source Filmmaker is free!

But it is great to see that Valve is definitely working on making Hammer more versatile, and possibly more user-friendly. Only time can tell when we get to play around with this new version of Hammer for ourselves, but I can only assume that its development has been very closely linked to that of Source 2.

But of course, if we assume that Source 2 is being developed using a newer version of Hammer, then surely Source 2, fundamentally, is at least somewhat similar to the original Source. Just as GoldSource was fundamentally a lot like Source, and ironically, used an earlier version of Hammer for its toolset component.

Overall, this is a monstrous find, and it proves once and for all, that Valve is working on a next-gen Source 2. And I’ll bet you anything that it’ll be the engine used for the next installment in the Half-Life franchise. Anything.

What I find interesting is the mention of a “Hybrid” engine which appears to be closely related to Source 2. As one can tell from the name, I assume Hybrid is some sort of hybrid between Source 1 and Source 2 – a “missing link” of sorts. No idea what it would be used for out-house, but it does represent some pretty tasty food for thought.

Hybrid is at one point linked to “l4d2port“, which I can only assume is the L4D2 Linux port. This implies that Hybrid, and by extension, Source 2, may be based somewhat heavily around OpenGL architecture, which is also quite interesting.

Still, I reserve my judgement for when we find out exactly what Source 2 is like. There’s only so much these code snippets can reveal to us, and I am far from a programmer. But surely a reveal can’t be too far off by now – this thing seems to be going full steam ahead!

  • Share/Bookmark