Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-09-11 04:10:41

stag019
Idea Killer
Registered: 2011-01-05
Post 12/630

Pokemon Generation I Graphics Compressor

Pokemon Generation I Graphics Compressor

The instructions are on the page. It picks which interpretation compresses the best and gives you that one (except for in the secret debug mode, which isn't that hard to find as long as you know how to _REQUEST it). It doesn't do that very efficiently though, as it just tries every single one and then gives you the smallest one.

Note: This page may at some time move, or be removed altogether. I'll try to edit the post should that happen.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#2 2011-09-26 06:01:54

286/703

Re: Pokemon Generation I Graphics Compressor

Have you released the source? Will you release the source?

#3 2012-01-31 18:20:30

stag019
Idea Killer
Registered: 2011-01-05
Post 132/630

Re: Pokemon Generation I Graphics Compressor

Yes


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#4 2012-06-27 12:02:01

Danny-E 33
Administrator
Registered: 2012-06-09
Post 9/1,119

Re: Pokemon Generation I Graphics Compressor

stag019 wrote:

Note: This page may at some time move, or be removed altogether. I'll try to edit the post should that happen.

If that happens, will you be able to put it back up somewhere else so it can still be accessed? Or maybe at that point, would it motivate you to write it in C or some programming language? Also, what is Romendo? Does it have a home page of some kind? I've only ever been able to find Romendo pages that have /stag019 in them... :P

Offline

#5 2012-06-27 23:04:21

stag019
Idea Killer
Registered: 2011-01-05
Post 176/630

Re: Pokemon Generation I Graphics Compressor

Danny-E 33 wrote:
stag019 wrote:

Note: This page may at some time move, or be removed altogether. I'll try to edit the post should that happen.

If that happens, will you be able to put it back up somewhere else so it can still be accessed? Or maybe at that point, would it motivate you to write it in C or some programming language? Also, what is Romendo? Does it have a home page of some kind? I've only ever been able to find Romendo pages that have /stag019 in them... :P

If I move it, I'll try to post the new link in every place I've ever posted it at, but no guarentees if I'm even still around these parts of the internets when that time comes. And I've tried to convert it to C, but I haven't really had the time and I'm still not that great at C. I'll try again at some point I hope.

As far as what romendo is, it's a long story. The main point of the story though is that now Romendo is defunct, but the guys that owns the hosting still lets me have access, so I just use it for my personal files.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#6 2012-07-26 14:32:48

stag019
Idea Killer
Registered: 2011-01-05
Post 182/630

Re: Pokemon Generation I Graphics Compressor

Just to let everyone know, I finally ported it to C. The source is here on pastebin. Next step is to make an easy tool to convert PNG's (and probably BMPs since it's easy enough) into the 2bpp format for Gameboy.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#7 2012-07-28 04:53:53

Danny-E 33
Administrator
Registered: 2012-06-09
Post 70/1,119

Re: Pokemon Generation I Graphics Compressor

stag019 wrote:

Just to let everyone know, I finally ported it to C. The source is here on pastebin.

Awesome! I'll give you my thoughts on it when I have time to take a look at it. But I'm sure I'll love it!

stag019 wrote:

Next step is to make an easy tool to convert PNG's (and probably BMPs since it's easy enough) into the 2bpp format for Gameboy.

This sure would speed up the process! :P I would have no idea how such a program would work, but I'm sure you can figure it out! Good luck! :)

Offline

#8 2012-09-15 06:58:03

Danny-E 33
Administrator
Registered: 2012-06-09
Post 125/1,119

Re: Pokemon Generation I Graphics Compressor

I found a bug in your compression tool today. The online version, at least. I'm gonna try to explain this as best as I can.

Some time ago, I used your tool to compress every front/back sprite of the Pokemon sprites I'm using for my hack. Since I haven't had 6x6 back sprites working til now, I only inserted the starter families backsprites and I just delt with them looking buggy.

But now that they are displaying appropriately, I can see that Venusaur and Blastoise's sprites didn't compress correctly. From what I could tell, the layers of the light shade and the dark shade were not correctly aligned - one layer of color was shifted about 1 tile up.

I remade the 2bpp file in TileMolester, then remade the compressed file in your tool but got the same result. Then I downloaded WoodPression and tried that out using the same 2bpp files that I'd been using.

