English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 03 June 2017, 11:35   #21
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 1,931
The RNC packer works all right, but is really less effective than the official packer. So resulting packed files cannot replace original blocks in a diskfile. Still useful for file-based games, though.

I fiddled with the parameters (BLOCK_SIZE, etc.) and I only was able to make the compressed file bigger For a 16k file, it compresses to 6900 bytes whereas original packer produces a 6100 byte file size, so the difference is important.
jotd is offline  
AdSense AdSense  
Old 03 June 2017, 12:18   #22
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,578
Quote:
Originally Posted by jotd View Post
The RNC packer works all right, but is really less effective than the official packer. So resulting packed files cannot replace original blocks in a diskfile. Still useful for file-based games, though.

I fiddled with the parameters (BLOCK_SIZE, etc.) and I only was able to make the compressed file bigger For a 16k file, it compresses to 6900 bytes whereas original packer produces a 6100 byte file size, so the difference is important.
If this is specifically for Magic Pockets, I can do a version that is ripped to files instead of sector loading and then there will be zero issues replacing files.
Galahad/FLT is offline  
Old 03 June 2017, 15:22   #23
temisu
Registered User

 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 20
Quote:
Originally Posted by jotd View Post
The RNC packer works all right, but is really less effective than the official packer. So resulting packed files cannot replace original blocks in a diskfile. Still useful for file-based games, though.
This is rather surprising since the compression algorithm itself is very straightforward. Something is broken there, and the code is really bad, I wouldn't try to do non-trivial changes there.

Better to write a new implementation. It should not take more than one evening. I can think about that next week...
temisu is offline  
Old 03 June 2017, 15:30   #24
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 1,931
@Galahad: yes, using WRip provides all the crunched files & the offsets (all files are crunched) but I can also fix my whdload slave to do that / use files + diskfile. I wanted to be able to provide 1 diskimage so it can be used with emulators without whdload or even on a A500+floppy.

@temisu: yes the code is bad. For instance it computes a hash with 3 bytes to identify similar blocks, but what if there are a lot of stray 2-bytes similar blocks? I'm not a big compression expert, though... If you write a better implementation that would really be cool. I only need that to create a fully functional editor / disk packer for Magic Pockets. The rest is already working.

(edit: although I tried to pack my NEW1.PIN new level file with propack and it ended up way bigger than the original level, so it cannot fit on the diskfile, so maybe improving the packer is not worth it, there's a 5-10% size difference only)

Last edited by jotd; 03 June 2017 at 19:39.
jotd is offline  
Old 03 June 2017, 21:02   #25
Foul
Registered User

Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 43
Posts: 1,260
Send a message via ICQ to Foul Send a message via MSN to Foul Send a message via Skype™ to Foul
No one tested the Cruncher i posted on #12 ?
Foul is offline  
Old 03 June 2017, 21:48   #26
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 1,931
Sorry Foul we kind of hijacked the thread with RNC.
jotd is offline  
Old 11 June 2017, 14:50   #27
temisu
Registered User

 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 20
Quote:
Originally Posted by temisu View Post
Better to write a new implementation. It should not take more than one evening. I can think about that next week...
I have to now admit that it actually isn't so easy.

Well, making the compressor was easy, but tuning it is hard. I made the code horrible by testing few things so it is yet another difficult to read implementation (it is also missing leeway calculation which is needed for some assembly decompressors)

(It is still better than the dungeon keeper utilities though )

Anyway. I dumped the current code here in case someone has some good idea how to improve it, or it might be useful for some things as is...

https://github.com/temisu/ancient_fo...e/master/extra
temisu is offline  
Old 12 June 2017, 23:23   #28
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 1,931
That's very good. Is it very difficult to add leeway? That would be cool if you could beat DK compression ratio, or even original compression ratio.

BTW Codetapper referenced our changes: http://codetapper.com/amiga/random-r...orthen-propack

it also contains a few nice benches for speed & efficiency against the original ProPack.
jotd is offline  
Old 13 June 2017, 01:19   #29
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
Is the RNC format an IFF format?
idrougge is offline  
Old 13 June 2017, 08:27   #30
temisu
Registered User

 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 20
Quote:
Originally Posted by jotd View Post
That's very good. Is it very difficult to add leeway? That would be cool if you could beat DK compression ratio, or even original compression ratio.
Well, if we take the test-file you sent earlier. RNC-propack does it in 6100 bytes, DK will do it in 6500. My thingy does it in 6350. So it is not entirely bad but still not good enough

I'll take a fresh look of it later this week and add the leeway as well. It would be waste of effort to leave it in half-working state.

(Probably there is some gotcha-moment to be had)

Quote:
Originally Posted by jotd View Post
BTW Codetapper referenced our changes: http://codetapper.com/amiga/random-r...orthen-propack

it also contains a few nice benches for speed & efficiency against the original ProPack.
This is cool

Quote:
Originally Posted by idrougge View Post
Is the RNC format an IFF format?
Nope, although in theory IFF could be used to contain anything, but I haven't heard that someone tried RNC...
temisu is offline  
Old 13 June 2017, 21:00   #31
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
I ask because I was looking at the data files for UFO: Enemy Unknown yesterday, and they contain the familiar FORM header followed by chunks identified as RNC1…
idrougge is offline  
Old 14 June 2017, 20:24   #32
temisu
Registered User

 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 20
Quote:
Originally Posted by idrougge View Post
I ask because I was looking at the data files for UFO: Enemy Unknown yesterday, and they contain the familiar FORM header followed by chunks identified as RNC1
You can try the scan-functionality of the decompressor I wrote (link in the previous post) to see if it really validates as a RNC1 stream.
temisu is offline  
Old 15 October 2017, 14:07   #33
temisu
Registered User

 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 20
Ok, one last hijack of this thread. Since we already started on the RNC-topic

I (finally) fixed my implementation of the RNC1 compressor. Added leeway. Improved compression efficiency a bit. RNC seems to work best on short block sizes (f.e. 4096 bytes)

It's on my github, should someone want to give it a spin
temisu is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crunchers that support overlays? BarryB support.Apps 9 07 March 2017 12:58
What Crunchers do you guys prefer? Plagueis/KRX Coders. General 67 31 July 2014 00:20
Old crunchers absence Coders. General 3 25 June 2012 19:47
ASM - Rolling Thunder sources - accurate delay Asman Coders. General 5 22 September 2010 00:15
Old crunchers for A500/WB1.3? Photon Coders. General 21 03 December 2004 03:14

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:40.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.19518 seconds with 14 queries