1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

W3Protect - Jass and Lua map optimizer

Discussion in 'Warcraft Editing Tools' started by Frotty, Sep 26, 2019.

  1. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,437
    Resources:
    11
    Models:
    3
    Tools:
    1
    Maps:
    5
    Tutorials:
    1
    Wurst:
    1
    Resources:
    11
    Thanks for reporting, but the map itself is broken, it doesn't even run in warcraft III.
    The war3map.j contains vjass code, which seems very wrong.

    [​IMG]

    Btw you can see debug info in console if you run from there.
     
    Last edited: Oct 9, 2019
  2. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,162
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Ups, sorry for this.

    Anyways I tried with again with playable map, and get "Code has errors", or with console the following:

    upload_2019-10-10_23-33-16.png
     
  3. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,437
    Resources:
    11
    Models:
    3
    Tools:
    1
    Maps:
    5
    Tutorials:
    1
    Wurst:
    1
    Resources:
    11
    Thanks. The "Critical Error" from console only means that you don't have the same (i.e. missing) permissions when running from there (for some reason).

    The "Code has Errors" is because Wurst detects potential faults in your code ;)
    The war3map.j contains calls to ExecuteFunc with non existing functions as arguments, e.g.
    call ExecuteFunc("s__PlayerTools_Init__onInit")
    .
    For development that makes sense, but the optimizer should simply remove the call. I will push an update for this.
     
  4. lolreported

    lolreported

    Joined:
    Aug 16, 2007
    Messages:
    751
    Resources:
    12
    Tools:
    1
    Maps:
    5
    Spells:
    6
    Resources:
    12
    Works like a charm :)
     
  5. lolreported

    lolreported

    Joined:
    Aug 16, 2007
    Messages:
    751
    Resources:
    12
    Tools:
    1
    Maps:
    5
    Spells:
    6
    Resources:
    12
    New issue found,

    Using "Extreme Compression" completely obliterates all(?) imported sounds; causing them to become, as UndeadImmortal said, an "ear splitting noise".
     
  6. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,437
    Resources:
    11
    Models:
    3
    Tools:
    1
    Maps:
    5
    Tutorials:
    1
    Wurst:
    1
    Resources:
    11
    Thanks for the report. Actually only .wav files are affected, since they are exempt from recompression due to increasing in size by deflation.
    I will push a fix for this soon.
     
  7. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,437
    Resources:
    11
    Models:
    3
    Tools:
    1
    Maps:
    5
    Tutorials:
    1
    Wurst:
    1
    Resources:
    11
    Version 0.5.8 released. See first post for download & changelog.

    @IcemanBo Okay, useless EF calls get removed. Do all of your maps work now?

    @lolreported I added a "fix" for the .wav problem, but in general .wavs are just problematic. The world editor uses a lossy compression for wavs with around 30% compression ratio, which would turn to 90%+ ratio if we just used lossless zlib. If we don't change the sector size we can just keep the files of course, but we want to increase the sector size to better compress all other files. Recompression is also not really feasible, because the first sector of wavs is not lossy compressed (assumably to retain header info) and with a big sector size there only is one sector per file, thus the lossy compression wouldn't even get into action.
    Depending on how much space the wavs take up in the map a higher sector count could still be okay, so I will add an option to force recompression in the future.
    For now it will just show a message when .wav files have been detected, and keep the sector size and .wav files as is.
    I don't think there is much point in further research due to the generous map file size constraint in battle.net.
     
  8. lolreported

    lolreported

    Joined:
    Aug 16, 2007
    Messages:
    751
    Resources:
    12
    Tools:
    1
    Maps:
    5
    Spells:
    6
    Resources:
    12
    It sounds like a very complicated problem and just ignoring the .wav files altogether is fine, in my opinion. As you said, the map file size is huge nowadays and file sizes aren't that big of a problem.

    I'll report back how it works when I'm done updating my map. :)


    EDIT
    Used the recent version of the tool and the map now crashes when loading, using Extreme Compression or not doesn't matter. Version 0.5.7 works without issue (not using Extreme Compression to avoid the sound glitch).

    crash.PNG
     
    Last edited: Oct 18, 2019
  9. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,437
    Resources:
    11
    Models:
    3
    Tools:
    1
    Maps:
    5
    Tutorials:
    1
    Wurst:
    1
    Resources:
    11
    Thanks for the report, it was yet another bug in the wts inliner :D
    I pushed 0.5.9 with a fix.
     
  10. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,162
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    All works fine for me. People should use this!