When I compared the two compressed Venusaur sprites in a hex editor, the first even-half of the two files were identical, but the second even-half were entirely different.
This was also true for the compressed Blastoise sprites. Exactly the first half was identical, but the second half didn't resemble eachother at all.

When I put the new file from WoodPression into the rom, it worked just fine for both Venusaur and Blastoise. I found it strange that the other 7 Pokemon from the starters' families worked without any problems in your program.

I hope you're able to figure out the problem, cause I know I can't help explain any of the technical stuff :P

Offline

#9 2012-09-15 07:16:57

stag019
Idea Killer
Registered: 2011-01-05
Post 209/630

Re: Pokemon Generation I Graphics Compressor

Would you be able to supply the 2bpp files that aren't working as examples? It would be a lot easier to figure it out.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#10 2012-09-15 18:24:26

Danny-E 33
Administrator
Registered: 2012-06-09
Post 126/1,119

Re: Pokemon Generation I Graphics Compressor

I've never used MediaFire before or anything like that, but I made an account and tried it out. Let's hope I did it all correctly :P

Here is Venusaur's 6x6 backsprite 2bpp binary file.
This is the same 2bpp file I used with your compressor and Sawakita's compressor that come up with different results.

I also forgot to mention, when I was comaring the two compressed images from you and Sawakita, they were exactly the same length. It's just that the second half of them were nothing alike. Does this mean each of the two programs attempted the same compression interpretation?

Offline

#11 2012-09-15 23:14:09

stag019
Idea Killer
Registered: 2011-01-05
Post 211/630

Re: Pokemon Generation I Graphics Compressor

That was a 7x7 frontsprite. Lemme see if I can get it myself...


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#12 2012-09-15 23:47:13

stag019
Idea Killer
Registered: 2011-01-05
Post 212/630

Re: Pokemon Generation I Graphics Compressor

Okay, I just did it and you were indeed right. As far as why, I still have to investigate. In the meantime, you could compile my C program, which did successfully compress it.

http://pastebin.com/gUpEP6JD


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#13 2012-09-16 05:16:30

Danny-E 33
Administrator
Registered: 2012-06-09
Post 128/1,119

Re: Pokemon Generation I Graphics Compressor

Oh crap... I uploaded the wrong file... well that's embarrassing... I guess if you figured it out, no need to reupload it. Sorry for the hassle :P

And could you give me a crashcourse in compiling a program? I haven't come across a clear explination.

Offline

#14 2012-09-16 09:16:23

stag019
Idea Killer
Registered: 2011-01-05
Post 214/630

Re: Pokemon Generation I Graphics Compressor

I fixed it anyways. The reason the C program didn't show the error is because it doesn't choose the most efficient method for some reason. But anyways I fixed the online tool. When I compared the bit streams of my version vs Sawakita's version, I noticed my version was only off because it had two more bits of zeros added in. When searching through the source I noticed two zeros are always added after every data packet. On a hunch, I decided that since the error was right in the middle of the file, that perhaps data packets did not need the two zero bits if they were at the end of a compressed stream. I reread the document to see "After the 00-bit-group an RLE packet must follow. " which supports that theory. I changed the online tool and poof, Vensaur's worked.

It's very likely that this bug could have effected a large number of sprites, but the fact it's been used so infrequently means that no one has noticed yet (or someone did and didn't care to share with me). Thank you for putting it to good use, and reporting your bug. I hope that if there are any more bugs, you run across them while you're working on this project so that I may clean this program of all of its bugs.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#15 2012-09-16 15:57:21

Danny-E 33
Administrator
Registered: 2012-06-09
Post 129/1,119

Re: Pokemon Generation I Graphics Compressor

That's very interesting. Well I'm glad you got it all sorted out!

So why is it that out of all the sprites I've tested, that error has only occured on Venusaur's and Blastoise's backsprite? Is that because those are the only two sprites so far that have used that specific interpretation?

Offline

#16 2012-09-16 17:58:01

stag019
Idea Killer
Registered: 2011-01-05
Post 215/630

Re: Pokemon Generation I Graphics Compressor

Danny-E 33 wrote:

That's very interesting. Well I'm glad you got it all sorted out!

So why is it that out of all the sprites I've tested, that error has only occured on Venusaur's and Blastoise's backsprite? Is that because those are the only two sprites so far that have used that specific interpretation?

Not even that. They were probably the only ones that the first compression stream ended on a data packet.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#17 2012-10-10 04:49:31

Danny-E 33
Administrator
Registered: 2012-06-09
Post 161/1,119

Re: Pokemon Generation I Graphics Compressor

Hey stag019, quick question. The Data Crystal Red/Blue ROM Map notes the end of the sprites in each bank differently than what your sprites and offsets chart says they end.

For example, in bank 09, Data Crystal says the sprites go longer and don't stop until 0x27DAF but your chart says the last sprite in that bank ends at 0x27D6B. This is also true for banks 0A and 0C.
But Data Crystal lists the sprite data as being shorter than you chart shows for banks 0B and 0D.

I know Data Crystal is much less detailed than your chart and your chart decompresses all the sprites as it is loaded, so do you trust your offsets more than Data Crystal?
And should I assume that the extra code that Data Crystal is including as sprite data is unrelated and I should leave it alone?

stag019 wrote:

Next step is to make an easy tool to convert PNG's (and probably BMPs since it's easy enough) into the 2bpp format for Gameboy.

