Quote:Original post by wyrd
Not sure how that'd work since any given tile can have multiple color variations. Perhaps you could elaborate?
Quote:
... It does this by simply going through the pixels within and area and direction and detects whether or not it is the background color.
...the background is not one single color. It is a bunch of 32x32 images are multitudes of colors, especially when overlaying another...
What I am suggesting is apply the techniques that you described, but use the alpha value instead of the pixel color - this is only possible if you do not draw with the alpha. You said that it simply goes through the pixels within an area and direction and detects whether or not it is the background color. Instead of using the background color - test it with the alpha value - which you would have set manually. This way, you are only working on a scale of 0-255 and since the image is not being drawn with the alpha, the values do not matter. I will try to illustrate it with words a little better:
Let's say you have a 32x32 grass tile. It does not use the alpha value of the pixel components. You can set the alpha value for all pixels to 0 for full passability and no objects are there. Now, since you are using layers - everytime you check for passability you will be adding up all the layer's alpha values. Since they are all 0 currently the tile is passable and can be moved onto freely. Now this will start to get more complext, but I hope I do not lose you. Now, lets skip over the fact that some tiles may not be passable by nature - such as water - and move to characters. If you set the alpha value of them to lets say 1, you will noe be able to check to see if a set of pixel's has a collision. If we have 5 layers of free grass - it is 0 + 0 + 0 + 0 + 0 = 0. Then, an enemy moves there, so some pixels are now 1. When you are doing the collision checking, if the result is 2, then you know there was a collision between 2 bots at some pixel point.
Can you see what I am saying now, or do I need to exaplain more? This is all theoretical - I have not ever tried this method, but I would think that it would work - as long as the sensors/whiskers method you are describing using background colors works.