Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Miscellaneous => Topic started by: babboide on July 25, 2013, 01:11:42 am

Title: [SOLVED] [QUESTION] MPQ Chain order
Post by: babboide on July 25, 2013, 01:11:42 am
How WoW determines the priority for each MPQ archive in the chain? Why Data/patch-x.MPQ has higher precedence than Data/enGB/patch-enGB-x.MPQ? Is there an algorithm or it is hardcoded?

Thanks
fbbdev
Title: Re: [QUESTION] MPQ Chain order
Post by: Steff on July 25, 2013, 09:52:42 am
The statement is simple wrong. Data patches get loaded before locals. So the locals ahve heigher prio.
Read the Tutorial part 2. In the File extraction part i have a list how wow load the MPQs.
Title: Re: [QUESTION] MPQ Chain order
Post by: babboide on July 25, 2013, 10:46:28 am
I used to think so, but I observed a different behavior. I'm using WoW 3.3.5a. I created a patch with modified textures from Data/[locale]/patch-[locale]-3.MPQ and saved it as Data/patch-4.MPQ. WoW loads textures from my patch, and standard output from the client shows that my patch is loaded after locale archives.
Title: Re: [QUESTION] MPQ Chain order
Post by: schlumpf on July 25, 2013, 11:01:17 am
Standard output is the correct way to check for it. Do not believe anything else but that.

The actual order is defined by a hardcoded array consisting of filename, priority, build/locale dependencies.
Title: Re: [QUESTION] MPQ Chain order
Post by: babboide on July 25, 2013, 01:21:10 pm
Thank you schlumpf. After some digging in client code I think the priority order (highest priority to lowest piority) should be:

patch-[locale]-3.MPQ
patch-[locale]-2.MPQ
patch-3.MPQ
patch-2.MPQ
patch-[locale].MPQ
patch.MPQ

lichking.MPQ
expansion.MPQ
common-2.MPQ
common.MPQ

lichking-locale-[locale].MPQ ........... lichking-speech-[locale].MPQ
expansion-locale-[locale].MPQ ...... expansion-speech-[locale].MPQ
locale-[locale].MPQ ........................ speech-[locale].MPQ

After these files the client loads additional files called
patch-[number >= 4].MPQ and patch-[locale]-[number >= 4].MPQ and gives them higher priority than any other archive, so patch-4.MPQ overrides ANYTHING and patch-[locale]-4.MPQ overrides patch-4.MPQ.

Please correct me if I'm wrong.

Thanks in advance
fbbdev
Title: Re: [QUESTION] MPQ Chain order
Post by: schlumpf on July 25, 2013, 01:49:05 pm
The last part seems really odd.

Have you tried creating dummy files for
Code: [Select]
[locale]/expansion-locale-[locale].MPQ
[locale]/expansion-speech-[locale].MPQ
[locale]/lichking-locale-[locale].MPQ
[locale]/lichking-speech-[locale].MPQ
[locale]/locale-[locale].MPQ
[locale]/patch-[locale].MPQ
[locale]/patch-[locale]-2.MPQ
[locale]/patch-[locale]-3.MPQ
[locale]/patch-[locale]-4.MPQ
[locale]/patch-[locale]-5.MPQ
[locale]/patch-[locale]-a.MPQ
[locale]/patch-[locale]-z.MPQ
[locale]/speech-[locale].MPQ
common.MPQ
common-2.MPQ
expansion.MPQ
lichking.MPQ
patch.MPQ
patch-2.MPQ
patch-3.MPQ
patch-4.MPQ
patch-5.MPQ
patch-a.MPQ
patch-z.MPQ
and then just watching what is printed on standard output?

That would be the easiest way to verify.

Also, to my belief, order has been
Code: [Select]
common.MPQ
common-2.MPQ
expansion.MPQ
lichking.MPQ
patch.MPQ
patch-2.MPQ
patch-3.MPQ
patch-4.MPQ
patch-5.MPQ
patch-a.MPQ
patch-z.MPQ
[locale]/locale-[locale].MPQ
[locale]/speech-[locale].MPQ
[locale]/expansion-locale-[locale].MPQ
[locale]/expansion-speech-[locale].MPQ
[locale]/lichking-locale-[locale].MPQ
[locale]/lichking-speech-[locale].MPQ
[locale]/patch-[locale].MPQ
[locale]/patch-[locale]-2.MPQ
[locale]/patch-[locale]-3.MPQ
[locale]/patch-[locale]-4.MPQ
[locale]/patch-[locale]-5.MPQ
[locale]/patch-[locale]-a.MPQ
[locale]/patch-[locale]-z.MPQ
Title: Re: [QUESTION] MPQ Chain order
Post by: babboide on July 26, 2013, 02:23:18 am
Ok, I've done a lot of testing and here's the result:
Code: [Select]
---- HIGHEST PRIORITY
Datapatch-z.MPQ
           .
           .
           .
Datapatch-a.MPQ

Datapatch-9.MPQ
           .
           .
           .
Datapatch-2.MPQ

Data[locale]patch-[locale]-z.MPQ
                             .
                             .
                             .
Data[locale]patch-[locale]-a.MPQ

Data[locale]patch-[locale]-9.MPQ
                             .
                             .
                             .
Data[locale]patch-[locale]-2.MPQ

Datapatch.MPQ
Data[locale]patch-[locale].MPQ

Data[locale]lichking-speech-[locale].MPQ
Data[locale]expansion-speech-[locale].MPQ
Data[locale]lichking-locale-[locale].MPQ
Data[locale]expansion-locale-[locale].MPQ
Data[locale]speech-[locale].MPQ
Data[locale]locale-[locale].MPQ

