Blame the Dither?

temurleng

Another Dumb Message
Joined
Jul 22, 2004
Messages
167
Location
North of the South Pole
So I'm working on new terrain files. Using bright colors. I plug 'em in for a test run, and on the borders are these wierd brightly-colored pixels. Attached are some examples. I guessed it was the dither in the lower-left of terr1, but my editing efforts created all new problems. Anyone know how to solve this?
 

Attachments

I think it simply has to do with the terrain graphics involved.

Um, I'm not sure how to explain...

The pixels in a tile that are black in the dither image will use the terrain graphics of the adjacent square.

Those few yellow pixels in your leftmost example, for instance, are stray pixels from the terrain to the top-right of them. They're part of that funny yellow/blue/red thingy. But since there only are a few dither dots, it's just the two yellow dots that remain.

The same goes for the second example. The blue, red and yellow dots are part of the terrain type graphic of the terrain to the upper-left of it. The reddish bit in your third example is part of the red/yellow graphics of the terrain to the upper-left of it as well.

You'll either have to adjust the dither pattern by removing (or adding) some black dots (the ones that reveal those bright squares), or removing the dither altogether (color the entire dither pattern in magenta or you get funny effects)... Or you can edit the terrain graphics so they mix better.
 
After working on the suggestions posted, I think they can be boiled down to the following 4:
1- change the color of the dither dots- go to the opposite end of the dark/light spectrum
2- remove the dither altogether- color the entire dither pattern in magenta, or you'll get funny effects
3- edit the terrain graphics so they mix better- it simply has to do with the terrain graphics involved
4- adjust the dither pattern by removing or adding some black dots

