Battlezone Universe

Battlezone Universe => Battlezone 2 => Maps and Modding => Topic started by: Steeveeo on June 04, 2008, 03:49:18 AM

Title: Map Auto-Smoothing
Post by: Steeveeo on June 04, 2008, 03:49:18 AM
Well, after some trial and error with ODLWinter, I got my general map working.

The only problem is that, because heightmaps are generated from on a per-pixel basis, and 16-bit pngs refused to import properly, the entire map is really rough and the pixels really apparent sometimes (little square plateaus). Now, I could spend the time to run the height tool in Blend mode over the entire map, but the map is pretty much huge, so that is basically out of the question.

Is there a tool I have missed that can take a granulated map like this and smooth it out down to gentle hills instead of legos? (Preferably one that has a changeable strength/threshold/factor/whatever so that I can keep SOME roughness, just not squares :P).

Thanks in advance!
Title: Re: Map Auto-Smoothing
Post by: OvermindDL1 on June 04, 2008, 12:05:53 PM
That is because you are doing it in 8-bit, you *have* to use 16-bit grayscale png's if you want it to be smooth, 16-bit png's mean squat, they will still be 8-bit grayscale, it needs to be 16-bit grayscale.  Most image editing programs are crap when it comes to things that high quality, find a good one.

The issue with 8-bit grayscale is that it only allow for 256 'levels', whereas 16-bit grayscale allows for 65536 levels, which happens to be *exactly* what BZ2 uses for terrain, 65536 levels, hence when you use a 256 level version you are missing lots of data between the various level, 255 less per level to be exact, that is a lot.  The original winter only supported 8-bit, the only difference with mine is that it supports 16-bit (and I have added a few more things since...).  When importing an 8-bit grayscale file though, it will do it's best to scale it, meaning  that if you are not going to use all of those levels (you are not, the map would be freakishly tall, mountains so high you could not fathom it) then you tell it where the bottom of your 8-bit file is (generally 1000 or more is good, if you do it at zero then you cannot lower your map below that point, so more then 1000 is good as it gives you leeway in-case you wanted to edit your map any), as well as what the tallest point in your 8-bit grayscale image is and it will interpolate in-between, so, for example, if you only used 256 levels in your terrain (unlikely, although most maps generally do not use more then a few thousand so this still gives you vastly more data to work with) then it would be a perfect match.

If you post up (or email me) your png file you are working with, I can tell you instantly whether it is 16-bit, or 16-bit grayscale (16-bit's worth of colors is worthless for a terrain map, need 16-bit's worth of grayscale for a terrain map :P ).
(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Generated by OvermindDL1's Signature Auto-Add Script (http://overminddl1.com) via GreaseMonkey (http://greasemonkey.mozdev.org/)


Title: Re: Map Auto-Smoothing
Post by: Steeveeo on June 04, 2008, 03:41:28 PM
I was using Photoshop...

I saved as 16-bit, and it refused to import to ODLWinter, tried switching modes (from grayscale to RGB), no effect, it refused to accept my 16-bit stuff.

Hence why I said this:

Quote from: Steeveeo on June 04, 2008, 03:49:18 AM
The only problem is that, because heightmaps are generated from on a per-pixel basis, and 16-bit pngs refused to import properly, the entire map is really rough and the pixels really apparent sometimes (little square plateaus).

NOTE: No I did not switch between modes on the exported PNG, I did it on the PSD (hitting undo if I had already changed modes).

(And I really didnt need the 90 page disertation on the difference between 8-bit and 16-bit, kinda already knew that :P)


Anyway, since I've already made progress on the map way past the initial heightmap, I do no want to have to regenerate the terrain and have to do it all over again, so I need some sort of auto-smoother, otherwise my map may just stick to being majorly rough...
Title: Re: Map Auto-Smoothing
Post by: Nielk1 on June 04, 2008, 04:16:51 PM
Did you actually read it Steeveeo? The whole thing about 16 bit PNG != 16 bit gray-scale PNG was important.
Title: Re: Map Auto-Smoothing
Post by: Steeveeo on June 04, 2008, 04:25:48 PM
Quote from: Nielk1 on June 04, 2008, 04:16:51 PM
Did you actually read it Steeveeo? The whole thing about 16 bit PNG != 16 bit gray-scale PNG was important.
Did you read what I said?

No matter WHAT 16-bit mode I use (grayscale, RGB, CMYK, w/e), it does not import into ODLWinter!
Title: Re: Map Auto-Smoothing
Post by: Nielk1 on June 04, 2008, 04:38:25 PM
Try another editor?
Title: Re: Map Auto-Smoothing
Post by: mrtwosheds on June 04, 2008, 05:12:13 PM
Try .bmp then (works for me), a simple blur function usually smooths things out nicely.
Title: Re: Map Auto-Smoothing
Post by: Feared_1 on June 04, 2008, 05:49:08 PM
Quote from: mrtwosheds on June 04, 2008, 05:12:13 PM
Try .bmp then (works for me), a simple blur function usually smooths things out nicely.
Why use PNG when there are other, easier, solutions? :)
Title: Re: Map Auto-Smoothing
Post by: Nielk1 on June 04, 2008, 08:37:29 PM
Steeveeo told be BMP files cannot be 16 bit, I thought he was wrong but, eh.
Title: Re: Map Auto-Smoothing
Post by: Steeveeo on June 04, 2008, 09:02:09 PM
Quote from: Nielk1 on June 04, 2008, 08:37:29 PM
Steeveeo told be BMP files cannot be 16 bit, I thought he was wrong but, eh.
Photoshop wouldnt allow an already 16-bit mode set image to be saved as BMP, had to be an 8-bit for it to work.
Title: Re: Map Auto-Smoothing
Post by: OvermindDL1 on June 04, 2008, 09:14:33 PM
BMP does not support 16-bit, there are 'unofficial' versions that do, but I do not support those.  And last I saw, Photoshop did not support 16-bit grayscale png's... although that was a few versions ago...

