English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 03 June 2017, 10:35   #21
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,172
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  
Old 03 June 2017, 11:18   #22
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,987
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, 14:22   #23
temisu
Registered User
 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
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, 14:30   #24
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,172
@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 18:39.
jotd is offline  
Old 03 June 2017, 20:02   #25
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
No one tested the Cruncher i posted on #12 ?
Foul is offline  
Old 03 June 2017, 20:48   #26
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,172
Sorry Foul we kind of hijacked the thread with RNC.
jotd is offline  
Old 11 June 2017, 13:50   #27
temisu
Registered User
 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
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, 22:23   #28
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,172
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, 00:19   #29
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Is the RNC format an IFF format?
idrougge is offline  
Old 13 June 2017, 07:27   #30
temisu
Registered User
 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
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, 20:00   #31
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
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, 19:24   #32
temisu
Registered User
 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
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, 13:07   #33
temisu
Registered User
 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
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  
Old 13 April 2019, 13:57   #34
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
Hi temisu,

I am learning c++ and my first project requires me to decompress RNC packed files for SWOS. A couple of questions:

1). Am I able to use your compressor/decompressors? Full credit will naturally be given
2). Due to be very new to C++ what would be the easiest way to incorporate this into my own code. Note I am using QT due to having a GUI for my tool.

Thanks in advance
BippyM is offline  
Old 13 April 2019, 14:59   #35
temisu
Registered User
 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
Quote:
Originally Posted by BippyM View Post
1). Am I able to use your compressor/decompressors? Full credit will naturally be given
I created the project under BSD 2-Clause license, which I think is the most permissive one. You can take the sources modify them as you wish, then combine it whatever you have and you dont even have to share the modifications if you do not want to.

The only requirements is to attach the disclaimer: https://github.com/temisu/ancient_fo...master/LICENSE

If you include the BZIP2 there is one special file (similar conditions):

https://github.com/temisu/ancient_fo...BZIP2Table.hpp

In short, do what you want, share what you want. Just give credit where it is due.

Quote:
Originally Posted by BippyM View Post
2). Due to be very new to C++ what would be the easiest way to incorporate this into my own code. Note I am using QT due to having a GUI for my tool.
Qt is good, just make sure you can do C++14 in your environment.

Depends what you want there are 2 ways to do it assuming you only want RNC. 1. The decompressor(s) can be taken in as a library and the compressor needs to bundled separetely.
2. just taking the bare minimum files needed for RNC, it is not much. Actual decompressor header, buffer, huffman stuff + actual compressor, decompressor.

If you want to use MSVC, you also need some patches that are not on the mainline but I can share later if you wish
temisu is offline  
Old 13 April 2019, 20:44   #36
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
Hi temisu,

QT does support C++14, I just need to enable it in the .pro file. I only need RNC support (decrunch and crunch), so will look to use just the files required for that.

Thank you
BippyM is offline  
Old 16 August 2019, 10:44   #37
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Hey, guys... first off, thank you a lot.. I am using this, and it ->normally works like a charm.

I have one file, though, where I get an "Segmentation Error". It's not even the largest file I am packing (biggest one is 150kb, this one only around 50).

Any idea what may cause this?
Tigerskunk is offline  
Old 16 August 2019, 13:16   #38
temisu
Registered User
 
Join Date: Mar 2017
Location: Tallinn / Estonia
Posts: 74
Quote:
Originally Posted by Steril707 View Post
Any idea what may cause this?
Well, smells like a bug. Is the file something you can share in the zone?
temisu is offline  
Old 16 August 2019, 14:01   #39
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
@Temisu: uploaded it into the zone. "Assetslevel1.bin"..
Thanks for having a look into it...
Tigerskunk is offline  
Old 18 August 2019, 07:17   #40
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Now I have that problem also with another assets file.
The weird thing is, if I just add a pixel in those assets, the problem doesn't show up.

That doesn't work with the first assets file, unfortunately.

Super weird.

Last edited by Tigerskunk; 18 August 2019 at 07:23.
Tigerskunk is offline  
 


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 11:58
What Crunchers do you guys prefer? Plagueis/KRX Coders. General 67 30 July 2014 23:20
Old crunchers absence Coders. General 3 25 June 2012 18:47
ASM - Rolling Thunder sources - accurate delay Asman Coders. General 5 21 September 2010 23:15
Old crunchers for A500/WB1.3? Photon Coders. General 21 03 December 2004 02: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 23:21.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13967 seconds with 13 queries