What is TF:S2

Ever since Source 2 was first mentioned publicly as an engine that Valve was working on, a lot of people in the Team Fortress 2 community have started asking the question: “If Valve ever ports TF2 to Source 2, what would it look like? How different gameplay would be? And would TF2 even feel the same?”. Unfortunately, none of these questions have been answered properly up until this time.

However, something really significant has happened recently that can change that - s&box, the spiritual successor of Garry’s Mod made on the Source 2 engine, has been released as part of a dev preview to a group of community members, including ourselves. It, pretty much, like Garry’s Mod itself, allows you to build whatever you want using the toolset that it provides. So we’ve decided to not lose that chance.

We are all big TF2 fans here, most of us have sunk hundreds or even thousands hours into this game. So, we have decided that we are going to try to answer that exact question - we want to rebuild Team Fortress 2 mechanics, port all the assets from the base game to the new engine and see how different it can look and feel from the original game. This is what TF:S2 is about. Our goal is to remake, improve, iterate, and create a new Team Fortress experience on Source 2 engine using s&box.

This project is a huge undertaking, we would have to consider all nitpicks of TF2 gameplay, try to rebuild every single mechanic to feel similar to the base game, but with enough dedication, I believe that we can do it! For more information visit our about page. But for now, please take a peek at what we have been busy with for the past few months.

Porting assets to Source 2

In Source 2, Valve made tools to automatically import and convert Source 1 assets into Source 2, like maps, materials, models, and particles. These tools really help us out since we don’t have to manually import everything. However, these tools aren’t perfect and not really made for s&box: a lot of assets need to be fixed manually.

Source 2 uses PBR instead of Phong Shading. So, I’ve been fixing many of the materials so it would look great in Source 2.

All of the TF2 Particles have been ported into Source 2, but s&box broke all of them since a lot of the Initalizers got removed in the Particle Editor. Most of the particles can be fixed, but it’s not perfect because of those missing Initalizers.

The TF2 Skyboxes have to be manually ported over since there is no way to automatically port them over. Source 2 uses the Skybox’s HDR for ambient lighting and post processing bloom. So, It’s important to port over the TF2 Skyboxes with the original HDR.

Getting Well on Source 2

Over the month of June, I’ve been experimenting with importing Source maps into Source 2. There is no other way to describe it: porting maps is a really slow process if you want to make it right, and decent for Source 2 standards. Despite getting some pretty cool results, it wasn’t that much worth it.

The reason being that Source 2 maps are now entirely mesh based. Long live the BSP format, that uses block brushes to build a map, say hello to meshes! Which means that all blocks have backfaces, that can cause troubles for the lighting, VIS calculation and many more optimisation issues specific to Source 2. As well as many other obsolete entities that have to be replaced or cleared.

The first map we’ve been trying to import with Justyn was Arena Well, we wanted a rather small map that we liked. The first part was getting the materials fixed as well as creating new ones for the blend textures. I had to redo all the floor meshes in order to subdivide them to paint the blend textures on them, the old Source blocks were already causing me troubles.

Once that was done, I spent a couple hours redoing the entire middle point building’s meshes to see how long it would take me to do it, and how it would look. While it helped with the lighting and some various optimization, it made me literally rebuild a part of the map from scratch.

You don’t have to go through this if you really wanted to import a map from Source. I just felt that if we wanted to import some, we should do it correctly, which takes a lot of time. Here are some screenshots of the latest build I made of Well:

One thing I would recommend to anyone willing to do some TF2 content in s&box: try doing original levels and do not stick to only importing decades old broken Source maps.

TF:S2 Showcase Map

This is what I’ve been playing with over the end of July: a simple original test map, spytech themed, which served me as a better introduction to Source 2’s Hammer, also made to showcase our fixed assets. This was definitely more interesting to do, especially when testing a new engine, and seeing how you could make good use of it with imported and fixed assets.

This map is now released on s&box! If you have access to the game, feel free to try it out and let me know what you think!

Here are some screenshots of it:

The New And Improved HUD

There is no denying it: The Team Fortress 2 Heads Up Display (or, HUD) is as iconic as any other part of the game. Its perfect implementation of the game's art-style and the surprising readability, being not as distracting as you would expect during gameplay is what has personally set it apart from any other HUD in most games I've played in the last 10 years.

When the UI team & I were tasked with bringing the old HUD's style, refreshing it up and making it fit a modern title, it was definitely a daunting job. We started first re-implementing the crucial parts of the HUD, but later, as our plans grew toward a different direction, we started working on finding a direction to compliment the original interface while making room for new elements we want to see in our unique experience.

