• 🏆 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!

Water Mesh Height Fixer

  • Like
Reactions: deepstrasz
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.

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
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.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
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.
They should be using MPQEdit anyway.
Do you happen to know any good libraries for MPQ extaction and editing that we could use with our Java application?
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.
I have just come across StormLib.dll, which is written in C++.
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.
 
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.

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.
 

eejin

Tool Moderator
Level 12
Joined
Mar 6, 2017
Messages
221
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.
 

Nyctaeus

Hosted Project: W3E
Level 17
Joined
Oct 16, 2021
Messages
173
Sorry for refreshing 3-years old thread, but this one seems to be the only promise of finding fix after several hours of googling.

This seems to be working only for water made using cliffs or on everything that's above the default terrain height. Either of these seems to be the reason why this tool is not fixing the issue on my map.

I don't use any cliffs on my maps so cliff level of my entire map is almost always 0 [I use only brush-made terrain]. Also I often make very hilly maps and while the invisible water level goes up with the terrain raised to positive heights, it always remains on default height level if I make terran on negative height [relative to default level]

Attached files portray this issue on example of shadows [It affects shadows as well.] and on various levels of ground depression.

Could you please upgrade your tool to handle the issue also for terrain made on negative heights?
 

Attachments

  • tempimage.jpg
    tempimage.jpg
    887.5 KB · Views: 9
  • tempimage2.jpg
    tempimage2.jpg
    905.3 KB · Views: 9
Top