GCFScape

From Valve Developer Community
Revision as of 19:20, 11 November 2006 by Nem (talk | contribs) (Definition of Fragmentation)

Jump to: navigation, search
Typical GCFScape Window

Overview

GCFScape is a small tool that enables you to browse through the GCF files that are utilized by Steam for game content storage. This could be useful for making model mods or extracting in game sounds.

Extraction

Extracting files from GCF's couldn't be simpler with this utility as it's like the Explorer folder tree format. But if you're still stuck, here's how to extract files:

When you install GCFScape make sure you associate GCF files with GCFScape so they'll open straight away, they'll look like this if they're associated:

Gcfscape-01.png

Double clicking one of these will open GCFScape. Say, you opened the Counter-Strike Source Shared GCF, the program will open and appear like this:

Gcfscape-02.png

Clicking the little Plus.PNG button, you can browse the folders clicking on them so they expand and show subfolders like so, then clicking on a folder will show the contents to the right:

Gcfscape-03.png

Right clicking a file will bring up a context menu from where you can extract from:

Gcfscape-04.png

Clicking this will bring up a window where you can choose your save location:

Gcfscape-05.png

Clicking OK will extract the file to your chosen location.

Supported Formats

In addition to GCF files, GCFScape also supports Half-Life BSP, PAK, WAD, and XZP files.

Options

The following options are available through the options menu from within GCFScape:

Verbose
Enable verbose logging (enabled by default). Disable this option to reduce log output. This can be useful when you are extracting large amounts of files and only want to be informed of errors.
File Mapping
Enable Windows file mapping (enabled by default). File mapping is an efficient method of random file access. Some operating systems have problems with file mapping (in particular Windows 98) and may produce errors; disable this option in such cases.
Quick File Mapping
Map the entire file to memory (instead of pieces of it as needed). Effectively caches the file in memory. Can speed things up if you have sufficient free memory. Some operating systems have problems with file mapping (in particular Windows 98) and may produce errors; disable this option in such cases.
Volatile Access
Enable volatile file access (enabled by default). By default, Steam loads .gcf files in read/write mode and is liable to change their contents at any time (as updates occur). Should this happen, GCFScape would become unstable and likely crash. Volatile access allows you to open GCF files loaded in Steam at your own risk. It is generally stable and can prove useful for examining which files Steam is updating.
Write Access
Enable write file access (disabled by default). Write access gives GCFScape the ability to modify certain files and is not compatible with volatile access for the instability a combination of the two would cause. This option is required for GCF defragmentation.

Validation

In version 1.5.0, GCFScape added the ability to validate GCF files. This process computes a series of hybrid CRC 32 and Adler-32 checksums for each file within a GCF file and compares each checksum to the checksums precalculated and stored within the GCF file. This feature provides a quick alternative to Steam for checking GCF corruption and listing corrupt and incomplete files, but cannot repair corrupted GCF files as Steam can.

To validate all or part of a GCF file using GCFScape, complete the following steps:

  1. Launch GCFScape.
  2. From the File menu, open your GCF file.
  3. Browse to the top level folder you wish to validate (root for the entire GCF file).
  4. Right click on the folder and select Validate.
  5. Repeat steps 2-4 for each GCF file you wish to defragment.

Defragmentation

In version 1.6.0, GCFScape added the ability to defragment GCF files. This feature was added after several tests by Nem indicated that Steam's built in defragmenter did not always completely defragment a game's GCF files. In fact, Steam would often falsely report a fragmentation of 0% when the true fragmentation was as high or higher than 10%, a value extremely detrimental to performance.

GCFScape defines the fragmentation ratio to be the number of used clusters that are out of order divided by the total number of used clusters. The first cluster in a file can never be out of order, so a file that consists of only one cluster (typically < 8192 KB) can never be fragmented. You can view the fragmentation of any file or folder (root for the entire GCF file) by checking it's properties.

To defragment your GCF files using GCFScape, complete the following steps:

  1. Shutdown Steam.
  2. Launch GCFScape.
  3. In the Options menu, enable File Mapping and Write Access and disable Volatile Access.
  4. From the File menu, open your GCF file.
  5. From the Tools menu, select Defragment.
  6. Repeat steps 4-5 for each GCF file you wish to defragment.

Note: The defragmentation process is quite slow, but can be canceled and resumed at any time.

External links