Datalichking.MPQ
Dataexpansion.MPQ
Datacommon-2.MPQ
Datacommon.MPQ
---- LOWEST PRIORITY

The order printed in client's output is different from the priority order, however you can subdivide the list in smaller groups, and files in those groups are printed in ascending priority order. Non-locale files whose name starts with "patch" (except patch.MPQ) are given the highest priority.

To find this I created two MPQs, one with modified GlueXML files and one with original versions of the same files; then I moved them around and swapped them with other archives to determine priority: WoW complains about corrupted interface files when the archive with modified GlueXML receives higher priority.
Title: Re: [SOLVED] [QUESTION] MPQ Chain order
Post by: Steff on July 26, 2013, 10:29:27 pm
That cannot be. Why?
because if i place some dbcs in data/patch files and thy exist in local patch files, client dont load them.
Learnd this hard during worldmap creation.
Title: Re: [SOLVED] [QUESTION] MPQ Chain order
Post by: mystical on July 27, 2013, 06:50:28 am
:lol:  Easiest Way without much work is to take a look at the logfile from Modelviewer.......

If you start the WoW Modelviewer without any Path Settings, it will scan the WoW Directory
and add all MPQ´s automatically to the loadup list.

Here s the Result:


06:05:28: Starting:
World of Warcraft Model Viewer v0.7.0.4 (Bouncing Baracuda) Windows 32-bit

06:05:28: Initializing Objects...
06:05:28: Creating Anim Control...
06:05:28: Creating Char Control...
.
.
.
06:05:35: Opening patch-5.mpq . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . <<<<<------  Highest Priority
06:05:35: Opening Patch-4.mpq
06:05:37: Opening patch-3.MPQ
06:05:37: Opening patch-2.mpq
06:05:38: Opening patch.MPQ
06:05:39: Opening lichking.MPQ
06:05:39: Opening expansion.MPQ
06:05:39: Opening common-2.MPQ
06:05:40: Opening common.MPQ
06:05:41: Opening deDEpatch-deDE-5.mpq
06:05:41: Opening deDEpatch-deDE-4.mpq
06:05:41: Opening deDEpatch-deDE-3.mpq
06:05:41: Opening deDEpatch-deDE-2.MPQ
06:05:41: Opening deDEpatch-deDE.MPQ
06:05:41: Opening deDElichking-locale-deDE.MPQ
06:05:41: Opening deDEexpansion-locale-deDE.MPQ
06:05:41: Opening deDElocale-deDE.MPQ
06:05:42: Opening deDEbase-deDE.MPQ . . . . . . . . . . . . . . . . . . . . . . . . . . <<<<<------  Lowest Priority


 :D  :D  :D  :D  :D

So new Stuff  has to be in  patch-5.mpq in my case :D :D
Title: Re: [SOLVED] [QUESTION] MPQ Chain order
Post by: schlumpf on July 27, 2013, 01:17:44 pm
Quote from: "mystical"
:lol:  Easiest Way without much work is to take a look at the logfile from Modelviewer.......
[...]
So new Stuff  has to be in  patch-5.mpq in my case :D :D

    This is just plain wrong: The model viewer is a custom application, thus does not even have to be remotely close to what WoW does. You may as well refer to noggit, then.
    Also, new stuff does not have to be in patch-5.mpq in your case.
    Title: Re: [SOLVED] [QUESTION] MPQ Chain order
    Post by: babboide on August 01, 2013, 04:19:39 pm
    Quote from: "Steff"
    That cannot be. Why?
    because if i place some dbcs in data/patch files and thy exist in local patch files, client dont load them.
    Learnd this hard during worldmap creation.

    I understand your point, but I'm saying that after trying and my experience is different from yours. Do you have a different locale than mine? I've got enGB/enUS; maybe Wow gives higher priority to non-English locales, this would explain the difference between our results.
    Title: Re: [SOLVED] [QUESTION] MPQ Chain order
    Post by: schlumpf on August 01, 2013, 05:06:59 pm
    There is no difference depending on the locale.
    Title: Re: [SOLVED] [QUESTION] MPQ Chain order
    Post by: Steff on August 02, 2013, 06:08:36 am
    QUick test could be.
    Add 2 BLP replace for some tileset WITH DIFFERENT IAMGES
    One in patch second in patch local.
    Then once you see get loaded last.
    Title: Re: [QUESTION] MPQ Chain order
    Post by: Dracbane on August 02, 2013, 07:43:27 pm
    Quote from: "babboide"
    Thank you schlumpf. After some digging in client code I think the priority order (highest priority to lowest piority) should be:

    patch-[locale]-3.MPQ
    patch-[locale]-2.MPQ
    patch-3.MPQ
    patch-2.MPQ
    patch-[locale].MPQ
    patch.MPQ

    lichking.MPQ
    expansion.MPQ
    common-2.MPQ
    common.MPQ

    lichking-locale-[locale].MPQ ........... lichking-speech-[locale].MPQ
    expansion-locale-[locale].MPQ ...... expansion-speech-[locale].MPQ
    locale-[locale].MPQ ........................ speech-[locale].MPQ

    After these files the client loads additional files called
    patch-[number >= 4].MPQ and patch-[locale]-[number >= 4].MPQ and gives them higher priority than any other archive, so patch-4.MPQ overrides ANYTHING and patch-[locale]-4.MPQ overrides patch-4.MPQ.

    Please correct me if I'm wrong.

    Thanks in advance
    fbbdev


    This has always been my experience when working with patches.  I often have patches from 4-9 and a-z because of working on different content for different things. Patch-4.MPQ overrides all the data patches and Patch-4-enUS.MPQ overrides everything.