Rawfile Asset

From COD Engine Research
Revision as of 22:06, 25 December 2014 by Red-EyeX32 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


The rawfile asset is used for a variety of things, usually with an extension identifying the type of rawfile. The rawfile asset itself has changed very little, while the actual rawfiles stored have changed. Keep in mind that Infinity Ward games past Call of Duty 4 compress their rawfiles using the same zlib compression that the FFs used. Keep in mind that every zone ends with a rawfile of the source FFs name that contains any compilation errors for that zone (usually none).

GSC Rawfiles

Call of Duty 4, Modern Warfare 2, and Black Ops 1 stored these script files as just basic rawfiles. After the GSC based mods that were important in the Modern Warfare 2 modding scene on TU6, TU7 removed the GSC processing and stores the precompiled gscs in the executable. Black Ops 1 uses rawfile based script files as well, except with security checks when connecting to other clients. After this, all games began using a script file asset that is very similar to the rawfile, except only used to the precompiled GSC scripts.

Vision Rawfiles

These are used to store global lighting settings that determine how the maps appears. Typically they simply set dvars, however on later CoDs they have additional commands. They are stored as basic text files at "raw/vision/". For example, here is "vision/mp_shipment.vision" from Modern Warfare 2.

r_glow                    "1"
r_glowRadius0             "0"
r_glowBloomCutoff         "0"
r_glowBloomDesaturation   "0"
r_glowBloomIntensity0     "0"

r_filmEnable				"1"
r_filmContrast				"0.87104"
r_filmBrightness			"0"
r_filmDesaturation			"0.352396"
r_filmInvert				"0"
r_filmLightTint				"1.10838 1.10717 1.15409"
r_filmDarkTint				"0.7 0.928125 1"

Shock and Rumble Rawfiles

These files are similar to vision files in that they set temporary dvars. They are often used at similar times. Shock files have a ".shock" extension and are stored as basic text files at "raw/shock/". They are used for slowing the player down and adding a noise (usually a ringing noise), typically used in radiation exposure and near-death explosions. There are 2 types of rumble files, the primary rumble files (extensionless) and rumble graph files (.rmb extension), both of which are stored as basic text files at "raw/rumble/".

Miscellaneous Rawfiles

There are several rawfiles that do not fit in any of the above categories. For instance the "video/cin_playlist.txt" contains the bik video playlist for the main multiplayer menu. It contains a number on the first line with the number of videos in the playlist following by the playlist. For example,

1
cod_intro

Just about every CoD game contains a "mp/playeranimtypes.txt" which contains an enum for all the animation types, used particularly in the weapon asset. Keep in mind there are many other .txt files and how they are processed varies with what they are used for. Another interesting rawfile in all the CoDs is the "mp/basemaps.arena". That is used to store the list of maps to be used in the map list menu. Here is a single map definition from the Modern Warfare 2 .arena file.

{
  map		"mp_highrise"
  longname	"MPUI_HIGHRISE"
  gametype	"dm war sab sab2 dom sd sd2 hc thc ctf koth"
  description	"MPUI_DESC_MAP_HIGHRISE"
  mapimage	"preview_mp_highrise"
  mapoverlay	"compass_overlay_map_blank"
  allieschar	"us_army"
  axischar	"opforce_airborne"
  environment	"urban"
}

Call of Duty 4 & World at War & Black Ops 1 & 2

 struct RawFile
 {
   const char *name;
   int len;
   const char *buffer;
 };

Buffer's length is len plus one for the null byte at the end.

Modern Warfare 2 & 3 & Ghosts & Advanced Warfare

 struct RawFile
 {
   const char *name;
   int compressedLen;
   int len;
   const char *buffer;
 };

Modern Warfare 2 rawfiles have the option to be compressed using minimum zlib compression or decompressed. If the rawfile is compressed, then buffer will be compressed data the size of compressed_len. If the rawfile isn't compressed, then compressed_len will be 0 and the length of buffer will be decompressed_len plus one for the null byte at the end.