Also, has there been any initiative taken for this?

Offline

#18 2012-10-10 08:36:53

stag019
Idea Killer
Registered: 2011-01-05
Post 223/630

Re: Pokemon Generation I Graphics Compressor

Danny-E 33 wrote:

Hey stag019, quick question. The Data Crystal Red/Blue ROM Map notes the end of the sprites in each bank differently than what your sprites and offsets chart says they end.

For example, in bank 09, Data Crystal says the sprites go longer and don't stop until 0x27DAF but your chart says the last sprite in that bank ends at 0x27D6B. This is also true for banks 0A and 0C.
But Data Crystal lists the sprite data as being shorter than you chart shows for banks 0B and 0D.

I know Data Crystal is much less detailed than your chart and your chart decompresses all the sprites as it is loaded, so do you trust your offsets more than Data Crystal?
And should I assume that the extra code that Data Crystal is including as sprite data is unrelated and I should leave it alone?

Yes, my charts are accurate. I assume when Koolboyman wrote his ROM map, he simply only mapped out what he knew, and from there just sort of assumed how much each bank was filled with pictures. If you take a look at the Pokered disassemby, you can see, for example, stuff in bank A clearly is something useful but not an image (there's a text pointer to "xxx was seeded!", the leech seed text string).

Danny-E 33 wrote:
stag019 wrote:

Next step is to make an easy tool to convert PNG's (and probably BMPs since it's easy enough) into the 2bpp format for Gameboy.

Also, has there been any initiative taken for this?

Yes, but once again it's an online tool and I haven't cared enough to try to write it in C yet. I wrote this a while ago and don't quite remember how it works, but it's located here.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#19 2012-10-10 15:13:07

Danny-E 33
Administrator
Registered: 2012-06-09
Post 162/1,119

Re: Pokemon Generation I Graphics Compressor

stag019 wrote:

