Sprite Sheets

Discussion and feedback on Construct 2

Post » Tue Aug 23, 2011 6:29 am

Any plan for supporting sprite sheet animations, as generated by Texture Packer ?

My character art frames are rendered out onto a standard size image, though the actual content changes size and shape from frame to frame considerably. (And there is a ton of it.)

Using Texture Packer is essential.

Thanks
Pepper
B
4
G
1
Posts: 5
Reputation: 635

Post » Tue Aug 23, 2011 3:00 pm

r51 added a 'import sprite sheet' option to the animations editor Frames pane. However, frames must be laid out in a regular grid, because C2 cuts up sprite sheets in to rectangles. C2 doesn't support irregularly laid out frames like TexturePacker seems to do yet I'm afraid. Perhaps it has an option to use a regular grid?
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Wed Aug 24, 2011 3:24 am

Thanks for the response Ashley.

Yeah, you can use regular/same size cells in a Texture Packer sprite sheet, but as I am sure you know, this is really inefficient.

In my case especially, where I have an animated fighting game character that kicks, punches, jumps, ducks, and so forth so that in each frame, the art changes shape and position dramatically. I would have to have really large cells with tons of dead space to accommodate.ppprbrns2011-08-24 04:21:47
B
4
G
1
Posts: 5
Reputation: 635

Post » Wed Aug 24, 2011 1:47 pm

If you crop each frame that you import, it will remove any wasted space. (You might need to wait until we have hotspots for this to work smoothly though.) Once each frame is cropped, AFAIK the download size is not much more than a sprite sheet and the VRAM usage is about the same as well. Modern graphics cards support non-power-of-two textures so there's no memory wasted by having lots of different frames.Ashley2011-08-24 13:48:18
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Wed Aug 24, 2011 2:43 pm

Cool. I'll give it a try.
Will install 51 tonight.
Thanks for the feedback!
B
4
G
1
Posts: 5
Reputation: 635

Post » Thu Aug 25, 2011 12:31 am

[QUOTE=ppprbrns] Thanks for the response Ashley.

Yeah, you can use regular/same size cells in a Texture Packer sprite sheet, but as I am sure you know, this is really inefficient.

In my case especially, where I have an animated fighting game character that kicks, punches, jumps, ducks, and so forth so that in each frame, the art changes shape and position dramatically. I would have to have really large cells with tons of dead space to accommodate.[/QUOTE]
A sprite sheet with cropped frames is literally only a few kb larger then one that does not. Besides that, Texture Packer creates bloated pngs. Try a different program. Also, never have your character or object change positions in your sprite sheet, per frames. Any change in position should be done by code or game editor function. ;)
B
18
S
5
G
2
Posts: 16
Reputation: 2,012

Post » Thu Aug 25, 2011 3:54 pm

[quote]A sprite sheet with cropped frames is literally only a few kb larger then one that does not.[/quote]
That depends on how your graphics are created. E.g. if you have a character that is dodging and attacking with a sword it might be a *big* difference if frames are cropped or not.

[quote]Texture Packer creates bloated pngs[/quote]
Currently the file size is about 15% bigger then when using opting. This will be fixed with the 3.0.0 release.

[quote]Also, never have your character or object change positions in your sprite sheet, per frames. Any change in position should be done by code or game editor function.[/quote]
You have several cases with animations where this is exactly not what you want to do. You want to keep the anchor point steady while the animation moves around it...AndreasLoew2011-08-25 15:55:40
B
2
G
1
Posts: 2
Reputation: 454

Post » Thu Aug 25, 2011 4:02 pm

I don't know much about Texture Packer, but I can say:
- Construct 2 stores all images as PNG, so transparency around an image should all be compressed away. Still, it's good practice to crop them because images are stored as bitmap in memory for drawing, so the extra space means more memory used. Right now C2 also only has bounding box collision so empty space around the player will also collide, but you can work around that with a hidden collision sprite, or just wait until we add collision polygons.
- You have the option to recompress PNGs (via PNGCrush) on export, making them even smaller.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Fri Aug 26, 2011 3:25 am

[QUOTE=AndreasLoew]if you have a character that is dodging and attacking with a sword it might be a *big* difference if frames are cropped or not.

...snip...

You want to keep the anchor point steady while the animation moves around it...[/QUOTE]

Correct. Posemotion: Imagine a standing character crouching down to do a foot sweep, standing, then doing a high roundhouse kick. The size of the art in the frame changes dramatically.

[Quote=Ashley]Right now C2 also only has bounding box collision so empty space around the player will also collide, but you can work around that with a hidden collision sprite, or just wait until we add collision polygons.[/QUOTE]

I look forward to seeing this implemented; right now the bounding box collision issue is keeping me from really diving into Construct2 full force. In the meantime I am working on my design, art, and C2 tutorials.

I don't want to sound like an advertisement for Texture Packer, but I bring it up because it has a lot of nice features and was so easy to use with Corona SDK. (I ditched Corona due to their sprite libraries being completely broken.) I was hoping for similar interop with C2.

FWIW: I run my pngs through Photoshop's "Save for Web" interface to trim them up.

Thanks again for the great discussion.
B
4
G
1
Posts: 5
Reputation: 635

Post » Fri Aug 26, 2011 3:56 am

[QUOTE=AndreasLoew] [quote]A sprite sheet with cropped frames is literally only a few kb larger then one that does not.[/quote]
That depends on how your graphics are created. E.g. if you have a character that is dodging and attacking with a sword it might be a *big* difference if frames are cropped or not.[/QUOTE]
Then you would save some memory and the sword (possibly with arm too) on it own image. This would be for a large sword anyway. As there would definitely be a large amount of transparent image if it was all in one.
[QUOTE=AndreasLoew][quote]Texture Packer creates bloated pngs[/quote]
Currently the file size is about 15% bigger then when using opting. This will be fixed with the 3.0.0 release.[/QUOTE]
Sometimes even higher but can then be loaded and saved out of another program to reduce.
[QUOTE=AndreasLoew][quote]Also, never have your character or object change positions in your sprite sheet, per frames. Any change in position should be done by code or game editor function.[/quote]
You have several cases with animations where this is exactly not what you want to do. You want to keep the anchor point steady while the animation moves around it...[/QUOTE] You have to be kidding me? Animating by code will save more space then within frames. Anything can be animated in a frame but x/y coordinates, zooming, rotating, and so forth is much better by code.
B
18
S
5
G
2
Posts: 16
Reputation: 2,012

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests