[an error occurred while processing this directive] [an error occurred while processing this directive]
The Gallantry

The Gallantry
The Gallantry
Design Journal Entry #3



Map and Level Design 

Changing the Rules: A Treatise on Getting Around the Limitations of StarEdit

As some of you may think, and I do, the Starcraft 1.08 patch introduced more bugs than it fixed. StarEdit was not left alone, and nasty bugs were introduced in the sound managing functions of the program. I discovered this after StarEdit corrupted the first map of Episode I as I was adding sounds to it. I had to manually remove the WAVs from the map by editing the .CHK file I extracted using MPQ2K to save it from oblivion. Not only does StarEdit corrupt maps, it also imports WAV files incorrectly, for some reason not compressing them. The original size of the second mission was 30 MB, as opposed to the current 17.6 MB.

As you may not know, maps are just MPQ files with a different extension. The main file of a map is “staredit\scenario.chk”. It contains all the information about the map: the tile set, the size, the location of every unit, the triggers, etc. It also contains the list of all WAV files imported in the map. Basically, you have 2 sections relevant to sound: the “WAV “ section and the “STR “ section. The “STR “ section is the string section and contains as a list all the strings used in the map, including the full path, in the MPQ, of every WAV file. The “WAV “ section is just the list of the index in the “STR “ section of every WAV file in the map. All WAV files are imported in the “staredit\wav\” directory in the map. Thus, a map containing 1 WAV file named “dud.wav” would store “staredit\wav\dud.wav” in its “STR “ section, say in the 5th slot, and the “WAV “ section would contain the value “5” in its first entry.

What I basically needed to do to remove all the WAV files from the map was to put 0 in all the entries of the WAV section. As “0” points to the “empty string” in the “STR “ section, it tells StarEdit that there is no WAV file.

It turned out the corruption was not in the CHK file but rather in the WAV files. When you ask StarEdit to display the Sound dialog, it effectively reads the “WAV “ section, gets the full path of each WAV file in the “STR “ section and opens these files in the map. Now, what happened is that StarEdit imported some WAV files incorrectly, crashing the program when it attempted to read those files. So not only did StarEdit not compress WAV files, it also corrupted some!





                                                                                  

                                                                              
The solution was a simple one however. I wrote a small program capable of editing the “WAV “ and “STR “ sections of a .CHK file. The program allows me to add or remove a WAV file in the map, as well as rename existing ones. So once I finished a map, I used MPQ2K to extract the “staredit\scenario.chk” file, “added” all the WAV files that the map would contain using my program, and finally created a new MPQ, again using MPQ2K, and imported my modified “scenario.chk” file in the proper directory, as well as all the WAV files. The benefit of that method was of course the proper compression of WAV files, resulting in much smaller maps.

The complete spec of the CHK file is available on this website in the StarDraft section.

'Till next time!

- BahamutZERO


 

The Gallantry

 

  [an error occurred while processing this directive]