If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Development:Team Fortress 2/April 21st, 2020 Codebase Leak/Weapons

From The Cutting Room Floor
Jump to navigation Jump to search

This is a sub-page of Development:Team Fortress 2/April 21st, 2020 Codebase Leak.

Throwable Weapons

Entity Classname: tf_projectile_throwable

Throwable weapons are already a thing in Team Fortress 2. The Self-Aware Beauty Mark and Mutated Milk are classed as throwables in the code (tf_projectile_throwable_breadmonster). However, there are a few other throwable weapons within staging code blocks that Valve were testing.

Located in tf_weapon_throwable.cpp is a staging block of code defining different throwable weapon types based on different slots;

#ifdef STAGING_ONLY
CREATE_SIMPLE_WEAPON_TABLE( TFThrowablePrimary, tf_weapon_throwable_primary )
CREATE_SIMPLE_WEAPON_TABLE( TFThrowableSecondary, tf_weapon_throwable_secondary )
CREATE_SIMPLE_WEAPON_TABLE( TFThrowableMelee, tf_weapon_throwable_melee )
CREATE_SIMPLE_WEAPON_TABLE( TFThrowableUtility, tf_weapon_throwable_utility )
#endif

Of particular note is the tf_weapon_throwable_utility. The Utility Slot is a concept that comes up several times in the source code.


(Source: game/shared/tf/tf_weapon_throwable.cpp)

Also located in tf_weapon_throwable.cpp are the following snippets of code for several experimental throwable weapons;

Target Dummy

Entity Classname: tf_projectile_target_dummy

The throwable Target Dummy is a remarkably simple throwable. You throw it and out pops a plywood target dummy to distract the enemy.

At the point in time this code is from, the target dummy that got spawned was restricted to either models/props_training/target_engineer.mdl or models/props_training/target_demoman.mdl. Within tf_target_dummy.cpp, specifically the CTFTargetDummy::Spawn function, there is a developer comment stating // TODO: Model Selection. It seems that it may have been intended for the target dummy the switch model to match the class of the player who threw it.

Concussion Grenade

Entity Classname: tf_projectile_grenade_concussion

Functionally similar to the original Concussion Grenade. If you were to compare the original Concussion Grenade's code to the tf_weapon_throwable.cpp version, you can see there are some differences in their code. Especially between CTFGrenadeConcussionProjectile::Explode and CTFProjectile_ConcGrenade::Explode.

Teleport Grenade

Entity Classname: tf_projectile_grenade_teleport

The Teleport Grenade does exactly what it says in the name. Throw it and get teleported to where it lands.

This grenade is in all likelihood a prototype test for the Shadow Leap magic spell in the Hightower map.

Gravity/Chain Grenade

Entity Classname: tf_projectile_grenade_gravity

This grenade goes by Gravity Grenade most of the time. There is one instance where it is labelled as Chain Grenade and it's when this grenade is declared at the top of tf_weapon_throwable.cpp;

The grenade, when activated, would draw nearby enemies in closer to the center of it.

This grenade is in all likelihood a prototype test for the Ball O'Lightning magic spell in the Hightower map.

Throwing Knife

Entity Classname: tf_projectile_throwing_knife

Throwing knives like in Goldeneye 007! Would suppose to deal crits when hit from the back, and similar to Back Scatter, "back" hit detection is a quarter of sphere with 90 degrees angle range [1] (unlike Knife hit detection with its ridiculously wide 180 degree range, which is is equivalent of half of sphere). What is interesting about this throwable is its use of CreateStickyAttachmentToTarget(). This is the function that allows certain projectiles to stick out of players, like arrows or syringes.

Smoke Grenade

Entity Classname: tf_projectile_grenade_smoke

A standard smoke grenade. Possibly a revival of the early Smoke Bomb/Gas Grenade to go with the scrapped Spy vs Engineer WAR update. Not really much to say. Would have given the TF_COND_OBSCURED_SMOKE condition to the player so this seems to have been intended for the Spy.

Going back to tf_weapon_throwable.cpp, there are two throwable weapons listed in the code that are not in STAGING_ONLY blocks. These two throwables are a fair bit old as well, having been in the game for quite some time. Not entirely sure when specifically these entities were added but results can be found on Google from as far back as 2014 when searching for tf_projectile_throwable_repel or tf_projectile_throwable_brick.

Repel

A throwable airblast. It is unknown when this was first added to the game, but it had been known about for several years before the source code leak occurred. If being ubercharged by a Medic wielding the Quick Fix, you would be immune to the Repel.

Entity Classname: tf_projectile_throwable_repel

Function(s):

Brick

A throwable brick. Like in TimeSplitters: Future Perfect! Functions exactly as you'd expect. Hit someone with it, they get a bit of viewpunch. It is not known when the Brick was first added to the engine, nor what it was intended for.

Entity Classname: tf_projectile_throwable_brick

Function(s):

Experimental Weapons

Some experimental weapons can be found via references in the source code.

