Lets say you are playing Starcraft 2 melee map. The game loads the map. Melee maps have the following dependencies:

  • Liberty (Mod)
  • Liberty Multi (Mod)

I think the game engine will load the data from Liberty (Mod) first, then from Liberty Multi (Mod). For data that exists in both dependencies, the engine will use the one from Liberty Multi (Mod). Is this correct?

Liberty Multi (Mod) is updated with each patch of Starcraft 2.
Does the game engine load just the latest version of Liberty Multi (Mod)?
Does the game engine load all the versions and overwrite duplicate data with the latest version?

  • \$\begingroup\$ Close to a "How Was Game X Made"-question, which are generally off-topic ( meta.gamedev.stackexchange.com/questions/626/… ). Questions no-one can answer are not useful. \$\endgroup\$
    – Anko
    Mar 19, 2012 at 8:44
  • \$\begingroup\$ @Aku disagreed. This isn't asking how the whole game is created - just a portion of it. \$\endgroup\$ Mar 19, 2012 at 9:06
  • \$\begingroup\$ @Jonathan Hence "close to". I don't mean to close-vote; just to note that great answers may not come up. \$\endgroup\$
    – Anko
    Mar 19, 2012 at 10:02
  • \$\begingroup\$ @Aku you should state that - someone did vote to close it and likely because of that comment :). \$\endgroup\$ Mar 19, 2012 at 10:42
  • \$\begingroup\$ @Jonathan Oh dear, words are powerful indeed! :D I'll be more careful in the future. \$\endgroup\$
    – Anko
    Mar 19, 2012 at 13:51

1 Answer 1


You are very close to understanding how the system works. My answer won't necessarily be how Starcraft works - but most moddable games work like this; and Starcraft is either very similar or the same.

Firstly the mod system would have some form of a header file for each mod. This would list any 'base' dependencies: in the instance of "Liberty Multi" it would list "Liberty" as the only base mod. This is basically used to build a chain of names and nothing more, so what you are looking for at the end of the day is:

  • My Cool Map (more on this later)
  • Liberty Multi
  • Liberty

When you need to load an asset you would search the mods top-down. Starcraft would therefore look in Liberty Multi for assets and then Liberty. MPQ (Blizzard's zip-like files) are actually quite good at this as you can very quickly determine if a file is not present. If the file is not present look through any additional base mods. Something like the following pseudo-code:

routine findAsset(string assetName):
  let mods = "Joes Mod", "Liberty Multi", "Liberty"
  each mod in mods
    if modFileExists(mod, assetName):
      return loadAsset(mod, assetName)
  raise error "Asset not found" -- Or return a default asset for the asset type

You could even pre-build a table that contains the resolved file table for all the mods that are loaded - again investigate on how MPQ would make this possible.

Some systems let you skip the asset discovery and load an asset directly from a specific mod - this helps when, for example, a mod wants to call a script from the base mod that it has a new implementation/override of.

Starcraft overwrites assets when a patch is released. The engine is unaware of previous versions; except a routine which is used to upgrade (or translate-on-the-fly) previous save games and replays. If you remove something from the game you must leave the tombstones in your assets so that you don't get missing textures etc. for replays.

Finally remember that, in Starcraft specifically, a map is actually the first mod in the chain; and it is due to this that maps like DoTA were possible in Warcraft 3 (which is the code-base for Starcraft 2).

  • \$\begingroup\$ I thought when sending out patches it might be better (less bandwidth) to only send the changes in data to the client. The client could then build the latest assets based on the old data and the change information. This could all be done as part of the patching process. I wonder why that might not be the case. \$\endgroup\$
    – chobok
    Mar 20, 2012 at 3:57
  • \$\begingroup\$ @chobok only the changes are usually sent to the client. What you would typically do is download the new assets from your CDN, crack open the MPQ (or zip file/directory/whatever) and replace/diff-patch the files that are different - but you wouldn't keep the old ones around once the patching process has completed. \$\endgroup\$ Mar 20, 2012 at 8:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .