Playing With Fire: Flame Where You Aim
October 13, 2024 - Nitoandthefunkybunch
Tags:
development
fun
Many experienced Pyro players coming into TF2 Classic have reported flames feeling off. This is often chalked up to the flames in TF2 Classic being slower than their Live TF2 counterparts, and it's true that they are. There is way more going on behind the scenes, however. When you are moving and shooting, flames will inherit your velocity; if you move forward/backward, they will move faster/slower. While this does not increase or decrease your range, it also means that moving to the side causes your flames to move to the side. They veer off course, which results in situations like the following:
Fixing this serverside was easy: you simply calculate a relative velocity in the direction the Pyro is looking. For the client this is a much trickier issue. Source particles are handled at an engine level, which we don't have access to, and there is no existing function to calculate the relative velocity. This also means we have no easy way to line the flames up with the hitboxes directly, like in Live TF2.
We had to get a bit creative, and after pursuing several options (one of which involved a floating nail that would send its speed to the flames), we discovered that if we simply edit a set of coordinates every frame, and send that to the particle, then the particle can treat it as a velocity value and send the flames in the correct direction. So, in Update 2.2, flames will have new physics that reward leading your shots and sporadic movement. Here is a diagram of the difference:
That's all for this series of posts! Don't worry—you'll be hearing from us again soon!
Fixing this serverside was easy: you simply calculate a relative velocity in the direction the Pyro is looking. For the client this is a much trickier issue. Source particles are handled at an engine level, which we don't have access to, and there is no existing function to calculate the relative velocity. This also means we have no easy way to line the flames up with the hitboxes directly, like in Live TF2.
We had to get a bit creative, and after pursuing several options (one of which involved a floating nail that would send its speed to the flames), we discovered that if we simply edit a set of coordinates every frame, and send that to the particle, then the particle can treat it as a velocity value and send the flames in the correct direction. So, in Update 2.2, flames will have new physics that reward leading your shots and sporadic movement. Here is a diagram of the difference:
That's all for this series of posts! Don't worry—you'll be hearing from us again soon!