+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  How difficult is it to implement compression on a NES game?
Pages: [1]
Author Topic: How difficult is it to implement compression on a NES game?  (Read 1328 times)
Kitsune Sniper
Guest
« on: June 28, 2007, 01:00:35 am »

I'm stuck with Pizza Cats. I can't get the script any smaller than 10783 bytes - and there's only 7255 bytes of space in the game itself. If the game used more than one bank for the text, then there wouldn't be a problem, but I'm not so lucky.

I already tried using ScriptCrunch. Even with the highest compression settings, I can't get it to lower the size of the insertable script. The game uses MTE by default, using one byte to call each substring. So the only plausible solution is a more powerful compression scheme... unless someone can figure out how to make scriptcrunch compress everything.

And I had planned to release this tomorrow, but it won't happen, as usual. So. Help?
Bongo`
Guest
« Reply #1 on: June 28, 2007, 06:09:19 am »

Quote from: Kitsune Sniper on June 28, 2007, 01:00:35 am
I'm stuck with Pizza Cats. I can't get the script any smaller than 10783 bytes - and there's only 7255 bytes of space in the game itself. If the game used more than one bank for the text, then there wouldn't be a problem, but I'm not so lucky.

I already tried using ScriptCrunch. Even with the highest compression settings, I can't get it to lower the size of the insertable script. The game uses MTE by default, using one byte to call each substring. So the only plausible solution is a more powerful compression scheme... unless someone can figure out how to make scriptcrunch compress everything.

And I had planned to release this tomorrow, but it won't happen, as usual. So. Help?

Hey! What's up, Kit. Mind if I have a look at the ASM text routine if you have that located
and the full ROM name? I wouldn't mind having a look at it. Smiley
Nightcrawler
Guest
« Reply #2 on: June 28, 2007, 08:15:27 am »

If the game already uses MTE, you should be getting decent compression yields. One option if it's not enough is to expand the MTE table. Are you using all 256 possible values already? Of course, you'll probably tell me you only have enough room to use whatever space the original game's MTE table took up. How about relocating that? Or splitting it up by halfs. Maybe above 0x7F goes one place and below goes another? That would require some small ASM hacking though.

I'd also wonder how much RAM space is free in the game. You may be able to rig something up with a different compression scheme or table in memory as well.
Kitsune Sniper
Guest
« Reply #3 on: June 28, 2007, 09:28:27 am »

Quote from: Nightcrawler on June 28, 2007, 08:15:27 am
If the game already uses MTE, you should be getting decent compression yields. One option if it's not enough is to expand the MTE table. Are you using all 256 possible values already? Of course, you'll probably tell me you only have enough room to use whatever space the original game's MTE table took up. How about relocating that? Or splitting it up by halfs. Maybe above 0x7F goes one place and below goes another? That would require some small ASM hacking though.

I'd also wonder how much RAM space is free in the game. You may be able to rig something up with a different compression scheme or table in memory as well.

There's only a limited amount of space for MTE values, and I think I can only use about 30 or 40 entries. I can change it to a dictionary (the original script used DTE/MTE/Dictionary values), but that requires even more space... The most I managed to crunch teh script was about 28% but that required a ton of substring space I didn't have.

And, joneeman (I can't recall the exact spelling Sad ) added an anti-piracy bootup intro to the game, so I dunno if that'll get in the way.

bongo`, I'll send you an email later today, I have to go to work so I'll be gone for most of the morning. K?
Ryusui
Guest
« Reply #4 on: June 28, 2007, 11:43:47 pm »

Talk to RedComet. He works miracles with Huffman. (Patlabor will still likely never see the light of day, thanks to the evil masterminds at Interbec, but his Huffman docs and code made the prospect of cramming a full English script into the game a reality.)
Kitsune Sniper
Guest
« Reply #5 on: June 29, 2007, 12:00:00 am »

Well, holy hell. I got some help from Klarth but I couldn't get the text past 9k...