Sticky Ball Launcher

Only appearing as two internal weapon names (one for the weapon, one for the projectile) found within the enum ETFWeaponType enumerator in tf_shareddefs.cpp, nothing else is known about this weapon.

Going off of its position in the enumerator, and when it was added to the SourceMod tf2_stocks.inc file, it appears that the Sticky Ball Launcher was added to the game some time in 2012.

TF_WEAPON_STICKY_BALL_LAUNCHER,
TF_WEAPON_GRENADE_STICKY_BALL,

Dispenser Gun

Nothing is known about the Dispenser Gun, as the only bit of code for it is the internal weapon name TF_WEAPON_DISPENSER_GUN, found within the enum ETFWeaponType enumerator in tf_shareddefs.cpp and tf_shareddefs.h.

Going off of its position in the enumerator, and when it was added to the SourceMod tf2_stocks.inc file, it appears that the Dispenser Gun was added to the game some time in 2010, possibly within the Engineer Update as it is listed after TF_WEAPON_LASER_POINTER which is the string name for the Engineer's Wrangler weapon which was added in that update. It would appear that the Dispenser Gun weapon string is actually for the Big Mean Mother Hubbard which is described in promotional artwork from the Polycount Contest as a gun that dispenses things.

Decoy

The Decoy is a Spy weapon that was in development at some point in time but didn't make the cut. Going off some code in game/shared/tf/tf_weapon_decoy.h, we can see it was meant as a Spy weapon. We can also see that the Decoy weapon, in the code, is inheriting functionalities from CTFJar, meaning this could have been a thrown weapon similar to Jarate or the Flying Guillotine. The Decoy's internal weapon name is TF_WEAPON_LIFELINE, but according to a dev comment in tf_weapon_decoy.h, that internal name was potentially not final.

Upon being thrown, the Decoy would spawn a clone of the player who threw it. That clone player would continue on down the same direction the player was running in. This can be seen in the code in game/server/tf/bot_npc/bot_npc_decoy.cpp, where the Decoy's bot is taking information from its owner to set up the require class model, disguise, etc, as well as also grabbing information about its owner's velocity, eye angles, etc.

Entity Classname: tf_weapon_decoy

Function(s):

Dynamite Sapper

That's right. It's just a dynamite pack that would be supposed to attached to buildings. Why we even need to disable buildings if we can just blow them up?
When exploded, this type of "sapper" was supposed to deal damage that is based on victim's current health (1.5 * current health), just Sentry Buster's explosion. The type of damage is DMG_BLAST, which actually can be negated by numerous measures if dealt to players, such as Medic's Vaccinator bubble, and radius of blast is 200 HU. It would explode even when destroyed (detached) by appropriate weapons, which is... really strange desicion for designers. Detonation time would depend on buiding's health and equal the same time usual sapper would destroy this building, that means maximum buiding health divided on 25 - 6 seconds for level 1, 7.2 seconds for level 2 and 8,64 seconds for level 3 buildings, 4 seconds for mini-sentry. [2]

StopSound( "WeaponDynamiteSapper.TickTock" );
StopSound( "WeaponDynamiteSapper.BellRing" );

Two sounds effects belonged to dynamite sapper. The fisrt one is a replacement for sizzing of standart sapper, and the second one - bell ring - would supposed to play when target building has less than 60 HP, which likely implies that Dynamite Sapper could constantly damage buildings just like normal sapper.

Revolver Sniper Rifle

The fact that Valve had intended to include this into the game was already known due to leftover animations left in game files. with the Source Code Leak, the proposed functionality of this weapon is revealed.
Stored in tf_weapon_sniperrifle.cpp (line 2055) under STAGING_ONLY tag and even partially commented, the code for this weapon claims that it supposed to be rather low-damage weapon with unique "fast attack speed" ability. It would deal 40 damage when not scoped, 50 damage when scoped and not fully charged (and no damage gradations when mid-charged, unlike all other sniper rifles), and 75 when fully charged. "fast attack speed" ability reduces time between shots (that is reload time) from 1.5 to 0.3 seconds when shooting while fully charged. The commented code part suggests another mechanic - only reduce reload time, up to 0.2 seconds when shooting with full charge, and decrease discount time from 0.2 to 0 proportionally to charge value (which doesn't make sense, since the previous condition was "only when fully charged").
This sniper rifle would be unique by having projectiles instead of being hitscan weapons, just like all other rifles do. The projectiles are affected by gravity a little (0.1), and the speed of projectile is 3000 HU/s. (HU stands for Hammer Units.)

Mortar Launcher

The Mortar Launcher is a scrapped primary weapon for Soldier. Its main distinct ability would be manual trajectory redirection of a launched rocket. Redirection could be performed only once per one rocket. The code for this weapon is under the STAGING_ONLY tag.

  1. tf2_src/shared/tf/tf_weapon_throwable.cpp, line 1091
  2. game/server/tf/tf_obj_sapper.cpp, line 323, 389, 634