Regarding the first- I hadn't even known it would pay attention to non-black dither dots. Darker dots don't work with my lighter terrain, though, while lighter dots don't mesh with the darker terrain (see attached).
Regarding the second- I tried to recolor it to magenta- and did get undesired effects. There was no blurring at the boundaries where different terrain types meet, but there were wierd bars. (attached)
Regarding the third- After moving the fish (yes, they're fish) away from the upper-right boundary, I eliminated the yellow dots appearing in the original shown at the beginning of this thread. In the attached below, to the left is a variant graphic; the right, the new one.
Regarding the fourth- Merely crowding the dots, without adding or subtracting, produced the below effect. The results of adding and removing are also attached. However, rearranging the dots so they form a perfect line around the perimeter resulted in the below effect.

It seems there's some logic to this. Has anyone seen a detailed effort to explain dithers, either thread or paper?
 

Attachments

wasn't suggesting that you use a whole lot of dither dots, just stick with the three or four you had at the beginning and change the colour as you did in experiment one.

experiment two is a dead end, i tried that long ago.
three-as you said
four - only useful if you want to have permanent borders for tiles, did this once myself.
 
kobayashi said:
wasn't suggesting that you use a whole lot of dither dots, just stick with the three or four you had at the beginning and change the colour as you did in experiment one.

I wish I had shown the dither of the first attachment, but I simply used the standard dither field. For "Suggestion 1", I changed all the black dots (from the standard) to blue. I'll see what happens when I limit the dither dots to only a small handful.

Further efforts have shown that the dither only applies to the base filler, not special resources. How it applies to Terr2 I havent yet tested, but I suspect they do.
 
What Mercator said. So try reducing the width of the dithered area or placing the fish away from the edges of the tile (you may have to shrink them a little) - or both.

For removing the dither completely, ie, method 2, try the attached tile. I'm not familiar with that banding effect, since I use the ToT game engine and zero dithering works fine.

temurleng said:
Further efforts have shown that the dither only applies to the base filler, not special resources. How it applies to Terr2 I havent yet tested, but I suspect they do.
No, only the base fillers.
 

Attachments

  • NoDither.gif
    NoDither.gif
    1,015 bytes · Views: 197
Wobbegong said:
Try reducing the width of the dithered area or placing the fish away from the edges of the tile.

Moving the fish away worked perfectly. Seems the base filler graphic needs to be a certain distance away from the pink/gray boundary. What do you mean by reducing the width, though? You mean, at the most extreme, a straight up and down line-dither? Or, do you mean make the graphic to be dithered not as wide? Have to try both when I get to my comp.


FYI, after looking at "Sugg 1" on my second pic of this thread, I see Terr2 does use the dither, but the special resources on terr1 dont.
 
temurleng said:
Moving the fish away worked perfectly. Seems the base filler graphic needs to be a certain distance away from the pink/gray boundary. What do you mean by reducing the width, though? You mean, at the most extreme, a straight up and down line-dither? Or, do you mean make the graphic to be dithered not as wide? Have to try both when I get to my comp.
You're reading too much into my comment. Basically I mean: reduce the amount of dithering. See the first attached image (maybe try the second or third patterns).

temurleng said:
FYI, after looking at "Sugg 1" on my second pic of this thread, I see Terr2 does use the dither, but the special resources on terr1 dont.
Take a closer look. It doesn't. Actually, take a look at the screenshot I've attached below. The red, yellow and green tiles are from Terrain1. The dithering between these types is clear. The 3 blue types are all from Terrain2. There is no dithering, except from the underlying base texture (which in this case is pink for all 3). Rivers, which don't dither either, are brown; their underlying bases vary. The white is ocean (from Terrain2). It uses the tile to the left of mouse2 (bottom row in Terrain1) as the base for dithering.

I'm going to have dithering on the brain after this lot. :crazyeye:
 

Attachments

  • DitherTypes.gif
    DitherTypes.gif
    1 KB · Views: 95
  • DitherScreen.gif
    DitherScreen.gif
    10.9 KB · Views: 103
You're attachment (and the attachment I referred to) makes it clear that Terr2 isnt dithered. I think your terrains would be great used for some of those wierd scenarios, like where all the units are children, or blobs.

The dithers you provided look real useful, especially the second and third ones. In the classic civ2, it seems blank dithers arent allowed, though. What a shame.

Wobbegong said:
I'm going to have dithering on the brain after this lot. :crazyeye:
Tell me about it. I'd been playing with that little dither tile for hours before making one post about it here.
 
temurleng said:
I think your terrains would be great used for some of those wierd scenarios, like where all the units are children, or blobs.
Heh. I'll be sure to give those ones a wide berth. ;)

temurleng said:
The dithers you provided look real useful, especially the second and third ones.
I use the third one as standard. I tend to use the really large dithering patterns only in situations where the contrast between terrain types is low – it can look pretty untidy otherwise. No dithering works best on maps which use terrain types with well-defined boundaries, eg, walls, developed areas, streets, tunnels, etc.

temurleng said:
In the classic civ2, it seems blank dithers arent allowed, though. What a shame.
The tile in my first post isn't entirely blank: there are two black pixels in the left and right corners. They should remove the banding effect. Just be careful about the palette index of that grey; it's index 255 (invisible), but if you paste it into an existing file, I'm sure it'll switch to index 16 (identical RGB value, but very visible). It might be best to simply add/remove the black pixels in the original terrain1 file.
 
Well, I tried the second and third dithers. I can post the results, but suffice it to say they produced undesirable results. It seems that, when the dither doesnt have "enough" dots, the game makes them, like in example 2 of suggestion 4 above, or suggestion 2. Could be one of the differences between ToT and classic. I'm not giving up, though: maybe some more playing around will lead to a eureka moment.

Wobbegong said:
No dithering works best on maps which use terrain types with well-defined boundaries.
Which brings me to one of my issues: most of my terrains stand out from each other quite well. In the second attachment I showed on this thread, the light blue water the fish are on is very different from the dark blue around it. I use that dark water several times, and want to use the red volcanoes shown on the first post, but the dither keeps blending radically different terrains into each other. From the examples in this thread, would you say it's better to limit the dither as much as possible (using the fourth example of suggestion 4), or simply grin and bear it, and deal with results like those in suggestion 1?

Oh, and how do you make your attachments something to be clicked on, rather than viewed in the thread, and does it save your allowable attachment memory?
 
temurleng said:
Well, I tried the second and third dithers. I can post the results, but suffice it to say they produced undesirable results. It seems that, when the dither doesnt have "enough" dots, the game makes them, like in example 2 of suggestion 4 above, or suggestion 2.
I don't seem to be getting what you're getting (see below).

Wobbegong said:
No dithering works best on maps which use terrain types with well-defined boundaries.
By this I mean in situations where clean and distinct boundaries are desirable. As a general rule, if you're using terrain types which contrast strongly in hue and/or brightness then you'd want at least some dithering to help them blend.

temurleng said:
From the examples in this thread, would you say it's better to limit the dither as much as possible (using the fourth example of suggestion 4), or simply grin and bear it, and deal with results like those in suggestion 1?
Well it's a trade-off between the amount of dithering and the size of the "radically different" object in the centre of the tile. In the fish example, I'd keep the dithering standard and reduce the size of the fish until it no longer "spilled" into adjacent tiles. If following resizing, the fish began to resemble a blob, then I'd consider trimming the dither.

I've attached some examples below. The screenshots are taken from Civ2:FW. The terrain graphics are from BeBro's SubWars scenario. The fish were reduced to 75% of the original size. In pic 1 there's no dithering at all. I found that you can in fact have zero dithering in FW, providing the diamond shape has palette index 253 (magenta) and the remaining areas (especially the 2 pixels at the extreme left and right corners) have index 255 (grey, purple or teal – depending on the palette). In pics 4 and 5, you'll notice that pixels from the fish begin to fall into adjacent tiles. Out of those my preference would be 3. However, with that volcano you may find that dither pattern 2 is more suitable. It's your call.

temurleng said:
Oh, and how do you make your attachments something to be clicked on, rather than viewed in the thread, and does it save your allowable attachment memory?
It happens if you attach more than one file; they do in fact occupy your allowable attachment space.
 

Attachments

  • DitherFish.gif
    DitherFish.gif
    21.9 KB · Views: 186
Well, I've been playing with your dithers for a while. The results are attached below. Comparing your results and mine, it seems something about either my game or my method of saving doesn't tolerate a small number of dither dots. To get those possibilities out of the way: My current Civ2 version is "2.4, custom 8", and (since my PSP8 is acting up) I'm using PSP 3.11, saving as CompuServe GIF, version 89a- non-interlaced.
Interestingly, the grassland square at the bottom of Terr1, fourth from the left, suddenly appeared when I tried the two-dot dither. I read somewhere that it wasn't known what it's for. In the example attached below, the blue/brown stuff in the lower and upper left is my coastline. Those green triangles are in every tile that is adjacent to an "ocean" square (but is, in fact, land). What the tile is for, though, I don't know.

Although I still haven't found a "perfect" dither, I think the dithers you've given me have gotten me closer. I've created some that I'm almost satisfied with. Thanks so much for the help.
 

Attachments

temurleng said:
To get those possibilities out of the way: My current Civ2 version is "2.4, custom 8", and (since my PSP8 is acting up) I'm using PSP 3.11, saving as CompuServe GIF, version 89a- non-interlaced.
That's not the problem. The problem is that you removed the diamond outline (palette index 255) from the tile. In Civ2 MGE or less you can't have the background consisting entirely of magenta (index 253) otherwise you'll end up with the results you're getting. You may have problems rectifying this if index 255 in your terrain1.gif file is grey (#878787) as it's the same colour as index 16. Whenever you try to select 255, your graphics editor will always switch to 16 and you'll end up with the problem shown in the attachment below. In this case your best bet is to either load the palette from units.gif (maintaining indexes – important!) or edit the colour of index 255. If you don't have the software to do this (MS Paint isn't good enough), post your terrain1.gif file here.

temurleng said:
Interestingly, the grassland square at the bottom of Terr1, fourth from the left, suddenly appeared when I tried the two-dot dither. I read somewhere that it wasn't known what it's for. In the example attached below, the blue/brown stuff in the lower and upper left is my coastline. Those green triangles are in every tile that is adjacent to an "ocean" square (but is, in fact, land). What the tile is for, though, I don't know.
Wobbegong said:
The white is ocean (from Terrain2). It uses the tile to the left of mouse2 (bottom row in Terrain1) as the base for dithering.
:mischief:
 

Attachments

  • GreyDiamond_Index16.gif
    GreyDiamond_Index16.gif
    5.7 KB · Views: 162
Wobbegong said:
The problem is that you removed the diamond outline (palette index 255) from the tile.

I'm pretty certain I didn't, but I'll try it again. I've used the pure pink box for other terrains and units w/o a problem, but maybe it's cause it's the dither. The way I get around MSPaint changing the color to 16 is by having a hollow 255 diamond (w/o the pink) in the terr1 file I'm editing. It is appropriately indexed and I can select it, hold down control and drag it to the desired spot.

Oh, and when you post my statement, then follow it with yours, and then ":mischief:" , are you trying to suggest there might be some connection? :D :wallbash:
 
This is still alive? :eek:

temurleng said:
I'm pretty certain I didn't, but I'll try it again.
Well, there's no index 255 in your last attachment. The backgrounds consist entirely of magenta. Rather obvious I would've thought.

temurleng said:
I've used the pure pink box for other terrains and units w/o a problem, but maybe it's cause it's the dither.
Yep.

I should point out that the dithering in ToT is exactly the same as that of older versions. I looked at some of my scenario files recently and found that the reason I never had any banding problems with zero dithering was because I'd been doing it as per pic 1 (my attachment) all along. Because I use the Mercator-style smooth tiles, the pixels at the left and right corners of the diamond were always of the secondary transparent colour (defined by the pixel in the top-left corner of the tile box in ToT - equivalent to index 255 in older versions).
 
Wobbegong said:
This is still alive? :eek:
Yeah, I can't believe it either. But, by changing the color of the dither dots, their location, selecting new terrains so they didn't vary in color as much, putting the 255 triangles around and editing the terrains a little, I got the dither to finally behave. (mostly)
Wobbegong said:
Well, there's no index 255 in your last attachment. The backgrounds consist entirely of magenta. Rather obvious I would've thought.
I'd tried it between the two posts, but got some (forgotten) undesireable results. No worries now.

Regarding the Mercator link: I'd seen it before and I figure if I stare at it long enough, it'll suddenly make sense.
 
Back
Top Bottom