smart storage of pngs

Get help using Construct 2

Post » Fri Oct 04, 2013 12:37 am

Hi! Again, I guess this must be somewhere in the forum since is not a small issue, but I can't find a reference to it.

I've made a sprite with several animations. Some of those animations repeat frames that were used in other anims of the same char. I thought I was saving storage space copypasting frames from one animation to another, but when I turned de CAPX into a RAR and checked inside it I saw that the duplicated frames where there, twice, one inside every anim's folder.

Is there a way to save space by telling the soft to use a sprite from another folder or something like that? anything that works for not having repeated pngs using space.

I guess there must be a simple way to do this.

EDIT: Well, I've checked that frames are saved 2 times even if they are repeated inside one single animation, inside the same folder. that's even worse! Borghi2013-10-04 06:14:43
B
5
S
1
Posts: 92
Reputation: 609

Post » Fri Oct 04, 2013 6:16 am

each frame is it's own image. So no there is no inherit way in C2 to do this. you could make a custom plugin for custom animation and frame control rather than use the default.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Fri Oct 04, 2013 6:28 am

oh, too bad.
This should really be improved in the future. If you have a big character that has many animations but uses always the same 7 or 8 images you're wasting an awful lots of space.

Shouldn't be too hard to implement.

thanks anyway.
B
5
S
1
Posts: 92
Reputation: 609

Post » Fri Oct 04, 2013 6:43 am

If you're already at a high data size you could also consider doing your own animations with events, if javascript to make your own plugin isn't a possible way for you.
1) Add all frames in one animation of your object.
2) Fill an array with the indices of the frames you want to use for an animation
3) To animate, run through the array at a certain speed. There are various ways. For example,
myFrame = (myFrame + 20 * dt) % walkArray.Width
Set animationframe to walkArray.At(myFrame)
will loop your custom walking animation with 20 fps
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Fri Oct 04, 2013 7:11 am

[QUOTE=Borghi] oh, too bad.
This should really be improved in the future. If you have a big character that has many animations but uses always the same 7 or 8 images you're wasting an awful lots of space.

Shouldn't be too hard to implement.

thanks anyway.[/QUOTE]

They already implemented what you are saying a while back: https://www.scirra.com/construct2/releases/r133

On export, your images should be deduplicated.
B
24
S
9
G
7
Posts: 756
Reputation: 7,302

Post » Fri Oct 04, 2013 9:22 am

[QUOTE=vee41]They already implemented what you are saying a while back: https://www.scirra.com/construct2/releases/r133

On export, your images should be deduplicated.[/QUOTE] oops
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Fri Oct 04, 2013 7:06 pm

that's good news!
B
5
S
1
Posts: 92
Reputation: 609


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, MPPlantOfficial, Sup with that? and 61 guests