Implementation of Classes and Weapons

The first thing that comes into one's mind when thinking about TF2 are classes and weapons. It’s a class-based shooter after all. So we thought that starting with reimplementing TF2 classes and their classes would be a great point to start. But how do we do that?

In the base game, all class properties are hardcoded in the game’s code. We, however, want to eventually allow everyone else to fork our gamemode and add any new class or weapon they want into the game and play with it. And this is where the Custom Asset System shines! As well as allowing you to work with all predefined asset types using Source 2 tools, (like sounds, models, materials, etc), s&box also allows you to create your own types and work with them in the code.

So here’s what we did: to create a new class you create a new file called classname.tfclass. This file can be opened by the s&box tool called “Inspector” and it basically allows you to specify all class-specific properties, like name, player model, arms model, health, speed in a pretty UI and load that information in the game. Compare that to Source 1 where you would have to define all those properties in the game’s code.

We have chosen to do the same approach with weapons, thus significantly easing the process of adding them into the gamemode and allowing their modification to be done in a pretty UI.

Soldier

Soldier was the first class I’ve decided to implement. There is not really a particular reason why I decided to start with this class, I kinda just felt like it. It is the most generic class you could think of to port, so it just came out like that naturally. So, what can I say about this class? Since this was the first class to be ever added, it was also the class which I also used to test the asset system and used to develop a “base” for Team Fortress weapons.

Shotgun was probably the easiest weapon to implement. Since s&box already contained the code for hitscan weapons, like pistols, it was just a question of making this said pistol fire a few more bullets per shot in random direction and you’ve got yourself a working shotgun.

Unlike pistols, s&box didn’t have any code for melee weapons, so I had to get a bit more creative on this behalf. But it still wasn’t such a hard task to implement, because all you had to do is modify the bullet to have maximum distance it can trace to and add a small delay between when you hit the attack button and attack was made to match the animation. I think it came out pretty nicely, but I'm still wondering how I can improve this.

And the final boss, the Rocket Launcher. I’ve posted a few videos showcasing this weapon on my Twitter account a few months ago, but the truth is that the Rocket Launcher, or specifically the rocket it fires, went through so many iterations, that what you saw there was probably rewritten like at least two times. Biggest issue here was trying to make the rocket feel and work as close to Source 1 as possible. The actual firing works nicely at this moment and I'm satisfied with it. But what I am not satisfied about, however, is the rocket jumping. Source 2 uses a different physics engine so that means making Rocket Jumping feel similar to Source 1 will take some time. But I'm pretty sure with enough iteration making it feel authentic is possible.

Pyro

Pyro was the second class I decided to implement. Since I've already implemented a class system for the soldier, I was able to just reuse that to create Pyro. So from now on, I'll be mostly talking about weapons and their gameplay.

So, the Flamethrower. Justyn, a member of our Source 1 Porting team was able to fix the flamethrower particle from TF2 and improve it. Now it actually lights the area around it to make the flame feel more natural.

I’ve also taken some time to implement airblasting. However I’ve also decided to experiment with it a bit and made it also push the physics props away, which it doesn’t do in the base game. I think it turned out pretty solid.

Pyro also wields Shotgun and Fire Axe, but for these, I just reused what I did for Soldier with one exception of changing the Shovel model to Fire Axe.

Scout

Scout, by far, was the easiest class to rebuild. The Scattergun, much like in TF2, is literally just a shotgun with a different model. So getting that done was just a matter of changing the model of the shotgun to the scattergun.

Pistol is in the similar bowl, it doesn’t require any new mechanics to be made in the code, so to add it I just needed to tweak the properties a bit, like: attack intervals, reload time, etc.

And bat is literally just a shovel from Soldier with a different model.

Demoman

And the last one - Demoman. He was probably the most challenging class to make this far, since two out of three of his base weapons are projectile based. To make him work I had to spend a bit more time tinkering down the projectile code to allow all the functionality that base grenades have. But in the end, I think it turned out pretty nicely. Again, big props to Justyn, who ported and improved all the models.

Sniper

Sniper was a pretty straightforward class to recreate as his weapons are entirely hitscan and his melee/secondary have no special gimmicks. The Sniper Rifle is his only weapon that needed any real tinkering to get working. The power charge currently works almost identically to how it does in TF2 - scoping activates the charge automatically, which takes about 1.3 seconds to begin having an effect, and 3.3 seconds to reach full charge. It scales from 50 to 150 damage.

The SMG and Kukri were very simple as they didn't need any unique mechanics. The SMG is basically a pistol with a larger clip size and better accuracy, while the Kukri is just another melee weapon using a different model.