And I was looking at my original project files and found that RedComet had already helped me a bit by changing the MTE code lookup table. It used to be two bytes per substring, but he made it one byte per substring instead. It may be much simpler to just ignore RedComet's original hack, and go with something even more powerful, I guess.

-_- I feel so useless.

I sent the files already. Hope you can do something with them.
« Last Edit: June 29, 2007, 12:17:28 am by Kitsune Sniper »
Bongo`
Guest
« Reply #6 on: June 29, 2007, 06:24:01 am »

Quote from: Ryusui on June 28, 2007, 11:43:47 pm
Talk to RedComet. He works miracles with Huffman. (Patlabor will still likely never see the light of day, thanks to the evil masterminds at Interbec, but his Huffman docs and code made the prospect of cramming a full English script into the game a reality.)

Hehe. I was thinking about using a huffman routine with a maximum of 384 byte header.
Maybe add in a little LZ per string function too. I have been working on something like
that for a while now. I wanted to implement it in a Snes game first.

Kit:
Glad to see you are getting TONS of help. I wish you luck, brother. Smiley
Kitsune Sniper
Guest
« Reply #7 on: June 29, 2007, 10:38:09 am »

Quote from: Bongo` on June 29, 2007, 06:24:01 am
Quote from: Ryusui on June 28, 2007, 11:43:47 pm
Talk to RedComet. He works miracles with Huffman. (Patlabor will still likely never see the light of day, thanks to the evil masterminds at Interbec, but his Huffman docs and code made the prospect of cramming a full English script into the game a reality.)

Hehe. I was thinking about using a huffman routine with a maximum of 384 byte header.
Maybe add in a little LZ per string function too. I have been working on something like
that for a while now. I wanted to implement it in a Snes game first.

Kit:
Glad to see you are getting TONS of help. I wish you luck, brother. Smiley
Did ya get the email? I sent it from my hotmail account, but it had three attachments so I dunno if you got it or not.
Bongo`
Guest
« Reply #8 on: June 30, 2007, 07:09:23 am »

Quote from: Kitsune Sniper on June 29, 2007, 10:38:09 am
Quote from: Bongo` on June 29, 2007, 06:24:01 am
Hehe. I was thinking about using a huffman routine with a maximum of 384 byte header.
Maybe add in a little LZ per string function too. I have been working on something like
that for a while now. I wanted to implement it in a Snes game first.

Kit:
Glad to see you are getting TONS of help. I wish you luck, brother. Smiley
Did ya get the email? I sent it from my hotmail account, but it had three attachments so I dunno if you got it or not.

Yea I got it. I'm looking at the code now.
I will need to know a few things though. Script size, space available, etc...

I also need to know what table values ( range from $00 to ?? ) you are using for the standard text.
Non DTE/MTE values. Smiley
Kitsune Sniper
Guest
« Reply #9 on: June 30, 2007, 07:11:53 pm »

Quote from: Bongo` on June 30, 2007, 07:09:23 am
Quote from: Kitsune Sniper on June 29, 2007, 10:38:09 am
Quote from: Bongo` on June 29, 2007, 06:24:01 am
Hehe. I was thinking about using a huffman routine with a maximum of 384 byte header.
Maybe add in a little LZ per string function too. I have been working on something like
that for a while now. I wanted to implement it in a Snes game first.

Kit:
Glad to see you are getting TONS of help. I wish you luck, brother. Smiley
Did ya get the email? I sent it from my hotmail account, but it had three attachments so I dunno if you got it or not.

Yea I got it. I'm looking at the code now.
I will need to know a few things though. Script size, space available, etc...

I also need to know what table values ( range from $00 to ?? ) you are using for the standard text.
Non DTE/MTE values. Smiley
I sent all the data you wanted (and then some) a few hours ago.

Just a thing I forgot to mention - while $00 is -not- used in the script itself, I left it alone because I thought it might use it somewhere I'm not aware of. Mmkay? Thanks. Smiley
Bongo`
Guest
« Reply #10 on: July 15, 2007, 07:26:48 pm »

Yo! How's the game coming along there, buck-o!?  Grin
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC