The International Simutrans Forum

PakSets and Customization => General Resources and Tools => Tools => Topic started by: Nazalassa on October 11, 2024, 01:04:02 PM

Title: Does Makeobj store several copies of the same image when merging pak files?
Post by: Nazalassa on October 11, 2024, 01:04:02 PM
Suppose I have a lot of factories in a pakset that all use the same base graphics, but have different FrontImages so they don't all look the same. (Moreover, some FrontImages are the same across several factories.) When paking the factories, Makeobj will create one pak file per factory, which contains all the images required for that factory. But then, if I merge all those pak files into a single file, there can be some duplicated images, such as the base graphics.

So, when several pak files are merged, does Makeobj store one copy of an image per object that uses it, or does it store only one copy of the image for all the objects in the pak file?

(The latter may help reduce the size of paksets with a lot of objects that se the same images.)
Title: Re: Does Makeobj store several copies of the same image when merging pak files?
Post by: Leartin on October 11, 2024, 01:46:46 PM
P192C has an example of this scenario: Citybuilding winter smoke is always the same for each building (with a chimney). It's literally the same image referenced in many, many dats.

I asked the same question back when we introduced this, and while I can't remember the exact answer, P192C does not merge pak files... so I guess not, or there is some other reason why it does not matter. (Maybe because the issue with so many duplicates comes up in the game memory long before it matters for the size on disk)
Title: Re: Does Makeobj store several copies of the same image when merging pak files?
Post by: Combuijs on October 11, 2024, 04:57:51 PM
If I remember correctly the images are still duplicated in the pak-files, but upon loading in memory duplicates are eliminated. So, no change in paksize, but memory is less burdened.
Title: Re: Does Makeobj store several copies of the same image when merging pak files?
Post by: prissi on October 13, 2024, 12:03:06 PM
This is correct.