• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Mac Compatibility Scan

Status
Not open for further replies.
Preface:

Warcraft III on a Mac has a lot of downsides. One of the bigger issues is that
Warcraft III will crash when trying to load a BLP with particular settings.
Those settings are outlined here:
http://www.hiveworkshop.com/forums/warcraft-editing-tools-277/blp1-mac-computers-235604/#C

Although the rule is not 100% final (yet), I decided to make a tool to scan a map
for those faulty BLP's. This only scans the map for faulty BLP's, it does not
fix them. The process of fixing is explained later in this post.​

Requirements:

This program currently runs only on Mac OS X (pretty stupid, huh?).
However, I will be porting it to Windows soon. I just posted this since the Mac
version is essentially complete. If you want me to test a map, I'll be happy to
run it through the program for you.​

Usage:

  • Download the ZIP.
  • Double click it in Finder. Move it to the applications folder if you want (so it'll show up on launchpad).
  • Open it up. You'll be met with this screen:
    attachment.php
  • Click the image well in the center to browse for the map you want to check (alternatively, go to "File -> Open")
  • Select the map, and a table will appear:
    attachment.php
  • The table will list several things:

    Plain Name - The plain name of the file within the map. This is just the file
    without the directories (e.g. it excludes ReplaceableTextures/CommandButtons/ and other paths like that)

    Compatibility - If it shows "Yes", then it most likely won't crash. If it shows "No",
    then chances are that it will crash. All the "No"'s are shown first.

    Format - JPEG or Paletted/Paletted Alpha. JPEG's cause the crash, paletted are ignored.

    Mip Maps - Number of mip maps defined in the BLP header. Real mipmaps represent
    the "true" mip map count. The fake ones just point to a real mip map. For compatibility, the file must either
    be Paletted or "Real" must be greater than or equal to the "Required" slot.

Fix:

Fixing BLP's is a tedious process. The faulty ones are usually just icons that were converted with ButtonManager.

To fix them, you need to download BLPLab.​

  • First, extract the BLP file from your map either with an MPQ editor or through WE.
  • Open it in BLP lab and look at the mip-map count.
    attachment.php
  • There are two ways to fix it. You can either resave it as Paletted (no need to change
    the number of mip maps), or you can resave it with the mip map number on the left. In the pic above,
    that would be "7" (or you can look in the program and check the "Required" slot):
    attachment.php
  • Select a location to save it (click the ...) and then save.
  • Import the new BLP into your map under the same path.

The sad part is that you have to do that for every "faulty" BLP (at least until I learn more
about writing to BLP's).

If you have a mac, you can run BLP Lab through WineBottler (google).​

Batch Fix (Faster):

This method will allow you to fix them a bit faster.​

  • Extract all the BLP files labeled as "incompatible" from your map.
  • Put them in a separate folder.
  • Make a separate folder called "Output" or something (it can be inside the other folder).
  • Open up BLP Lab.
  • Go to "Tools -> Batch Converter".
  • Check "BLP" as the source format, uncheck the others.
  • Destination format should be BLP1.
  • Select the source folder as the folder containing the faulty BLP's.
  • Select the destination folder as the "Output" folder.
  • Click "File Format Options" in the bottom left.
  • For mip maps, choose "16". Alternatively, you can check "Paletted" if you
    don't want to edit the mips.
    Adjust the quality as desired.
  • Press "OK", then "Convert". The fixed files should be in the "Output" folder.
  • Import them into your map, replacing the old ones. Save and it should be fixed.

Prevention:

This is obviously a tedious process, so to save yourself some time,
just convert with better options. If you are using BLP Lab, convert your BLP's as either paletted
or put enough mip maps so that there aren't any fake ones generated (if you use JPEG compression).

If you are using button manager, then adjust the settings like so:
http://www.thehelper.net/threads/mac-certain-map-crash-on-selection.130633/#post-1140701

Exceptions:

This tool isn't guaranteed to find all faulty BLP files. It'll find all that don't match up with
the "rule" I posted, but there may be other options that cause crashes. For example, I scanned
Gaia's Retaliation and all of them returned as compatible, but it crashes on a mac.
As such, this tool and the rule are still considered WIP.​

Source Code:

I'm not releasing the source for this release. Perhaps in the future if I clean up the code.
It isn't because I'm protective or anything, it is just that my code honestly lacks organization and
proper names. There are still tons of commented debug code (I was still learning how to make apps
at the time). Once I recode it in python for Windows, I'll release the source.

If you really need the source, just PM me.​

Credits:
  • Weep - Initial rule
  • Ladislav Zezula - StormLib
  • Sam Wilkins - StormLib OS X Port
  • Shadow Daemon - BLP Lab

Download:

Remember, this currently runs on a mac only. I'll bump the thread once I have a
Windows version running. If you need me to run your map through it, PM me or post here. It
is always good for me to get extra material to test. :)
 

Attachments

  • Screen Shot 2013-10-10 at 3.56.53 PM.png
    Screen Shot 2013-10-10 at 3.56.53 PM.png
    27.5 KB · Views: 375
  • Screen Shot 2013-10-10 at 3.59.02 PM.png
    Screen Shot 2013-10-10 at 3.59.02 PM.png
    84.6 KB · Views: 337
  • Clipboard01.png
    Clipboard01.png
    57.7 KB · Views: 391
  • Clipboard02.png
    Clipboard02.png
    32.9 KB · Views: 416
  • Mac Compatibility Scan.zip
    282.5 KB · Views: 122
Level 30
Joined
Nov 29, 2012
Messages
6,637
So this actually scans maps that has files (let us call them harmful files) that will make it in Mac crash. So this is much of a scanner that lets you know if map has chances of crushing at Mac so to save time, this was made? Am I correct? Mind explaining further whats the use of it?
 
So this actually scans maps that has files (let us call them harmful files) that will make it in Mac crash. So this is much of a scanner that lets you know if map has chances of crushing at Mac so to save time, this was made? Am I correct? Mind explaining further whats the use of it?

Yep, you've got it.

Normally, if a map crashes on a mac you have to look through every BLP file and check it for the faulty settings. This will save you some time by loading all the BLP's and determining whether it is compatible by looking at that BLP's format.

In the future/in the windows release, I'll have an option to extract the BLP files and probably an option to import a directory (to replace the files with improved ones). That might speed up the process a bit, BLP lab will take care of the actual fixing with the batch conversion.

I mean, it might seem a bit useless if you run on a Windows, but I encourage map makers to attempt to make their maps compatible on macs. I know there aren't very many mac war3 players (because Blizz has really bad support for it), but this may at least help a few poor souls out there (e.g. me).
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
I see, this really is useful to those mac players who always experience crashing. Now they can spot the cause of all the crash with this tool instead of searching one by one.

Overall, I like this even if Im not using Mac but I feel there are also Mac users that will surely neeed this and also like you'll be adding a feature that also fix that file so the map can work.

Great job + you have my support also + 4 REP :cgrin:
 
any news regarding the Windows Version?

Not yet. x(

I am learning a new toolkit for GUI's in python, so it may take a little while before I have any news (I'll be sure to read up on it tomorrow!). The actual core code will be easy to port (will only take a few days) after I get the GUI stuff out of the way.

edit: Python is throwing memory access errors *sigh* I may have to resort to C++.
 
Last edited:
Status
Not open for further replies.
Top