Resource file size ?

Why are the resources in the game split?

Got a series of interesting questions regarding the resource files that EV Nova uses.

A. Is there a size limit on the size of the resource files?
I was wondering if simply cramming them all into one file might work.

B. What are the potential ramifications of cramming the resources together in a big file?

C. Is the engine coded to look for all those resources in separate files and is there a map that shows where the different resources are?

D. Has anyone else played around with this?

Maybe I should run some experiments... I broke my QT install by autoupdating (On PC) so I'll play with it later after I get a fully running EV Nova and EV NEW again...

I think this might be of interest. As for C, the answer is no - you can put resources in whatever files you like. If they fit in one, then great.

As you are using Windows, be warned that you probably won't have many problems if you try to cram every resource into one file- it's just that the plug will crash spectacularly if converted to Mac format.

As for previous experience with combining data files, I have successfully combined all of the non-graphics resources into two files: one for descs, and one for everything else. The desc file has 3031 resources, and the other one has 3684 resources (about 40% over the theoretical resource limit- why isn't this one corrupted?). They are very useful for looking things up.

Anyway, if you plan on releasing your plugs, make sure that they aren't too big, and don't have too many resources. You should also get at least one person on a Mac to test your plug.

Edwards

Guy, on Jul 30 2005, 10:25 PM, said:

I think this might be of interest. As for C, the answer is no - you can put resources in whatever files you like. If they fit in one, then great.
View Post

Awesome. I was looking up .rez and .rsrc in search. That link was exactly what I needed. So, it seems as if we PC pluggers need to keep the limits of the Mac Resource files in mind for full compatibility. πŸ˜›

I bet I could cram all my .rez files together in my own PC install of EV Nova without running into problems... make modding with plugs a bit easier if all the relevant resources are located in the same file and not having to open up multiple copies of EV NEW. <_<

Maybe anyone with app programming experience could whip up a .rez collator tool for us... :huh:

Edwards, on Jul 30 2005, 10:50 PM, said:

As you are using Windows, be warned that you probably won't have many problems if you try to cram every resource into one file- it's just that the plug will crash spectacularly if converted to Mac format.

As for previous experience with combining data files, I have successfully combined all of the non-graphics resources into two files: one for descs, and one for everything else. The desc file has 3031 resources, and the other one has 3684 resources (about 40% over the theoretical resource limit- why isn't this one corrupted?). They are very useful for looking things up.

Anyway, if you plan on releasing your plugs, make sure that they aren't too big, and don't have too many resources. You should also get at least one person on a Mac to test your plug.

Edwards
View Post

I'll find a way to mash the .rez all together. One big file. Everything at hand for reference.

My plug? Nah, not to big yet. Only thing I'm working on is a ship mod (for graphics exp) based off of Polaris Dragon ,Manta, and Striker... eventually expanding out into new outfits, weapons, spob, syst, and mission lines to develop these new craft. I'll simply ask someone to test when I get near release.

=============

Hybrid TK/TP Polaris craft - Mechanorganic Psionic spacecraft made from your very own DNA! Donate now, and receive a free T2 Manta with your purchase of a T1 Dragon! Act soon to get an additional organ upgrade for free!

=============

Still haven't found a way to export the PICT files out of EV NEW under XP. Meh...

Thanks for the info folks. I'll update this when I get the combined .rez together and tell all the PC guys how easy it makes modding πŸ˜„ (if it does)

bloodpuff, on Jul 31 2005, 12:29 AM, said:

Still haven't found a way to export the PICT files out of EV NEW under XP. Meh...

Thanks for the info folks. I'll update this when I get the combined .rez together and tell all the PC guys how easy it makes modding πŸ˜„ (if it does)
View Post

If you can import graphics, you can export them, too, the process is very similar.

For picts and RleDs and the like, open up the specific resource you wish to export, then go up to File > Export. A dialog box will come up asking you to supply further information, including where you want the picture to be saved and what you want it to be called. Enter information as appropriate, then click ok. EVNEW should save it as a .bmp file to the location and name you specified.

We split the files up for three reasons:

  • The maximum size of a resource fork (a single file) is around 15-16 megs

  • The maximum total number of resources of all types is very low -- something like 1500 or something quite small.

  • The total number of characters that can be used as resource names is very small indeed. We quickly found ourselves running out in Nova.

Hope that helps. Keep your files small, your numbers of resources per file small, etc. Having many files open at once is no hassle at all, but overrunning the limits of the resource manager is Bad NewsΒ™.

pipeline, on Jul 31 2005, 11:38 AM, said:

  • The total number of characters that can be used as resource names is very small indeed. We quickly found ourselves running out in Nova.

View Post

OK. That's interesting. I've never heard of that before, could you expand on that?

Read the "Inside Macintosh" books for more details. It's just an aribtrary size limit in the resource map of each resource file. Back in 1984, they never thought you'd go over it.

I just figured it was to look cool. Shows what I know, doesn't it.

GutlessWonder, on Jul 31 2005, 01:04 AM, said:

If you can import graphics, you can export them, too, the process is very similar.

For picts and RleDs and the like, open up the specific resource you wish to export, then go up to File > Export. A dialog box will come up asking you to supply further information, including where you want the picture to be saved and what you want it to be called. Enter information as appropriate, then click ok. EVNEW should save it as a .bmp file to the location and name you specified.
View Post

The problem is this: Yes, I get a dialog from EVNEW, and it gives me a browser box to save/specify file name. It seems like it works, but no files appear in the directory I specify. :huh: I've tried saving to different disks, different folders, the same folder as the .rez file, and even done a search for every .bmp file I have on my computer (Took a long time... darned pr0n πŸ˜„ ).

So, it seems to be a different issue than where the file goes.

I've installed qt v 5 to 7 and none of them will export a PICT file for me. :mad: Another thread (the link for which I don't currently have) said that QT media layer couldn't open the .bmp resource on that particular user's installation and reinstalling QT fixed their problem. Not mine. <_<

If I can't export, I'll have to go the screenshot route I suppose... :unsure:

(I'm playing with smileys, they're fun!)

As to the issues that pipeline mentioned regarding the resource limitations, they don't exist for the PC as far as the resource manager goes .rez is padded to provide more address space than EV Nova can use AFAIK. We wondows people are working with the EV Nova engine limitations I think (pipeline, how much of the engine strictures are inhereted from the Mac development environment?)

Explained better -link below- is a bit of difference between the Mac resources and the .rez file format used by Windows PCs.

http://www.ambrosiasw.com/forums/index.php...topic=20693&hl;=

This link mentioned earlier by Guy is an excellent informative post. Thank you Guy.

Ephialtes, on Jul 31 2005, 12:55 PM, said:

OK. That's interesting. I've never heard of that before, could you expand on that?
View Post

The easy one: there is a limit of 64k chars of resource names in a single resource file.

The complicated one: for each resource that has a name, add 1 (lenght byte, Pascal-style strings) plus the number of chars of the name. Resources that have no name don't count. If the total goes over 65535, you're in trouble.

I've one file with 500 someod ships, 500 someod shans, 1057 systs, 300+ spobs, 3000+ descs, plus other randoms.

pipeline, on Jul 31 2005, 05:38 AM, said:

(*)The maximum total number of resources of all types is very low -- something like 1500 or something quite small.
View Post

It's always best to err on the side of more files rather than fewer; even if things seem to be working properly, an overloaded resource file can start malfunctioning or losing data when you least expect it. This hit both EV Override and EV Nova during their development, and was afflicting plug-ins like Elite Frontiers back in the days of the original Escape Velocity.

.rez seems to be a bit more flexible (not surprising, given that it's a recent invention designed specifically for modern games, whereas the resource fork dates back to the 1980s and computers without hard drives), but I'd still advise caution.

Contrary to the 16MB limit and the 64kb of resource names limit, the number of resources limit is a lot more murky. The Apple Developer Documentation states "around 2700" or 2727 sometimes. There is a logical explanation for that (in my topic Guy linked to). But file have been reportedly containing more than 2800 resources, with symptoms ranging from nothing to end of the world, with ResEdit crashing when (explicitely) saving, which shouldn't have mattered since modifications are automatically saved, and indeed the file was still valid and still had more than 2800 resources. I don't think you can possibly go over 5500, as you would explode the resource map. Others have had problems with less resources. Either way, I don't think it's reasonable to tempt the crash - ResEdit (and others) are already unstable enough as it is, not to mention losing some precious work, and not only what you were just working on and did not save, but the whole file. In programming, when something is unsupported, even when it works, it works in fact for you on your computer at the time you're doing it on your system and you'd better find another way. Same thing here (reminder: resources are (were) meant to be used only by developers).

I suggest a practical upper limit of around 2500.