Left 4 Dead disable head movement/bobbing


Hello everyone,
I am trying to locate the gamemovement.cpp or its variant for Left 4 Dead 1, so I can disable head bobbing on movement for better demo smoothing / recording of ingame-recorded demo footage.
Does anyone know the correct file path?? Thank you very much in advance, and for any time it takes for you to help me out with an answer.


AFAIK, the only official single-player Source SDK with source code is for the HL2 and Episodic engines (via GitHub), so I don’t know if this is possible. There was a leak a while ago but I don’t think that includes L4D (it was the 2007 engine).

Another thing to try is simply setting cl_viewbob (which I found on the Valve Developer Wiki) to 0. but I can’t test that since I don’t own L4D :frowning:

Good luck figuring it out anyway.

Oh, and welcome!


You see, L4D 1 has many old source commands present in the engine that are ‘hidden’ in other words, they don’t respond to var manipulation and even prompt that such a command doesn’t even exist, or is ‘not found’.
Just for this reason I made a custom L4D1 install with sourcemod installed on it. I too had found that old post on the Valve developer wiki about cl_viewbob_enabled, and I tried it in the console as a straight up run - nothing, then again also with sm_cvar, and it told me no such command existed both times. I used sm_cvar to force-load the command “cl_viewbob 0” and VOILA - working like a charm!!
But you really thought outside the box with that one, thanks man.

You’re awesome, and I am going to credit you for helping me finalize my movie config after all these years. Whenever I upload it you’ll be getting a shout!

UPDATE: So through using cl_viewbob via a custom installation of L4D for moviemaking equipped with sourcemod; it now works fine, although there is one last problem I face, when the weapon gets fired, the screen jerks up by recoil - anyone know the command for that one?

UPDATE 2: This is resolved, I just ended up removing recoil from all the metal weapons throughout the movie-making installation of L4D. Scripts along with cl_viewbob 0 - and its working flawlessly. GG.


Wow, really? I spent like 6 minutes Googling. :stuck_out_tongue: Still, glad I could help. Best of luck with future running and rendering. :smiley:


Well, you gave me the inspiration to give it a try, and your slight editing of the command as from how it was actually presented on the dev wiki (cl_viewbob_enabled 1) was a spot on guess. I just provided the environment for it to succeed with unlocking the var with sourcemod. Its looking soooooo good.

With demo smoothing like this, its as close as you can get to STV demos without actually having them. (SourceTV is busted in L4D).


Well, I thought everything was fixed, and for the most part, it is, but visual recoil on previously recorded demos that were recorded without the scripts in place cause there to be visual recoil on the demo playback as well.
Anyone know the bare-bones way of removing all visual recoil from the game?
Will I have to make a dll and inject it every time??


Without me having tested anything, I’ll make a couple of possible guesses as to what’s happening. Either the relevant cvar is included in the demo, in which case you could just create some alias loop to force the value to 0 or possibly even alias the command itself to something else after initially setting it. If that fails then the actual camera angles are included in the demo. If this is the case I suppose you could painstakingly use the demo smoother or whatever the tool is called, but I’d probably give up at that point.

EDIT: having reread what you were doing, it seems that if one of those two suggestions is correct, it’s almost certainly the latter. So you might have a bit of a problem.

It may be simpler to not worry about existing demos and just record nicer looking ones in the future. Not ideal but if you spend maybe a couple of hours looking for a solution and don’t find one, you may as well play L4D for that long and get more demos. :stuck_out_tongue:

Note that I’m just trying my luck with more suggestions since apparently I helped before, so I’m sorry if this is no help at all but I suppose it’s better to have an idea than to be completely helpless, so hopefully possibly maybe I said something that could send you down the right track.

Good luck. :stuck_out_tongue:


Thanks for your ideas, time, and suggestions. I can’t use any cvar to remove the view punching when the gun fires though. I’ve tried every one of them. L4D has a very locked-down engine in terms of cvars, many of the older Source cvar are set to DEVONLY tag, so when entered into the console most old cvars simply say “such a command does not exist”, so I removed ALL of the DEVONLY tags from the every command in the engine - unlocking every cvar, and by extension, making them all visible in the console (including host_framerate, fuck yeah!!!). Although, sadly, I have combed the entire cvarlist using the find command, searching any kind of keywords that might turn up something about recoil, view, camera, view punching, punch, kick, etc…
The closest two cvars I found that fit the bill entirely is sv_suppress_viewpunch (0 default). I’ve set it to one (and many other test values) - with no effect at all.

And z_gun_vertical_punch 0 (default 1)
description - “Toggles vertical punchangles for guns” - Also no luck here either.

I’ve set punch_angle_decay_rate to everything from -999999999999999 to 999999999999999 and a LOT of values inbetween (also tried 0), and while it seems to slow or speed up the punching a slight amount, its effect is quite negligible.
I’ve also tried using the command shake_stop during the viewpunching, but it did nothing as well.
I have also tried using cl_demoviewoverride
description: “Override view during demo playback” - but all it does in L4D is disable my ability to control the camera, even with the drive function on the demoui enabled; proceeding to cause my camera to move in a straight line through walls as though I had noclip enabled.
I have even tried viewanim_reset.
description: “reset view angles!” - and attempted to use it exactly as how I used shake_stop; binding it to a key and using that key during the view punching. No luck.

This is for sure my culprit https://developer.valvesoftware.com/wiki/ViewPunch
And this information could help me formulate a hack .dll that I could inject into the memory anytime I needed to smooth demo footage of versus matches - though I must admit I’m not the best coder around… ;///

The demo smoother is what I am using (and it has no advanced camera options such as removing recoil) - with my movie configuration I take the recorded footage of my versus games and move it to my L4D movie installation folder; then I go into my moviemaking install and playback the demo to the spot I want to smooth - where I make my camera keyframes and run spline origin and spline angles.
Once I have the smoothed demo, I open the newly created filenamehere_smooth.dem and go to the tick of the smooth (camera flyby) that I just created, hide all hud elements such as arms, gun model, bullet tracers, health bars and icons and basically all elements of VGUI, boomer bile on the screen, etc; and then I playback the newly created camera animation created by using the demo-smoother.
However, since L4D has no SourceTV (HLTV), only POV demos can be recorded and used.
POV demos record your camera, your inputs, your motion - literally - as the camera, though, so if you’re firing a weapon, even if you hide muzzleflashes, gun model and arms, camera bobbing while walking (which also used to show up over smooths before you helped me with that one), and VGUI, you still end up with this annoying view punch that occurs over the top of your clean, hud-less, and gun-less camera animation - so the demo smoother can’t be of any help in this situation.

My largest-scale issue with simply creating nicer looking demos using my movie-making installation (which has the no recoil scripts) is that I play versus matches, which are online, so I cannot use no recoil scripts there (nor would I want to), and because recording demos of single-player campaigns would make for utterly boring videos in 2015.

But I do see a degree of merit in that suggestion, and I have thought of using the single-player no-recoil version to attempt to ‘re-create’ footage recorded in online versus matches - but that could be more work than its worth.