Very large room files (SOLVED)

Started by Bernie, Sun 13/11/2005 03:10:10

Previous topic - Next topic

Bernie

I rebuilt my room files a while back. It resulted in some of my room files getting really huge. They're all over 2MB now and there doesn't seem to be a logical explanation for it. This increased my overall filesize a lot. All my other games had small room files at about 300 kb or smaller.

What could make them so big? Even more important: How can I make my room files small again? Any ideas?

Thanks~

Gilbert

Did you happened to use a lower colour depth (8 bit for example) at first and then changed it to a much higher one (32bit)?

Bernie

Hmm... I changed it from 16 to 32 bit once, but that didn't do anything to the room file size. It increased when I recompiled the rooms, I did that quite a long time after changing the color depth. The game uses a resolution of 320x200.

Pumaman

If you like, upload one of your 2 MB room files and I can take a look to see why it might be so big.


Pumaman

The file looks fine, however it does have a rather large compiled script; my guess would be that you've added some sort of large array to your script header, but forgotten to import it, and so the data is being duplicated across all your room files.

If you can't figure it out, please post your script header so we can look at it for you.

Bernie

It seems you were right about the big array! I had a big struct thing in my script header. These can't be used in rooms anyway (I think), so I moved it to the global script. All my rooms are fine now. Is there a way to make structs globally usable in v2.70?

Thanks! :)

Pumaman

Yes, just add an import for it to the script header.

So if you currently have this in your global script:

MyStruct structname;

just add this to the script header:

import MyStruct structname;

and you're done!


monkey0506

#9
I get an error when trying to import a struct object...in 2.71RC2.  Is this a bug in RC2?

[EDIT:]

That might be RC3...I'm not sure anymore.

Bernie

#10
I have this in my global script:

struct CHARACTER_STATS_TYPE {
int idleset;
int level;
int hp;
int hpmax;
//etc....
};
CHARACTER_STATS_TYPE charvals[300];

I can't seem to figure out how to make an import for it in the script header. Am I doing something wrong?

Pumaman

Move this:

struct CHARACTER_STATS_TYPE {
int idleset;
int level;
int hp;
int hpmax;
//etc....
};

into the script header, and delete it from the global script. The actual struct type should only be defined once.
Then, under that in the script header, put:

import CHARACTER_STATS_TYPE charvals[300];

and in the global script, put:

CHARACTER_STATS_TYPE charvals[300];

that should do it.

QuoteI get an error when trying to import a struct object...in 2.71RC2.  Is this a bug in RC2?

You'll need to post more information than that ... what does your script look like and what is the error message?


monkey0506

Quote from: Pumaman on Sun 13/11/2005 17:03:56
QuoteI get an error when trying to import a struct object...in 2.71RC2.  Is this a bug in RC2?

You'll need to post more information than that ... what does your script look like and what is the error message?

I think it was basically just what you told Bernie to do...I just thought it would be possible to have an object of a custom defined type available at global scope without the struct being globally accessible as well.

SMF spam blocked by CleanTalk