View unanswered posts | View active topics It is currently Thu Jan 16, 2025 10:30 am



Reply to topic  [ 37 posts ]  Go to page 1, 2, 3  Next
 why not zip the mods? 
Author Message

Joined: Mon Aug 16, 2010 7:23 am
Posts: 12
Reply with quote
Post why not zip the mods?
hello, CC is very slow on loading, I found that mod folder contains lots of small resource files,
maybe preload all the content in a package(like zip) will save lots of loading time?


Mon Aug 16, 2010 7:29 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: why not zip the mods?
because if you zip the mods they will just have to get extracted by the program and then loaded into RAM

it would end up taking longer, because you'd be constantly decompressing the files and then loading them, rather than directly loading them

there's a reason the game uses .bmps: there's no compression whatsoever. they're plain image files, which means less time taken to load stuff into RAM.


Mon Aug 16, 2010 7:43 am
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: why not zip the mods?
Compression shrinks files down, yes, but that doesn't make them easier to read, in fact in makes it harder.

You know how you see on spy movies, etc, they always have to un-encrypt some message or file, and it takes forever?
Compressing a file is the same as encrypting it, except in this case CC would have to un-encrypt the files so it could read them.


Most of what makes it slow is probably interpreting ini files since they've been made so user friendly, or inefficient programming.


Mon Aug 16, 2010 7:54 am
Profile WWW

Joined: Mon Aug 16, 2010 7:23 am
Posts: 12
Reply with quote
Post Re: why not zip the mods?
In my experience, in game development,
the time of loading small files is far more than load a zip file & upzip it in memory. (because gamers use powerful CPU and big RAM, and can use zip method to reduce the file size of resources, and disk loading time is much slower than CPU time----especially for lots of small files)
that's why most games use a package manager to organize resources.

maybe worth a try.


Last edited by halida on Mon Aug 16, 2010 8:04 am, edited 1 time in total.



Mon Aug 16, 2010 7:58 am
Profile

Joined: Mon Aug 16, 2010 7:23 am
Posts: 12
Reply with quote
Post Re: why not zip the mods?
CrazyMLC wrote:
Compression shrinks files down, yes, but that doesn't make them easier to read, in fact in makes it harder.

You know how you see on spy movies, etc, they always have to un-encrypt some message or file, and it takes forever?
Compressing a file is the same as encrypting it, except in this case CC would have to un-encrypt the files so it could read them.

Most of what makes it slow is probably interpreting ini files since they've been made so user friendly, or inefficient programming.


another game, STALKER, provide two method to access resource files, ziped and not ziped.

nowadays, zip and unzip not take much time, even shorter(In my experience, run-length)


Mon Aug 16, 2010 8:03 am
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: why not zip the mods?
Even so, CC's physics engine uses a lot of CPU and RAM, and I doubt having to zip/unzip sprites and sounds during the game would help at all.

A better way to increase efficiency might be to read the mod's code and to save a program-friendly version to increase loading speeds.


Mon Aug 16, 2010 8:07 am
Profile WWW

Joined: Mon Aug 16, 2010 7:23 am
Posts: 12
Reply with quote
Post Re: why not zip the mods?
CrazyMLC wrote:
Even so, CC's physics uses lots of CPU and RAM, and I doubt having to zip/unzip sprites and sounds during the game would help at all.

A better way to increase efficiency might be to read the mod's code and to save a program-friendly version to increase loading speeds.


zip/upzip method only take time on loading, after loaded and unziped, is same as ordinary method.
like this:

if config.use_zipped_resource:
res_data = unzip(res_file)
else:
res_data = loop_get_res(res_dir)

run_game(res_data)


Mon Aug 16, 2010 8:11 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: why not zip the mods?
Except that still takes longer than loading it as it is, as it's doing the same thing with an unnecessary extra step.


Mon Aug 16, 2010 8:16 am
Profile WWW
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: why not zip the mods?
If you really think it'll speed up the game, then I'm all for it.

However, your main roadblock would be pitching it to Data, the programmer of Cortex Command.
He is often difficult to contact, if not impossible to.

He has also already said that he doesn't want to go back and rewrite his engine, which took him at least a few years to code.
His engine likely includes the code for loading files.


Mon Aug 16, 2010 8:16 am
Profile WWW
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: why not zip the mods?
Just because a file is smaller doesn't mean it loads faster. Unzipping a file actually takes more time to load, as it has to decompress the file from its compressed state. In the end, it would just make the game take longer to load. The only difference it would make is that the game would be a smaller file size.


Mon Aug 16, 2010 8:17 am
Profile WWW
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: why not zip the mods?
Well the thing is, you're loading a file that's just as big, but you have to decompress it first.


Mon Aug 16, 2010 8:18 am
Profile WWW
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: why not zip the mods?
That would be exactly what I just said, yes :P


Mon Aug 16, 2010 8:23 am
Profile WWW
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: why not zip the mods?
I think what he means is this:

Load the files as compressed files, without unzipping/whatevering them.
After loading is finished, and when, say, an actor is bought and its code is needed, unzip it and store its components in memory.
When all of said actor are killed, you could, say, delete the files from memory.

This would decrease loading times while only slightly worsening performance.

I don't know if it would really work, since I'm not a game developer or anything, but it seems plausible.


Mon Aug 16, 2010 8:26 am
Profile WWW
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: why not zip the mods?
In the end, you've got the exact same loading time, but you're distributing it to different places. Yes, you wouldn't have to decompress the files at the beginning of the game, but they have to be decompressed at some point. If you were to do that every time a sprite was needed, it would slow the game to a crawl. Whether you're always aware or not, there can be dozens of different sprites on screen at any given time, and when you consider that sprites will change with animation, that's a whole other layer of complication.
People will probably mention that other games use a compressed file system (e.g. GCF files in Valve games). The main reason for these files is not to decrease load times - in fact, it increases them. It's to keep everything in one place. The other reason Valve's games can use this is that in any given level, the computer knows exactly which models are needed - a level in Left 4 Dead, for instance, is only going to use the models that are included in the level, aside from a limited few models that are included no matter what. Because of this, some loading can be done before the level starts. This approach is used in a lot of games. However, this doesn't work in CC. At any time, in any level, any object could be spawned. Therefore, you either have to load everything at once, or do it on-demand, which, as I mentioned, isn't really feasible.

tl;dr
No, zipping files isn't going to make the game load faster.


Mon Aug 16, 2010 8:34 am
Profile WWW
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: why not zip the mods?
I would think that would be fairly painful.
It would also mess with the error checking, in all likelihood.
EDIT: Ninja'd


Mon Aug 16, 2010 8:35 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 37 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.055s | 13 Queries | GZIP : Off ]