1. Are you planning to upload your awesome tool to Hive? Please review the rules here.
    July 9, 2018: The rules for the Tool Section have been revised. Please be sure to read the revisions.
    Dismiss Notice
  2. The poll for our 11th Music Contest is up! Help us choose the most awesome cinematic tracks by casting a vote!
    Dismiss Notice
  3. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  4. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  5. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice

Water Mesh Height Fixer

Submitted by Tommi Gustafsson
This bundle is marked as approved. It works and satisfies the submission rules.
Summary
This is a Java Application to fix a water mesh height problem that causes Area of Effect spells and items show their targeting circle at a wrong location.

Bug Corrected
This application corrects the following bug:
Editor Bug: Phantom Water Height

Tutorial
A tutorial to use this application is found on YouTube:


How it works?

It edits the war3map.w3e file and calculates a new water height for every vertex that has water mesh disabled, if the water mesh is found to be on a higher cliff level than the ground mesh.

Other tools needed
WinMPQ - to unmpq and rempq war3map.w3e (alternatively, you can use MPQ Editor)
JRE - to run Java applications

Credits
- Dr. Super Good for war3map.w3e editing tools in Java
- Sami Termonen and Tommi Gustafsson (members of Sound Mind Games) for programming the fixer application
- Tommi Gustafsson for the video tutorial

Change Log
- 21.3.2018 (v2): The tool no longer causes water cliffs. It has been modified to calculate a new water height instead of setting it straight to 0.
Contents

WaterMeshHeightFixer-v2.zip (Binary)

Reviews
eejin
Approved! Works properly and without too much hassle. Would be a nice addition to automatically extract and insert the war3map.w3e from the map archive. Maybe also change the WinMPQ link to refer to Zezula his MPQ editor which is more user friendly.
  1. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    24,992
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Something occurred to me. Due to water mesh interpolating height with neighbouring nodes it might be required to leave the water height of nodes that neighbour enabled water nodes unchanged, at least in a 1 x and y orientation. Otherwise one might end up with a water cliff. at the edges of water fields (areas of enabled water nodes) where the height suddenly drops to 0. In a well made map this should be under the ground mesh, but in less well made maps or border conditions it could possibly be visible.

    At least that is the theory, maybe it never happens in practice.
     
  2. Tommi Gustafsson

    Tommi Gustafsson

    Joined:
    May 26, 2017
    Messages:
    208
    Resources:
    6
    Tools:
    1
    Maps:
    2
    Tutorials:
    3
    Resources:
    6
    By the way, we are thinking about adding MPQ editing functionality to the software at some point so that people wouldn't need to use WinMPQ. Do you happen to know any good libraries for MPQ extaction and editing that we could use with our Java application?
    I have just come across StormLib.dll, which is written in C++.
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    24,992
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    They should be using MPQEdit anyway.
    That is kind of the problem and why such tools do not already exist. The MPQEdit team wrote a C/C++ MPQ API which is reliable. All others are not. My Java MPQ API was read only, and although used by some tools does not fit the requirements here. JMPQ3 has read/write support but is highly buggy as it was written by inexperienced software engineers who tried to prematurely optimize with techniques like memory mapping.
    Such APIs are not portable like Java applications. Where as a pure Java solution works for Mac and Linux, a Java wrapped C++ DLL does not as that will only work for Windows.
     
  4. Tommi Gustafsson

    Tommi Gustafsson

    Joined:
    May 26, 2017
    Messages:
    208
    Resources:
    6
    Tools:
    1
    Maps:
    2
    Tutorials:
    3
    Resources:
    6
    I have now modified the tool so that it does not cause water cliffs. Any testing is welcome.
    Please always make a backup copy of your map, before using this tool. It can still mess up some things, which I haven't tested it with.
     
  5. eejin

    eejin

    Tool Reviewer

    Joined:
    Mar 6, 2017
    Messages:
    116
    Resources:
    0
    Resources:
    0
    Approved! Works properly and without too much hassle. Would be a nice addition to automatically extract and insert the war3map.w3e from the map archive. Maybe also change the WinMPQ link to refer to Zezula his MPQ editor which is more user friendly.
     
  6. Tommi Gustafsson

    Tommi Gustafsson

    Joined:
    May 26, 2017
    Messages:
    208
    Resources:
    6
    Tools:
    1
    Maps:
    2
    Tutorials:
    3
    Resources:
    6
    Ok. Added an alternative link to the MPQ Editor.