Page 1 of 1

Why ! : Ogre & 7Zip

Posted: Mon Feb 08, 2010 3:42 pm
by n9ine
Hi all;

Why not use 7zip as zipArchive since zip is an old format?
Zlib is a dead project and since 2005 this project is no more maintained and lot of bugs were found.

Hope interested people give there point of view about this and give hints to how this can be done.

Re: Why ! : Ogre & 7Zip

Posted: Mon Feb 08, 2010 8:42 pm
by syedhs
Well the issue has already been raised here.

If you read the thread, it basically boils down to having self-extracting 7zip done automatically in linux - I wonder how it is done?

Re: Why ! : Ogre & 7Zip

Posted: Tue Feb 09, 2010 12:32 am
by nbeato
Maybe I missed something, but that thread is talking about downloading the OGRE library. I think the question was regarding archive support importing (Zip=blah.zip in a resource config).

Edit: I can't really, tell I think he's actually asking why resource configs don't import 7z files instead of older zip files... but there's no reason that can't be added without destroying the current zip loader. My interpretation is: why not use 7zip as the zip decompress lib since zlib is not maintained anymore. ah screw it, OP needs to clarify.

Re: Why ! : Ogre & 7Zip

Posted: Tue Feb 09, 2010 1:11 am
by MrD
I interpreted it as using 7zip to handle both zip files and also add support for the 7zip format. Now the addition of the 7zip format would be nice since the compression is better than zip, and the LZMA SDK is freely available; but (and I haven't checked this) I don't think the LZMA SDK can replace zlib for handling zip files since I think it just handles the 7z format.

I see no logical reason why 7zip support can't be added without having to remove zip support, it could just be added as another archive type.

Re: Why ! : Ogre & 7Zip

Posted: Tue Feb 09, 2010 1:43 pm
by vitefalcon
7-zip SDK is a bit confusing to start with I guess. I've tried to make a 7zip archive plugin just like Zip. But in the end I had to drop it because other works took priority. But while working on the 7-zip archive plugin, I was wondering, if someone needed the archive to be password-protected, Ogre cannot deal with it (afaik). I even thought of editing the format like

Code: Select all

7zip=location[encoded-password/hint]
The user can then make a listener to the archive reader which should provide the password based on the encoded-password/hint when prompted by the archive reader. There must be a better way but that was my naive way of getting password protected archive files to be opened.
Once I'm off my current rework of our framework I can have a look at reviving this.

Re: Why ! : Ogre & 7Zip

Posted: Tue Feb 09, 2010 2:53 pm
by n9ine
Thanks vitefalcon
vitefalcon wrote:I can have a look at reviving this.
And if you want i can be helpful doing this.
:wink:

Re: Why ! : Ogre & 7Zip

Posted: Tue Feb 09, 2010 2:57 pm
by MrD
Password protection is a whole other can of worms, and imho should be dealt with as a separate issue to this thread considering that normal zip archives can also be password protected so it would seem to be a more general archive manager kind of thing.

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 12:22 pm
by Kojack
One day I want to play around with PhysicsFS (it has nothing to do with physics). It's a virtual file system which handles zip and 7zip files. You can mount multiple directories, zips and other stuff (it handles doom wad files, quake pak files, etc) into a virtual directory structure, with per file replacement so you can have patch files or modified files outside of a zip which override the usual game data. You can also specify a write directory and physicsfs will block writes (when using it's functions of course) to any other directory, good for allowing scripting languages to do free io, but protecting the user's system.

I've never used it though, so maybe it's not as good as it sounds.

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 12:33 pm
by jacmoe
It's rather nice! :)
Been around for ages - for good reason.

7Zip is good, but it's not as fast as regular zip.
And still not as fast as FastLz:
http://www.fastlz.org/index.html

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 1:31 pm
by MrD
Kojack wrote:One day I want to play around with PhysicsFS
Looks interesting.

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 1:36 pm
by CABAListic
PhysicsFS is very nice. I have a working C++ wrapper and Ogre integration (read-only currently) for it, it's relatively easy to do.

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 2:35 pm
by n9ine
CABAListic wrote:PhysicsFS is very nice. I have a working C++ wrapper and Ogre integration (read-only currently) for it, it's relatively easy to do.
would you please share your wrapper.It is interesting as an ogreaddons , is 'nt it?.

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 3:09 pm
by CABAListic
It consists merely of two files. I actually posted an earlier version here: https://www.ogre3d.org/forums/viewtopic.php?f=5&t=35254
Although, if I remember correctly, that version contained a tiny error somewhere. Anyway, I can upload the current version when I get home. It is slightly more integrated with our game engine, though, and it uses POCO, so you may not be able to use it directly.

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 3:18 pm
by jacmoe
That sounds interesting! :)
After all my talk about POCO, I admit that I haven't started using it yet. :P

Re: Why ! : Ogre & 7Zip

Posted: Wed Feb 10, 2010 4:00 pm
by CABAListic
Well, we eventually switched from Boost to POCO, but mostly because of POCO's zip handling functions. I want to use zip archives for certain game data, and I need both read and write support. I didn't find any other convincing library for the purpose, so I stuck with POCO, and since POCO and Boost often obtain similar purposes, we dropped boost as a dependency.

Anyway, here is the current version: http://downloads.oddbeat.de/physfs_cpp.zip
As I said, it is more integrated with our engine, so to actually use it, you'll have to make some modifications. Or just use the first version, which is independent. The bug I mentioned was, iirc, in the functions enumerateFiles / getDirListing / getFileListing, just compare them with the current version.

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 4:57 pm
by n9ine
physicsfs is cool but it can not be a replacement for zip.

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 5:19 pm
by jacmoe
There's absolutely no reason to change it. :)
It's really easy to code and register your own archive types in Ogre.

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 5:31 pm
by n9ine
I have a bug with zlib and nobody can fix this since zlib is dead.
Why not switch to 7Zip ?
http://www.ogre3d.org/forums/viewtopic.php?f=5&t=55541

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 5:39 pm
by jacmoe
Implement your own archive, and your problem is solved.
2500 zip files?
Insane.

It's really easy to create a 7zip archive yourself, so why not do that?

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 5:39 pm
by CABAListic
As jacmoe said, if you want to use 7zip, then just build your own Archive plugin, it's really not that hard (provided you find a good library to handle 7z archives). As a core feature of Ogre, I'm rather sceptical. zip is a lot more common than 7z, so dropping support of zip in favour of 7z is imho not a smart move right now.

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 5:41 pm
by n9ine
jacmoe wrote:It's really easy to create a 7zip archive yourself, so why not do that?
Yah i will do that. :D

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 5:44 pm
by jacmoe
It works. It's used internally. It's only one possible type of archive.
Ogre is designed that way: pluggable.
You can implement your own archive types / managers, your own scene managers, etc.
It wouldn't be Ogre otherwise. :)

Re: Why ! : Ogre & 7Zip

Posted: Fri Feb 12, 2010 5:45 pm
by jacmoe
n9ine wrote:
jacmoe wrote:It's really easy to create a 7zip archive yourself, so why not do that?
Yah i will do that. :D
If you need help, shout. :)