Identifying objects in sprite sheets - Printable Version +- The VG Resource (https://www.vg-resource.com) +-- Forum: Archive (https://www.vg-resource.com/forum-65.html) +--- Forum: July 2014 Archive (https://www.vg-resource.com/forum-139.html) +---- Forum: Other Stuff (https://www.vg-resource.com/forum-6.html) +----- Forum: Questions, Info, and Tutorials (https://www.vg-resource.com/forum-89.html) +----- Thread: Identifying objects in sprite sheets (/thread-17064.html) |
Identifying objects in sprite sheets - jeapostrophe - 04-03-2011 First, I apologize if this is a stupid question. I've tried to search for the answer on the site, general internet, and the forums. Now, the question, when I look at most sprite sheets on this site, such as http://www.spriters-resource.com/nes/supermariobros/sheet/6189 or http://www.spriters-resource.com/nes/supermariobros/sheet/21195 There does not seem to be any "index" into the sprites. For example, I would expect that there would be some formula such as "Each sprite is 32x32 with a 1 pixel margin, starting after a 50 pixel header". In some cases, this can be discovered, for example: http://www.ladyada.net/images/fuzebox/SMB-Tiles.gif has 16x16 sprites with 1px margins. Is there some standard way to identify the individual objects? In the second Mario one linked above, I could imagine writing a program that would look at the transparent border and the background color on each object to identify the offsets for the pieces, but that strategy doesn't look like it would work on the first one. Am I missing something obvious or is the answer just "hard work and manually figuring it out"? Thank you very much, Jay RE: Identifying objects in sprite sheets - Rosencrantz - 04-04-2011 Really, people mostly rip sprites and throw them up on tSR. I don't think a whole lot of people think about indexing when arranging sheets; since they are mostly intended for fanworks and visuals, they are often presented in a nice, visually pleasing matter. I'm not saying people don't do the arrangements in a way to help people such as animators and the like have easy access to pulling the frames off of a sheet and animating them, but a lot of the sheets on tSR (and I'm sure this applies to other sites) are just however the ripper felt like arranging them. If you want indexing, you unfortunately need to figure it out for yourself : ( RE: Identifying objects in sprite sheets - TheouAegis - 04-19-2011 Sorry for bumping this after a couple weeks, but just wanted to also point out to the OP that, understanding his question and his frustration (I'm one of the arrangers Rosencrantz mentioned), even when you do find a sheet that looks like everything's arranged neatly and organized, it's not always guaranteed. I have seen many sheets have 3 or 4 sprites in a row aligned correctly, then suddenly sprites are 1 pixel off, even within the same animation index (or whatever you want to call it). Then you have arrangers like me who sometimes try to align sprites how the arranger thinks they should be (logically), but which may in fact be completely wrong. (I was doing this with Dragon Force sprites as I was organizing them... realized I got most of them all wrong, shifted left when i should have shifted right and so on.) So as Rosen said, unfortunately it's up to your powers of deduction and reasoning. Or rip the sprites yourself (what i'm doing for my Castlevania game I'm programming). RE: Identifying objects in sprite sheets - jeapostrophe - 04-19-2011 Thanks for the responses. Some follow-up... I wrote a little program to do a connect component labeling on the sheet where I first manually select the background color. In most cases, this works, but sometimes a sprite will have a few pixels (think sparks) that aren't actually connected. So, I have a configurable neighborhood-size that I can increase in these circumstances. My program then shows me the sprites one-by-one so I can give them a meaningful name/sequence number and its outputs a data structure containing OpenGL texture coordinates. This works perfectly on the most bizarre sprite sheets I've found on tSR. The Wikipedia article on this algorithm is very good: http://en.wikipedia.org/wiki/Connected_Component_Labeling Jay RE: Identifying objects in sprite sheets - dan334477 - 06-23-2011 Inspired by this thread, I created a Java program to do what jeapostrophe described. I got in contact with him and he sent me off in the right direction. If anyone is interested, you can get it here (free and open source): http://fluffynukeit.com/software/sprite-clipper/ Or if you want you can search on youtube for Sprite Clipper and you should find a video demo. Sorry to bump this thread, but I read the rules and I think this constitutes a substantial enough contribution to the thread to warrant a bump. Plus if anyone finds this thread through Google, having the info here would be a plus. This is not at all meant to be self-serving. I don't have any ads on my site presently or have any monetary interest here. I just made this program to help myself out in my quest to learn some game development skills. Hopefully others will find this useful as well. |