Why ! : Ogre & 7Zip

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
n9ine
Halfling
Posts: 55
Joined: Mon Aug 25, 2008 4:24 pm

Why ! : Ogre & 7Zip

Post 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.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Re: Why ! : Ogre & 7Zip

Post 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?
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
nbeato
Gnome
Posts: 372
Joined: Thu Dec 20, 2007 1:00 am
Location: Florida
x 3
Contact:

Re: Why ! : Ogre & 7Zip

Post 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.
User avatar
MrD
Goblin
Posts: 292
Joined: Wed Oct 21, 2009 3:16 pm
Location: England
x 1

Re: Why ! : Ogre & 7Zip

Post 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.
Insimnax Framework - A game framework for OGRE
User avatar
vitefalcon
Orc
Posts: 438
Joined: Tue Sep 18, 2007 5:28 pm
Location: Seattle, USA
x 13

Re: Why ! : Ogre & 7Zip

Post 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.
Image
User avatar
n9ine
Halfling
Posts: 55
Joined: Mon Aug 25, 2008 4:24 pm

Re: Why ! : Ogre & 7Zip

Post 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:
User avatar
MrD
Goblin
Posts: 292
Joined: Wed Oct 21, 2009 3:16 pm
Location: England
x 1

Re: Why ! : Ogre & 7Zip

Post 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.
Insimnax Framework - A game framework for OGRE
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: Why ! : Ogre & 7Zip

Post 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.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Why ! : Ogre & 7Zip

Post 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
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
MrD
Goblin
Posts: 292
Joined: Wed Oct 21, 2009 3:16 pm
Location: England
x 1

Re: Why ! : Ogre & 7Zip

Post by MrD »

Kojack wrote:One day I want to play around with PhysicsFS
Looks interesting.
Insimnax Framework - A game framework for OGRE
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Why ! : Ogre & 7Zip

Post 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.
User avatar
n9ine
Halfling
Posts: 55
Joined: Mon Aug 25, 2008 4:24 pm

Re: Why ! : Ogre & 7Zip

Post 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?.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Why ! : Ogre & 7Zip

Post 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.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Why ! : Ogre & 7Zip

Post by jacmoe »

That sounds interesting! :)
After all my talk about POCO, I admit that I haven't started using it yet. :P
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Why ! : Ogre & 7Zip

Post 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.
User avatar
n9ine
Halfling
Posts: 55
Joined: Mon Aug 25, 2008 4:24 pm

Re: Why ! : Ogre & 7Zip

Post by n9ine »

physicsfs is cool but it can not be a replacement for zip.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Why ! : Ogre & 7Zip

Post by jacmoe »

There's absolutely no reason to change it. :)
It's really easy to code and register your own archive types in Ogre.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
n9ine
Halfling
Posts: 55
Joined: Mon Aug 25, 2008 4:24 pm

Re: Why ! : Ogre & 7Zip

Post 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
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Why ! : Ogre & 7Zip

Post 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?
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Why ! : Ogre & 7Zip

Post 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.
User avatar
n9ine
Halfling
Posts: 55
Joined: Mon Aug 25, 2008 4:24 pm

Re: Why ! : Ogre & 7Zip

Post 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
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Why ! : Ogre & 7Zip

Post 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. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Why ! : Ogre & 7Zip

Post 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. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Post Reply