19

I play many Valve games. Particularly Portal 2, and TF2. However, after playing these games for a while, I have noticed that in the task manager these programs come up under a process hl2.exe - Half Life 2. This seems to be the case for all Valve games.

After further research, I have found that this process is associated with all Source SDK and other assorted games.

So my question is, why do all Valve (and some other) games have the hl2.exe process?

  • Interestingly, this "limitation" is removed on Source Engine 2 (ref. Dota2) – Kroltan May 5 '15 at 13:09
  • 1
    This question requires a lot of speculation of developer intent. – Powerlord May 5 '15 at 13:37
  • I could post an answer that "The Source SDK defaults to hl2.exe and the developers were too lazy to rename it." and you have no idea if it's more or less accurate than the other answers posted. – Powerlord May 5 '15 at 13:38
  • 22
    If you notice one with hl3.exe, please let everybody know. – Wjousts May 5 '15 at 15:56
18

Source Engine games (all those you've mentioned) are really closer to what you'd usually call a ("total conversion") mod. You're never running the game - you're running the engine, telling it to select a given mod (note how the games are run like hl2.exe -game cstrike, for example).

The exe file is just a bootstrap that prepares the engine, and loads the actual mod (like Half-Life 2 or Counter Strike: Source), which in itself is a bunch of data and DLLs. It could have just as easily been called e.g. source.exe. The main point, however, is that you never actually build your game by changing the hl2.exe file; that's the same for all games on the same version of the Source engine. You're only changing other DLLs and the data files - and the dll itself usually is called something like cstrike.dll, not hl2.dll.

If you want a flawed analogy, ponder this: why is Chrome's executable called chrome.exe, when you're actually browsing Facebook? You're running the Facebook application, aren't you? :)

And if you want a bit more history, this has been the convention carried over from the original Half-Life. The engine Half-Life 1 used was actually a heavily modified Quake engine, and the game was a mod on top of that modified engine; when the (very popular) mods like Team Fortress and Counter Strike came, they were likewise mods on the Half-Life 1 engine; but not the half-life game, really (pretty much entirely true for CS, while mods like Blue Shift reused a lot of the assets and code of HL1). And just like Half-Life 1 is a mod running on the Half-Life 1 engine (retroactively dubbed GoldSrc), Half-Life 2 is just a mod running on the Half-Life 2 engine (Source).

| improve this answer | |
  • 11
    You're flawed analogy is incredibly misleading. Chrome is acting like an OS. You're not running a "facebook application" the same way you run a games executable. The URL in this case is much closer to the "hl2.exe" discrepancy than the chrome.exe is and does say you are viewing facebook. – Reafexus May 5 '15 at 14:45
  • 8
    @Reafexus I think you missed the point. If you want to open facebook in Chrome, you run Chrome.exe www.facebook.com. If you want to run Portal 2 in Source engine, you run hl2.exe -game Portal2. – Luaan May 5 '15 at 16:08
  • @Luaan You can pass a URL as a parameter to the Chrome executable? Edit: You can too! The random things you learn while browsing. – Carcigenicate May 5 '15 at 17:29
  • 2
    I can see how you can make that connection now. It still feels like its presence confuses the issue rather than clears anything up. especially with the use of the word "application." – Reafexus May 5 '15 at 18:03
  • Does this mean that someone could put all of their Source games into one central folder and use the same hl2.exe to run them all? – AER Jun 8 '15 at 5:30
11

Because all/most of their games are build on the Source Engine. The Source Engine was originally made for Half-Life 2. Which started the trend of hl2.exe.

So in short: Games made in the Source engine have their executable named hl2.exe

| improve this answer | |
  • Okay, this makes sense. It sounds correct to me, however I will wait to see if I get some answers explaining why they chose to give it the process name hl2 instead of the game's name. – angussidney May 5 '15 at 8:27
  • If only both of your answers were combined. If both are combined I will accept that answer. – angussidney May 5 '15 at 10:45
  • 10
    @AngusAtkinson why? The answers do contradict each other in detail, and are both actually guesses. Now that you've set such an ultimatum, both posters will face the choice to grab the rep from another for literally no value provided. Remember why the "acceptance" mechanic does exist in the first place - to help other people find answers, not to be a prize some people award to others... – Orc JMR May 5 '15 at 11:28
  • Dota 2 uses Source engine too but its executable name is dota2.exe. – omerfarukdogan Jun 12 '16 at 22:06
4

Like all the other answers, this is just going to be a guess, but this one is backed up by actual history.

It's because of how Steam packages files.

Valve's games made prior to Left 4 Dead all include the Half-Life 2 Shared Files.

One of my old answers breaks down how the GCF files were laid out for TF2 specifically.

There are 2,722.83MB taken up by shared files, including the multiplayer ob binaries.gcf file, which would include the version of hl2.exe used by all of Valve's older multiplayer titles.

Note that there was likely also a single player binaries gcf file used by HL2, both of its episodes, and Portal 1.

These GCF files were shared between games.

In 2013, Valve switched over to the VPK system. This renders most of what is listed here as moot as the HL2 "Shared Files" are now distributed as part of the game itself. Valve likely keeps the executable with the old name out of laziness.

Incidentally, in games from 2008 or later, you will likely see the executable named some variation of the game name since they didn't use the shared files.

| improve this answer | |
  • I should note I haven't yet checked SteamDB to see if the HL2 shared files are a separate depot yet. Despite not being shared on the hard drive, they may still be shared on Steam. – Powerlord May 5 '15 at 18:23
  • For TF2, the HL2 Shared Files are now directly in the TF2 Client server shared depot (appid 441) rather than being a separate depot. – Powerlord May 5 '15 at 18:48
1

All those games (Portal, TF, CounterStrike, They Hunger and so on) started long ago as mods for half-life and half-life 2. I guess the name of executable was simply kept from those days because developers got used to it.

| improve this answer | |
  • If only both of your answers were combined. If both are combined I will accept that answer. – angussidney May 5 '15 at 10:45
  • 1
    TF was never a mod for HL2, so "keeping" the name from HL2 seems an unlikely reason. Portal was never a mod at all. – Orc JMR May 5 '15 at 11:33
  • Team Fortress started as Quake mod, after that it become HL1 mod, after that a development of standalone game started. – Barafu Albino May 5 '15 at 12:40
0

They are all built off of one common engine: The Source Engine

The Source Engine was first used to develop "Counter Strike: Source", a remake version of the original Counter Strike that was a mod built off of the original Half-Life-1. This was shortly followed by Valve's own creation, Half-Life-2.

Now, the reason for all games built off of this engine using the same .exe file is the nature of the engine itself. It is made to be Modular, with each game built off of it expanding a general 'package' of the engine.

As such, whenever you are playing a game off of the Source Engine (TF2, Left4Dead, Portal) you are actually playing a highly-customized mod of the original Source engine, and the first 'original' mod for this engine was Half-Life-2.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.