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

terrain 1.0 tool changed .w3e not working

Status
Not open for further replies.
Level 12
Joined
Nov 3, 2013
Messages
989
I'm using this tool to change the terrain height, but every time I open the map (completely empty map) which I've replaced the original war3map.w3e file with the .tga converted war3map.w3e file my world editor crash.

the .tga is 193x193 and the map is 192x192. (the height map's dimensions are supposed to be one pixel larger, so 193x193 is intentional)

I've used this tool in the past to make another map, the only difference I can think of is the new 2.7 warcraft 3 patch.

Anybody who know or can figure out what's up?

This is the image that I desaturated, inverted (white -> black & black -> white) and resized the canvas of.
153496d1459435980-terrain-1-0-tool-changed-w3e-not-working-geogebra-export-3-.png
 

Attachments

  • 4v4v4v1AoSCtPCtF193x193.tga
    54.3 KB · Views: 39
  • geogebra-export (3).png
    geogebra-export (3).png
    94.8 KB · Views: 295
Level 12
Joined
Nov 3, 2013
Messages
989
The tool requires you to input a tga and a map, you presented a tga, I took a test map and it worked with it.

Yeah, it just need you to make a map with the same dimensions -1, -1

But for some reason after I replace the terrain map with the new one I can't load the map.

a popup shows up about shadows being invalid and then after some more loading windows tell me that world edit has crashed.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
That's the already broken version. It says the shadow map is invalid because the map constraints defined in the w3e do not match, respectively the height parameter is garbage and maybe the center coordinates as well. Now I do not know what exactly should be happening but when I fixed those, I got a flat, only-dirt map. Is the tga really uncompressed?

Maybe I can fix you a substitute application later if you tell precisely how the height map is to be interpreted.
 
Level 12
Joined
Nov 3, 2013
Messages
989
That's the already broken version. It says the shadow map is invalid because the map constraints defined in the w3e do not match, respectively the height parameter is garbage and maybe the center coordinates as well. Now I do not know what exactly should be happening but when I fixed those, I got a flat, only-dirt map. Is the tga really uncompressed?

Maybe I can fix you a substitute application later if you tell precisely how the height map is to be interpreted.

It's an empty map because the whole point of me using the tool is to make a base terrain height map.

I've got a couple of other maps with stuff to then put into it, but I don't have an actual map that I'm planning to change the terrain of.

So there's no "not broken" version, because they're just empty new maps I made every time I tried to use the tool and then WinMPQ to change the terrain-map from the blank to the tool generated one...

p.s. so for the record the steps I'm taking are:
  1. Create a new map in world editor with 192x192 dimensions and save map without anything.
  2. Use the tool with the attached file here (but tga instead of png of course) and the new map I just saved to convert the image for an appropriate terrain map.
  3. Open the same newly created map with WinMPQ and remove existing war3map.w3e to then replace it with the one from the tool.
  4. Attempt to open map in the editor again, but the shadow map invalid & crash to desktop after a couple of minutes loading.

I've used it to make outlines for wc3 maps before so I know that it was working at least at some point, but I don't think I'm doing anything wrong either so I don't know what's up.
 

Attachments

  • 193x193.png
    193x193.png
    31.5 KB · Views: 65
Last edited:
Level 26
Joined
Aug 18, 2009
Messages
4,097
That's what I did and it still worked (see attached map as input). I do not mind the emptyness but I am saying that the tool did not apply any visible height map features, only broke the header.

edit: wait a sec, I try your new image

edit2: It did something in both cases (both images), but basically none of the structures are observable to the naked eye in the editor. I then altered the image, put a big white dot in the center since maybe the lines were to thin. The black parts are lowered to -248, the full white dot is at -242, so that's marginally higher.
 

Attachments

  • base.w3x
    51.7 KB · Views: 45
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
Wait are you saying that it doesn't change at all? Even when you just made something else? I've used it before and there's images in the related tool thread from replies showing other people using it as well. example

Shouldn't white be as high as it can be and black as low as possible?

So from your last edit, it's working (for you), but only with a range of 6 units of height difference from min to max? ehh
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Shouldn't white be as high as it can be and black as low as possible?
Terrain and water height is actually 14 bits. Giving 16384 different possible values. This cannot be represented by a standard 8 bit greyscale image (missing 6 bits), as such 16bit greyscale images are needed for maximum precision. Since 16bit greyscale offers 2 bits too many, the least significant 2 bits are discarded. Further more one can think of these images as being linear in color space due to how they get interpreted.

Depending on the image framework used it may internally cast 8bit greyscale or colour images into 16bit grey scale for conversion into terrain.

A flat terrain with 0 height offset should be half maximum intensity due to how the height values are interpreted, with black being lowest possible terrain and white being the highest possible terrain.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Terrain and water height is actually 14 bits. Giving 16384 different possible values. This cannot be represented by a standard 8 bit greyscale image (missing 6 bits), as such 16bit greyscale images are needed for maximum precision. Since 16bit greyscale offers 2 bits too many, the least significant 2 bits are discarded. Further more one can think of these images as being linear in color space due to how they get interpreted.

Depending on the image framework used it may internally cast 8bit greyscale or colour images into 16bit grey scale for conversion into terrain.

A flat terrain with 0 height offset should be half maximum intensity due to how the height values are interpreted, with black being lowest possible terrain and white being the highest possible terrain.

So the image is in 8 bit instead of 16? Or what did I do wrong here? (I'm not very adept with gimp or photoshop so I might very well have made some kind of mistake)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I do not know exactly what you were doing wrong, I am only stating how such tools work, or at least should work from personal experience making one.

Subtle shading differences may not be visible in game due to how small the difference is. 16 bit greyscale is needed for maximum accuracy.
 
Level 12
Joined
Nov 3, 2013
Messages
989
I do not know exactly what you were doing wrong, I am only stating how such tools work, or at least should work from personal experience making one.

Subtle shading differences may not be visible in game due to how small the difference is. 16 bit greyscale is needed for maximum accuracy.

Well, there should be a pretty big difference between black and white? No matter how inaccurate it is, it couldn't possibly be subtle with complete opposites on the spectrum?

Here's the same .tga (though I've zoomed in before I took this screenshot) as I've attached in one of the earlier posts.

77c4297e00.png


Is the tga really uncompressed?

Maybe I can fix you a substitute application later if you tell precisely how the height map is to be interpreted.
The intention is that the white / light grey lines are supposed to be higher so I can use the terrain brush and get the pattern down before I smooth out the terrain again. (And I've got no idea whether it is or isn't compressed, I would assume not...)
 
Level 12
Joined
Nov 3, 2013
Messages
989
I hacked together some JAVA to do this and here you go.

I am not sure the provided height map was of a useful quality.

Thanks, it's workable enough for my purposes. (to fill in the spaces between the lines with different terrain textures, afterwards I'll just make everything flat again.)

That said, it kinda hit me that this method I'm using is probably very convoluted. I mean if people are smart enough to make these tools, they probably also know how to make a tool to just turn different colors in an image to different terrain textures on the map instead of using so roundabout methods.

Maybe there's even a tool like that already, that would be kinda embarrassing for me to be honest...

Either way it was good enough for me. :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
That said, it kinda hit me that this method I'm using is probably very convoluted. I mean if people are smart enough to make these tools, they probably also know how to make a tool to just turn different colors in an image to different terrain textures on the map instead of using so roundabout methods.
Especially if you were to provide a 16 color pallet image. The colors could be mapped directly to texture. I did something like this with greyscale before but the results would probably be more human friendly as pallet.
 
Status
Not open for further replies.
Top