Sprite file compression

Started by Pax Animo, Mon 21/03/2022 21:07:03

Previous topic - Next topic

Pax Animo

Greeting,

I'm curious as too how much of an impact on performance the "General setting: 'Compress the sprite file'" actually has, I'm assuming it will depend on how many sprites are used. 



Edit: I forgot to ask, is this performance loss only during compiling the game or am I missing something.
Misunderstood

Crimson Wizard

#1
The description refers to perfomance loss during playing the game, as engine will have to decompress the sprites as an additional step.

However, the real effect will depend on several factors, and may even be positive in some situations.
The sprite's load time is composed of two steps:
1. loading from disk
2. decompressing (optional)

Compressed sprites take less size on disk, thus loading them is actually faster. This may compensate the time spent on decompressing.
In practice this depends on compression level and player's computer, so there's no easy answer here.

The option may be turned on and off without problem, so it's possible to make perfomance tests with and without it anytime.

Pax Animo

Quote from: Crimson Wizard on Mon 21/03/2022 21:35:46
The description refers to performance loss during playing the game, as engine will have to decompress the sprites as an additional step.

Is this process during the game initialization only or throughout the game cycle.

Quote from: Crimson Wizard on Mon 21/03/2022 21:35:46
Compressed sprites take less size on disk, thus loading them is actually faster. This may compensate the time spent on decompressing.
In practice this depends on compression level and player's computer, so there's no easy answer here.

I did wonder about this too, with todays machines having much more RAM and faster HDD's, there shouldn't be too much of an issue on performance.

Thanks for clarifying.
Misunderstood

Crimson Wizard

Quote from: Pax Animo on Mon 21/03/2022 22:07:17
Is this process during the game initialization only or throughout the game cycle.

Throughout the game play. AGS loads sprites on demand and stores them in a "sprite cache". The sprites will then be used from this cache without loading them again.
The size of the sprite cache may be set in game config (by players too). When the cache is full it will delete some sprites from memory to open space for more.

Pax Animo

Quote from: Crimson Wizard on Mon 21/03/2022 22:14:50
The size of the sprite cache may be set in game config (by players too). When the cache is full it will delete some sprites from memory to open space for more.

I seen that setting and did wonder about this one too, I see the default is 128.
Which user hardware resource does this use up, is it RAM? can this be safely increased if assuming people have half decent PC's these days.
Misunderstood

Crimson Wizard

Quote from: Pax Animo on Mon 21/03/2022 22:40:06
I seen that setting and did wonder about this one too, I see the default is 128.
Which user hardware resource does this use up, is it RAM?

Yes, it's RAM.
On Windows AGS is still distributed as a 32-bit program (not sure why...), so it will be limited approximately to 2 GB anyway (but this includes everything, not only sprites).

Pax Animo

Thanks CW for explaining these settings.
It really helps to get a better understanding of what those settings actually do.
Misunderstood

SMF spam blocked by CleanTalk