Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » BITMAP* Comparison

Credits go to CGamesPlay, Kibiz0r, and Matthew Leverton for helping out!
This thread is locked; no one can reply to it. rss feed Print
 1   2 
BITMAP* Comparison
Matthew Leverton
Supreme Loser
January 1999
avatar

I've attached the output of my program.

Just looking at it, it appears to have duplicate tiles though. I'd have to check exact RGB values to see if they really are.

David Layne
Member #2,053
March 2002

I wrote a simple tile ripper a while back for my own use. I needed a way to import old versions of worminator maps into the new build of the game, and since the tile sets had changed all the graphics were out of whack. So, I wrote a little program that would search through the old and new tilesets to find matches, and adjust the tile numbers for the older maps so they line up correctly with the most recent tileset.

Anyway, I adapted my code quickly to search for unique tiles. I get the same results for the first image (with 16*16 tiles), but I also get apparent 'duplicates' when running on the latest image 2 posts back (32 *32 tiles).

After examining the image closely, there is something wrong with the tile alignment on the latest image. I thought the tiles were dupes initially, but after looking closely at them, they are shifted up/down/left/right by 1 pixel. If you look carefully at the source image, some identical tiles are shifted slightly which is causing the duped tiles. For example, look at the upper left house, and compare it to the other 4 houses with the same graphics. If you compare them pixel by pixel, the house in the upper left is very slightly off from the rest when aligned to a 32*32 grid.

So, in this case I believe our tile rippers are working correctly, but there is something funky with the source image.

Jeff Bernard
Member #6,698
December 2005
avatar

David Layne: I noticed that as well, sometime after making that post. It turns out I ripped the map from the game incorrectly. There is a border around the playable field of the map, 31 pixels on the top, 31 pixels on the left, 33 pixels on the right, and 28 pixels on the bottom. For the image that I posted, I had removed some pixels on the bottom to get the dimensions to be correct, but I did not notice that the other borders where off on whole tiles as well.

--
I thought I was wrong once, but I was mistaken.

 1   2 


Go to: