News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Does Makeobj store several copies of the same image when merging pak files?

Started by Nazalassa, October 11, 2024, 01:04:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nazalassa

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.)
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

Leartin

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)

Combuijs

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.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



prissi