Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
Custom Spritesheets
By Jules
For Source devs. These are the missing bits of information needed to create animated sprite sheets for Left 4 Dead's particle system. Follow any TF2 or Half-Life guide (video on Youtube or otherwise) and supplement with the rest here which includes some additional tips.
   
Award
Favorite
Favorited
Unfavorite
Notes:
Source Engine Sprite Sheet Tutorial Video
Creating & Editing Particle Systems (use L4D2 Tools mode (2009) or Alien Swarm (2010)

Can't find gameinfo.txt / vconfig won't work? - https://developer.valvesoftware.com/wiki/Can't_find_steam_app_user_info

- Keep in mind that a spritesheet is a compiled animation file. It is not in any way a texture file that can be edited, even though the ultimate file is a .vtf. It contains all of the images necessary, with no duplicates, and it is embedded with essential behavioral information much like that found in a .qc file (the file that defines the behavior of a model).

- Many of the issues people have with these tools come from using a 64-bit system and the difference in folder structures (Program Files (x86), etc.). Yes, it's totally worth the effort to image a computer with a 32-bit copy of Windows 7 and do the work on that station, there are too many 64-bit filesystem issues that Valve won't bother to fix.

- L4D2's binary tools are very buggy for whatever reason. If you have trouble, try using Alien Swarm or L4D1 bin's. I have had good success using L4D1's combo of mksheet and vtex .exe's (using the exact same directions below but in the L4D1 directory).

- Placement/directory of your frames and their .mks file does not matter during the first step (using mksheet.exe). However, once you are ready to compile your .sht / .mks / .tga compile group, they must be placed in a folder named "materialsrc", itself located inside of your L4D2 binaries folder (where vtex.exe and mksheet.exe are located). I had to create the "materialsrc" folder.

- Also missing was a folder named "vconfig", which needs to be inside the binaries folder in order for the tools to work. Inside the vconfig folder throw in a copy of the gameinfo.txt located in the L4D2 main directory.

- If you can't get mksheet.exe to pre-compile your .tga image, try downsizing your source frames. It is picky about frames 512x or higher.

- One way to get frame names onto the .mks sheet file is to highlight all of the frame files, hold control+shift, right click them and choose "copy as path". Paste that into the .mks file, edit appropriately, then on each entry paste "frame" on the left and add the timing number on the right (usually 1, this is measured in seconds like all other time-based particle effect parameters). There is probably an ever quicker way, but this is easy enough.

- The organization of "frames" is completely up to you. The animation works top to bottom; in the .mks file you can put 10 occurences of the exact same frame if you want that image to last longer. You can also create multiple sequences - for example create a second "list" of frames in a different order to be used for a different particle effect. Separate these with the appropriate title, Sequence 0, Sequence 1, Sequence 2... you get the thought. When you are in the particle editor you are able to select from the various sequences that are embedded in the compiled spritesheet.

- Frame files need to be color formatted to RGB, index color systems will turn black & white after being compiled.

- Use Photoshop's batch tools! I can't emphasize this enough. No matter the project you should never waste time when a superior method is available. If you are getting extremely bored in your work guess what? You're doing it wrong and inefficiently. In Photoshop you can edit frames for a sprite sheet in 2 minutes instead of an hour. Record an action in the action menu, then use File -> Automate -> Batch and use your recorded action on the folder of frames. GIMP also has scripting abilities but I ♥♥♥♥♥♥♥ hate GIMP with a passion, still that's an option.

- Place a shortcut of your L4D2 game install folder on your desktop, you will be back and forth into it constantly.

- After dragging your pre-compiled .tga file into vtex.exe, upon successful compile your final .vtf will be located in a folder called "materials", located in the L4D2 root folder. You will get two .vtf files, one standard and a second ".pwl.vtf" which appears to be an SRGB corrected version.

- Sometimes random errors occur in the tool command line window, but the window closes immediately so that you cannot read the error. Make a shortcut of the windows cmd.exe app located in accesories, place it in your bin folder. Change the shortcut's target to this format:

%windir%\system32\cmd.exe /K "C:\Program Files\Steam\SteamApps\common\Left 4 Dead 2\bin\mksheet.exe"

This will disable the automatic closing of the command window after an error.


ADDITIONAL INFO / LINKS:

https://developer.valvesoftware.com/wiki/Animated_Particles
https://developer.valvesoftware.com/wiki/SpriteCard
https://developer.valvesoftware.com/wiki/Particle_System_Renderers




2 Comments
Uni 19 Feb, 2015 @ 9:28pm 
Finally a useful L4D2 guide, thanks!
fido42 19 Feb, 2015 @ 1:49pm 
ThAnKs ThIs GuIdE wAs HeLp FuLl