The Starcraft Editing Bible

Chapter One: The Architecture of Starcraft Data

Stardraft CWADs and "Custom" MPQs

So what the hell was up with that last section anyway? MPQs? What does that have to do with Stardraft? (which I'm sure is the only thing you care about right?) While in actuality, you probably won't have to deal with MPQ files at all when making Stardraft customs (unless you choose to), it is important to understand their basic structure and function because Stardraft utilizes many of the same ideas to work.

Back to the discussion about input/output and the engine in the introduction. Now that you know where SC loads its input files from (the MPQs), it should be pretty obvious about how to give it different or "custom" input to produce varied outputs in the actual game-play: just put different files in the correct places in the MPQs. Instant Custom MPQ. Easy, right? It is pretty simple, providing that you know how to replace or add files to an MPQ archive. Until recently, that task was a long and painful process of SCM compilation through a patched version of Staredit (as you should remember, a SCM is also an MPQ, and thus Staredit essentially creates them). But now, several MPQ Compilers have been developed to simplify the task (programs which can add files to, replace files in, and generally manipulate MPQ archives -- like Winzip or pkzip for ZIP files). (See /starcraft/programs/ for up-to-date download links)

The basic idea in creating an MPQ file that you distribute is to recall the fact that the patch_rt.mpq file is read over both Broodat and Stardat (and in most cases, also Install.exe). That means if you compile all your files you want to replace into the patch_rt, then you don't have to distribute a 30+ MB MPQ archive for minor replacements. The trouble with this method is that usually you have to request that the user overwrites their old patch_rt with your new one, otherwise they will not be able to get their game to load your replacement files. (This means they will have to switch back to their old patch_rt to return their game data to normal again) There are ways of bypassing this, namely by hacking the path info in the starcraft.exe and/or staredit.exe, but that discussion will be reserved for later.

Custom MPQs provide a sort of "permanent" patch solution for replacing the input data that the game receives, which in some cases may be desirable, but is not very handy for casual use. This is where Camelot Systems' Stardraft comes in. (See http://www.camsys.org for up-to-date download links) Stardraft utilizes similar files to MPQs called CWADs, which are also basically file archives (though using a different compression routine than MPQs). The way Stardraft works is that it temporarily "patches" certain files normally found in the MPQ with replacements that are present in a CWAD file. By "temporarily," I mean that when you use Stardraft to "load" the CWAD and the game, it pushes the files that are in the CWAD archive into the memory slots that are normally allocated for those files in the MPQ. Thus, the game is tricked into using those instead. The actual technicalities aren't that important, but it is important to note that Stardraft patches at runtime (meaning only when you run the program) so it does nothing to permanently alter files on your (or anyone else's) actual hard drive.

There is often some confusion about Stardraft CWAD files and what are referred to as "Self Extracting CWADs" or CWAD files which are executable (with an *.exe extension; a binary). Normally you load CWADs through the patch loader sub-program within Stardraft (which pushes your CWAD files into memory and then loads starcraft or staredit), but this is not always convenient for casual users. A Self Extracting CWAD (abbreviated SECWAD) can be generated from the CWAD Manager to resolve this problem. A SECWAD is just a combined, modified form of the patch loader sub-program and your cwad in a single executable file. Thus, loading a CWAD through Stardraft's patch loader or through a SECWAD produces essentially the same result. (Plus, with an SECWAD you get to implement your own splash screen to play before loading the game and it omits the system memory overhead that the huge Stardraft program generally requires :)

Still can't get the CWAD Manager to work? Quick Reference will be coming just after the next section.

Optional Section: Pros, Cons, and other Methods of Input

Copyright (c) 1999-2000 Jeffrey Pang. Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the
Free Software Foundation with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU Free Documentation License".

[an error occurred while processing this directive]