Edit:  Just checked.  Photoshop has "limited 16bps support", which does not include grayscale at all.  There is a plugin for PS called something like "SuperPNG" that adds 16bps color support, but I do not know about grayscale support.  I am pretty sure ImageMagick supports basn0g16 (png 16-bit grayscale in other words, the technical term for it) just fine.  I think my app also supported 16-bit grayscale tiff's whether the open box says it can or not (try forcing it, do not use any compression in the tiff to be on the safe-side though)...
(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Generated by OvermindDL1's Signature Auto-Add Script (http://overminddl1.com) via GreaseMonkey (http://greasemonkey.mozdev.org/)

Title: Re: Map Auto-Smoothing
Post by: BNG Da BZ Fool on June 05, 2008, 12:29:03 AM
Is ODLWinter any easier to use over the original Winter? I made a few .trn files, but must not understand how it works as I got mixed results when I load the .bzn file into the map editor. Most of them where I ended up with huge canyon like terrain and vast flat areas, but very little in the way any kind of sloping terrain. It just seems easier to do it all with the tools already included with the map editor itself.
Title: Re: Map Auto-Smoothing
Post by: GreenHeart on June 05, 2008, 12:41:33 AM
The ODLWinter is better & has more support since bz2 uses 16 bit images not 8bit so techinally the orginal winter program downgraded things.  Also ODLWinter has a 3D render view that is close enough to give you an idea of what it will be in bz2 but not totally on target with the height.
Title: Re: Map Auto-Smoothing
Post by: OvermindDL1 on June 05, 2008, 03:21:25 AM
Yea, never did figure out the exact height scaling value that BZ2 uses, it is not the same scale that the X and Y axis are, but yea, as stated, it is close enough for a quick idea.
(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Generated by OvermindDL1's Signature Auto-Add Script (http://overminddl1.com) via GreaseMonkey (http://greasemonkey.mozdev.org/)

Title: Re: Map Auto-Smoothing
Post by: BNG Da BZ Fool on June 05, 2008, 03:13:48 PM
Can I dl it at OM's forum?
Title: Re: Map Auto-Smoothing
Post by: Steeveeo on June 05, 2008, 03:33:07 PM
Quote from: BNG Da BZ Fool on June 05, 2008, 03:13:48 PM
Can I dl it at OM's forum?
i couldnt find it, had to get it from N1
Title: Re: Map Auto-Smoothing
Post by: Nielk1 on June 05, 2008, 04:14:59 PM
I found it in some one's folder in the 1.3 test file repository.
OM likely has a newer version somewhere.
Title: Re: Map Auto-Smoothing
Post by: OvermindDL1 on June 05, 2008, 09:29:30 PM
It was either greenheart or RD or someone that I made it for, they should have the latest 'usable' version.  I have a newer version on my pc, but it was adding other features, mostly to the 3d renderer and is not yet stable yet (well, by stable I mean it is stable, but it is not feature complete as there is a bug in the 3d input system).
(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Generated by OvermindDL1's Signature Auto-Add Script (http://overminddl1.com) via GreaseMonkey (http://greasemonkey.mozdev.org/)

Title: Re: Map Auto-Smoothing
Post by: Nielk1 on June 06, 2008, 01:42:34 AM
It came from one of their 1.3 private files folders, so it must be the highest version 'out there'.
Title: Re: Map Auto-Smoothing
Post by: OvermindDL1 on June 06, 2008, 03:22:59 AM
Probably from the guy who asked me to make it. :P
(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Generated by OvermindDL1's Signature Auto-Add Script (http://overminddl1.com) via GreaseMonkey (http://greasemonkey.mozdev.org/)