Yes, my charts are accurate. I assume when Koolboyman wrote his ROM map, he simply only mapped out what he knew, and from there just sort of assumed how much each bank was filled with pictures. If you take a look at the Pokered disassemby, you can see, for example, stuff in bank A clearly is something useful but not an image (there's a text pointer to "xxx was seeded!", the leech seed text string).

Cool cool. I just wanted to be certain.

stag019 wrote:

Yes, but once again it's an online tool and I haven't cared enough to try to write it in C yet. I wrote this a while ago and don't quite remember how it works, but it's located here.

Awesome, I'll have to take a look at this tonight. I'm pretty excited to have something way easier than Tile Molester! :D

Offline

#20 2012-10-11 02:38:35

Danny-E 33
Administrator
Registered: 2012-06-09
Post 163/1,119

Re: Pokemon Generation I Graphics Compressor

Alright, so here are my thoughts:

Some of the sprites I tested (Bulbasaur and Ivysaur) after I hit "imageto2bpp" showed maany lines that said:
Notice: Uninitialized string offset: [576-783] in /home/gamingg/stag019.net/pokedex/2bpp.php on line [124/125]
Then the images and dropdowns were at the bottom of the page and seemed to work fine.

For the four sprites I tested today (Bulbasaur, Ivysaur, Venusaur, and Beauty) the order that the colors appeared in your tool was usually black-light shade-white-dark shade. But sometimes the light and dark shade were switched. But black and white were always 0 and 2. This isn't an error, of course, but it was odd. So logically, I have to change the order of the dropdowns from 0-1-2-3 to correctly match the order of Red's palette order which would be 3-1-0-2 (or 3-2-0-1 if the light and the dark shade were switched, which only happened for Bulbasaur)

After I did this and then downloaded the 2bpp binary files, I compared them with the 2bpp files I already made with Tile Molester and realized none of them were the same...
So I compressed them and inserted them into a rom and noticed all four sprites used black correctly. So making the dropdown for black (which was always the first color) be 3 instead of 0 seems to always work, just like it logically should.
But the other three colors were always in a random order. White was always displayed as either where the light or dark shade should be. And where white should be (the background of the sprite) was always light shade or dark shade. And I cannot find any pattern as to how to know the correct order because it never seems to be consistent. So I always have to put 2 or 3 in the dropdown for the white color in your tool, but I don't know which one until I compress it, insert it, and test it...

Also, I cannot make any sense of the second picture that your tool displays... Of course it's the same image but fitted into a 7x7 tile window, but the palettes associated with the image never makes any sense either.
It doesn't seem to illistrate:
1) The default palette numbers in the dropdowns (black never showed up where white was supposed to be, since black is color 0 by default in your tool)
2) The correct order of the colors, white-light shade-dark shade-black (obviously, since the preview image in your tool doesn't have any of the four colors in their correct places, it doesn't match the right order)
3) The true, random order that the colors need to be labled in order to work (once I finally do decode the real order of the dropdowns necessary to display the image correctly, it doesn't make sense with the way the colors are displayed with the preview image in your tool)

Finally, Venusaur had two whites and no green... O_o
The order your tool used was black-white-white-pink...

Offline

#21 2012-10-11 03:24:09

stag019
Idea Killer
Registered: 2011-01-05
Post 224/630

Re: Pokemon Generation I Graphics Compressor

Like I said, this is a very work in progress. The PHP notices are because it expect an exact certain size (7x7 probably) and if it's not it tries to read data tat doesn't exist. As for the color mapping, I haven't really figured out a way to make it consistent, or there wouldn't be those dropdowns in the first place.

But yeah, one of these days I'll work on it again.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#22 2012-10-11 04:07:05

Danny-E 33
Administrator
Registered: 2012-06-09
Post 164/1,119

Re: Pokemon Generation I Graphics Compressor

Oh, sorry I didn't know this was a work in progress still, I thought I was just reporting a bug.
Well I know I would put it to good use if you finished it :) It's a great start though.

Offline

#23 2012-11-21 01:32:18

Danny-E 33
Administrator
Registered: 2012-06-09
Post 267/1,119

Offline

#24 2013-08-07 20:09:11

Danny-E 33
Administrator
Registered: 2012-06-09
Post 622/1,119

Re: Pokemon Generation I Graphics Compressor

Hey stag, all of your Romendo pages are down. Are they hosted anywhere else right now?

Offline

#25 2013-08-08 03:10:53

stag019
Idea Killer
Registered: 2011-01-05
Post 484/630

Re: Pokemon Generation I Graphics Compressor

[00:06:01] <stag019> gamingg
[00:36:16] <GamingG> stag019
[00:42:33] <stag019> there he is
[00:43:17] <stag019> when is my stuff gonna be up?
[00:43:56] <stag019> at the very least people are depending on my online compressor tool
[00:44:02] <stag019> even though i did rewrite it in C
[01:00:06] <stag019> gamingg
[02:26:17] <stag019> gamingg is a miserable failure btw
[03:13:58] |<-- GamingG has left nucleus.kafuka.org (Client closed the connection)
[03:14:14] <stag019> fuck you too
[03:14:15] <stag019> asshole
[03:14:27] -->| GamingG (Yehoshua@173.216.104.247) has joined #botplace
[03:15:33] <stag019> [03:13:58] |<-- GamingG has left nucleus.kafuka.org (Client closed the connection)
[03:15:33] <stag019> [03:14:14] <stag019> fuck you too
[03:15:33] <stag019> [03:14:15] <stag019> asshole
[03:15:33] <stag019> [03:14:27] -->| GamingG (Yehoshua@173.216.104.247) has joined #botplace
[09:50:37] |<-- GamingG has left nucleus.kafuka.org (Client closed the connection)
[09:51:00] -->| GamingG (Yehoshua@173.216.104.247) has joined #botplace
[14:08:11] |<-- GamingG has left nucleus.kafuka.org (Client closed the connection)

Spliced up.
He hasn't been around since.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

Board footer

Powered by FluxBB